Belle II Software prerelease-11-00-00d
RelationContainer.cc
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#include <framework/dataobjects/RelationContainer.h>
10
11#include <framework/dataobjects/RelationElement.h>
12
13using namespace std;
14using namespace Belle2;
15
17 // Deliberately small initial capacity (see also the StoreEntry struct):
18 // the array grows on demand, but Clear()/Delete() cost scales with the capacity.
19 m_elements(RelationElement::Class(), 10),
21 m_toName(""), m_toDurability(-1), m_modified(true)
22{
23}
24
26{
27 return *static_cast<RelationElement*>(m_elements.At(i));
28}
30{
31 m_elements.Delete();
32 m_fromName.clear();
33 m_toName.clear();
34 m_modified = true;
36}
virtual void Clear(Option_t *="")
Clear container to free memory.
TClonesArray m_elements
TClonesArray to store all elements.
const RelationElement & getElement(int i) const
Get reference to RelationElement at index i.
RelationContainer()
Default constructor, initialize all values to sane default.
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.
Class to store a single element of a relation.
Abstract base class for different kinds of events.
STL namespace.