apoCHARMM 1.0.0
High-performance molecular dynamics simulations on GPUs
 
Loading...
Searching...
No Matches
apocharmm.force_manager._SubscribableForce Class Reference

Defines the private Python subscription extension protocol. More...

Inherits Protocol.

Protected Member Functions

None _subscribe_to_force_manager (self, "ForceManager" force_manager, str|None force_tag=None)
 Connects this object to a ForceManager.
 
None _unsubscribe_from_force_manager (self, "ForceManager" force_manager)
 Disconnects this object from a ForceManager.
 

Detailed Description

Defines the private Python subscription extension protocol.

An object accepted by ForceManager.subscribe() must provide matching subscribe and unsubscribe callbacks. The manager retains a strong Python reference only after the subscribe callback succeeds.

Native _ApoObject implementations normally forward these callbacks to their C ABI subscription functions. Pure Python implementations may define other behavior but remain responsible for honoring the manager lifecycle.

Member Function Documentation

◆ _subscribe_to_force_manager()

None apocharmm.force_manager._SubscribableForce._subscribe_to_force_manager (   self,
"ForceManager"  force_manager,
str | None   force_tag = None 
)
protected

Connects this object to a ForceManager.

Parameters
[in]force_managerLive manager receiving the subscription.
[in]force_tagOptional non-empty force label. None permits a native force implementation to choose its default tag.

◆ _unsubscribe_from_force_manager()

None apocharmm.force_manager._SubscribableForce._unsubscribe_from_force_manager (   self,
"ForceManager"  force_manager 
)
protected

Disconnects this object from a ForceManager.

Parameters
[in]force_managerLive manager from which this object is being removed.