ATLAS Offline Software
Public Member Functions | Protected Attributes | List of all members
HLTNavDetails::TypelessAuxProxy Class Reference

#include <TypeProxy.h>

Inheritance diagram for HLTNavDetails::TypelessAuxProxy:
Collaboration diagram for HLTNavDetails::TypelessAuxProxy:

Public Member Functions

virtual StatusCode create () override
 Make a new object. More...
 
virtual StatusCode reg (StoreGateSvc *, const std::string &) override
 Save proxied object in DG (record) More...
 
virtual StatusCode clear (StoreGateSvc *) override
 Remove the object from SG and make the pointer null. More...
 
virtual StatusCode sync (StoreGateSvc *sg, const std::string &key) override
 SG retrieve, and fill the proxy. More...
 
virtual void syncTypeless () override
 
virtual ITypeProxyclone () const override
 This is how typed proxy is obtained. More...
 
bool contains (StoreGateSvc *sg, const std::string &key) const
 Check whether StoreGate contains an object of this type and with the specified key. More...
 
bool transientContains (StoreGateSvc *sg, const std::string &key) const
 Check whether StoreGate contains a modifyable object of this type and with the specified key. More...
 
bool empty () const
 True if proxy has not yet made object or not synced to any yet (0 pointer) More...
 
CLID clid () const
 The CLID of the object being proxied. More...
 
const std::string & typeName () const
 The type name of the object being proxied. More...
 
const void * cptr () const
 

Protected Attributes

CLID m_clid {0}
 The CLID of the type being proxied. More...
 
std::string m_typeName
 The type name of the object being proxied. More...
 
std::string m_key
 StoreGate key of the proxied object. More...
 
SG::DataProxym_proxy {nullptr}
 StoreGate proxy for the object. More...
 
void * m_ncPointer {nullptr}
 Non-const pointer to the proxied object. More...
 
const void * m_pointer {nullptr}
 Const pointer to the proxied object. More...
 
bool m_isAuxVectorBase {false}
 Does the proxied type inherit from SG::AuxVectorBase? More...
 

Detailed Description

Definition at line 111 of file TypeProxy.h.

Member Function Documentation

◆ castAuxVectorBase()

SG::AuxVectorBase * HLTNavDetails::ITypeProxy::castAuxVectorBase ( )
inherited

Return a pointer to the SG::AuxVectorBase base class of the object if possible.

Definition at line 35 of file TypeProxy.cxx.

35  {
36 
37  if( m_isAuxVectorBase ) {
38  return static_cast< SG::AuxVectorBase* >( m_ncPointer );
39  } else {
40  return 0;
41  }
42  }

◆ castIAuxStore()

SG::IAuxStore * HLTNavDetails::ITypeProxy::castIAuxStore ( )
inherited

Return a pointer to the SG::IAuxStore base class of the object if possible.

This cast can be done based on StoreGate, since SG::IAuxStore has a CLID, as should the type that we're proxying.

Definition at line 47 of file TypeProxy.cxx.

47  {
48 
49  return static_cast< SG::IAuxStore* >( m_ncPointer );
50  }

◆ clear()

virtual StatusCode HLTNavDetails::TypelessAuxProxy::clear ( StoreGateSvc sg)
inlineoverridevirtual

Remove the object from SG and make the pointer null.

Implements HLTNavDetails::ITypeProxy.

Definition at line 122 of file TypeProxy.h.

122  {
123  REPORT_MESSAGE( MSG::ERROR ) << "read-only aux proxy. it can't delete objects (because it didn't create any)" << endmsg;
124  return StatusCode::FAILURE;
125  };

◆ clid()

CLID HLTNavDetails::ITypeProxy::clid ( ) const
inherited

The CLID of the object being proxied.

Definition at line 68 of file TypeProxy.cxx.

68  {
69 
70  return m_clid;
71  }

◆ clone()

virtual ITypeProxy* HLTNavDetails::TypelessAuxProxy::clone ( ) const
inlineoverridevirtual

