Loading...
Searching...
No Matches
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=nullptr, Index uniqueId=MaxIndex)
| Create a persistent atom, with the specified unique id.
| PersistentAtom (const AtomType &a)
| Create a persistent atom from a standard atom object.
void | set (MoleculeType *m, Index uniqueId)
| Set the molecule and unique ID for the persistent object.
void | set (const AtomType &a)
| Set the persistent atom from a standard atom object.
void | reset ()
| Reset the object to an invalid state.
bool | isValid () const
MoleculeType * | molecule () const
Index | uniqueIdentifier () const
| The persistent unique ID of the atom.
AtomType | atom () const
| Obtain the atom being held by the persistent object.

## Constructor & Destructor Documentation

## PersistentAtom() [1/2]

template<typename Molecule_T>

PersistentAtom | ( | MoleculeType * | m = nullptr,
|  | Index | uniqueId = MaxIndex )

explicit

Parameters

  m | The molecule the persistent atom belongs to.
  uniqueId | The unique identifier for the atom.

## PersistentAtom() [2/2]

template<typename Molecule_T>

PersistentAtom | ( | const AtomType & | a | ) |

explicit

Parameters

  a | The atom that a persistent reference should be created for.

## Member Function Documentation

## set() [1/2]

template<typename Molecule_T>

void set | ( | MoleculeType * | m,
|  | Index | uniqueId )

Parameters

  m | The molecule that contains the atom.
  uniqueId | The unique ID of the atom.

## set() [2/2]

template<typename Molecule_T>

void set | ( | const AtomType & | a | ) |

Parameters

  a | The atom that a persistent reference should be created for.

## isValid()

template<typename Molecule_T>

bool isValid | ( |  | ) | const

Returns
  True if the persistent atom is valid.

## molecule()

template<typename Molecule_T>

MoleculeType * molecule | ( |  | ) | const

Returns
  The molecule the atom is a part of.

## uniqueIdentifier()

template<typename Molecule_T>

Index uniqueIdentifier | ( |  | ) | const

Returns
  The unique ID of the atom.

## atom()

template<typename Molecule_T>

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:

- persistentatom.h