All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RegistryEntry.h
Go to the documentation of this file.
1 // $Id: RegistryEntry.h,v 1.8 2005/07/18 16:34:05 hmd Exp $
2 #ifndef GAUDIKERNEL_REGISTRYENTRY_H
3 #define GAUDIKERNEL_REGISTRYENTRY_H
4 
5 // STL include files
6 #include <vector>
7 
8 // Framework include files
9 #include "GaudiKernel/Kernel.h"
10 #include "GaudiKernel/IRegistry.h"
11 
12 // Forward declarations
13 class DataSvc;
14 class DataObject;
15 class IDataProviderSvc;
16 class IOpaqueAddress;
17 class IDataStoreAgent;
18 
19 
20 namespace DataSvcHelpers {
35  private:
37  typedef std::vector<IRegistry*> Store;
38  public:
39  friend class ::DataSvc;
41  typedef Store::const_iterator Iterator;
42  private:
44  unsigned long m_refCount;
46  bool m_isSoft;
48  std::string m_fullpath;
50  std::string m_path;
61 
62  private:
68  void assemblePath(std::string& buffer) const;
71  IRegistry* i_find ( const IRegistry* pDirectory ) const;
73  RegistryEntry* i_find ( const std::string& path ) const;
75  RegistryEntry* i_find ( const DataObject* pObject ) const;
77  RegistryEntry* i_add ( const std::string& name );
79  void setParent(RegistryEntry* pParent);
82  m_pDataProviderSvc = s;
83  }
86  return m_pParent;
87  }
89  RegistryEntry* findLeaf(const std::string& path) const {
90  return i_find(path);
91  }
93  RegistryEntry* findLeaf(const DataObject* key) const {
94  return i_find(key);
95  }
97  void makeHard (DataObject* pObject);
99  void makeHard (IOpaqueAddress* pAddress);
101  void makeSoft (DataObject* pObject);
103  void makeSoft (IOpaqueAddress* pAddress);
104  public:
106  RegistryEntry(const std::string& path, RegistryEntry* parent = 0);
108  virtual ~RegistryEntry();
110  virtual unsigned long release();
112  virtual unsigned long addRef() {
113  return ++m_refCount;
114  }
116  const std::string& name() const {
117  return m_path;
118  }
120  virtual const std::string& identifier() const {
121  return m_fullpath;
122  }
124  virtual IDataProviderSvc* dataSvc() const {
125  return m_pDataProviderSvc;
126  }
128  virtual DataObject* object() const {
129  return m_pObject;
130  }
132  virtual IOpaqueAddress* address() const {
133  return m_pAddress;
134  }
136  virtual IRegistry* parent() const {
137  return m_pParent;
138  }
140  virtual bool isSoft() const {
141  return m_isSoft;
142  }
144  const Store& leaves() const {
145  return m_store;
146  }
148  virtual int size() const {
149  return m_store.size();
150  }
152  virtual bool isEmpty() const {
153  return m_store.size() == 0;
154  }
156  virtual Iterator begin () const {
157  return m_store.begin();
158  }
160  virtual Iterator end () const {
161  return m_store.end();
162  }
164  virtual IRegistry* find ( const IRegistry* obj ) const {
165  return i_find(obj);
166  }
168  virtual IRegistry* find ( const std::string& path ) const {
169  return i_find(path);
170  }
172  void setAddress(IOpaqueAddress* pAddress);
174  void setObject(DataObject* obj);
175 
177  virtual long add(const std::string& name,
178  DataObject* pObject,
179  bool is_soft = false);
181  virtual long add(const std::string& name,
182  IOpaqueAddress* pAddress,
183  bool is_soft = false);
185  virtual long remove(const std::string& name);
187  virtual long add(IRegistry* obj);
189  virtual long remove(IRegistry* obj);
191  virtual long deleteElements();
193  virtual long traverseTree(IDataStoreAgent* pAgent, int level = 0);
194  };
195 }
196 #endif // GAUDIKERNEL_REGISTRYENTRY_H
RegistryEntry * findLeaf(const std::string &path) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:89
virtual unsigned long addRef()
IInterface implementation: Dereference the object.
RegistryEntry * findLeaf(const DataObject *key) const
Find identified leaf in this registry node.
Definition: RegistryEntry.h:93
RegistryEntry * m_pParent
Pointer to parent.
Definition: RegistryEntry.h:52
std::vector< IRegistry * > Store
Definition of datastore type.
Definition: RegistryEntry.h:37
const Store & leaves() const
Access the leaves of the object.
Data provider interface definition.
virtual RegistryEntry * parentEntry()
Pointer to parent registry entry.
Definition: RegistryEntry.h:85
std::string m_fullpath
String containing full path of the object (volatile)
Definition: RegistryEntry.h:48
virtual bool isSoft() const
Is the link soft or hard.
virtual IOpaqueAddress * address() const
Retrieve opaque storage address.
virtual Iterator begin() const
Return starting point for container iteration.
IDataProviderSvc * m_pDataProviderSvc
Pointer to hosting transient store.
Definition: RegistryEntry.h:58
void setDataSvc(IDataProviderSvc *s)
Set the transient data store.
Definition: RegistryEntry.h:81
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
virtual bool isEmpty() const
Simple check if the Container is empty.
Store::const_iterator Iterator
Iterator definition.
Definition: RegistryEntry.h:41
IOpaqueAddress * m_pAddress
Pointer to opaque address (load info)
Definition: RegistryEntry.h:54
virtual IDataProviderSvc * dataSvc() const
Retrieve pointer to Transient Store.
bool m_isSoft
Is the link soft or hard?
Definition: RegistryEntry.h:46
GAUDI_API std::string path(const AIDA::IBaseHistogram *aida)
get the path in THS for AIDA histogram
Definition of an entry in the transient data store.
Definition: RegistryEntry.h:34
virtual IRegistry * find(const std::string &path) const
Try to find an object identified by its relative name to the directory.
DataObject * m_pObject
Pointer to object.
Definition: RegistryEntry.h:56
virtual const std::string & identifier() const
Full identifier (or key)
unsigned long m_refCount
Reference counter.
Definition: RegistryEntry.h:44
const std::string & name() const
Retrieve name of the entry.
virtual IRegistry * parent() const
Pointer to parent directory entry.
Generic data agent interface.
virtual int size() const
Return the size of the container(=number of objects)
Data service base class.
Definition: DataSvc.h:39
Store m_store
Store of leaves.
Definition: RegistryEntry.h:60
string s
Definition: gaudirun.py:210
std::string m_path
Path name.
Definition: RegistryEntry.h:50
virtual DataObject * object() const
Retrive object behind the link.
Opaque address interface definition.
#define GAUDI_API
Definition: Kernel.h:108
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:31
virtual IRegistry * find(const IRegistry *obj) const
Try to find an object identified by its pointer.
virtual Iterator end() const
Return end elemtn if the container.