This is how typed proxy is obtained.

Implements HLTNavDetails::ITypeProxy.

Definition at line 151 of file TypeProxy.h.

151  {
152  REPORT_MESSAGE( MSG::ERROR ) << "read-only Aux Proxy should be created by direct object creation, not via clone of static instance" << endmsg;
153  return nullptr;
154  };

◆ contains()

bool HLTNavDetails::ITypeProxy::contains ( StoreGateSvc sg,
const std::string &  key 
) const
inherited

Check whether StoreGate contains an object of this type and with the specified key.

Definition at line 52 of file TypeProxy.cxx.

52  {
53 
54  return sg->contains( m_clid, key );
55  }

◆ cptr()

const void* HLTNavDetails::ITypeProxy::cptr ( ) const
inlineinherited

Definition at line 92 of file TypeProxy.h.

92 { return m_pointer; }

◆ create()

virtual StatusCode HLTNavDetails::TypelessAuxProxy::create ( )
inlineoverridevirtual

Make a new object.

Implements HLTNavDetails::ITypeProxy.

Definition at line 114 of file TypeProxy.h.

114  {
115  REPORT_MESSAGE( MSG::ERROR ) << "read-only aux proxy. it can't create new objects" << endmsg;
116  return StatusCode::FAILURE;
117  }

◆ empty()

bool HLTNavDetails::ITypeProxy::empty ( ) const
inherited

True if proxy has not yet made object or not synced to any yet (0 pointer)

Definition at line 63 of file TypeProxy.cxx.

63  {
64 
65  return ( ( m_proxy == 0 ) && ( m_ncPointer == 0 ) );
66  }

◆ reg()

virtual StatusCode HLTNavDetails::TypelessAuxProxy::reg ( StoreGateSvc sg,
const std::string &  key 
)
inlineoverridevirtual

Save proxied object in DG (record)

Implements HLTNavDetails::ITypeProxy.

Definition at line 118 of file TypeProxy.h.

118  {
119  REPORT_MESSAGE( MSG::ERROR ) << "read-only aux proxy. it can't register new objects to SG" << endmsg;
120  return StatusCode::FAILURE;
121  };

◆ sync()

virtual StatusCode HLTNavDetails::TypelessAuxProxy::sync ( StoreGateSvc sg,
const std::string &  key 
)
inlineoverridevirtual

SG retrieve, and fill the proxy.

Reimplemented from HLTNavDetails::ITypeProxy.

Definition at line 127 of file TypeProxy.h.

127  {
128  REPORT_MESSAGE( MSG::INFO ) << "syncing a read-only Aux proxy with key " << key << endmsg;
129  const SG::IAuxStore* aux = nullptr;
130  StatusCode sc = sg->retrieve(aux,key);
131  if(!aux or sc.isFailure() ){
132  REPORT_MESSAGE( MSG::ERROR ) << "syncing of read-only Aux proxy failed" << key << endmsg;
133  return StatusCode::FAILURE;
134  }
135  // We do need the non-const Aux store pointer as well to be able to fill
136  // it during deserialization. So the comment above that this is read-only
137  // is not quite correct.
138  auto nonconstaux ATLAS_THREAD_SAFE = const_cast<SG::IAuxStore*>(aux);
139  m_ncPointer = nonconstaux;
140  m_pointer = aux;
141 
142  REPORT_MESSAGE( MSG::INFO ) << "syncing of read-only Aux proxy succeeded" << key << endmsg;
143 
144  return StatusCode::SUCCESS;
145  }

◆ syncTypeless()

virtual void HLTNavDetails::TypelessAuxProxy::syncTypeless ( )
inlineoverridevirtual

Implements HLTNavDetails::ITypeProxy.

Definition at line 147 of file TypeProxy.h.

147  {
148  REPORT_MESSAGE( MSG::ERROR ) << "read-only Aux Proxy, syncing typeless" << endmsg;
149  };

◆ transientContains()

