AvogadroLibs 1.97.0
Public Types | Public Member Functions | List of all members
PersistentBond< Molecule_T > Class Template Reference

The PersistentBond object provides a container for a persistent bond reference that can be held onto. The bond() method gets the underlying bond using the unique ID mechanism of the molecule.

#include <avogadro/qtcore/persistentbond.h>

Public Types

typedef Molecule_T MoleculeType
 
typedef Molecule_T::BondType BondType
 

Public Member Functions

 PersistentBond (MoleculeType *m=nullptr, Index uniqueId=MaxIndex)
 Create a persistent bond, with the specified unique id. More...
 
 PersistentBond (const BondType &b)
 Create a persistent bond from a standard bond object. More...
 
void set (MoleculeType *m, Index uniqueId)
 Set the molecule and unique ID for the persistent object. More...
 
void set (const BondType &b)
 Set the persistent bond from a standard bond object. More...
 
void reset ()
 Reset the object to an invalid state.
 
bool isValid () const
 
MoleculeType * molecule () const
 
Index uniqueIdentifier () const
 The persistent unique ID of the bond. More...
 
BondType bond () const
 Obtain the bond being held by the persistent object. More...
 

Constructor & Destructor Documentation

◆ PersistentBond() [1/2]

PersistentBond ( MoleculeType *  m = nullptr,
Index  uniqueId = MaxIndex 
)
explicit
Parameters
mThe molecule the persistent bond belongs to.
uniqueIdThe unique identifier for the bond.

◆ PersistentBond() [2/2]

PersistentBond ( const BondType &  b)
explicit
Parameters
bThe bond that a persistent reference should be created for.

Member Function Documentation

◆ set() [1/2]

void set ( MoleculeType *  m,
Index  uniqueId 
)
Parameters
mThe molecule that contains the bond.
uniqueIdThe unique ID of the bond.

◆ set() [2/2]

void set ( const BondType &  b)
Parameters
bThe bond that a persistent reference should be created for.

◆ isValid()

bool isValid
Returns
True if the persistent bond is valid.

◆ molecule()

MoleculeType * molecule ( ) const
Returns
The molecule the bond is a part of.

◆ uniqueIdentifier()

Index uniqueIdentifier ( ) const
Returns
The unique ID of the bond.

◆ bond()

Molecule_T::BondType bond
Returns
A reference to the bond held by the object.

The documentation for this class was generated from the following file: