Belle II Software prerelease-11-00-00d
StoreEntry.h
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#pragma once
9
10#include <string>
11
12class TObject;
13class TClass;
14class TClonesArray;
15
16namespace Belle2 {
22 struct StoreEntry {
24 StoreEntry() : isArray(false), dontWriteOut(false), objClass(nullptr), object(nullptr), ptr(nullptr), name() {};
25
27 StoreEntry(bool isArray, TClass* cl, std::string name, bool dontWriteOut);
28
30 void invalidate();
32 void resetForGetEntry();
36 void recreate();
38 TClonesArray* getPtrAsArray() const;
39
40 bool isArray;
42 TClass* objClass;
43
49 TObject* object;
50
52 TObject* ptr;
53
54 std::string name;
55 };
56
57}
Abstract base class for different kinds of events.
TObject * ptr
The pointer to the returned object, either equal to 'object' or null, depending on whether the object...
Definition StoreEntry.h:52
TClonesArray * getPtrAsArray() const
Return ptr cast to TClonesArray.
Definition StoreEntry.cc:92
bool dontWriteOut
Flag that indicates whether the object should be written to the output by default.
Definition StoreEntry.h:41
StoreEntry()
default constructor.
Definition StoreEntry.h:24
TObject * object
The pointer to the actual object.
Definition StoreEntry.h:49
void invalidate()
invalidate entry for next event.
Definition StoreEntry.cc:86
bool isArray
Flag that indicates whether the object is a TClonesArray.
Definition StoreEntry.h:40
std::string name
Name of the entry.
Definition StoreEntry.h:54
void recoverFromNullObject()
Recreate object if null.
Definition StoreEntry.cc:30
void resetForGetEntry()
Reset stored object to defaults, or nullptr.
Definition StoreEntry.cc:64
void recreate()
Reset stored object to defaults, set ptr to new object.
Definition StoreEntry.cc:77
TClass * objClass
class of object.
Definition StoreEntry.h:42