![]() |
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. | |
| DataProxy (std::unique_ptr< TransientAddress > tAddr, IConverter *pDataLoader, bool constFlag=false, bool resetOnly=true) | |
| build from TransientAddress | |
| 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 | |
| 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 | |
| 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. | |
| unsigned int | m_refCount {} |
| bool | m_resetFlag = true |
| reset and not delete: default is true | |
| bool | m_boundHandles {} |
| True if there are any bound handles. | |
| std::atomic< bool > | m_const {} |
| Is the proxy currently const? | |
| bool | m_origConst {} |
| Was the proxy created as const? | |
| std::atomic< DataObject * > | m_dObject = nullptr |
| 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. | |
| objMutex_t | m_objMutex |
| virtual unsigned long | addRef () override final |
| Add reference to object. | |
| virtual unsigned long | release () override final |
| release reference to object | |
| unsigned long | refCount () const |
| return refCount | |
| virtual const name_type & | name () const override final |
| Retrieve data object key == string. | |
| virtual const id_type & | identifier () const override final |
| Retrieve data object key == string duplicated for Gaudi folks does same as name(). | |
| virtual DataObject *object | ATLAS_NOT_CONST_THREAD_SAFE () const override final |
| Retrieve DataObject. | |
| virtual void | setAddress (IOpaqueAddress *ioa) override final |
| set an IOpaqueAddress | |
| void | setAddress (CxxUtils::RefCountedPtr< IOpaqueAddress > ioa) |
| set an IOpaqueAddress | |
| virtual IOpaqueAddress * | address () const override final |
| Retrieve IOpaqueAddress. | |
| virtual IDataProviderSvc * | dataSvc () const override final |
| set DataSvc (Gaudi-specific); do nothing for us | |
| sgkey_t | sgkey () const |
| < Get the primary (hashed) SG key. | |
| void | setSGKey (sgkey_t sgkey) |
| Return the ID of the store containing this proxy. | |
| StoreID::type | storeID () const |
| check if it is a transient ID (primary or symLinked): | |
| bool | transientID (CLID id) const |
| return the list of transient IDs (primary or symLinked): | |
| CLIDCont_t | transientID () const |
| void | setTransientID (CLID id) |
| Add a new transient ID. | |
| AliasCont_t | alias () const |
| access set of proxy aliases Returns a COPY of the alias set. | |
| bool | hasAlias (const std::string &key) const |
| Test to see if a given string is in the alias set. | |
| void | setAlias (const std::string &key) |
| Add a new proxy alias. | |
| bool | removeAlias (const std::string &key) |
| remove alias from proxy | |
| IAddressProvider * | provider () |
| Return the address provider. | |
| void | setProvider (IAddressProvider *provider, StoreID::type storeID) |
| Set the address provider. | |
| void | setID (CLID id, const std::string &key) |
| Set the CLID / key. | |
| void | reset (bool hard=false) |
| Other methods of DataProxy (not in Interface IRegistry): | |
| void | finalReset () |
| bool | isValid () const |
| called by destructor | |
| bool | isValidAddress () const |
| is the address valid? | |
| bool | isValidObject () const |
| is the object valid? | |
| 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. | |
| DataObject * | accessData () |
| Access DataObject on-demand using conversion service. | |
| ErrNo | errNo () const |
| CLID | clID () const |
| Retrieve clid. | |
| bool | isConst () const |
| Check if it is a const object. | |
| void | setConst () |
| Mark this object as const. | |
| void | resetOnly (const bool &flag) |
| set the reset only flag: Clear Store will reset and not delete. | |
| bool | isResetOnly () const |
| Check reset only: | |
| 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. | |
| void | setStore (IProxyDict *store) |
| Set the store of which we're a part. | |
| IProxyDict * | store () |
| Return the store of which we're a part. | |
| const IProxyDict * | store () const |
| Return the store of which we're a part. | |
| 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. | |
| IConverter * | loader () |
| std::unique_ptr< DataObject > | readData () |
| Read in a new copy of the object referenced by this proxy. | |
| DataProxy (const DataProxy &)=delete | |
| DataProxy & | operator= (const DataProxy &)=delete |
| DataObject * | accessDataOol () |
| Out-of-line part of accessData(). | |
| bool | requestRelease (bool force, bool hard) |
| Reset/release a proxy at the end of an event. | |
| void | resetRef () |
| Drop the reference to the data object. | |
| void | lock (objLock_t &) |
| Lock the data object we're holding, if any. | |
| std::unique_ptr< DataObject > | readData (objLock_t &objLock, ErrNo *errNo) |
| Read in a new copy of the object referenced by this proxy. | |
| 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. | |
| const EventContext & | contextFromStore () const |
| Retrieve the EventContext saved in the owning store. | |
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 332 of file DataProxy.h.
| typedef std::string SG::DataProxy::id_type |
Definition at line 53 of file DataProxy.h.
|
private |
Definition at line 341 of file DataProxy.h.
|
private |
Definition at line 340 of file DataProxy.h.
| typedef std::string SG::DataProxy::name_type |
Definition at line 52 of file DataProxy.h.
|
private |
Definition at line 355 of file DataProxy.h.
|
private |
Definition at line 354 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 98 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 109 of file DataProxy.cxx.
| DataProxy::DataProxy | ( | TransientAddress && | tAddr, |
| IConverter * | pDataLoader, | ||
| bool | constFlag = false, | ||
| bool | resetOnly = true ) |
Definition at line 118 of file DataProxy.cxx.
| DataProxy::DataProxy | ( | DataObject * | dObject, |
| TransientAddress * | tAddr, | ||
| bool | constFlag = false, | ||
| bool | resetOnly = true ) |
build from DataObject
Definition at line 133 of file DataProxy.cxx.
| DataProxy::DataProxy | ( | DataObject * | dObject, |
| TransientAddress && | tAddr, | ||
| bool | constFlag = false, | ||
| bool | resetOnly = true ) |
Definition at line 145 of file DataProxy.cxx.
|
virtual |
Definition at line 157 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 496 of file DataProxy.cxx.
|
finaloverridevirtual |
|
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 185 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 705 of file DataProxy.cxx.
|
finaloverridevirtual |
set DataSvc (Gaudi-specific); do nothing for us
| ErrNo SG::DataProxy::errNo | ( | ) | const |
| void DataProxy::finalReset | ( | ) |
Definition at line 226 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 |
is the address valid?
Definition at line 574 of file DataProxy.cxx.
| 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 687 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 403 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 422 of file DataProxy.cxx.
| unsigned long DataProxy::refCount | ( | ) | const |
return refCount
Definition at line 282 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 674 of file DataProxy.cxx.
|
finaloverridevirtual |
release reference to object
Definition at line 296 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 329 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 216 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 252 of file DataProxy.cxx.
| void SG::DataProxy::resetOnly | ( | const bool & | flag | ) |
set the reset only flag: Clear Store will reset and not delete.
|
inlineprivate |
Drop the reference to the data object.
Definition at line 202 of file DataProxy.cxx.
| void DataProxy::setAddress | ( | CxxUtils::RefCountedPtr< IOpaqueAddress > | ioa | ) |
set an IOpaqueAddress
Definition at line 383 of file DataProxy.cxx.
|
finaloverridevirtual |
set an IOpaqueAddress
Definition at line 376 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 175 of file DataProxy.cxx.
| 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 368 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 355 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 269 of file DataProxy.cxx.
| bool DataProxy::updateAddress | ( | ) |
Definition at line 591 of file DataProxy.cxx.
|
friend |
For access to requestRelease.
Definition at line 265 of file DataProxy.h.
|
private |
|
private |
|
private |
Definition at line 327 of file DataProxy.h.
|
private |
Definition at line 323 of file DataProxy.h.
|
private |
Definition at line 333 of file DataProxy.h.
|
private |
Definition at line 344 of file DataProxy.h.
|
mutableprivate |
Definition at line 342 of file DataProxy.h.
|
mutableprivate |
Definition at line 356 of file DataProxy.h.
|
private |
|
private |
Definition at line 306 of file DataProxy.h.
|
private |
reset and not delete: default is true
Definition at line 309 of file DataProxy.h.
|
private |
|
private |
Definition at line 329 of file DataProxy.h.
|
private |
Definition at line 325 of file DataProxy.h.