#include <mapping.hh>
This is the low level unit that is used by reactions to identify the particular component of a molecule to update or change when a transformation is required. It is maintained by a MappingSet which is just a collection of Mapping objects. The "type" of mapping is identified in the same way as the "type" of transformation. See the Transformation class for a list of those types. The "index" simply is the index of the binding site or state of a molecule. It is possible that some "types" do not require an "index" (as in the case of adding or deleting an entire molecule).
Public Member Functions | |
Mapping (unsigned int type, int index) | |
~Mapping () | |
unsigned int | getType () const |
int | getIndex () const |
Molecule * | getMolecule () const |
void | clear () |
bool | setMolecule (Molecule *m) |
void | printDetails () const |
void | printDetails (ostream &o) const |
Static Public Member Functions | |
static void | clone (Mapping *original, Mapping *newClone) |
Protected Attributes | |
unsigned int | type |
int | index |
Molecule * | m |
NFcore::Mapping::Mapping | ( | unsigned int | type, | |
int | index | |||
) |
Creates a new Mapping object with the specified "type" (as defined by the types in the Transformation class) and a specified "index" which is the binding site or state index (in a MoleculeType) that this Mapping will map onto. The type and index does not (and should not) change during a simulation.
NFcore::Mapping::~Mapping | ( | ) |
Destroys this mapping, but does not delete the molecule it is mapped to.
unsigned int NFcore::Mapping::getType | ( | ) | const |
Returns the type of mapping this is. See Transformation for the possible types that can be assigned.
int NFcore::Mapping::getIndex | ( | ) | const |
Molecule * NFcore::Mapping::getMolecule | ( | ) | const [inline] |
void NFcore::Mapping::clear | ( | ) |
This clears the Mapping by forgetting the Molecule that this maps to. It is good practice to call this function after the Mapping becomes unused (as is done by ReactantList) but it is not always necessary as long as you have another way to keep track of mappings (as ReactionList does).
bool NFcore::Mapping::setMolecule | ( | Molecule * | m | ) |
void NFcore::Mapping::printDetails | ( | ) | const |
void NFcore::Mapping::printDetails | ( | ostream & | o | ) | const |
unsigned int NFcore::Mapping::type [protected] |
The "type" of mapping this is, taken from the same list of types in the Transformation class.
int NFcore::Mapping::index [protected] |
The index of the binding site or state that this Mapping keeps track of.
Molecule* NFcore::Mapping::m [protected] |