|
ATLAS Offline Software
|
Go to the documentation of this file.
13 #ifndef STOREGATE_SG_VARHANDLEBASE_H
14 #define STOREGATE_SG_VARHANDLEBASE_H 1
26 #include "GaudiKernel/ServiceHandle.h"
27 #include "GaudiKernel/EventContext.h"
45 static constexpr
bool defaultQuiet =
false;
107 const std::string&
sgkey,
176 virtual const std::string&
key()
const override final;
284 virtual
void reset (
bool hard) override;
400 bool returnExisting);
421 std::unique_ptr<DataObject> dobj,
597 #include "StoreGate/VarHandleBase.icc"
600 #endif //> !STOREGATE_SG_VARHANDLEBASE_H
VarHandleBase(CLID clid, Gaudi::DataHandle::Mode mode)
Constructor with default key.
A property holding a SG store/key/clid from which a VarHandle is made.
IProxyDict * storeFromHandle(const EventContext *ctx) const
Return the store instance to use.
std::unique_ptr< VarHandleKey > m_ownedKey
An owned VarHandleKey.
virtual void finalReset() override final
Reset this handle at the end of processing.
void * typeless_dataPointer(bool quiet=defaultQuiet)
Retrieve an object from StoreGate.
convert to and from a SG storable
const std::string & name() const
Return the StoreGate ID for the referenced object.
StatusCode assign(const std::string &sgkey)
Update the underlying key from a string.
StatusCode setState()
Retrieve and cache all information managed by a handle.
Base class for VarHandle types.
CLID clid() const
Return the class ID for the referenced object.
void * typeless_dataPointer_impl(bool quiet)
Retrieve an object from StoreGate.
VarHandleBase & operator=(const VarHandleBase &rhs)
Assignment operator.
bool const RAWDATA *ch2 const
StatusCode setConst()
Set the 'const' bit for the bound proxy in the store.
friend std::ostream & operator<<(std::ostream &, const VarHandleBase &)
Output stream.
void varHandleTest(SGTest::TestStore &)
a resetable object (e.g. a SG DataHandle)
virtual StatusCode setProxyDict(IProxyDict *store)
Explicitly set the event store.
void resetProxy()
Clear the m_proxy field and release the old proxy.
::StatusCode StatusCode
StatusCode definition for legacy code.
const VarHandleKey * m_key
The associated key object.
std::string store() const
Return the name of the store holding the object we are proxying.
functions & macros to test the difference between floats
SG::DataProxy * m_proxy
Proxy holding the object to which we are bound.
uint32_t CLID
The Class ID type.
bool isInitialized() const
Has a proxy been retrieved from SG?
Gaudi::DataHandle::Mode mode() const
Return the mode (read/write/update) for this handle.
an iterator over instances of a given type in StoreGateSvc. It d-casts and caches locally the pointed...
bool isPresent_impl(const std::string &key) const
Is the referenced object present in SG?
virtual void reset(bool hard) override
Reset this handle.
void * typeless_dataPointer_fromProxy(SG::DataProxy *proxy, bool quiet) const
Retrieve a pointer from a proxy.
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
A property holding a SG store/key/clid from which a VarHandle is made.
virtual ~VarHandleBase() override
Destructor.
const std::string & objKey() const
Return the key string of the underlying DataObjID.
const ServiceHandle< IProxyDict > & storeHandle() const
Return handle to the referenced store.
const void * typeless_cptr()
Retrieve an object from StoreGate as a const pointer.
bool setStoreFromHandle(const EventContext *ctx)
Initialize the store pointer from the store handle.
const DataObjID & fullKey() const
Return the key as a DataObjID.
void * typeless_ptr(bool quiet=defaultQuiet)
Retrieve an object from StoreGate as non-const pointer.
StatusCode initialize(bool used=true)
Verify that the handle has been configured properly.
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
bool m_storeWasSet
True if the store was set explicitly via setProxyDict.
void * m_ptr
The object to which we are bound.
=============================================================================
bool isPresent() const
Is the referenced object present in SG?
bool isConst() const
True if this handle has a proxy, and the proxy is const.
const void * put_impl(const EventContext *ctx, std::unique_ptr< DataObject > dobj, const void *dataPtr, bool allowMods, bool returnExisting, IProxyDict *&store) const
Helper to record an object in the event store.
virtual bool isValid()=0
Can the handle be successfully dereferenced?
IProxyDict * m_store
Pointer to the store that owns the object.
virtual bool isSet() const override final
Has a proxy been retrieved from SG?
StatusCode record_impl(std::unique_ptr< DataObject > dobj, void *dataPtr, bool allowMods, bool returnExisting)
Helper to record an object in the event store.
static const std::string & storeName(const StoreID::type &s)
StatusCode symLink_impl(CLID newClid, const std::string &newKey)
Make a symlink or alias to the object currently referenced by this handle.
const void * get_impl(const EventContext *ctx, bool quiet=defaultQuiet) const
void setProxy(SG::DataProxy *proxy)
Set a new proxy.