PODIO v00-16-03
An Event-Data-Model Toolkit for High Energy Physics Experiments
Loading...
Searching...
No Matches
podio::ObjBase Class Reference

#include <ObjBase.h>

Public Member Functions

 ObjBase (ObjectID id_, unsigned i)
 Constructor from ObjectID and initial object-count.
 
void acquire ()
 
int release ()
 
virtual ~ObjBase ()=default
 destructor
 

Public Attributes

podio::ObjectID id
 ID of the object.
 

Detailed Description

Definition at line 10 of file ObjBase.h.

Constructor & Destructor Documentation

◆ ObjBase()

podio::ObjBase::ObjBase ( ObjectID  id_,
unsigned  i 
)
inline

Constructor from ObjectID and initial object-count.

Definition at line 13 of file ObjBase.h.

13 : id(id_), ref_counter(i) {
14 }
podio::ObjectID id
ID of the object.
Definition: ObjBase.h:41

◆ ~ObjBase()

virtual podio::ObjBase::~ObjBase ( )
virtualdefault

destructor

Member Function Documentation

◆ acquire()

void podio::ObjBase::acquire ( )
inline

checks whether object is "untracked" by a collection if yes, increases reference count

Definition at line 18 of file ObjBase.h.

18 {
19 if (id.index == podio::ObjectID::untracked) {
20 ++ref_counter;
21 }
22 };
static const int untracked
not part of a collection
Definition: ObjectID.h:15

◆ release()

int podio::ObjBase::release ( )
inline

checks whether object is "untracked" by a collection if yes, decrease reference count and delete itself if count===0

Definition at line 26 of file ObjBase.h.

26 {
27 if (id.index != podio::ObjectID::untracked) {
28 return 1;
29 };
30 if (--ref_counter == 0) {
31 delete this;
32 }
33 return 0;
34 };

Member Data Documentation

◆ id

podio::ObjectID podio::ObjBase::id

ID of the object.

Definition at line 41 of file ObjBase.h.


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