AvogadroLibs  1.90.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Public Types | Public Member Functions | List of all members
PersistentAtom< Molecule_T > Class Template Reference

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

#include <avogadro/qtcore/persistentatom.h>

Public Types

typedef Molecule_T MoleculeType
 
typedef Molecule_T::AtomType AtomType
 

Public Member Functions

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

Constructor & Destructor Documentation

PersistentAtom ( MoleculeType *  m = NULL,
Index  uniqueId = MaxIndex 
)
explicit
Parameters
mThe molecule the persistent atom belongs to.
uniqueIdThe unique identifier for the atom.
PersistentAtom ( const AtomType &  a)
explicit
Parameters
aThe atom that a persistent reference should be created for.

Member Function Documentation

void set ( MoleculeType *  m,
Index  uniqueId 
)
Parameters
mThe molecule that contains the atom.
uniqueIdThe unique ID of the atom.
void set ( const AtomType &  a)
Parameters
aThe atom that a persistent reference should be created for.
bool isValid ( ) const
Returns
True if the persistent atom is valid.
MoleculeType* molecule ( ) const
Returns
The molecule the atom is a part of.
Index uniqueIdentifier ( ) const
Returns
The unique ID of the atom.
Molecule_T::AtomType atom ( ) const
Returns
A reference to the atom held by the object.

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