Belle II Software development
RelationContainer Class Reference

Class to store relations between StoreArrays in the DataStore. More...

#include <RelationContainer.h>

Inheritance diagram for RelationContainer:

Public Member Functions

 RelationContainer ()
 Default constructor, initialize all values to sane default.
 
const std::string & getFromName () const
 Get name of the StoreArray we relate from.
 
int getFromDurability () const
 Get durability of the StoreArray we relate from.
 
const std::string & getToName () const
 Get name of the StoreArray we relate to.
 
int getToDurability () const
 Get durability of the StoreArray we relate to.
 
void setFromName (const std::string &name)
 Set name of the StoreArray we relate from.
 
void setFromDurability (int durability)
 Set durability of the StoreArray we relate from.
 
void setToName (const std::string &name)
 Set name of the StoreArray we relate to.
 
void setToDurability (int durability)
 Set durability of the StoreArray we relate to.
 
void setModified (bool modified)
 check for modification since creation or deserialization.
 
bool isDefaultConstructed () const
 Returns true if no information was set yet or Clear() was called.
 
virtual void Clear (Option_t *="")
 Clear container to free memory.
 
TClonesArray & elements ()
 Get reference to the elements.
 
const TClonesArray & elements () const
 Get const reference to the elements.
 
const RelationElementgetElement (int i) const
 Get reference to RelationElement at index i.
 
int getEntries () const
 Get number of elements.
 
bool getModified () const
 check for modification since creation or deserialization.
 

Protected Member Functions

 ClassDef (RelationContainer, 1)
 Class to store relations between StoreArrays in the DataStore.
 

Protected Attributes

TClonesArray m_elements
 TClonesArray to store all elements.
 
std::string m_fromName
 name of the StoreArray we relate from.
 
int m_fromDurability
 durability of the StoreArray we relate from.
 
std::string m_toName
 name of the StoreArray we relate to.
 
int m_toDurability
 durability of the StoreArray we relate to.
 
bool m_modified
 check for modification since creation or deserialization.
 

Friends

class RelationArray
 transient
 
class DataStore
 

Detailed Description

Class to store relations between StoreArrays in the DataStore.

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

See also
RelationElement

Definition at line 27 of file RelationContainer.h.

Constructor & Destructor Documentation

◆ RelationContainer()

Default constructor, initialize all values to sane default.

Definition at line 16 of file RelationContainer.cc.

16 :
17 m_elements(RelationElement::Class()),
19 m_toName(""), m_toDurability(-1), m_modified(true)
20{
21}
TClonesArray m_elements
TClonesArray to store all elements.
int m_toDurability
durability of the StoreArray we relate to.
std::string m_fromName
name of the StoreArray we relate from.
bool m_modified
check for modification since creation or deserialization.
std::string m_toName
name of the StoreArray we relate to.
int m_fromDurability
durability of the StoreArray we relate from.

Member Function Documentation

◆ Clear()

void Clear ( Option_t *  = "")
virtual

Clear container to free memory.

Prefer to deleting objects of this type.

Definition at line 27 of file RelationContainer.cc.

28{
29 m_elements.Delete();
30 m_fromName.clear();
31 m_toName.clear();
32 m_modified = true;
34}

◆ elements() [1/2]

TClonesArray & elements ( )
inline

Get reference to the elements.

Definition at line 71 of file RelationContainer.h.

71{ return m_elements; }

◆ elements() [2/2]

const TClonesArray & elements ( ) const
inline

Get const reference to the elements.

Definition at line 74 of file RelationContainer.h.

74{ return m_elements; }

◆ getElement()

const RelationElement & getElement ( int  i) const

Get reference to RelationElement at index i.

Definition at line 23 of file RelationContainer.cc.

24{
25 return *static_cast<RelationElement*>(m_elements.At(i));
26}
Class to store a single element of a relation.

◆ getEntries()

int getEntries ( ) const
inline

Get number of elements.

Definition at line 80 of file RelationContainer.h.

80{ return m_elements.GetEntriesFast(); }

◆ getFromDurability()

int getFromDurability ( ) const
inline

Get durability of the StoreArray we relate from.

Definition at line 37 of file RelationContainer.h.

37{ return m_fromDurability; }

◆ getFromName()

const std::string & getFromName ( ) const
inline

Get name of the StoreArray we relate from.

Definition at line 34 of file RelationContainer.h.

34{ return m_fromName; }

◆ getModified()

bool getModified ( ) const
inline

check for modification since creation or deserialization.

Definition at line 83 of file RelationContainer.h.

83{ return m_modified; }

◆ getToDurability()

int getToDurability ( ) const
inline

Get durability of the StoreArray we relate to.

Definition at line 43 of file RelationContainer.h.

43{ return m_toDurability; }

◆ getToName()

const std::string & getToName ( ) const
inline

Get name of the StoreArray we relate to.

Definition at line 40 of file RelationContainer.h.

40{ return m_toName; }

◆ isDefaultConstructed()

bool isDefaultConstructed ( ) const
inline

Returns true if no information was set yet or Clear() was called.

Definition at line 61 of file RelationContainer.h.

62 {
63 return (m_fromDurability == -1 and m_toDurability == -1 and
64 m_fromName.empty() and m_toName.empty() and getEntries() == 0);
65 }
int getEntries() const
Get number of elements.

◆ setFromDurability()

void setFromDurability ( int  durability)
inline

Set durability of the StoreArray we relate from.

Definition at line 49 of file RelationContainer.h.

49{ m_fromDurability = durability; }

◆ setFromName()

void setFromName ( const std::string &  name)
inline

Set name of the StoreArray we relate from.

Definition at line 46 of file RelationContainer.h.

46{ m_fromName = name; }

◆ setModified()

void setModified ( bool  modified)
inline

check for modification since creation or deserialization.

Definition at line 58 of file RelationContainer.h.

58{ m_modified = modified; }

◆ setToDurability()

void setToDurability ( int  durability)
inline

Set durability of the StoreArray we relate to.

Definition at line 55 of file RelationContainer.h.

55{ m_toDurability = durability; }

◆ setToName()

void setToName ( const std::string &  name)
inline

Set name of the StoreArray we relate to.

Definition at line 52 of file RelationContainer.h.

52{ m_toName = name; }

Friends And Related Function Documentation

◆ DataStore

friend class DataStore
friend

Definition at line 106 of file RelationContainer.h.

◆ RelationArray

friend class RelationArray
friend

transient

Definition at line 105 of file RelationContainer.h.

Member Data Documentation

◆ m_elements

TClonesArray m_elements
protected

TClonesArray to store all elements.

Definition at line 88 of file RelationContainer.h.

◆ m_fromDurability

int m_fromDurability
protected

durability of the StoreArray we relate from.

Definition at line 94 of file RelationContainer.h.

◆ m_fromName

std::string m_fromName
protected

name of the StoreArray we relate from.

Definition at line 91 of file RelationContainer.h.

◆ m_modified

bool m_modified
protected

check for modification since creation or deserialization.

Definition at line 103 of file RelationContainer.h.

◆ m_toDurability

int m_toDurability
protected

durability of the StoreArray we relate to.

Definition at line 100 of file RelationContainer.h.

◆ m_toName

std::string m_toName
protected

name of the StoreArray we relate to.

Definition at line 97 of file RelationContainer.h.


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