Chemical Data Processing Library Python API - Version 1.4.0
Public Member Functions | List of all members
CDPL.ConfGen.CallbackFunction Class Reference

Generic wrapper for storing user-defined callback functions returning a bool status flag (see [FUNWRP]). More...

+ Inheritance diagram for CDPL.ConfGen.CallbackFunction:

Public Member Functions

None __init__ ()
 Contructs the CallbackFunction instance.
 
None __init__ (CallbackFunction func)
 Contructs a copy of the CallbackFunction instance func. More...
 
None __init__ (object callable)
 Contructs the CallbackFunction instance for the specified callable object. More...
 
bool __call__ ()
 Invokes the wrapped callable object. More...
 
bool __bool__ ()
 Tells whether the instance holds a callable object. More...
 
bool __nonzero__ ()
 Tells whether the instance holds a callable object. More...
 

Detailed Description

Generic wrapper for storing user-defined callback functions returning a bool status flag (see [FUNWRP]).

Used by the conformer generation pipeline (Chem.ConformerGenerator, Chem.TorsionDriver, etc.) for the periodic abort and timeout-check callbacks: returning False signals the pipeline to abort.

Constructor & Destructor Documentation

◆ __init__() [1/2]

None CDPL.ConfGen.CallbackFunction.__init__ ( CallbackFunction  func)

Contructs a copy of the CallbackFunction instance func.

Parameters
funcThe CallbackFunction instance to copy.

◆ __init__() [2/2]

None CDPL.ConfGen.CallbackFunction.__init__ ( object  callable)

Contructs the CallbackFunction instance for the specified callable object.

Parameters
callableThe callable object to wrap.

Member Function Documentation

◆ __call__()

bool CDPL.ConfGen.CallbackFunction.__call__ ( )

Invokes the wrapped callable object.

Returns
The obtained return value.

◆ __bool__()

bool CDPL.ConfGen.CallbackFunction.__bool__ ( )

Tells whether the instance holds a callable object.

Returns
True if the instance holds a callable object, and False otherwise.

◆ __nonzero__()

bool CDPL.ConfGen.CallbackFunction.__nonzero__ ( )

Tells whether the instance holds a callable object.

Returns
True if the instance holds a callable object, and False otherwise.