13#ifndef STOREGATE_SG_VARHANDLEBASE_H
14#define STOREGATE_SG_VARHANDLEBASE_H 1
26#include "GaudiKernel/ServiceHandle.h"
27#include "GaudiKernel/EventContext.h"
108 const std::string& sgkey,
109 Gaudi::DataHandle::Mode
mode,
110 const std::string& storename,
111 const EventContext* ctx);
137 Gaudi::DataHandle::Mode
mode);
178 virtual const std::string&
key()
const override final;
286 virtual
void reset (
bool hard) override;
402 bool returnExisting);
599#include "StoreGate/VarHandleBase.icc"
uint32_t CLID
The Class ID type.
convert to and from a SG storable
A property holding a SG store/key/clid from which a VarHandle is made.
an iterator over instances of a given type in StoreGateSvc.
void * typeless_ptr(bool quiet=defaultQuiet)
Retrieve an object from StoreGate as non-const pointer.
StatusCode assign(const std::string &sgkey)
Update the underlying key from a string.
VarHandleBase(CLID clid, Gaudi::DataHandle::Mode mode)
Constructor with default key.
virtual void reset(bool hard) override
Reset this handle.
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
std::unique_ptr< VarHandleKey > m_ownedKey
An owned VarHandleKey.
bool isPresent_impl(const std::string &key) const
Is the referenced object present in SG?
IProxyDict * storeFromHandle(const EventContext *ctx) const
Return the store instance to use.
StatusCode symLink_impl(CLID newClid, const std::string &newKey)
Make a symlink or alias to the object currently referenced by this handle.
StatusCode setState()
Retrieve and cache all information managed by a handle.
bool isPresent() const
Is the referenced object present in SG?
void setProxy(SG::DataProxy *proxy)
Set a new proxy.
const void * typeless_cptr()
Retrieve an object from StoreGate as a const pointer.
bool m_storeWasSet
True if the store was set explicitly via setProxyDict.
void * typeless_dataPointer_fromProxy(SG::DataProxy *proxy, bool quiet) const
Retrieve a pointer from a proxy.
const std::string & objKey() const
Return the key string of the underlying DataObjID.
StatusCode setConst()
Set the 'const' bit for the bound proxy in the store.
const void * get_impl(const EventContext *ctx, bool quiet=defaultQuiet) const
virtual void finalReset() override final
Reset this handle at the end of processing.
virtual bool isSet() const override final
Has a proxy been retrieved from SG?
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.
const ServiceHandle< IProxyDict > & storeHandle() const
Return handle to the referenced store.
IProxyDict * m_store
Pointer to the store that owns the object.
void * m_ptr
The object to which we are bound.
virtual bool isValid()=0
Can the handle be successfully dereferenced?
StatusCode record_impl(std::unique_ptr< DataObject > dobj, void *dataPtr, bool allowMods, bool returnExisting)
Helper to record an object in the event store.
Gaudi::DataHandle::Mode mode() const
Return the mode (read/write/update) for this handle.
void * typeless_dataPointer(bool quiet=defaultQuiet)
Retrieve an object from StoreGate.
const VarHandleKey * m_key
The associated key object.
SG::DataProxy * m_proxy
Proxy holding the object to which we are bound.
const DataObjID & fullKey() const
Return the key as a DataObjID.
virtual StatusCode setProxyDict(IProxyDict *store)
Explicitly set the event store.
void * typeless_dataPointer_impl(bool quiet)
Retrieve an object from StoreGate.
VarHandleBase & operator=(const VarHandleBase &rhs)
Assignment operator.
friend std::ostream & operator<<(std::ostream &, const VarHandleBase &)
Return the name of the store holding the object we are proxying.
std::string store() const
Return the name of the store holding the object we are proxying.
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
bool isInitialized() const
Has a proxy been retrieved from SG?
bool isConst() const
True if this handle has a proxy, and the proxy is const.
StatusCode initialize(bool used=true)
Verify that the handle has been configured properly.
bool setStoreFromHandle(const EventContext *ctx)
Initialize the store pointer from the store handle.
void resetProxy()
Clear the m_proxy field and release the old proxy.
CLID clid() const
Return the class ID for the referenced object.
virtual ~VarHandleBase() override
Destructor.
const std::string & name() const
Return the StoreGate ID for the referenced object.
A property holding a SG store/key/clid from which a VarHandle is made.
holding In fact this class is here in order to allow STL container for all features This class is sho...
functions & macros to test the difference between floats
void varHandleTest(SGTest::TestStore &)
=============================================================================
static constexpr bool defaultQuiet