| The Gaudi Framework v30r0 (c919700c)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

RegistryEntry.h
Go to the documentation of this file.
1 #ifndef GAUDIKERNEL_REGISTRYENTRY_H
2 #define GAUDIKERNEL_REGISTRYENTRY_H
3
4 // STL include files
5 #include <vector>
6
7 // Framework include files
8 #include "GaudiKernel/IRegistry.h"
9 #include "GaudiKernel/Kernel.h"
10 #include <boost/utility/string_ref.hpp>
11
12 // Forward declarations
13 class DataSvc;
14 // DP add this fwd decl for thread safety
15 class TsDataSvc;
16 class DataObject;
17 class IDataProviderSvc;
18 class IOpaqueAddress;
19 class IDataStoreAgent;
20
21 namespace DataSvcHelpers
22 {
36 class GAUDI_API RegistryEntry final : public IRegistry
37 {
38 private:
40 typedef std::vector<IRegistry*> Store;
41
42 public:
43 friend class ::DataSvc;
44 // DP add friend class: the thread safe version of the DataSvc
45 friend class ::TsDataSvc;
47 typedef Store::const_iterator Iterator;
48
49 private:
51 unsigned long m_refCount = 0;
53 bool m_isSoft = false;
55 std::string m_fullpath;
57 std::string m_path;
59 RegistryEntry* m_pParent = nullptr;
61 IOpaqueAddress* m_pAddress = nullptr;
63 DataObject* m_pObject = nullptr;
65 IDataProviderSvc* m_pDataProviderSvc = nullptr;
67 Store m_store;
68
69 private:
75 void assemblePath( std::string& buffer ) const;
78 IRegistry* i_find( const IRegistry* pDirectory ) const;
80 RegistryEntry* i_find( boost::string_ref path ) const;
82 RegistryEntry* i_find( const DataObject* pObject ) const;
84 RegistryEntry* i_create( std::string name );
86 long i_add( RegistryEntry* entry );
88 void setParent( RegistryEntry* pParent );
90 void setDataSvc( IDataProviderSvc* s ) { m_pDataProviderSvc = s; }
92 virtual RegistryEntry* parentEntry() { return m_pParent; }
94 RegistryEntry* findLeaf( boost::string_ref path ) const { return i_find( path ); }
96 RegistryEntry* findLeaf( const DataObject* key ) const { return i_find( key ); }
98 void makeHard( DataObject* pObject );
100 void makeHard( IOpaqueAddress* pAddress );
102 void makeSoft( DataObject* pObject );
104 void makeSoft( IOpaqueAddress* pAddress );
105
106 public:
108 RegistryEntry( std::string path, RegistryEntry* parent = nullptr );
110 ~RegistryEntry() override;
112 unsigned long release() override;
114 unsigned long addRef() override { return ++m_refCount; }
116 const std::string& name() const override { return m_path; }
118 const std::string& identifier() const override { return m_fullpath; }
120 IDataProviderSvc* dataSvc() const override { return m_pDataProviderSvc; }
122 DataObject* object() const override { return m_pObject; }
124 IOpaqueAddress* address() const override { return m_pAddress; }
126 virtual IRegistry* parent() const { return m_pParent; }
128 virtual bool isSoft() const { return m_isSoft; }
130 const Store& leaves() const { return m_store; }
132 virtual int size() const { return m_store.size(); }
134 virtual bool isEmpty() const { return m_store.size() == 0; }
136 virtual Iterator begin() const { return m_store.begin(); }
138 virtual Iterator end() const { return m_store.end(); }
140 virtual IRegistry* find( const IRegistry* obj ) const { return i_find( obj ); }
142 virtual IRegistry* find( boost::string_ref path ) const { return i_find( path ); }
144 void setAddress( IOpaqueAddress* pAddress ) override;
146 void setObject( DataObject* obj );
147
149 virtual StatusCode add( std::string name, DataObject* pObject, bool is_soft = false );
151 virtual StatusCode add( std::string name, IOpaqueAddress* pAddress, bool is_soft = false );
153 virtual StatusCode remove( boost::string_ref name );
155 virtual long add( IRegistry* obj );
157 virtual long remove( IRegistry* obj );
159 virtual long deleteElements();
161 virtual StatusCode traverseTree( IDataStoreAgent* pAgent, int level = 0 );
162 };
163 }
164 #endif // GAUDIKERNEL_REGISTRYENTRY_H
Kernel.h
DataSvcHelpers::RegistryEntry::findLeaf
RegistryEntry * findLeaf(boost::string_ref path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:94
DataSvcHelpers::RegistryEntry::object
DataObject * object() const override
Retrive object behind the link.
Definition: RegistryEntry.h:122
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:895
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:32
DataSvcHelpers::RegistryEntry::name
const std::string & name() const override
Retrieve name of the entry.
Definition: RegistryEntry.h:116
DataSvcHelpers::RegistryEntry::addRef
unsigned long addRef() override
IInterface implementation: Dereference the object.
Definition: RegistryEntry.h:114
DataSvcHelpers::RegistryEntry::findLeaf
RegistryEntry * findLeaf(const DataObject *key) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:96
DataSvcHelpers::RegistryEntry::Store
std::vector< IRegistry * > Store
Definition of datastore type.
Definition: RegistryEntry.h:40
std::vector::end
T end(T...args)
DataSvcHelpers::RegistryEntry::leaves
const Store & leaves() const
Access the leaves of the object.
Definition: RegistryEntry.h:130
IDataProviderSvc
Data provider interface definition.
Definition: IDataProviderSvc.h:46
DataSvcHelpers::RegistryEntry::find
virtual IRegistry * find(boost::string_ref path) const
Try to find an object identified by its relative name to the directory.
Definition: RegistryEntry.h:142
DataSvcHelpers::RegistryEntry::parentEntry
virtual RegistryEntry * parentEntry()
Pointer to parent registry entry.
Definition: RegistryEntry.h:92
std::string
STL class.
DataSvcHelpers::RegistryEntry::m_fullpath
std::string m_fullpath
String containing full path of the object (volatile)
Definition: RegistryEntry.h:55
GaudiPython.Persistency.add
def add(instance)
Definition: Persistency.py:39
DataSvcHelpers::RegistryEntry::isSoft
virtual bool isSoft() const
Is the link soft or hard.
Definition: RegistryEntry.h:128
DataSvcHelpers::RegistryEntry::dataSvc
IDataProviderSvc * dataSvc() const override
Retrieve pointer to Transient Store.
Definition: RegistryEntry.h:120
DataSvcHelpers::RegistryEntry::begin
virtual Iterator begin() const
Return starting point for container iteration.
Definition: RegistryEntry.h:136
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataSvcHelpers::RegistryEntry::setDataSvc
void setDataSvc(IDataProviderSvc *s)
Set the transient data store.
Definition: RegistryEntry.h:90
IRegistry.h
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
DataSvcHelpers::RegistryEntry::isEmpty
virtual bool isEmpty() const
Simple check if the Container is empty.
Definition: RegistryEntry.h:134
DataSvcHelpers::RegistryEntry::Iterator
Store::const_iterator Iterator
Iterator definition.
Definition: RegistryEntry.h:47
DataSvcHelpers::RegistryEntry::address
IOpaqueAddress * address() const override
Retrieve opaque storage address.
Definition: RegistryEntry.h:124
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
std::vector::size
T size(T...args)
std::vector< IRegistry * >
DataSvcHelpers::RegistryEntry::parent
virtual IRegistry * parent() const
Pointer to parent directory entry.
Definition: RegistryEntry.h:126
IDataStoreAgent
Generic data agent interface.
Definition: IDataStoreAgent.h:16
std::vector::begin
T begin(T...args)
TsDataSvc
Data service base class.
Definition: TsDataSvc.h:58
DataSvcHelpers::RegistryEntry::size
virtual int size() const
Return the size of the container(=number of objects)
Definition: RegistryEntry.h:132
DataSvc
Data service base class.
Definition: DataSvc.h:44
DataSvcHelpers::RegistryEntry::m_store
Store m_store
Store of leaves.
Definition: RegistryEntry.h:67
gaudirun.s
string s
Definition: gaudirun.py:253
DataSvcHelpers::RegistryEntry::m_path
std::string m_path
Path name.
Definition: RegistryEntry.h:57
gaudirun.level
level
Definition: gaudirun.py:271
DataSvcHelpers
Definition: DataSvc.h:26
DataSvcHelpers::RegistryEntry::identifier
const std::string & identifier() const override
Full identifier (or key)
Definition: RegistryEntry.h:118
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:110
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
DataSvcHelpers::RegistryEntry::find
virtual IRegistry * find(const IRegistry *obj) const
Try to find an object identified by its pointer.
Definition: RegistryEntry.h:140
DataSvcHelpers::RegistryEntry::end
virtual Iterator end() const
Return end elemtn if the container.
Definition: RegistryEntry.h:138