![]() |
Belle II Software development
|
Network of directed nodes of the type EntryType. More...
#include <DirectedNodeNetwork.h>
Public Member Functions | |
| DirectedNodeNetwork () | |
| ************************* CONSTRUCTOR/DESTRUCTOR ************************* | |
| ~DirectedNodeNetwork () | |
| destructor taking care of cleaning up the pointer-mess WARNING only needed when using classic pointers for the nodes! | |
| bool | addNode (NodeID nodeID, EntryType &newEntry) |
| ************************* PUBLIC MEMBER FUNCTIONS ************************* | |
| bool | addInnerToLastOuterNode (NodeID innerNodeID) |
| to the last outerNode added, another innerNode will be attached | |
| bool | addOuterToLastInnerNode (NodeID outerNodeID) |
| to the last innerNode added, another outerNode will be attached | |
| bool | linkNodes (NodeID outerNodeID, NodeID innerNodeID) |
| takes two entry IDs and weaves them into the network | |
| bool | isNodeInNetwork (const NodeID nodeID) const |
| Check if a given entry is already in the network. | |
| void | clear () |
| Clear directed node network Called to clear the directed node network if its size grows to large. | |
| std::vector< Node * > | getOuterEnds () |
| getters: | |
| std::vector< Node * > | getInnerEnds () |
| returns all nodes which have no inner nodes (but outer ones) and therefore are inner ends of the network | |
| Node * | getNode (NodeID toBeFound) |
| Returns pointer to the node carrying the entry which is equal to given parameter. | |
| std::vector< Node * > & | getNodes () |
| Returns all nodes of the network. | |
| std::vector< Node * >::iterator | begin () |
| Returns iterator for container: begin. | |
| std::vector< Node * >::iterator | end () |
| Returns iterator for container: end. | |
| unsigned int | size () const |
| Returns number of nodes to be found in the network. | |
Protected Types | |
| using | Node = DirectedNode<EntryType, MetaInfoType> |
| Defining abbreviation for the used directed node type pack. | |
| using | NodeID = std::int64_t |
| NodeID should be some unique integer. | |
Protected Member Functions | |
| void | finalize () |
| Finalizing the NodeNetwork. | |
Static Protected Member Functions | |
| static bool | createLink (Node &outerNode, Node &innerNode) |
| ************************* INTERNAL MEMBER FUNCTIONS ************************* | |
Protected Attributes | |
| std::unordered_map< NodeID, Node * > | m_nodeMap |
| ************************* DATA MEMBERS ************************* | |
| std::vector< Node * > | m_nodes |
| After the network is finalized this vector will also carry all nodes to be able to keep the old interface. | |
| std::vector< Node * > | m_outerEnds |
| keeps track of current outerEnds (nodes which have no outerNodes) entries are the NodeIDs of the nodes which currently form an outermost node | |
| std::vector< Node * > | m_innerEnds |
| keeps track of current innerEnds (nodes which have no innerNodes) entries are the NodeIds of the nodes which currently form an innermost node | |
| NodeID | m_lastOuterNodeID |
| temporal storage for last outer node added, used for speed-up | |
| NodeID | m_lastInnerNodeID |
| temporal storage for last inner node added, used for speed-up | |
| bool | m_isFinalized |
| keeps track of the state of the network to fill the vectors m_nodes, m_outerEnds, m_innerEnds only if required | |
Network of directed nodes of the type EntryType.
| EntryType | : type of the directe nodes |
| MetaInfoType | : meta info type of the nodes |
Definition at line 29 of file DirectedNodeNetwork.h.
|
protected |
Defining abbreviation for the used directed node type pack.
Definition at line 32 of file DirectedNodeNetwork.h.
|
protected |
NodeID should be some unique integer.
Definition at line 34 of file DirectedNodeNetwork.h.
|
inline |
************************* CONSTRUCTOR/DESTRUCTOR *************************
Constructor
Definition at line 39 of file DirectedNodeNetwork.h.
|
inline |
destructor taking care of cleaning up the pointer-mess WARNING only needed when using classic pointers for the nodes!
Definition at line 51 of file DirectedNodeNetwork.h.
|
inline |
to the last outerNode added, another innerNode will be attached
Definition at line 76 of file DirectedNodeNetwork.h.
|
inline |
************************* PUBLIC MEMBER FUNCTIONS *************************
Adding new node to nodeMap, if the nodeID is not already present in the nodeMap. Returns true if new node was added.
Definition at line 63 of file DirectedNodeNetwork.h.
|
inline |
to the last innerNode added, another outerNode will be attached
Definition at line 99 of file DirectedNodeNetwork.h.
|
inline |
Returns iterator for container: begin.
Definition at line 200 of file DirectedNodeNetwork.h.
|
inline |
Clear directed node network Called to clear the directed node network if its size grows to large.
This is necessary to prevent to following modules from processing events with only partly filled networks.
Definition at line 154 of file DirectedNodeNetwork.h.
|
inlinestaticprotected |
************************* INTERNAL MEMBER FUNCTIONS *************************
links nodes with each other. returns true if everything went well, returns false, if not
Definition at line 222 of file DirectedNodeNetwork.h.
|
inline |
Returns iterator for container: end.
Definition at line 208 of file DirectedNodeNetwork.h.
|
inlineprotected |
Finalizing the NodeNetwork.
Definition at line 238 of file DirectedNodeNetwork.h.
|
inline |
returns all nodes which have no inner nodes (but outer ones) and therefore are inner ends of the network
Definition at line 176 of file DirectedNodeNetwork.h.
Returns pointer to the node carrying the entry which is equal to given parameter.
If no fitting entry was found, nullptr is returned.
Definition at line 185 of file DirectedNodeNetwork.h.
|
inline |
Returns all nodes of the network.
Definition at line 192 of file DirectedNodeNetwork.h.
|
inline |
getters:
returns all nodes which have no outer nodes (but inner ones) and therefore are outer ends of the network
Definition at line 168 of file DirectedNodeNetwork.h.
|
inline |
Check if a given entry is already in the network.
Definition at line 144 of file DirectedNodeNetwork.h.
|
inline |
takes two entry IDs and weaves them into the network
Definition at line 123 of file DirectedNodeNetwork.h.
|
inline |
Returns number of nodes to be found in the network.
Definition at line 216 of file DirectedNodeNetwork.h.
|
protected |
keeps track of current innerEnds (nodes which have no innerNodes) entries are the NodeIds of the nodes which currently form an innermost node
Definition at line 268 of file DirectedNodeNetwork.h.
|
protected |
keeps track of the state of the network to fill the vectors m_nodes, m_outerEnds, m_innerEnds only if required
Definition at line 277 of file DirectedNodeNetwork.h.
|
protected |
temporal storage for last inner node added, used for speed-up
Definition at line 274 of file DirectedNodeNetwork.h.
|
protected |
temporal storage for last outer node added, used for speed-up
Definition at line 271 of file DirectedNodeNetwork.h.
|
protected |
************************* DATA MEMBERS *************************
carries all nodes
Definition at line 255 of file DirectedNodeNetwork.h.
|
protected |
After the network is finalized this vector will also carry all nodes to be able to keep the old interface.
This shouldn't affect the performance drastically in comparison to directly accessing the nodeMap.
Definition at line 260 of file DirectedNodeNetwork.h.
|
protected |
keeps track of current outerEnds (nodes which have no outerNodes) entries are the NodeIDs of the nodes which currently form an outermost node
Definition at line 264 of file DirectedNodeNetwork.h.