bool HLTNavDetails::ITypeProxy::transientContains ( StoreGateSvc sg,
const std::string &  key 
) const
inherited

Check whether StoreGate contains a modifyable object of this type and with the specified key.

Definition at line 57 of file TypeProxy.cxx.

58  {
59 
60  return sg->transientContains( m_clid, key );
61  }

◆ typeName()

const std::string & HLTNavDetails::ITypeProxy::typeName ( ) const
inherited

The type name of the object being proxied.

Definition at line 73 of file TypeProxy.cxx.

73  {
74 
75  return m_typeName;
76  }

Member Data Documentation

◆ m_clid

CLID HLTNavDetails::ITypeProxy::m_clid {0}
protectedinherited

The CLID of the type being proxied.

Definition at line 95 of file TypeProxy.h.

◆ m_isAuxVectorBase

bool HLTNavDetails::ITypeProxy::m_isAuxVectorBase {false}
protectedinherited

Does the proxied type inherit from SG::AuxVectorBase?

Definition at line 102 of file TypeProxy.h.

◆ m_key

std::string HLTNavDetails::ITypeProxy::m_key
protectedinherited

StoreGate key of the proxied object.

Definition at line 97 of file TypeProxy.h.

◆ m_ncPointer

void* HLTNavDetails::ITypeProxy::m_ncPointer {nullptr}
protectedinherited

Non-const pointer to the proxied object.

Definition at line 99 of file TypeProxy.h.

◆ m_pointer

const void* HLTNavDetails::ITypeProxy::m_pointer {nullptr}
protectedinherited

Const pointer to the proxied object.

Definition at line 100 of file TypeProxy.h.

◆ m_proxy

SG::DataProxy* HLTNavDetails::ITypeProxy::m_proxy {nullptr}
protectedinherited

StoreGate proxy for the object.

Definition at line 98 of file TypeProxy.h.

◆ m_typeName

std::string HLTNavDetails::ITypeProxy::m_typeName
protectedinherited

The type name of the object being proxied.

Definition at line 96 of file TypeProxy.h.


The documentation for this class was generated from the following file:
HLTNavDetails::ITypeProxy::m_ncPointer
void * m_ncPointer
Non-const pointer to the proxied object.
Definition: TypeProxy.h:99
StoreGateSvc::contains
bool contains(const TKEY &key) const
Look up a keyed object in TDS (compare also tryRetrieve) returns false if object not available in TDS...
HLTNavDetails::ITypeProxy::m_isAuxVectorBase
bool m_isAuxVectorBase
Does the proxied type inherit from SG::AuxVectorBase?
Definition: TypeProxy.h:102
SG::AuxVectorBase
Manage index tracking and synchronization of auxiliary data.
Definition: AuxVectorBase.h:98
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
StoreGateSvc::retrieve
StatusCode retrieve(const T *&ptr) const
Retrieve the default object into a const T*.
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
HLTNavDetails::ITypeProxy::m_proxy
SG::DataProxy * m_proxy
StoreGate proxy for the object.
Definition: TypeProxy.h:98
StoreGateSvc::transientContains
bool transientContains(const TKEY &key) const
Look up a transient data object in TDS only (no Proxy lookup) returns false if object not available i...
HLTNavDetails::ITypeProxy::m_clid
CLID m_clid
The CLID of the type being proxied.
Definition: TypeProxy.h:95
REPORT_MESSAGE
#define REPORT_MESSAGE(LVL)
Report a message.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:365
HLTNavDetails::ITypeProxy::m_pointer
const void * m_pointer
Const pointer to the proxied object.
Definition: TypeProxy.h:100
SG::IAuxStore
Interface for non-const operations on an auxiliary store.
Definition: IAuxStore.h:48
ATLAS_THREAD_SAFE
#define ATLAS_THREAD_SAFE
Definition: checker_macros.h:211
HLTNavDetails::ITypeProxy::m_typeName
std::string m_typeName
The type name of the object being proxied.
Definition: TypeProxy.h:96
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37