Class SBDDataGraphNodeIndexer#
ClassList > SBDDataGraphNodeIndexer
#include <SBDDataGraphNodeIndexer.hpp>
Inherits the following classes: SBCContainerIndexer
Public Functions#
Type | Name |
---|---|
SBDDataGraphNodeIndexer () Constructs a node indexer. |
|
SBDDataGraphNodeIndexer (unsigned int initialSize) Constructs a node indexer with a pre-allocated initialSize . |
|
SBDDataGraphNodeIndexer (const SBDDataGraphNodeIndexer & other) Copy constructor. |
|
SBDDataGraphNodeIndexer (SBDDataGraphNodeIndexer && other) Move constructor. |
|
unsigned int | addNode (SBDDataGraphNode * node) Adds a node to the indexer and returns the index of the node. |
unsigned int | getIndex (SBDDataGraphNode * node) const Returns the index associated to the node . |
bool | getIndex (SBDDataGraphNode * node, unsigned int & index) const Returns the index associated to the node . |
SBDDataGraphNode * | getNode (unsigned int index) const Returns the node with the given index . |
void | getNodes (SBDDataGraphNodeIndexer & nodeIndexer, const SBNodePredicate & selectionPredicate=SBNodePredicateTrue(), const SBNodePredicate & visitPredicate=SBNodePredicateTrue(), bool includeDependencies=false) const Collects nodes into nodeIndexer , based on aselectionPredicate and avisitPredicate , with or without dependencies. |
void | getRootNodes (SBDDataGraphNodeIndexer & nodeIndexer) const Collect the root nodes among the indexed nodes, i.e. the nodes that do not have indexed ascendants. |
bool | hasIndex (SBDDataGraphNode * node) const Returns true if the node has an index. |
bool | hasNode (SBDDataGraphNode * node) const Returns true if the node has an index. |
bool | hasNode (const SBNodePredicate & selectionPredicate=SBNodePredicateTrue(), const SBNodePredicate & visitPredicate=SBNodePredicateTrue(), bool includeDependencies=false) const Checks for nodes based on a selectionPredicate and avisitPredicate , with or without dependencies. |
SBDDataGraphNodeIndexer & | operator= (const SBDDataGraphNodeIndexer & other) Copy assignment. |
SBDDataGraphNodeIndexer & | operator= (SBDDataGraphNodeIndexer && other) Move assignment. |
SBDDataGraphNode * | operator[] (unsigned int i) const Returns the node with the given index . |
unsigned int | removeNode (SBDDataGraphNode * node) Erases the node from the indexer. |
virtual | ~SBDDataGraphNodeIndexer () Destructs the node indexer. |
Public Functions inherited from SBCContainerIndexer#
Type | Name |
---|---|
SBCContainerIndexer () Creates an indexer. |
|
SBCContainerIndexer (unsigned int initialSize) Creates an indexer with a default pre-allocated size. |
|
SBCContainerIndexer (std::set< ObjectType > & objectSet) Indexes a set of objects. |
|
SBCContainerIndexer (std::vector< ObjectType > & objectVector) Indexes a vector of objects. |
|
SBCContainerIndexer (const SBCContainerIndexer & indexer) Copy constructor. |
|
SBCContainerIndexer (SBCContainerIndexer && indexer) Move constructor. |
|
iterator | begin () Returns an iterator that points to the beginning of the indexer. |
const_iterator | begin () const Returns an iterator that points to the beginning of the indexer. |
void | clear () Clears the indexer. |
bool | empty () const Returns true if and only if the indexer is empty. |
iterator | end () Returns an iterator that points to the end of the indexer. |
const_iterator | end () const Returns an iterator that points to the end of the indexer. |
unsigned int | eraseIndex (unsigned int objectIndex) Erases object objectIndex from the indexer. |
unsigned int | eraseObject (const ObjectType & object) Erases the object from the indexer. |
unsigned int | getIndex (const ObjectType & object) const Returns the index associated to the object . |
bool | getIndex (const ObjectType & object, unsigned int & index) const Returns the index associated to the object . |
ObjectType | getObject (unsigned int index) const Returns the object associated to the index . |
bool | hasIndex (const ObjectType & object) const Returns true if the object has an index. |
unsigned int | insert (unsigned int i, const ObjectType & object) Inserts an object in the indexer at position i if possible, and returns the index of the object. |
SBCContainerIndexer & | operator= (const SBCContainerIndexer & indexer) Copy assignment. |
SBCContainerIndexer & | operator= (SBCContainerIndexer && indexer) Move assignment. |
ObjectType | operator[] (unsigned int index) const Returns the object associated to the index . |
unsigned int | pop_back () Adds an object in the indexer and returns the index of the object. |
void | print () const Prints some debugging information. |
unsigned int | push_back (const ObjectType & object) Adds an object in the indexer if possible, and returns the index of the object. |
reverse_iterator | rbegin () Returns a reverse iterator that points to the reverse beginning of the indexer. |
const_reverse_iterator | rbegin () const Returns a reverse iterator that points to the reverse beginning of the indexer. |
reverse_iterator | rend () Returns a reverse iterator that points to the reverse end of the indexer. |
const_reverse_iterator | rend () const Returns a reverse iterator that points to the reverse end of the indexer. |
unsigned int | size () const Returns the number of indexed objects. |
virtual | ~SBCContainerIndexer () Destructs the indexer. |
Protected Attributes inherited from SBCContainerIndexer#
Type | Name |
---|---|
HashMap * | indexMap The hash map. |
Vector * | objectVector The object vector. |
Detailed Description#
This class describes a node indexer
Short name: SBNodeIndexer
Public Functions Documentation#
function SBDDataGraphNodeIndexer [1/4]#
Constructs a node indexer.
function SBDDataGraphNodeIndexer [2/4]#
Constructs a node indexer with a pre-allocated initialSize
.
function SBDDataGraphNodeIndexer [3/4]#
Copy constructor.
function SBDDataGraphNodeIndexer [4/4]#
Move constructor.
function addNode#
Adds a node
to the indexer and returns the index of the node.
function getIndex [1/2]#
Returns the index associated to the node .
function getIndex [2/2]#
Returns the index associated to the node .
function getNode#
Returns the node with the given index .
function getNodes#
Collects nodes into nodeIndexer
, based on aselectionPredicate
and avisitPredicate
, with or without dependencies.
void SBDDataGraphNodeIndexer::getNodes (
SBDDataGraphNodeIndexer & nodeIndexer,
const SBNodePredicate & selectionPredicate=SBNodePredicateTrue (),
const SBNodePredicate & visitPredicate=SBNodePredicateTrue (),
bool includeDependencies=false
) const
For each node in the indexer, this function calls the getNodes function.
Note that the nodeIndexer
is not cleared when entering this function.
See also: SBNodePredicate
See also: getNodes
function getRootNodes#
Collect the root nodes among the indexed nodes, i.e. the nodes that do not have indexed ascendants.
Collects the root nodes among the indexed nodes, i.e. the nodes that do not have indexed ascendants. The resulting root nodes are added in the nodeIndexer
.
For example, if the indexed nodes contain two nodes - an atom and its direct parent node (e.g. a backbone node) - then only this parent node will be added in the resulting nodeIndexer
.
Note that the nodeIndexer
is not cleared when entering this function.
function hasIndex#
Returns true if the node has an index.
function hasNode [1/2]#
Returns true if the node has an index.
function hasNode [2/2]#
Checks for nodes based on a selectionPredicate
and avisitPredicate
, with or without dependencies.
bool SBDDataGraphNodeIndexer::hasNode (
const SBNodePredicate & selectionPredicate=SBNodePredicateTrue (),
const SBNodePredicate & visitPredicate=SBNodePredicateTrue (),
bool includeDependencies=false
) const
For each node in the indexer, this function calls the hasNode function until either the called function returns true or the indexer is fully traversed.
See also: SBNodePredicate
See also: hasNode
function operator=#
Copy assignment.
SBDDataGraphNodeIndexer & SBDDataGraphNodeIndexer::operator= (
const SBDDataGraphNodeIndexer & other
)
function operator=#
Move assignment.
function operator[]#
Returns the node with the given index .
function removeNode#
Erases the node from the indexer.
function ~SBDDataGraphNodeIndexer#
Destructs the node indexer.