Belle II Software  release-08-01-10
RelationIndexContainer< FROM, TO > Class Template Reference

Class to store a bidirectional index between two StoreArrays. More...

#include <RelationIndexContainer.h>

Inheritance diagram for RelationIndexContainer< FROM, TO >:
Collaboration diagram for RelationIndexContainer< FROM, TO >:

Classes

struct  Element
 Element type for the index. More...
 

Public Types

typedef boost::multi_index::multi_index_container< Element, boost::multi_index::indexed_by< boost::multi_index::ordered_non_unique< boost::multi_index::member< Element, const FROM *, &Element::from > >, boost::multi_index::ordered_non_unique< boost::multi_index::member< Element, const TO *, &Element::to > > > > ElementIndex
 Boost MultiIndex container to keep the bidirectional index. More...
 

Public Member Functions

 operator bool () const
 Returns true if relation is valid.
 
const ElementIndexindex () const
 Get the index.
 
ElementIndexindex ()
 Get the index.
 
AccessorParams getAccessorParams () const
 Get the AccessorParams of the underlying relation.
 
const AccessorParamsgetFromAccessorParams () const
 Get the AccessorParams of the StoreArray the relation points from.
 
const AccessorParamsgetToAccessorParams () const
 Get the AccessorParams of the StoreArray the relation points to.
 

Protected Member Functions

 RelationIndexContainer (const RelationArray &relArray)
 Constructor to create a new IndexContainer. More...
 
 RelationIndexContainer (const RelationIndexContainer &)=delete
 Restrict copies.
 
RelationIndexContaineroperator= (const RelationIndexContainer &)=delete
 Restrict copies.
 
void rebuild (bool force=false)
 Rebuild the index. More...
 
virtual void clear () override
 Clear the index (at the end of an event)
 

Protected Attributes

ElementIndex m_index
 Instance of the index.
 
RelationArray m_storeRel
 the underlying relation.
 
AccessorParams m_storeFrom
 AccessorParams of the StoreArray the relation points from.
 
AccessorParams m_storeTo
 AccessorParams of the StoreArray the relation points to.
 
bool m_valid
 Indicate wether the relation is valid.
 

Friends

class RelationIndexManager
 Allow the RelationIndexManager to create instances.
 

Detailed Description

template<class FROM, class TO>
class Belle2::RelationIndexContainer< FROM, TO >

Class to store a bidirectional index between two StoreArrays.

This class provides a bidirectional access to a given Relation to ease use of Relations for the normal user. There is no support for changing or adding Relations. All instances of this class will be managed and created by the RelationIndexManager.

This class is only used internally, users should use RelationsObject/RelationsInterface to access/add relations.

Definition at line 50 of file RelationIndexContainer.h.

Member Typedef Documentation

◆ ElementIndex

typedef boost::multi_index::multi_index_container< Element, boost::multi_index::indexed_by < boost::multi_index::ordered_non_unique < boost::multi_index::member<Element, const FROM*, &Element::from> >, boost::multi_index::ordered_non_unique < boost::multi_index::member<Element, const TO*, &Element::to> > > > ElementIndex

Boost MultiIndex container to keep the bidirectional index.

All the heavy lifting is done by this class

Definition at line 91 of file RelationIndexContainer.h.

Constructor & Destructor Documentation

◆ RelationIndexContainer()

RelationIndexContainer ( const RelationArray relArray)
inlineexplicitprotected

Constructor to create a new IndexContainer.

Parameters
relArrayRelationArray to build the relation for

Definition at line 115 of file RelationIndexContainer.h.


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