Belle II Software development
DirectedNode< EntryType, MetaInfoType > Class Template Reference

The Node-Class. More...

#include <DirectedNode.h>

Public Member Functions

bool operator== (const DirectedNode &b) const
 ************************* OPERATORS *************************
 
bool operator!= (const DirectedNode &b) const
 != -operator - compares if two nodes are not identical
 
bool operator== (const EntryType &b) const
 == -operator - compares if the entry passed is identical with the one linked in this node
 
bool operator!= (const EntryType &b) const
 == -operator - compares if the entry passed is not identical with the one linked in this node
 
std::vector< DirectedNode< EntryType, MetaInfoType > * > & getInnerNodes ()
 ************************* PUBLIC MEMBER FUNCTIONS *************************
 
std::vector< DirectedNode< EntryType, MetaInfoType > * > & getOuterNodes ()
 Returns links to all outer nodes attached to this one.
 
EntryType & getEntry ()
 Allows access to stored entry.
 
const EntryType & getConstEntry () const
 Allows const access to stored entry (needed for external operator overload.
 
DirectedNode< EntryType, MetaInfoType > * getPtr ()
 Returns Pointer to this node.
 
MetaInfoType & getMetaInfo ()
 Returns reference to MetaInfoType attached to this node.
 
short getFamily () const
 Returns identifier of this cell.
 
void setFamily (short family)
 Assign a family identifier to this cell.
 

Public Attributes

EntryType & m_entry
 ************************* DATA MEMBERS *************************
 
std::vector< DirectedNode< EntryType, MetaInfoType > * > m_innerNodes
 Carries all links to inner nodes.
 
std::vector< DirectedNode< EntryType, MetaInfoType > * > m_outerNodes
 Carries all links to outer nodes.
 
MetaInfoType m_metaInfo
 Contains a MetaInfo for doing extra-stuff (whatever you need)
 
short m_family
 Identifier for all connected nodes.
 

Protected Member Functions

 DirectedNode (EntryType &entry)
 ************************* CONSTRUCTORS *************************
 
 DirectedNode (const DirectedNode &node)=delete
 Forbid copy constructor.
 
DirectedNodeoperator= (const DirectedNode &node)=delete
 Forbid assignment operator.
 
void addInnerNode (DirectedNode< EntryType, MetaInfoType > &newNode)
 ************************* INTERNAL MEMBER FUNCTIONS *************************
 
void addOuterNode (DirectedNode< EntryType, MetaInfoType > &newNode)
 Adds new links to the outward direction.
 

Friends

template<typename AnyType , typename AnyOtherType >
class DirectedNodeNetwork
 Only the DirectedNodeNetwork can create DirectedNodes and link them.
 

Detailed Description

template<typename EntryType, typename MetaInfoType>
class Belle2::DirectedNode< EntryType, MetaInfoType >

The Node-Class.

Carries an instance of a class which shall be woven into a network. additionally a Cell can be attached for Cellular Automaton functionality. If you don't need the Cell-features, just insert an empty dummy-class. or use ../tracking/trackFindingVXD/segmentNetwork/VoidMetaInfo.h, where such a dummy class is defined.

Prerequisites for template EntryType:

  • has to have an == operator defined prerequisites for template MetaInfoType:
  • has to have a public constructor with no arguments passed.

Definition at line 31 of file DirectedNode.h.

Constructor & Destructor Documentation

◆ DirectedNode()

DirectedNode ( EntryType &  entry)
inlineexplicitprotected

************************* CONSTRUCTORS *************************

Protected constructor. accepts an entry which can not be changed any more

Definition at line 38 of file DirectedNode.h.

38 :
39 m_entry(entry), m_metaInfo(MetaInfoType()), m_family(-1)
40 {
41 // Reserve some space for the vectors, TODO: can still be fine-tuned
42 m_innerNodes.reserve(10);
43 m_outerNodes.reserve(10);
44 }
MetaInfoType m_metaInfo
Contains a MetaInfo for doing extra-stuff (whatever you need)
Definition: DirectedNode.h:121
EntryType & m_entry
************************* DATA MEMBERS *************************
Definition: DirectedNode.h:112
short m_family
Identifier for all connected nodes.
Definition: DirectedNode.h:124
std::vector< DirectedNode< EntryType, MetaInfoType > * > m_innerNodes
Carries all links to inner nodes.
Definition: DirectedNode.h:115
std::vector< DirectedNode< EntryType, MetaInfoType > * > m_outerNodes
Carries all links to outer nodes.
Definition: DirectedNode.h:118

Member Function Documentation

◆ addInnerNode()

void addInnerNode ( DirectedNode< EntryType, MetaInfoType > &  newNode)
inlineprotected

************************* INTERNAL MEMBER FUNCTIONS *************************

Adds new links to the inward direction

Definition at line 55 of file DirectedNode.h.

56 {
57 m_innerNodes.push_back(&newNode);
58 }

◆ addOuterNode()

void addOuterNode ( DirectedNode< EntryType, MetaInfoType > &  newNode)
inlineprotected

Adds new links to the outward direction.

Definition at line 62 of file DirectedNode.h.

63 {
64 m_outerNodes.push_back(&newNode);
65 }

◆ getConstEntry()

const EntryType & getConstEntry ( ) const
inline

Allows const access to stored entry (needed for external operator overload.

Definition at line 95 of file DirectedNode.h.

95{ return m_entry; }

◆ getEntry()

EntryType & getEntry ( )
inline

Allows access to stored entry.

Definition at line 92 of file DirectedNode.h.

92{ return m_entry; }

◆ getFamily()

short getFamily ( ) const
inline

Returns identifier of this cell.

Definition at line 104 of file DirectedNode.h.

104{ return m_family; }

◆ getInnerNodes()

std::vector< DirectedNode< EntryType, MetaInfoType > * > & getInnerNodes ( )
inline

************************* PUBLIC MEMBER FUNCTIONS *************************

Getters Returns links to all inner nodes attached to this one

Definition at line 86 of file DirectedNode.h.

86{ return m_innerNodes; }

◆ getMetaInfo()

MetaInfoType & getMetaInfo ( )
inline

Returns reference to MetaInfoType attached to this node.

Definition at line 101 of file DirectedNode.h.

101{ return m_metaInfo; }

◆ getOuterNodes()

std::vector< DirectedNode< EntryType, MetaInfoType > * > & getOuterNodes ( )
inline

Returns links to all outer nodes attached to this one.

Definition at line 89 of file DirectedNode.h.

89{ return m_outerNodes; }

◆ getPtr()

DirectedNode< EntryType, MetaInfoType > * getPtr ( )
inline

Returns Pointer to this node.

Definition at line 98 of file DirectedNode.h.

98{ return this; }

◆ operator!=() [1/2]

bool operator!= ( const DirectedNode< EntryType, MetaInfoType > &  b) const
inline

!= -operator - compares if two nodes are not identical

Definition at line 74 of file DirectedNode.h.

74{ return !(m_entry == b.getConstEntry()); }

◆ operator!=() [2/2]

bool operator!= ( const EntryType &  b) const
inline

== -operator - compares if the entry passed is not identical with the one linked in this node

Definition at line 80 of file DirectedNode.h.

80{ return !(m_entry == b); }

◆ operator==() [1/2]

bool operator== ( const DirectedNode< EntryType, MetaInfoType > &  b) const
inline

************************* OPERATORS *************************

== -operator - compares if two nodes are identical

Definition at line 71 of file DirectedNode.h.

71{ return (m_entry == b.getConstEntry()); }

◆ operator==() [2/2]

bool operator== ( const EntryType &  b) const
inline

== -operator - compares if the entry passed is identical with the one linked in this node

Definition at line 77 of file DirectedNode.h.

77{ return (m_entry == b); }

◆ setFamily()

void setFamily ( short  family)
inline

Assign a family identifier to this cell.

Definition at line 107 of file DirectedNode.h.

107{ m_family = family; }

Friends And Related Function Documentation

◆ DirectedNodeNetwork

friend class DirectedNodeNetwork
friend

Only the DirectedNodeNetwork can create DirectedNodes and link them.

Definition at line 33 of file DirectedNode.h.

Member Data Documentation

◆ m_entry

EntryType& m_entry

************************* DATA MEMBERS *************************

Entry can be of any type, DirectedNode is just the carrier

Definition at line 112 of file DirectedNode.h.

◆ m_family

short m_family

Identifier for all connected nodes.

Definition at line 124 of file DirectedNode.h.

◆ m_innerNodes

std::vector<DirectedNode<EntryType, MetaInfoType>*> m_innerNodes

Carries all links to inner nodes.

Definition at line 115 of file DirectedNode.h.

◆ m_metaInfo

MetaInfoType m_metaInfo

Contains a MetaInfo for doing extra-stuff (whatever you need)

Definition at line 121 of file DirectedNode.h.

◆ m_outerNodes

std::vector<DirectedNode<EntryType, MetaInfoType>*> m_outerNodes

Carries all links to outer nodes.

Definition at line 118 of file DirectedNode.h.


The documentation for this class was generated from the following file: