| The Gaudi Framework v28r2p1 (f1a77ff4)

- 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/Kernel.h"
9 #include "GaudiKernel/IRegistry.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
22 namespace DataSvcHelpers {
36 class GAUDI_API RegistryEntry : public IRegistry {
37 private:
39 typedef std::vector<IRegistry*> Store;
40 public:
41 friend class ::DataSvc;
42 // DP add friend class: the thread safe version of the DataSvc
43 friend class ::TsDataSvc;
45 typedef Store::const_iterator Iterator;
46 private:
48 unsigned long m_refCount = 0;
50 bool m_isSoft = false;
52 std::string m_fullpath;
54 std::string m_path;
56 RegistryEntry* m_pParent = nullptr;
58 IOpaqueAddress* m_pAddress = nullptr;
60 DataObject* m_pObject = nullptr;
62 IDataProviderSvc* m_pDataProviderSvc = nullptr;
64 Store m_store;
65
66 private:
72 void assemblePath(std::string& buffer) const;
75 IRegistry* i_find ( const IRegistry* pDirectory ) const;
77 RegistryEntry* i_find ( boost::string_ref path ) const;
79 RegistryEntry* i_find ( const DataObject* pObject ) const;
81 RegistryEntry* i_create ( std::string name );
83 long i_add ( RegistryEntry* entry );
85 void setParent(RegistryEntry* pParent);
87 void setDataSvc(IDataProviderSvc* s) {
88 m_pDataProviderSvc = s;
89 }
91 virtual RegistryEntry* parentEntry() {
92 return m_pParent;
93 }
95 RegistryEntry* findLeaf(boost::string_ref path) const {
96 return i_find(path);
97 }
99 RegistryEntry* findLeaf(const DataObject* key) const {
100 return i_find(key);
101 }
103 void makeHard (DataObject* pObject);
105 void makeHard (IOpaqueAddress* pAddress);
107 void makeSoft (DataObject* pObject);
109 void makeSoft (IOpaqueAddress* pAddress);
110 public:
112 RegistryEntry(std::string path, RegistryEntry* parent = nullptr);
114 ~RegistryEntry() override;
116 unsigned long release() override;
118 unsigned long addRef() override {
119 return ++m_refCount;
120 }
122 const std::string& name() const override {
123 return m_path;
124 }
126 const std::string& identifier() const override {
127 return m_fullpath;
128 }
130 IDataProviderSvc* dataSvc() const override {
131 return m_pDataProviderSvc;
132 }
134 DataObject* object() const override {
135 return m_pObject;
136 }
138 IOpaqueAddress* address() const override {
139 return m_pAddress;
140 }
142 virtual IRegistry* parent() const {
143 return m_pParent;
144 }
146 virtual bool isSoft() const {
147 return m_isSoft;
148 }
150 const Store& leaves() const {
151 return m_store;
152 }
154 virtual int size() const {
155 return m_store.size();
156 }
158 virtual bool isEmpty() const {
159 return m_store.size() == 0;
160 }
162 virtual Iterator begin () const {
163 return m_store.begin();
164 }
166 virtual Iterator end () const {
167 return m_store.end();
168 }
170 virtual IRegistry* find ( const IRegistry* obj ) const {
171 return i_find(obj);
172 }
174 virtual IRegistry* find ( const std::string& path ) const {
175 return i_find(path);
176 }
178 void setAddress(IOpaqueAddress* pAddress) override;
180 void setObject(DataObject* obj);
181
183 virtual long add(const std::string& name,
184 DataObject* pObject,
185 bool is_soft = false);
187 virtual long add(const std::string& name,
188 IOpaqueAddress* pAddress,
189 bool is_soft = false);
191 virtual long remove(const std::string& name);
193 virtual long add(IRegistry* obj);
195 virtual long remove(IRegistry* obj);
197 virtual long deleteElements();
199 virtual long traverseTree(IDataStoreAgent* pAgent, int level = 0);
200 };
201 }
202 #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:95
DataSvcHelpers::RegistryEntry::object
DataObject * object() const override
Retrive object behind the link.
Definition: RegistryEntry.h:134
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:772
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:28
DataSvcHelpers::RegistryEntry::name
const std::string & name() const override
Retrieve name of the entry.
Definition: RegistryEntry.h:122
DataSvcHelpers::RegistryEntry::addRef
unsigned long addRef() override
IInterface implementation: Dereference the object.
Definition: RegistryEntry.h:118
DataSvcHelpers::RegistryEntry::findLeaf
RegistryEntry * findLeaf(const DataObject *key) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:99
DataSvcHelpers::RegistryEntry::Store
std::vector< IRegistry * > Store
Definition of datastore type.
Definition: RegistryEntry.h:39
std::vector::end
T end(T...args)
DataSvcHelpers::RegistryEntry::leaves
const Store & leaves() const
Access the leaves of the object.
Definition: RegistryEntry.h:150
IDataProviderSvc
Data provider interface definition.
Definition: IDataProviderSvc.h:45
DataSvcHelpers::RegistryEntry::parentEntry
virtual RegistryEntry * parentEntry()
Pointer to parent registry entry.
Definition: RegistryEntry.h:91
std::string
STL class.
DataSvcHelpers::RegistryEntry::m_fullpath
std::string m_fullpath
String containing full path of the object (volatile)
Definition: RegistryEntry.h:52
GaudiPython.Persistency.add
def add(instance)
Definition: Persistency.py:32
DataSvcHelpers::RegistryEntry::isSoft
virtual bool isSoft() const
Is the link soft or hard.
Definition: RegistryEntry.h:146
DataSvcHelpers::RegistryEntry::dataSvc
IDataProviderSvc * dataSvc() const override
Retrieve pointer to Transient Store.
Definition: RegistryEntry.h:130
DataSvcHelpers::RegistryEntry::begin
virtual Iterator begin() const
Return starting point for container iteration.
Definition: RegistryEntry.h:162
DataSvcHelpers::RegistryEntry::setDataSvc
void setDataSvc(IDataProviderSvc *s)
Set the transient data store.
Definition: RegistryEntry.h:87
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:158
DataSvcHelpers::RegistryEntry::Iterator
Store::const_iterator Iterator
Iterator definition.
Definition: RegistryEntry.h:45
DataSvcHelpers::RegistryEntry::address
IOpaqueAddress * address() const override
Retrieve opaque storage address.
Definition: RegistryEntry.h:138
DataSvcHelpers::RegistryEntry
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:36
DataSvcHelpers::RegistryEntry::find
virtual IRegistry * find(const std::string &path) const
Try to find an object identified by its relative name to the directory.
Definition: RegistryEntry.h:174
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:142
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:154
DataSvc
Data service base class.
Definition: DataSvc.h:44
DataSvcHelpers::RegistryEntry::m_store
Store m_store
Store of leaves.
Definition: RegistryEntry.h:64
gaudirun.s
string s
Definition: gaudirun.py:245
DataSvcHelpers::RegistryEntry::m_path
std::string m_path
Path name.
Definition: RegistryEntry.h:54
gaudirun.level
level
Definition: gaudirun.py:261
DataSvcHelpers
Definition: DataSvc.h:26
DataSvcHelpers::RegistryEntry::identifier
const std::string & identifier() const override
Full identifier (or key)
Definition: RegistryEntry.h:126
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:107
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:170
DataSvcHelpers::RegistryEntry::end
virtual Iterator end() const
Return end elemtn if the container.
Definition: RegistryEntry.h:166