ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
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, ::Bool_t sharedOwner=kTRUE)
 Constructor getting hold of an auxiliary store object. More...
 
 RAuxManager (const RAuxManager &parent)
 Copy constructor. More...
 
RAuxManageroperator= (const RAuxManager &rhs)
 Assignment operator. More...
 
virtual ::Int_t getEntry (::Int_t getall=0) override
 Function for updating the object in memory if needed. More...
 
virtual const void * object () const override
 Function getting a const pointer to the object being handled. More...
 
virtual void * object () override
 Function getting a pointer to the object being handled. More...
 
virtual void setObject (void *obj) override
 Function replacing the object being handled. More...
 
virtual ::Bool_t create () override
 Create the object for the current event. More...
 
virtual ::Bool_t isSet () const override
 Check if the object was set for the current event. More...
 
virtual void reset () override
 Reset the object at the end of processing of an event. More...
 
RAuxStoregetStore ()
 Get a type-specific pointer to the managed object. More...
 
const SG::IConstAuxStoregetConstStore () const
 Get a convenience pointer to the managed object. More...
 

Private Attributes

std::shared_ptr< RAuxStorem_store
 The auxiliary store object. More...
 
RAuxStorem_storePtr
 Pointer to the auxiliary store object. More...
 

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 25 of file RAuxManager.h.

Constructor & Destructor Documentation

◆ RAuxManager() [1/2]

xAOD::RAuxManager::RAuxManager ( RAuxStore store,
::Bool_t  sharedOwner = kTRUE 
)

Constructor getting hold of an auxiliary store object.

Definition at line 13 of file RAuxManager.cxx.

14  : m_store(), m_storePtr( store ) {
15 
16  if( sharedOwner ) {
17  m_store.reset( store );
18  }
19  }

◆ RAuxManager() [2/2]

xAOD::RAuxManager::RAuxManager ( const RAuxManager parent)

Copy constructor.

Definition at line 21 of file RAuxManager.cxx.

22  : m_store( parent.m_store ), m_storePtr( parent.m_storePtr ) {}

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 65 of file RAuxManager.cxx.

65  {
66 
67  return kTRUE;
68  }

◆ getConstStore()

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

Get a convenience pointer to the managed object.

Definition at line 99 of file RAuxManager.cxx.

99  {
100 
101  return m_storePtr;
102  }

◆ 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 38 of file RAuxManager.cxx.

38  {
39 
40  return m_storePtr->getEntry( getall );
41  }

◆ getStore()

RAuxStore * xAOD::RAuxManager::getStore ( )

Get a type-specific pointer to the managed object.

Definition at line 94 of file RAuxManager.cxx.

94  {
95 
96  return m_storePtr;
97  }

◆ 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 74 of file RAuxManager.cxx.

74  {
75 
76  return kTRUE;
77  }

◆ 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 43 of file RAuxManager.cxx.

43  {
44 
45  return m_storePtr;
46  }

◆ object() [2/2]

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

Function getting a pointer to the object being handled.

Implements xAOD::TVirtualManager.

Definition at line 48 of file RAuxManager.cxx.

48  {
49 
50  return m_storePtr;
51  }

◆ operator=()

RAuxManager & xAOD::RAuxManager::operator= ( const RAuxManager rhs)

Assignment operator.

Definition at line 24 of file RAuxManager.cxx.

24  {
25 
26  // Check if anything needs to be done:
27  if( this == &rhs ) {
28  return *this;
29  }
30 
31  // Do the assignment:
32  m_store = rhs.m_store;
33  m_storePtr = rhs.m_storePtr;
34 
35  return *this;
36  }

◆ 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 83 of file RAuxManager.cxx.

83  {
84 
85  // Clear the store if it's a container store:
87  m_storePtr->resize( 0 );
88  m_storePtr->reset();
89  }
90 
91  return;
92  }

◆ setObject()

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

Function replacing the object being handled.

Implements xAOD::TVirtualManager.

Definition at line 53 of file RAuxManager.cxx.

53  {
54 
55  if( m_store.get() ) {
56  m_store.reset( reinterpret_cast< RAuxStore* >( ptr ) );
57  }
58  m_storePtr = reinterpret_cast< RAuxStore* >( ptr );
59 
60  return;
61  }

Member Data Documentation

◆ m_store

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

The auxiliary store object.

Definition at line 60 of file RAuxManager.h.

◆ m_storePtr

RAuxStore* xAOD::RAuxManager::m_storePtr
private

Pointer to the auxiliary store object.

Definition at line 62 of file RAuxManager.h.


The documentation for this class was generated from the following files:
xAOD::RAuxStore::structMode
EStructMode structMode() const
Return the structure mode of the object.
Definition: RAuxStore.cxx:91
SGTest::store
TestStore store
Definition: TestStore.cxx:23
xAOD::RAuxStore::kContainerStore
@ kContainerStore
The object describes an entire container.
Definition: RAuxStore.h:47
xAOD::RAuxStore::reset
void reset()
Reset the store.
Definition: RAuxStore.cxx:202
xAOD::RAuxManager::m_storePtr
RAuxStore * m_storePtr
Pointer to the auxiliary store object.
Definition: RAuxManager.h:62
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
xAOD::RAuxStore::getEntry
::Int_t getEntry(Long64_t entry, ::Int_t getall=0)
Get entry from the input RNTuple.
Definition: RAuxStore.cxx:155
xAOD::RAuxManager::m_store
std::shared_ptr< RAuxStore > m_store
The auxiliary store object.
Definition: RAuxManager.h:60
test_pyathena.parent
parent
Definition: test_pyathena.py:15
xAOD::RAuxStore::resize
virtual bool resize(size_t size) override
Resize the arrays to a given size.
Definition: RAuxStore.cxx:601