The Gaudi Framework
v30r3 (a5ef0a68)
|
A small class used to access easily (and efficiently) data items residing in data stores. More...
#include <GaudiKernel/SmartDataObjectPtr.h>
Classes | |
class | ObjectFinder |
Helper class to configure smart pointer functionality. More... | |
class | ObjectLoader |
Helper class to configure smart pointer functionality. More... | |
Public Types | |
using | AccessFunction = DataObject *(*)(SmartDataObjectPtr *ptr) |
Public Member Functions | |
SmartDataObjectPtr (AccessFunction access, IDataProviderSvc *pService, IRegistry *pDir, std::string path) | |
Standard constructor: Construct an SmartDataObjectPtr instance. More... | |
SmartDataObjectPtr (const SmartDataObjectPtr &)=default | |
Copy constructor: Construct an copy of a SmartDataStorePtr instance. More... | |
virtual | ~SmartDataObjectPtr ()=default |
Standard Destructor. More... | |
virtual SmartDataObjectPtr & | operator= (const SmartDataObjectPtr &) |
Assignment operator. More... | |
operator IRegistry * () | |
Automatic conversion to data directory. More... | |
const std::string & | path () const |
Path name. More... | |
IRegistry * | directory () |
Access to data directory. More... | |
void | setService (IDataProviderSvc *svc) |
Assign data service. More... | |
IDataProviderSvc * | service () |
Retrieve data service. More... | |
const StatusCode & | getLastError () const |
Access to potential errors during data accesses. More... | |
DataObject * | accessData () |
Static Object retrieval method: must call specific function. More... | |
DataObject * | retrieveObject () |
Object retrieve method. More... | |
DataObject * | findObject () |
Object find method. More... | |
DataObject * | updateObject () |
Object update method. More... | |
Static Public Member Functions | |
static DataObject * | retrieve (SmartDataObjectPtr *ptr) |
Static Object retrieval method. More... | |
static DataObject * | find (SmartDataObjectPtr *ptr) |
Static Object find method. More... | |
static DataObject * | update (SmartDataObjectPtr *ptr) |
Static Object update method. More... | |
Protected Member Functions | |
StatusCode | find (IRegistry *pDirectory, const std::string &path, DataObject *&refpObject) |
Find the specified object from the data store. More... | |
StatusCode | find (const std::string &fullPath, DataObject *&refpObject) |
Find the specified object from the data store. More... | |
StatusCode | retrieve (IRegistry *pDirectory, const std::string &path, DataObject *&refpObject) |
Retrieve the specified object from the data store. More... | |
StatusCode | retrieve (const std::string &fullPath, DataObject *&refpObject) |
Retrieve the specified object from the data store. More... | |
StatusCode | update (IRegistry *pDirectory) |
Update the specified object from the data store. More... | |
StatusCode | update (const std::string &fullPath) |
Update the specified object from the data store. More... | |
Protected Attributes | |
IDataProviderSvc * | m_dataProvider = nullptr |
Pointer to contained object. More... | |
IRegistry * | m_pRegistry = nullptr |
Pointer to the data registry containing the object. More... | |
StatusCode | m_status = {StatusCode::SUCCESS, true} |
Keep track of the last error. More... | |
std::string | m_path |
Path to object. More... | |
AccessFunction | m_accessFunc |
Data access function. More... | |
A small class used to access easily (and efficiently) data items residing in data stores.
The class is meant as configurable base class for real Smart pointer instances. Here mainly the access of the data store is handled. It is important to keep as less functions as possible NON-VIRTUAL in particular those, which handle the data access - they might be called very often and hence the compiler must be able to inline them.
Definition at line 32 of file SmartDataObjectPtr.h.
using SmartDataObjectPtr::AccessFunction = DataObject* (*)( SmartDataObjectPtr* ptr ) |
Definition at line 35 of file SmartDataObjectPtr.h.
|
inline |
Standard constructor: Construct an SmartDataObjectPtr instance.
svc | Pointer to the data service interface used to interact with the store. |
pDir | Pointer to data directory |
path | path to object relative to data directory |
Definition at line 57 of file SmartDataObjectPtr.h.
|
default |
Copy constructor: Construct an copy of a SmartDataStorePtr instance.
copy | Copy of Smart Pointer to object. |
|
virtualdefault |
Standard Destructor.
|
inline |
Static Object retrieval method: must call specific function.
Definition at line 91 of file SmartDataObjectPtr.h.
|
inline |
Access to data directory.
Definition at line 79 of file SmartDataObjectPtr.h.
|
inlinestatic |
Static Object find method.
Definition at line 97 of file SmartDataObjectPtr.h.
|
protected |
Find the specified object from the data store.
Retrieve the object from the data store.
pDirectory | Pointer to the directory entry holding the object. |
refpObject | Reference to the pointer finally holding the object |
Definition at line 44 of file SmartDataObjectPtr.cpp.
|
protected |
Find the specified object from the data store.
Retrieve the object from the data store.
fullPath | String containing the full path necessary to locate the object. |
refpObject | Reference to the pointer finally holding the object |
Definition at line 52 of file SmartDataObjectPtr.cpp.
DataObject * SmartDataObjectPtr::findObject | ( | ) |
Object find method.
If the object is not known to the local object, it is requested from the data service either using the full path if there is no directory information present.
Definition at line 90 of file SmartDataObjectPtr.cpp.
|
inline |
Access to potential errors during data accesses.
Definition at line 88 of file SmartDataObjectPtr.h.
|
inline |
Automatic conversion to data directory.
Definition at line 73 of file SmartDataObjectPtr.h.
|
virtual |
Assignment operator.
Reimplemented in SmartDataStorePtr< TYPE, LOADER >, and SmartDataStorePtr< TYPE, SmartDataObjectPtr::ObjectLoader >.
Definition at line 22 of file SmartDataObjectPtr.cpp.
|
inline |
|
inlinestatic |
Static Object retrieval method.
Definition at line 94 of file SmartDataObjectPtr.h.
|
protected |
Retrieve the specified object from the data store.
Retrieve the object from the data store.
pDirectory | Pointer to the directory entry holding the object. |
refpObject | Reference to the pointer finally holding the object |
Definition at line 31 of file SmartDataObjectPtr.cpp.
|
protected |
Retrieve the specified object from the data store.
Retrieve the object from the data store.
fullPath | String containing the full path necessary to locate the object. |
refpObject | Reference to the pointer finally holding the object |
Definition at line 38 of file SmartDataObjectPtr.cpp.
DataObject * SmartDataObjectPtr::retrieveObject | ( | ) |
Object retrieve method.
Object retrieval method.
If the object is not known to the local object, it is requested from the data service either using the full path if there is no directory information present.
Definition at line 74 of file SmartDataObjectPtr.cpp.
|
inline |
Retrieve data service.
Definition at line 85 of file SmartDataObjectPtr.h.
|
inline |
Assign data service.
Definition at line 82 of file SmartDataObjectPtr.h.
|
inlinestatic |
Static Object update method.
Definition at line 100 of file SmartDataObjectPtr.h.
|
protected |
Update the specified object from the data store.
update the object from the data store.
pDirectory | Pointer to the directory entry holding the object. |
Definition at line 58 of file SmartDataObjectPtr.cpp.
|
protected |
Update the specified object from the data store.
update the object from the data store.
fullPath | String containing the full path necessary to locate the object. |
Definition at line 64 of file SmartDataObjectPtr.cpp.
DataObject * SmartDataObjectPtr::updateObject | ( | ) |
Object update method.
If the object is not known to the local object, it is requested from the data service either using the full path if there is no directory information present. Needs to be virtual to to implicit object access.
If the object is not known to the local object, it is requested from the data service either using the full path if there is no directory information present.
Definition at line 106 of file SmartDataObjectPtr.cpp.
|
protected |
Data access function.
Definition at line 173 of file SmartDataObjectPtr.h.
|
mutableprotected |
Pointer to contained object.
Definition at line 165 of file SmartDataObjectPtr.h.
|
protected |
Path to object.
Definition at line 171 of file SmartDataObjectPtr.h.
|
mutableprotected |
Pointer to the data registry containing the object.
Definition at line 167 of file SmartDataObjectPtr.h.
|
mutableprotected |
Keep track of the last error.
Definition at line 169 of file SmartDataObjectPtr.h.