List of all members.
This is essentially a specialized vector implementation that allows a ReactionClass to easily keep track of all the MappingSet objects that can be involved in the reaction. All MappingSet objects stored in this class are created once and reused throughout the course of the simulation. This prevents new MappingSet objects to be created and destroyed. This class has the ability to automatically expand its capacity when extra mappings are needed, so there is no need for the user to manage these details. This class allows for constant time removal, insertion, and random selection of MappingSets, while std::vector requires linear time removal. We gain this speedup because the ordering of the list is unimportant. To use this class, call the pushNextAvailableMappingSet to get a pointer to the available MappingSet. Pass this MappingSet to a TemplateMolecule to actually map it onto molecules. If you don't end up using this MappingSet, call popLastMappingSet immediately. To remove MappingSets, call removeMappingSet with the ID of the MappingSet you want to remove. You can get this Id from the MappingSet object and Molecule objects also keep a vector of the MappingSet objects that point to it.
Public Member Functions
|ReactantList (unsigned int reactantIndex, TransformationSet *ts, unsigned int init_capacity)|
|virtual int||size () const|
|virtual MappingSet *||pushNextAvailableMappingSet ()|
|virtual void||popLastMappingSet ()|
|virtual void||removeMappingSet (unsigned int mappingSetId)|
|void||pickRandom (MappingSet *&ms)|
|virtual MappingSet *||getMappingSet (unsigned int mappingSetId) const|
|virtual void||printDetails () const|
|unsigned int *||msPositionMap|
|unsigned int|| init_capacity = |
Creates a new empty ReactantList with the given initial capacity (default is 50). This capacity should roughly be set to the number of mappings you expect this list to have. A reactantList must also be told what its reactionIndex is in the reaction and the TransformationSet of the reaction so that it can populate itself with MappingSets.
Deconstructor that deletes all mappingSets associated with this list.
|virtual int NFcore::ReactantList::size||(||)|| const
Returns the number of mappingSets that have been added to this list
|MappingSet * ReactantList::pushNextAvailableMappingSet||(||)||
Removes the very last mappingSet that was added to the list.
|void ReactantList::removeMappingSet||(||unsigned int||mappingSetId||)||
Removes the mapping set with the specified mappingSetId. Be careful here: make sure the mapping set is actually on the list before trying to remove or else this will give you an error!
|void ReactantList::pickRandom||(||MappingSet *&||ms||)|
Randomly selects a MappingSet from the list of available MappingSets.
|MappingSet * ReactantList::getMappingSet||(||unsigned int||mappingSetId||)|| const
|void ReactantList::printDetails||(||)|| const
Outputs basic details about this list - used only for debugging.
Maintains the number of mappingSets on this list
The total capacity that this list can hold
The transformation set of the ReactionClass that owns this list
|unsigned int NFcore::ReactantList::reactantIndex
The index of the reactant that this list maintains
|unsigned int* NFcore::ReactantList::msPositionMap
The actual array that stores a list of pointers to MappingSet objects