ATLAS Offline Software
Loading...
Searching...
No Matches
xAOD::RAuxManager Class Reference

Manager for RAuxStore objects. More...

#include <RAuxManager.h>

Inheritance diagram for xAOD::RAuxManager:
Collaboration diagram for xAOD::RAuxManager:

Public Member Functions

 RAuxManager (RAuxStore *store, ::Long64_t &entry, ::Bool_t sharedOwner=kTRUE)
 Constructor getting hold of an auxiliary store object.
virtual::Int_t getEntry (::Int_t getall=0) override
 Function for updating the object in memory if needed.
virtual const void * object () const override
 Function getting a const pointer to the object being handled.
virtual void * object () override
 Function getting a pointer to the object being handled.
virtual void setObject (void *obj) override
 Function replacing the object being handled.
virtual::Bool_t create () override
 Create the object for the current event.
virtual::Bool_t isSet () const override
 Check if the object was set for the current event.
virtual void reset () override
 Reset the object at the end of processing of an event.
RAuxStoregetStore ()
 Get a type-specific pointer to the managed object.
const SG::IConstAuxStoregetConstStore () const
 Get a convenience pointer to the managed object.

Private Attributes

std::shared_ptr< RAuxStorem_store
 The auxiliary store object.
RAuxStorem_storePtr
 Pointer to the auxiliary store object.
std::reference_wrapper<::Long64_t > m_entry
 Entry number.

Detailed Description

Manager for RAuxStore objects.

This class is used when connecting RAuxStore objects to the input ntuple as the auxiliary store of a DV container.

Definition at line 27 of file RAuxManager.h.

Constructor & Destructor Documentation

◆ RAuxManager()

xAOD::RAuxManager::RAuxManager ( RAuxStore * store,
::Long64_t & entry,
::Bool_t sharedOwner = kTRUE )

Constructor getting hold of an auxiliary store object.

Definition at line 11 of file RAuxManager.cxx.

13 : m_store(), m_storePtr(store), m_entry(entry) {
14
15 if (sharedOwner) {
16 m_store.reset(store);
17 }
18}
std::reference_wrapper<::Long64_t > m_entry
Entry number.
Definition RAuxManager.h:62
std::shared_ptr< RAuxStore > m_store
The auxiliary store object.
Definition RAuxManager.h:58
RAuxStore * m_storePtr
Pointer to the auxiliary store object.
Definition RAuxManager.h:60

Member Function Documentation

◆ create()

Bool_t xAOD::RAuxManager::create ( )
overridevirtual

Create the object for the current event.

There is no need for a default object.

Implements xAOD::TVirtualManager.

Definition at line 51 of file RAuxManager.cxx.

51 {
52
53 return kTRUE;
54}

◆ getConstStore()

const SG::IConstAuxStore * xAOD::RAuxManager::getConstStore ( ) const

Get a convenience pointer to the managed object.

Definition at line 85 of file RAuxManager.cxx.

85 {
86
87 return m_storePtr;
88}

◆ getEntry()

Int_t xAOD::RAuxManager::getEntry ( ::Int_t getall = 0)
overridevirtual

Function for updating the object in memory if needed.

Implements xAOD::TVirtualManager.

Definition at line 20 of file RAuxManager.cxx.

20 {
21
22 if (m_storePtr->getEntry(m_entry.get(), getall).isFailure()) {
23 return -1;
24 } else {
25 return 0;
26 }
27}

◆ getStore()

RAuxStore * xAOD::RAuxManager::getStore ( )

Get a type-specific pointer to the managed object.

Definition at line 80 of file RAuxManager.cxx.

80 {
81
82 return m_storePtr;
83}

◆ isSet()

Bool_t xAOD::RAuxManager::isSet ( ) const
overridevirtual

Check if the object was set for the current event.

The state of a RAuxStore object is always "set".

So this interface unfortunately doesn't make much sense for this manager class...

Implements xAOD::TVirtualManager.

Definition at line 60 of file RAuxManager.cxx.

60 {
61
62 return kTRUE;
63}

◆ object() [1/2]

const void * xAOD::RAuxManager::object ( ) const
overridevirtual

Function getting a const pointer to the object being handled.

Implements xAOD::TVirtualManager.

Definition at line 29 of file RAuxManager.cxx.

29 {
30
31 return m_storePtr;
32}

◆ object() [2/2]

void * xAOD::RAuxManager::object ( )
overridevirtual

Function getting a pointer to the object being handled.

Implements xAOD::TVirtualManager.

Definition at line 34 of file RAuxManager.cxx.

34 {
35
36 return m_storePtr;
37}

◆ reset()

void xAOD::RAuxManager::reset ( )
overridevirtual

Reset the object at the end of processing of an event.

Resetting an auxiliary store needs to be done in a smart way.

Container stores need to be emptied, while object stores don't need to be touched.

Implements xAOD::TVirtualManager.

Definition at line 69 of file RAuxManager.cxx.

69 {
70
71 // Clear the store if it's a container store:
73 m_storePtr->resize(0);
74 m_storePtr->reset();
75 }
76
77 return;
78}
@ kContainerStore
The object describes an entire container.

◆ setObject()

void xAOD::RAuxManager::setObject ( void * obj)
overridevirtual

Function replacing the object being handled.

Implements xAOD::TVirtualManager.

Definition at line 39 of file RAuxManager.cxx.

39 {
40
41 if (m_store.get()) {
42 m_store.reset(reinterpret_cast<RAuxStore*>(ptr));
43 }
44 m_storePtr = reinterpret_cast<RAuxStore*>(ptr);
45
46 return;
47}
void * ptr(T *p)
Definition SGImplSvc.cxx:74

Member Data Documentation

◆ m_entry

std::reference_wrapper<::Long64_t> xAOD::RAuxManager::m_entry
private

Entry number.

Definition at line 62 of file RAuxManager.h.

◆ m_store

std::shared_ptr<RAuxStore> xAOD::RAuxManager::m_store
private

The auxiliary store object.

Definition at line 58 of file RAuxManager.h.

◆ m_storePtr

RAuxStore* xAOD::RAuxManager::m_storePtr
private

Pointer to the auxiliary store object.

Definition at line 60 of file RAuxManager.h.


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