![]() |
ATLAS Offline Software
|
#include <DataProxy.h>
Public Types | |
enum | ErrNo { ALLOK, NOCNVSVC, NOIOA, CNVFAILED, T2PREGFAILED, RECURSIVEREAD, NERRORS } |
typedef std::string | name_type |
typedef std::string | id_type |
typedef TransientAddress::TransientClidSet | CLIDCont_t |
typedef std::vector< std::string > | AliasCont_t |
typedef IStringPool::sgkey_t | sgkey_t |
Public Member Functions | |
DataProxy () | |
DataProxy (TransientAddress *tAddr, IConverter *pDataLoader, bool constFlag=false, bool resetOnly=true) | |
build from TransientAddress Takes ownership of tAddr. More... | |
DataProxy (std::unique_ptr< TransientAddress > tAddr, IConverter *pDataLoader, bool constFlag=false, bool resetOnly=true) | |
build from TransientAddress More... | |
DataProxy (TransientAddress &&tAddr, IConverter *pDataLoader, bool constFlag=false, bool resetOnly=true) | |
DataProxy (DataObject *dObject, TransientAddress *tAddr, bool constFlag=false, bool resetOnly=true) | |
build from DataObject More... | |
DataProxy (DataObject *dObject, TransientAddress &&tAddr, bool constFlag=false, bool resetOnly=true) | |
virtual | ~DataProxy () |
IRegistry implementation | |
typedef std::vector< IResetable * > | handleList_t |
list of bound DataHandles More... | |
typedef std::recursive_mutex | mutex_t |
typedef std::lock_guard< mutex_t > | lock_t |
typedef std::recursive_mutex | objMutex_t |
typedef std::lock_guard< objMutex_t > | objLock_t |
class | SG::DataStore |
For access to requestRelease. More... | |
unsigned int | m_refCount |
bool | m_resetFlag |
reset and not delete: default is true More... | |
bool | m_boundHandles |
True if there are any bound handles. More... | |
std::atomic< bool > | m_const |
Is the proxy currently const? More... | |
bool | m_origConst |
Was the proxy created as const? More... | |
std::atomic< DataObject * > | m_dObject |
TransientAddress | m_tAddress |
IConverter * | m_dataLoader |
T2pMap * | m_t2p |
handleList_t | m_handles |
mutex_t | m_mutex |
Athena::IMessageSvcHolder | m_ims |
std::atomic< IProxyDict * > | m_store |
The store of which we are a part. More... | |
enum ErrNo | m_errno |
errno-style error code for accessData More... | |
objMutex_t | m_objMutex |
virtual unsigned long | addRef () override final |
Add reference to object. More... | |
virtual unsigned long | release () override final |
release reference to object More... | |
unsigned long | refCount () const |
return refCount More... | |
virtual const name_type & | name () const override final |
Retrieve data object key == string. More... | |
virtual const id_type & | identifier () const override final |
Retrieve data object key == string duplicated for Gaudi folks does same as name() More... | |
virtual DataObject *object | ATLAS_NOT_CONST_THREAD_SAFE () const override final |
Retrieve DataObject. More... | |
virtual void | setAddress (IOpaqueAddress *ioa) override final |
set an IOpaqueAddress More... | |
virtual IOpaqueAddress * | address () const override final |
Retrieve IOpaqueAddress. More... | |
virtual IDataProviderSvc * | dataSvc () const override final |
set DataSvc (Gaudi-specific); do nothing for us More... | |
sgkey_t | sgkey () const |
< Get the primary (hashed) SG key. More... | |
void | setSGKey (sgkey_t sgkey) |
Return the ID of the store containing this proxy. More... | |
StoreID::type | storeID () const |
check if it is a transient ID (primary or symLinked): More... | |
bool | transientID (CLID id) const |
return the list of transient IDs (primary or symLinked): More... | |
CLIDCont_t | transientID () const |
void | setTransientID (CLID id) |
Add a new transient ID. More... | |
AliasCont_t | alias () const |
access set of proxy aliases Returns a COPY of the alias set. More... | |
bool | hasAlias (const std::string &key) const |
Test to see if a given string is in the alias set. More... | |
void | setAlias (const std::string &key) |
Add a new proxy alias. More... | |
bool | removeAlias (const std::string &key) |
remove alias from proxy More... | |
IAddressProvider * | provider () |
Return the address provider. More... | |
void | setProvider (IAddressProvider *provider, StoreID::type storeID) |
Set the address provider. More... | |
void | setID (CLID id, const std::string &key) |
Set the CLID / key. More... | |
void | reset (bool hard=false) |
Other methods of DataProxy (not in Interface IRegistry): More... | |
void | finalReset () |
bool | isValid () const |
called by destructor More... | |
bool | isValidAddress () const |
is the address valid? More... | |
bool | isValidObject () const |
is the object valid? More... | |
bool | updateAddress () |
void | setObject (DataObject *obj, bool doreg=true) |
set DataObject If doreg is true, then call setRegistry to set the backpointer from obj to the proxt. More... | |
DataObject * | accessData () |
Access DataObject on-demand using conversion service. More... | |
ErrNo | errNo () const |
CLID | clID () const |
Retrieve clid. More... | |
bool | isConst () const |
Check if it is a const object. More... | |
void | setConst () |
Mark this object as const. More... | |
void | resetOnly (const bool &flag) |
set the reset only flag: Clear Store will reset and not delete. More... | |
bool | isResetOnly () const |
Check reset only: More... | |
bool | bindHandle (IResetable *ir) |
void | unbindHandle (IResetable *ir) |
void | setT2p (T2pMap *t2p) |
virtual void | registerTransient (void *p) override final |
Register a transient object in a t2p map. More... | |
void | setStore (IProxyDict *store) |
Set the store of which we're a part. More... | |
IProxyDict * | store () |
Return the store of which we're a part. More... | |
const IProxyDict * | store () const |
Return the store of which we're a part. More... | |
void | resetBoundHandles (bool hard) |
reset the bound DataHandles If HARD is true, then the bound objects should also clear any data that depends on the identity of the current event store. More... | |
IConverter * | loader () |
std::unique_ptr< DataObject > | readData () |
Read in a new copy of the object referenced by this proxy. More... | |
DataProxy (const DataProxy &)=delete | |
DataProxy & | operator= (const DataProxy &)=delete |
DataObject * | accessDataOol () |
Out-of-line part of accessData(). More... | |
bool | requestRelease (bool force, bool hard) |
Reset/release a proxy at the end of an event. More... | |
void | resetRef () |
Drop the reference to the data object. More... | |
void | lock (objLock_t &) |
Lock the data object we're holding, if any. More... | |
std::unique_ptr< DataObject > | readData (objLock_t &objLock, ErrNo *errNo) |
Read in a new copy of the object referenced by this proxy. More... | |
void | setObject (objLock_t &objLock, DataObject *obj, bool doreg) |
set DataObject If doreg is true, then call setRegistry to set the backpointer from obj to the proxt. More... | |
const EventContext & | contextFromStore () const |
Retrieve the EventContext saved in the owning store. More... | |
Definition at line 44 of file DataProxy.h.
typedef std::vector<std::string> SG::DataProxy::AliasCont_t |
Definition at line 55 of file DataProxy.h.
Definition at line 54 of file DataProxy.h.
|
private |
list of bound DataHandles
Definition at line 329 of file DataProxy.h.
typedef std::string SG::DataProxy::id_type |
Definition at line 53 of file DataProxy.h.
|
private |
Definition at line 338 of file DataProxy.h.
|
private |
Definition at line 337 of file DataProxy.h.
typedef std::string SG::DataProxy::name_type |
Definition at line 52 of file DataProxy.h.
|
private |
Definition at line 352 of file DataProxy.h.
|
private |
Definition at line 351 of file DataProxy.h.
Definition at line 56 of file DataProxy.h.
enum SG::DataProxy::ErrNo |
Enumerator | |
---|---|
ALLOK | |
NOCNVSVC | |
NOIOA | |
CNVFAILED | |
T2PREGFAILED | |
RECURSIVEREAD | |
NERRORS |
Definition at line 48 of file DataProxy.h.
DataProxy::DataProxy | ( | ) |
Definition at line 92 of file DataProxy.cxx.
DataProxy::DataProxy | ( | TransientAddress * | tAddr, |
IConverter * | pDataLoader, | ||
bool | constFlag = false , |
||
bool | resetOnly = true |
||
) |
build from TransientAddress Takes ownership of tAddr.
Definition at line 108 of file DataProxy.cxx.
DataProxy::DataProxy | ( | std::unique_ptr< TransientAddress > | tAddr, |
IConverter * | pDataLoader, | ||
bool | constFlag = false , |
||
bool | resetOnly = true |
||
) |
build from TransientAddress
Definition at line 119 of file DataProxy.cxx.
DataProxy::DataProxy | ( | TransientAddress && | tAddr, |
IConverter * | pDataLoader, | ||
bool | constFlag = false , |
||
bool | resetOnly = true |
||
) |
Definition at line 128 of file DataProxy.cxx.
DataProxy::DataProxy | ( | DataObject * | dObject, |
TransientAddress * | tAddr, | ||
bool | constFlag = false , |
||
bool | resetOnly = true |
||
) |
DataProxy::DataProxy | ( | DataObject * | dObject, |
TransientAddress && | tAddr, | ||
bool | constFlag = false , |
||
bool | resetOnly = true |
||
) |
Definition at line 168 of file DataProxy.cxx.
|
virtual |
Definition at line 187 of file DataProxy.cxx.
DataObject* SG::DataProxy::accessData | ( | ) |
Access DataObject on-demand using conversion service.
runtime_error | when converter fails |
|
private |
Out-of-line part of accessData().
Access DataObject on-demand using conversion service.
Definition at line 506 of file DataProxy.cxx.
|
finaloverridevirtual |
Add reference to object.
Definition at line 314 of file DataProxy.cxx.
|
finaloverridevirtual |
Retrieve IOpaqueAddress.
AliasCont_t SG::DataProxy::alias | ( | ) | const |
access set of proxy aliases Returns a COPY of the alias set.
|
finaloverridevirtual |
Retrieve DataObject.
bool DataProxy::bindHandle | ( | IResetable * | ir | ) |
Definition at line 215 of file DataProxy.cxx.
CLID SG::DataProxy::clID | ( | ) | const |
Retrieve clid.
|
private |
Retrieve the EventContext saved in the owning store.
Retrieve the EventContext saved in the parent store.
If there is no context recorded in the store, return a default-initialized context.
Do not call this holding m_mutex, or we could deadlock (ATEAM-755). (The store lock must be acquired before the DataProxy lock.)
Definition at line 706 of file DataProxy.cxx.
|
finaloverridevirtual |
set DataSvc (Gaudi-specific); do nothing for us
ErrNo SG::DataProxy::errNo | ( | ) | const |
void DataProxy::finalReset | ( | ) |
Definition at line 251 of file DataProxy.cxx.
bool SG::DataProxy::hasAlias | ( | const std::string & | key | ) | const |
Test to see if a given string is in the alias set.
bool SG::DataProxy::isConst | ( | ) | const |
Check if it is a const object.
bool SG::DataProxy::isResetOnly | ( | ) | const |
Check reset only:
bool SG::DataProxy::isValid | ( | ) | const |
called by destructor
am I valid?
bool DataProxy::isValidAddress | ( | ) | const |
bool SG::DataProxy::isValidObject | ( | ) | const |
is the object valid?
IConverter* SG::DataProxy::loader | ( | ) |
|
private |
Lock the data object we're holding, if any.
Should be called with the mutex held.
Definition at line 688 of file DataProxy.cxx.
Retrieve data object key == string.
IAddressProvider* SG::DataProxy::provider | ( | ) |
Return the address provider.
std::unique_ptr< DataObject > DataProxy::readData | ( | ) |
Read in a new copy of the object referenced by this proxy.
If this proxy has an associated loader and address, then load a new copy of the object and return it. Any existing copy held by the proxy is unaffected.
This will fail if the proxy does not refer to an object read from an input file.
Returns a null pointer on failure.
Definition at line 421 of file DataProxy.cxx.
Read in a new copy of the object referenced by this proxy.
errNo | If non-null, set to the resulting error code. |
If this proxy has an associated loader and address, then load a new copy of the object and return it. Any existing copy held by the proxy is unaffected.
This will fail if the proxy does not refer to an object read from an input file.
Definition at line 440 of file DataProxy.cxx.
unsigned long DataProxy::refCount | ( | ) | const |
return refCount
Definition at line 307 of file DataProxy.cxx.
|
finaloverridevirtual |
Register a transient object in a t2p map.
trans | The object to register. |
(IRegisterTransient
interface.)
trans | The object to register. |
Implements SG::IRegisterTransient.
Definition at line 675 of file DataProxy.cxx.
|
finaloverridevirtual |
release reference to object
Definition at line 321 of file DataProxy.cxx.
bool SG::DataProxy::removeAlias | ( | const std::string & | key | ) |
remove alias from proxy
|
private |
Reset/release a proxy at the end of an event.
force | If true, force a release rather than a reset. |
hard | Do a hard reset if true. |
This is usually called at the end of an event. No locking is done, so there should be no other threads accessing this proxy.
‘Release’ means that we want to remove the proxy from the store. ‘Reset’ means that we keep the proxy, but remove the data object that it references. Each proxy has a flag saying whether it wants to do a release or a reset. This can be forced via the FORCE argument; this would typically be done when deleting the store. This function does not actually release the proxy. If it returns true, the caller is expected to release the proxy.
See AthenaKernel/IResetable.h for the meaning of HARD.
Definition at line 354 of file DataProxy.cxx.
void DataProxy::reset | ( | bool | hard = false | ) |
Other methods of DataProxy (not in Interface IRegistry):
Reset DataObject, Handles and IOpaqueAddress: If HARD is true, then the bound objects should also clear any data that depends on the identity of the current event store. (See IResetable.h.)
Definition at line 241 of file DataProxy.cxx.
void DataProxy::resetBoundHandles | ( | bool | hard | ) |
reset the bound DataHandles If HARD is true, then the bound objects should also clear any data that depends on the identity of the current event store.
don't need no comment
(See IResetable.h.)
Definition at line 277 of file DataProxy.cxx.
void SG::DataProxy::resetOnly | ( | const bool & | flag | ) |
set the reset only flag: Clear Store will reset and not delete.
|
private |
|
finaloverridevirtual |
set an IOpaqueAddress
Definition at line 401 of file DataProxy.cxx.
void SG::DataProxy::setAlias | ( | const std::string & | key | ) |
Add a new proxy alias.
void DataProxy::setConst | ( | ) |
Mark this object as const.
(Lock the object.)
If the object held that derives from ILockable
, then we also call lock
on the object.
Definition at line 205 of file DataProxy.cxx.
Set the CLID / key.
This will only succeed if the clid/key are currently clear.
void DataProxy::setObject | ( | DataObject * | obj, |
bool | doreg = true |
||
) |
set DataObject If doreg is true, then call setRegistry to set the backpointer from obj to the proxt.
set a DataObject address
Definition at line 393 of file DataProxy.cxx.
|
private |
set DataObject If doreg is true, then call setRegistry to set the backpointer from obj to the proxt.
set a DataObject address If doreg is true, then call setRegistry to set the backpointer from obj to the proxt.
Definition at line 380 of file DataProxy.cxx.
void SG::DataProxy::setProvider | ( | IAddressProvider * | provider, |
StoreID::type | storeID | ||
) |
Set the address provider.
void SG::DataProxy::setSGKey | ( | sgkey_t | sgkey | ) |
Return the ID of the store containing this proxy.
void SG::DataProxy::setStore | ( | IProxyDict * | store | ) |
Set the store of which we're a part.
void DataProxy::setT2p | ( | T2pMap * | t2p | ) |
void SG::DataProxy::setTransientID | ( | CLID | id | ) |
Add a new transient ID.
sgkey_t SG::DataProxy::sgkey | ( | ) | const |
IProxyDict* SG::DataProxy::store | ( | ) |
Return the store of which we're a part.
const IProxyDict* SG::DataProxy::store | ( | ) | const |
Return the store of which we're a part.
StoreID::type SG::DataProxy::storeID | ( | ) | const |
check if it is a transient ID (primary or symLinked):
CLIDCont_t SG::DataProxy::transientID | ( | ) | const |
bool SG::DataProxy::transientID | ( | CLID | id | ) | const |
return the list of transient IDs (primary or symLinked):
void DataProxy::unbindHandle | ( | IResetable * | ir | ) |
Definition at line 294 of file DataProxy.cxx.
bool DataProxy::updateAddress | ( | ) |
Definition at line 592 of file DataProxy.cxx.
|
friend |
For access to requestRelease.
Definition at line 262 of file DataProxy.h.
|
private |
True if there are any bound handles.
Definition at line 313 of file DataProxy.h.
|
private |
Is the proxy currently const?
Definition at line 316 of file DataProxy.h.
|
private |
Definition at line 324 of file DataProxy.h.
|
private |
Definition at line 320 of file DataProxy.h.
|
private |
errno-style error code for accessData
Definition at line 344 of file DataProxy.h.
|
private |
Definition at line 330 of file DataProxy.h.
|
private |
Definition at line 341 of file DataProxy.h.
|
mutableprivate |
Definition at line 339 of file DataProxy.h.
|
mutableprivate |
Definition at line 353 of file DataProxy.h.
|
private |
Was the proxy created as const?
Definition at line 318 of file DataProxy.h.
|
private |
Definition at line 303 of file DataProxy.h.
|
private |
reset and not delete: default is true
Definition at line 306 of file DataProxy.h.
|
private |
The store of which we are a part.
Definition at line 344 of file DataProxy.h.
|
private |
Definition at line 326 of file DataProxy.h.
|
private |
Definition at line 322 of file DataProxy.h.