ATLAS Offline Software
|
Type-independent part of DataLink
; holds the persistent state.
More...
#include <DataLinkBase.h>
Inherited by DataLink< STORABLE >, DataLink< ActsTrk::TrackContainer >, DataLink< ALFA_DigitCollection >, DataLink< ALFA_LocRecCorrEvCollection >, DataLink< ALFA_LocRecCorrODEvCollection >, DataLink< ALFA_LocRecEvCollection >, DataLink< ALFA_LocRecODEvCollection >, DataLink< ALFA_ODDigitCollection >, DataLink< ALFA_RawDataContainer >, DataLink< Analysis::TauDetailsContainer >, DataLink< AthExIParticles >, DataLink< CaloCellContainer >, DataLink< CaloClusterContainer >, DataLink< CaloTowerContainer >, DataLink< DataVector >, DataLink< DataVector< Muon::MuonPatternCombination > >, DataLink< DOBJ >, DataLink< egDetailContainer >, DataLink< ExampleHitContainer >, DataLink< HLT::HLTResult >, DataLink< INav4MomAssocs >, DataLink< INav4MomToTrackParticleAssocs >, DataLink< JetKeyDescriptor >, DataLink< JetMomentMap >, DataLink< Rec::TrackParticleContainer >, DataLink< SG::AuxVectorBase >, DataLink< SG::IConstAuxStore >, DataLink< SGTutorial::MyDataObj >, DataLink< T >, DataLink< TrackParticleAssocs >, DataLink< TrigInDetTrackCollection >, DataLink< VxContainer >, DataLink< xAOD::TrackJacobianAuxContainer_v1 >, DataLink< xAOD::TrackMeasurementAuxContainer_v1 >, DataLink< xAOD::TrackParametersAuxContainer_v1 >, DataLink< xAOD::TrackStateAuxContainer_v1 >, and DataLink< xAOD::TrackSurfaceAuxContainer_v1 >.
Public Types | |
typedef SG::DataProxyHolder::sgkey_t | sgkey_t |
Type of hashed keys. More... | |
typedef SG::DataProxyHolder::ID_type | ID_type |
Type of string keys. More... | |
typedef SG::DataProxyHolder::pointer_t | pointer_t |
typedef SG::DataProxyHolder::const_pointer_t | const_pointer_t |
typedef SG::DataProxyHolder::castfn_t | castfn_t |
Function casting from a SG::DataProxy to a pointer. More... | |
Public Member Functions | |
bool | isDefault () const |
Test to see if we're in the default state. More... | |
const ID_type & | dataID () const |
Return the SG key that we reference, as a string. More... | |
sgkey_t | key () const |
Return the SG key that we reference, as a hash. More... | |
void | clear () |
Clear the link (make it null). More... | |
SG::DataProxy * | proxy (bool nothrow=false) const |
Return the DataProxy for this link. More... | |
IProxyDict * | source () const |
Return the data source for this reference. More... | |
bool | toTransient (IProxyDict *sg=0) |
Finish initialization after link has been read. More... | |
bool | toTransient (const EventContext &ctx) |
Finish initialization after link has been read. More... | |
bool | toTransient (const ID_type &dataID, CLID link_clid, IProxyDict *sg=0) |
Finish initialization like the link as just been read from root, but with a specified key. More... | |
bool | toTransient (const ID_type &dataID, CLID link_clid, const EventContext &ctx) |
Finish initialization like the link as just been read from root, but with a specified key. More... | |
bool | toPersistent () |
Prepare this link for writing. More... | |
bool | toPersistentNoRemap () |
Prepare this link for writing. More... | |
bool | operator== (const DataLinkBase &other) const |
Compare for equality. More... | |
bool | operator!= (const DataLinkBase &other) const |
Compare for inequality. More... | |
DataLinkBase (uint32_t key=0) | |
Default constructor. More... | |
virtual | ~DataLinkBase () |
Destructor. More... | |
uint32_t | persKey () const |
Get the key/identifier of the referenced container. More... | |
void | setPersKey (uint32_t key) |
Set the key/identifier of the referenced container. More... | |
bool | isDefault () const |
Test if the link is in the default state. More... | |
void | clear () |
Clear the link (make it null) More... | |
virtual bool | toTransient ()=0 |
Reset the object's internal cache. More... | |
Protected Member Functions | |
DataLinkBase () | |
Default constructor. More... | |
DataLinkBase (const_pointer_t obj, CLID link_clid, IProxyDict *sg) | |
Constructor from pointer to object. More... | |
DataLinkBase (const ID_type &dataID, CLID link_clid, IProxyDict *sg) | |
Constructor from a string key. More... | |
DataLinkBase (sgkey_t key, CLID link_clid, IProxyDict *sg) | |
Constructor from a hashed key. More... | |
DataLinkBase (sgkey_t key, const SG::DataProxyHolder &holder) | |
Constructor from a hashed key and a proxy holder object. More... | |
void | toStorableObject (const_pointer_t obj, CLID clid_in, IProxyDict *sg) |
Set the link to an object given by a pointer. More... | |
void | toIdentifiedObject (const ID_type &dataID, CLID clid, IProxyDict *sg) |
Set the link to an object given by a string key. More... | |
void | toIdentifiedObject (sgkey_t key, CLID clid, IProxyDict *sg) |
Set the link to an object given by a hashed key. More... | |
void * | storableBase (castfn_t *castfn, const CLID &clid, bool isConst) const |
Return a pointer to the currently-referenced object. More... | |
void | throwInvalidLink () const |
Throw a ExcInvalidLink exception for this link. More... | |
Protected Attributes | |
uint32_t | m_persKey |
Key/identifier of the referenced object. More... | |
bool | m_isDirectIO |
A transient variable signalling when direct I/O is happening. More... | |
Private Attributes | |
sgkey_t | m_persKey |
The hashed key for this link. More... | |
SG::DataProxyHolder | m_proxy |
SG proxy for this link. More... | |
Friends | |
class | ElementLinkBase |
template<class INDEXING_POLICY > | |
class | SG::GenericElementLinkBase |
class | DataLinkBase_test |
For component testing. More... | |
Type-independent part of DataLink
; holds the persistent state.
The persistent state for a DataLink
is the hashed SG key, stored here as m_persKey
. The transient member m_proxy
contains the data proxy pointer.
Definition at line 38 of file AthLinks/DataLinkBase.h.
typedef SG::DataProxyHolder::castfn_t DataLinkBase::castfn_t |
Function casting from a SG::DataProxy
to a pointer.
Definition at line 51 of file AthLinks/DataLinkBase.h.
Definition at line 48 of file AthLinks/DataLinkBase.h.
Type of string keys.
Definition at line 45 of file AthLinks/DataLinkBase.h.
Definition at line 47 of file AthLinks/DataLinkBase.h.
Type of hashed keys.
Definition at line 42 of file AthLinks/DataLinkBase.h.
|
protected |
Default constructor.
|
protected |
Constructor from pointer to object.
obj | Pointer to the object. |
link_clid | CLID of the link being set. |
sg | Associated store. |
If sg
is 0, we take the global default.
May throw ExcCLIDMismatch
.
|
protected |
Constructor from a string key.
dataID | Key of the object. |
link_clid | CLID of the link being set. |
sg | Associated store. |
If sg
is 0, we take the global default.
|
protected |
Constructor from a hashed key.
key | Hashed key of the object. |
link_clid | CLID of the link being set. |
sg | Associated store. |
If sg
is 0, we take the global default.
May throw ExcCLIDMismatch
.
|
protected |
Constructor from a hashed key and a proxy holder object.
Used internally for EL -> DL conversion.
key | Hashed key of the object. |
holder | Internal holder object for the proxy. |
DataLinkBase::DataLinkBase | ( | uint32_t | key = 0 | ) |
Default constructor.
Definition at line 8 of file DataLinkBase.cxx.
|
inlinevirtual |
void DataLinkBase::clear | ( | ) |
Clear the link (make it null)
void DataLinkBase::clear | ( | ) |
Clear the link (make it null).
Definition at line 36 of file DataLinkBase.cxx.
Return the SG key that we reference, as a string.
Returns a null string on failure.
bool DataLinkBase::isDefault | ( | ) | const |
Test if the link is in the default state.
bool DataLinkBase::isDefault | ( | ) | const |
Test to see if we're in the default state.
Definition at line 31 of file DataLinkBase.cxx.
sgkey_t DataLinkBase::key | ( | ) | const |
Return the SG key that we reference, as a hash.
Returns 0 on failure.
bool DataLinkBase::operator!= | ( | const DataLinkBase & | other | ) | const |
Compare for inequality.
bool DataLinkBase::operator== | ( | const DataLinkBase & | other | ) | const |
Compare for equality.
uint32_t DataLinkBase::persKey | ( | ) | const |
Get the key/identifier of the referenced container.
Definition at line 13 of file DataLinkBase.cxx.
SG::DataProxy* DataLinkBase::proxy | ( | bool | nothrow = false | ) | const |
Return the DataProxy
for this link.
nothrow | If true, return 0 on failure instead of throwing an exception. |
If this is a null link, we return 0. If we're directly referencing an object that's not in StoreGate, either return 0 or throw ExcPointerNotInSG
, depending on nothrow
. Otherwise, return the proxy for the object we're referencing.
void DataLinkBase::setPersKey | ( | uint32_t | key | ) |
IProxyDict* DataLinkBase::source | ( | ) | const |
Return the data source for this reference.
|
protected |
Return a pointer to the currently-referenced object.
castfn | Function to do the cast from data proxy to object. If 0, use a dynamic cast. |
clid | The CLID of the desired object. This is used to determine how the returned pointer is to be converted. |
isConst | True if the returned object will be treated as const. |
|
protected |
Throw a ExcInvalidLink
exception for this link.
sgkey | The hashed key for this link. |
This will fill in parameters for the exception message from the proxy.
|
protected |
Set the link to an object given by a string key.
dataID | Key of the object. |
link_clid | CLID of the link being set. |
sg | Associated store. |
If sg
is 0, then we take the store from whatever the link's currently set to. If the link has no current store, then we take the global default.
|
protected |
Set the link to an object given by a hashed key.
key | Hashed key of the object. |
link_clid | CLID of the link being set. |
sg | Associated store. |
If sg
is 0, then we take the store from whatever the link's currently set to. If the link has no current store, then we take the global default.
May throw ExcCLIDMismatch
.
bool DataLinkBase::toPersistent | ( | ) |
Prepare this link for writing.
One of the toPersistent
methods should be called before trying to write the link with root.
Ensures the hashed SG key to be saved is correct. If this link is referencing an object not in SG, we throw ExcPointerNotInSG
.
If the target of the link has been remapped, then the link will be updated with the remapped hash key.
Returns true.
bool DataLinkBase::toPersistentNoRemap | ( | ) |
Prepare this link for writing.
One of the toPersistent
methods should be called before trying to write the link with root.
Ensures the hashed SG key to be saved is correct. If this link is referencing an object not in SG, we throw ExcPointerNotInSG
.
This version does not perform link remapping.
Returns true.
|
protected |
Set the link to an object given by a pointer.
obj | Pointer to the object. |
link_clid | CLID of the link being set. |
sg | Associated store. |
If sg
is 0, then we take the store from whatever the link's currently set to. If the link has no current store, then we take the global default.
May throw ExcCLIDMismatch
.
|
pure virtual |
Reset the object's internal cache.
Implemented in DataLink< STORABLE >, DataLink< ALFA_RawDataContainer >, DataLink< JetKeyDescriptor >, DataLink< egDetailContainer >, DataLink< ALFA_LocRecEvCollection >, DataLink< Rec::TrackParticleContainer >, DataLink< xAOD::TrackMeasurementAuxContainer_v1 >, DataLink< xAOD::TrackSurfaceAuxContainer_v1 >, DataLink< INav4MomAssocs >, DataLink< ALFA_LocRecCorrEvCollection >, DataLink< DataVector >, DataLink< xAOD::TrackStateAuxContainer_v1 >, DataLink< ExampleHitContainer >, DataLink< INav4MomToTrackParticleAssocs >, DataLink< DataVector< Muon::MuonPatternCombination > >, DataLink< CaloCellContainer >, DataLink< T >, DataLink< ActsTrk::TrackContainer >, DataLink< xAOD::TrackJacobianAuxContainer_v1 >, DataLink< CaloClusterContainer >, DataLink< ALFA_DigitCollection >, DataLink< JetMomentMap >, DataLink< Analysis::TauDetailsContainer >, DataLink< TrigInDetTrackCollection >, DataLink< DOBJ >, DataLink< VxContainer >, DataLink< ALFA_ODDigitCollection >, DataLink< SG::AuxVectorBase >, DataLink< CaloTowerContainer >, DataLink< SGTutorial::MyDataObj >, DataLink< HLT::HLTResult >, DataLink< xAOD::TrackParametersAuxContainer_v1 >, DataLink< TrackParticleAssocs >, DataLink< ALFA_LocRecCorrODEvCollection >, DataLink< ALFA_LocRecODEvCollection >, DataLink< AthExIParticles >, and DataLink< SG::IConstAuxStore >.
bool DataLinkBase::toTransient | ( | const EventContext & | ctx | ) |
Finish initialization after link has been read.
ctx | Event context for this link. |
This should be called after a link has been read by root in order to set the proxy pointer. Returns true.
Finish initialization like the link as just been read from root, but with a specified key.
dataID | Key of the object. |
link_clid | CLID of the link being set. |
ctx | Event context for this link. |
The link should be clear before this is called. Returns true.
bool DataLinkBase::toTransient | ( | const ID_type & | dataID, |
CLID | link_clid, | ||
IProxyDict * | sg = 0 |
||
) |
Finish initialization like the link as just been read from root, but with a specified key.
dataID | Key of the object. |
link_clid | CLID of the link being set. |
sg | Associated store. |
The link should be clear before this is called. Returns true.
If sg
is 0, then we use the global default store.
bool DataLinkBase::toTransient | ( | IProxyDict * | sg = 0 | ) |
Finish initialization after link has been read.
sg | Associated store. |
This should be called after a link has been read by root in order to set the proxy pointer. Returns true.
If sg
is 0, then we use the global default store.
|
friend |
For component testing.
Definition at line 210 of file AthLinks/DataLinkBase.h.
|
friend |
Definition at line 206 of file AthLinks/DataLinkBase.h.
|
friend |
Definition at line 207 of file AthLinks/DataLinkBase.h.
|
protected |
A transient variable signalling when direct I/O is happening.
This flag is used exclusively by the DataLink<>::toTransient() function to know when it should take the persistent data stored in this object into account. That function may be called in normal P->T conversions as well, in which case using the data from this class would just reset the object to its default state.
Definition at line 60 of file A/AthLinks/DataLinkBase.h.
|
protected |
Key/identifier of the referenced object.
Definition at line 50 of file A/AthLinks/DataLinkBase.h.
|
private |
The hashed key for this link.
Definition at line 343 of file AthLinks/DataLinkBase.h.
|
private |
SG proxy for this link.
Definition at line 346 of file AthLinks/DataLinkBase.h.