All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DataSvcHelpers::RegistryEntry Class Reference

Definition of an entry in the transient data store. More...

#include <GaudiKernel/RegistryEntry.h>

Inheritance diagram for DataSvcHelpers::RegistryEntry:
Collaboration diagram for DataSvcHelpers::RegistryEntry:

Public Types

typedef Store::const_iterator Iterator
 Iterator definition. More...
 
- Public Types inherited from IRegistry
typedef std::string name_type
 Type definitions Name type. More...
 
typedef std::string id_type
 Identifier Key type. More...
 

Public Member Functions

 RegistryEntry (const std::string &path, RegistryEntry *parent=0)
 Standard Constructor. More...
 
virtual ~RegistryEntry ()
 Standard Destructor. More...
 
virtual unsigned long release ()
 IInterface implementation: Reference the object. More...
 
virtual unsigned long addRef ()
 IInterface implementation: Dereference the object. More...
 
const std::string & name () const
 Retrieve name of the entry. More...
 
virtual const std::string & identifier () const
 Full identifier (or key) More...
 
virtual IDataProviderSvcdataSvc () const
 Retrieve pointer to Transient Store. More...
 
virtual DataObjectobject () const
 Retrive object behind the link. More...
 
virtual IOpaqueAddressaddress () const
 Retrieve opaque storage address. More...
 
virtual IRegistryparent () const
 Pointer to parent directory entry. More...
 
virtual bool isSoft () const
 Is the link soft or hard. More...
 
const Storeleaves () const
 Access the leaves of the object. More...
 
virtual int size () const
 Return the size of the container(=number of objects) More...
 
virtual bool isEmpty () const
 Simple check if the Container is empty. More...
 
virtual Iterator begin () const
 Return starting point for container iteration. More...
 
virtual Iterator end () const
 Return end elemtn if the container. More...
 
virtual IRegistryfind (const IRegistry *obj) const
 Try to find an object identified by its pointer. More...
 
virtual IRegistryfind (const std::string &path) const
 Try to find an object identified by its relative name to the directory. More...
 
void setAddress (IOpaqueAddress *pAddress)
 Set/Update Opaque address. More...
 
void setObject (DataObject *obj)
 Set/Update object address. More...
 
virtual long add (const std::string &name, DataObject *pObject, bool is_soft=false)
 Add entry to data store. More...
 
virtual long add (const std::string &name, IOpaqueAddress *pAddress, bool is_soft=false)
 Add entry to data store. More...
 
virtual long remove (const std::string &name)
 Remove an entry from the store. More...
 
virtual long add (IRegistry *obj)
 Add object to the container. More...
 
virtual long remove (IRegistry *obj)
 Remove an object from the container. More...
 
virtual long deleteElements ()
 Delete all contained elements. More...
 
virtual long traverseTree (IDataStoreAgent *pAgent, int level=0)
 traverse data tree More...
 
- Public Member Functions inherited from IRegistry
virtual ~IRegistry ()
 destructor More...
 

Private Types

typedef std::vector< IRegistry * > Store
 Definition of datastore type. More...
 

Private Member Functions

void assemblePath (std::string &buffer) const
 The following entries serve two aspects: 1) They are faster for recursive calls, because they are non-virtual 2) They can be re-used for the non-const entry points using a const_cast of the result. More...
 
IRegistryi_find (const IRegistry *pDirectory) const
 Internal method to retrieve data directory. More...
 
RegistryEntryi_find (const std::string &path) const
 Internal method to retrieve data directory. More...
 
RegistryEntryi_find (const DataObject *pObject) const
 Internal method to locate object entry. More...
 
RegistryEntryi_add (const std::string &name)
 Internal method to add entries. More...
 
void setParent (RegistryEntry *pParent)
 Set new parent pointer. More...
 
void setDataSvc (IDataProviderSvc *s)
 Set the transient data store. More...
 
virtual RegistryEntryparentEntry ()
 Pointer to parent registry entry. More...
 
RegistryEntryfindLeaf (const std::string &path) const
 Find identified leaf in this registry node. More...
 
RegistryEntryfindLeaf (const DataObject *key) const
 Find identified leaf in this registry node. More...
 
void makeHard (DataObject *pObject)
 Initialize link as hard link. More...
 
void makeHard (IOpaqueAddress *pAddress)
 Initialize link as hard link. More...
 
void makeSoft (DataObject *pObject)
 Initialize link as soft link. More...
 
void makeSoft (IOpaqueAddress *pAddress)
 Initialize link as soft link. More...
 

Private Attributes

unsigned long m_refCount
 Reference counter. More...
 
bool m_isSoft
 Is the link soft or hard? More...
 
std::string m_fullpath
 String containing full path of the object (volatile) More...
 
std::string m_path
 Path name. More...
 
RegistryEntrym_pParent
 Pointer to parent. More...
 
IOpaqueAddressm_pAddress
 Pointer to opaque address (load info) More...
 
DataObjectm_pObject
 Pointer to object. More...
 
IDataProviderSvcm_pDataProviderSvc
 Pointer to hosting transient store. More...
 
Store m_store
 Store of leaves. More...
 

Friends

class ::DataSvc
 

Detailed Description

Definition of an entry in the transient data store.

The RegistryEntry represents an entry of the transient data store. The object holds the recipe how to retrieve objects from the persistent world (member IOpaqueAddress) as well as the backward link to the parent entry and the leaves.

Author
Markus Frank
Sebastien Ponce

Definition at line 34 of file RegistryEntry.h.

Member Typedef Documentation

typedef Store::const_iterator DataSvcHelpers::RegistryEntry::Iterator

Iterator definition.

Definition at line 41 of file RegistryEntry.h.

typedef std::vector<IRegistry*> DataSvcHelpers::RegistryEntry::Store
private

Definition of datastore type.

Definition at line 37 of file RegistryEntry.h.

Constructor & Destructor Documentation

DataSvcHelpers::RegistryEntry::RegistryEntry ( const std::string &  path,
RegistryEntry parent = 0 
)

Standard Constructor.

Definition at line 45 of file RegistryEntry.cpp.

46 : m_refCount(0),
47  m_isSoft(false),
48  m_path(path),
50  m_pAddress(0),
51  m_pObject(0),
53 {
54  std::string::size_type sep = m_path.rfind(SEPARATOR);
55  if ( path[0] != SEPARATOR ) {
56  m_path.insert(m_path.begin(), SEPARATOR);
57  }
58  if ( sep != std::string::npos ) {
59  m_path.erase(0,sep);
60  }
62  addRef();
63 }
virtual unsigned long addRef()
IInterface implementation: Dereference the object.
RegistryEntry * m_pParent
Pointer to parent.
Definition: RegistryEntry.h:52
std::string m_fullpath
String containing full path of the object (volatile)
Definition: RegistryEntry.h:48
void assemblePath(std::string &buffer) const
The following entries serve two aspects: 1) They are faster for recursive calls, because they are non...
IDataProviderSvc * m_pDataProviderSvc
Pointer to hosting transient store.
Definition: RegistryEntry.h:58
IOpaqueAddress * m_pAddress
Pointer to opaque address (load info)
Definition: RegistryEntry.h:54
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
DataObject * m_pObject
Pointer to object.
Definition: RegistryEntry.h:56
unsigned long m_refCount
Reference counter.
Definition: RegistryEntry.h:44
virtual IRegistry * parent() const
Pointer to parent directory entry.
std::string m_path
Path name.
Definition: RegistryEntry.h:50
DataSvcHelpers::RegistryEntry::~RegistryEntry ( )
virtual

Standard Destructor.

Standard destructor.

Definition at line 66 of file RegistryEntry.cpp.

66  {
68  if ( 0 != m_pObject ) {
69  if ( !m_isSoft ) m_pObject->setRegistry(0);
70  m_pObject->release();
71  }
72  if ( 0 != m_pAddress ) {
73  if ( !m_isSoft ) m_pAddress->setRegistry(0);
75  }
76 }
virtual long deleteElements()
Delete all contained elements.
void setRegistry(IRegistry *pRegistry)
Set pointer to Registry.
Definition: DataObject.h:65
virtual unsigned long release()=0
release reference to object
IOpaqueAddress * m_pAddress
Pointer to opaque address (load info)
Definition: RegistryEntry.h:54
bool m_isSoft
Is the link soft or hard?
Definition: RegistryEntry.h:46
virtual unsigned long release()
release reference to object
Definition: DataObject.cpp:44
DataObject * m_pObject
Pointer to object.
Definition: RegistryEntry.h:56
virtual void setRegistry(IRegistry *r)=0
Update directory pointer.

Member Function Documentation

long DataSvcHelpers::RegistryEntry::add ( const std::string &  name,
DataObject pObject,
bool  is_soft = false 
)
virtual

Add entry to data store.

Add entry to the current data store item.

Definition at line 211 of file RegistryEntry.cpp.

211  {
212  RegistryEntry* entry = i_add(name);
213  if ( 0 != entry ) {
214  ( is_soft ) ? entry->makeSoft(pObject) : entry->makeHard(pObject);
215  add( entry );
216  return StatusCode::SUCCESS;
217  }
218  return StatusCode::FAILURE;
219 }
virtual long add(const std::string &name, DataObject *pObject, bool is_soft=false)
Add entry to data store.
RegistryEntry(const std::string &path, RegistryEntry *parent=0)
Standard Constructor.
const std::string & name() const
Retrieve name of the entry.
RegistryEntry * i_add(const std::string &name)
Internal method to add entries.
long DataSvcHelpers::RegistryEntry::add ( const std::string &  name,
IOpaqueAddress pAddress,
bool  is_soft = false 
)
virtual

Add entry to data store.

Add entry to the current data store item.

Definition at line 222 of file RegistryEntry.cpp.

222  {
223  RegistryEntry* entry = i_add(name);
224  if ( 0 != entry ) {
225  ( is_soft ) ? entry->makeSoft(pAddress) : entry->makeHard(pAddress);
226  add( entry );
227  return StatusCode::SUCCESS;
228  }
229  return StatusCode::FAILURE;
230 }
virtual long add(const std::string &name, DataObject *pObject, bool is_soft=false)
Add entry to data store.
RegistryEntry(const std::string &path, RegistryEntry *parent=0)
Standard Constructor.
const std::string & name() const
Retrieve name of the entry.
RegistryEntry * i_add(const std::string &name)
Internal method to add entries.
long DataSvcHelpers::RegistryEntry::add ( IRegistry obj)
virtual

Add object to the container.

Definition at line 195 of file RegistryEntry.cpp.

195  {
196  try {
197  RegistryEntry* pEntry = CAST_REGENTRY(RegistryEntry*, obj);
198  pEntry->setDataSvc(m_pDataProviderSvc);
199  m_store.push_back(pEntry);
200  pEntry->setParent(this);
201  if ( !pEntry->isSoft() && pEntry->address() != 0 ) {
202  pEntry->address()->setRegistry(pEntry);
203  }
204  }
205  catch ( ... ) {
206  }
207  return m_store.size();
208 }
#define CAST_REGENTRY(x, y)
IDataProviderSvc * m_pDataProviderSvc
Pointer to hosting transient store.
Definition: RegistryEntry.h:58
RegistryEntry(const std::string &path, RegistryEntry *parent=0)
Standard Constructor.
Store m_store
Store of leaves.
Definition: RegistryEntry.h:60
virtual unsigned long DataSvcHelpers::RegistryEntry::addRef ( )
inlinevirtual

IInterface implementation: Dereference the object.

Implements IRegistry.

Definition at line 112 of file RegistryEntry.h.

112  {
113  return ++m_refCount;
114  }
unsigned long m_refCount
Reference counter.
Definition: RegistryEntry.h:44
virtual IOpaqueAddress* DataSvcHelpers::RegistryEntry::address ( ) const
inlinevirtual

Retrieve opaque storage address.

Implements IRegistry.

Definition at line 132 of file RegistryEntry.h.

132  {
133  return m_pAddress;
134  }
IOpaqueAddress * m_pAddress
Pointer to opaque address (load info)
Definition: RegistryEntry.h:54
void DataSvcHelpers::RegistryEntry::assemblePath ( std::string &  buffer) const
private

The following entries serve two aspects: 1) They are faster for recursive calls, because they are non-virtual 2) They can be re-used for the non-const entry points using a const_cast of the result.

Recursive helper to assemble the full path name of the entry

Definition at line 339 of file RegistryEntry.cpp.

339  {
340  if ( m_pParent != 0 ) {
341  m_pParent->assemblePath(buffer);
342  }
343  buffer += m_path;
344 }
RegistryEntry * m_pParent
Pointer to parent.
Definition: RegistryEntry.h:52
void assemblePath(std::string &buffer) const
The following entries serve two aspects: 1) They are faster for recursive calls, because they are non...
std::string m_path
Path name.
Definition: RegistryEntry.h:50
virtual Iterator DataSvcHelpers::RegistryEntry::begin ( ) const
inlinevirtual

Return starting point for container iteration.

Definition at line 156 of file RegistryEntry.h.

156  {
157  return m_store.begin();
158  }
Store m_store
Store of leaves.
Definition: RegistryEntry.h:60
virtual IDataProviderSvc* DataSvcHelpers::RegistryEntry::dataSvc ( ) const
inlinevirtual

Retrieve pointer to Transient Store.

Implements IRegistry.

Definition at line 124 of file RegistryEntry.h.

124  {
125  return m_pDataProviderSvc;
126  }
IDataProviderSvc * m_pDataProviderSvc
Pointer to hosting transient store.
Definition: RegistryEntry.h:58
long DataSvcHelpers::RegistryEntry::deleteElements ( )
virtual

Delete all contained elements.

Delete recursively all elements pending from the current store item.

Definition at line 233 of file RegistryEntry.cpp.

233  {
234  for (Store::iterator i = m_store.begin(); i != m_store.end(); i++ ) {
236  if ( 0 != entry ) {
237  entry->deleteElements();
238  entry->release();
239  }
240  }
241  m_store.erase(m_store.begin(), m_store.end());
242  return 0;
243 }
#define CAST_REGENTRY(x, y)
RegistryEntry(const std::string &path, RegistryEntry *parent=0)
Standard Constructor.
Store m_store
Store of leaves.
Definition: RegistryEntry.h:60
list i
Definition: ana.py:128
virtual Iterator DataSvcHelpers::RegistryEntry::end ( ) const
inlinevirtual

Return end elemtn if the container.

Definition at line 160 of file RegistryEntry.h.

160  {
161  return m_store.end();
162  }
Store m_store
Store of leaves.
Definition: RegistryEntry.h:60
virtual IRegistry* DataSvcHelpers::RegistryEntry::find ( const IRegistry obj) const
inlinevirtual

Try to find an object identified by its pointer.

Definition at line 164 of file RegistryEntry.h.

164  {
165  return i_find(obj);
166  }
IRegistry * i_find(const IRegistry *pDirectory) const
Internal method to retrieve data directory.
virtual IRegistry* DataSvcHelpers::RegistryEntry::find ( const std::string &  path) const
inlinevirtual

Try to find an object identified by its relative name to the directory.

Definition at line 168 of file RegistryEntry.h.

168  {
169  return i_find(path);
170  }
GAUDI_API std::string path(const AIDA::IBaseHistogram *aida)
get the path in THS for AIDA histogram
IRegistry * i_find(const IRegistry *pDirectory) const
Internal method to retrieve data directory.
RegistryEntry* DataSvcHelpers::RegistryEntry::findLeaf ( const std::string &  path) const
inlineprivate

Find identified leaf in this registry node.

Definition at line 89 of file RegistryEntry.h.

89  {
90  return i_find(path);
91  }
GAUDI_API std::string path(const AIDA::IBaseHistogram *aida)
get the path in THS for AIDA histogram
IRegistry * i_find(const IRegistry *pDirectory) const
Internal method to retrieve data directory.
RegistryEntry* DataSvcHelpers::RegistryEntry::findLeaf ( const DataObject key) const
inlineprivate

Find identified leaf in this registry node.

Definition at line 93 of file RegistryEntry.h.

93  {
94  return i_find(key);
95  }
IRegistry * i_find(const IRegistry *pDirectory) const
Internal method to retrieve data directory.
DataSvcHelpers::RegistryEntry * DataSvcHelpers::RegistryEntry::i_add ( const std::string &  name)
private

Internal method to add entries.

Definition at line 179 of file RegistryEntry.cpp.

179  {
180  if ( nam[0] != SEPARATOR ) {
181  std::string path = nam;
182  path.insert(path.begin(), SEPARATOR);
183  return i_add(path);
184  }
185  // if this object is already present, this is an error....
186  for (Store::iterator i = m_store.begin(); i != m_store.end(); i++ ) {
187  if ( nam == (*i)->name() ) {
188  return 0;
189  }
190  }
191  return new RegistryEntry( nam, this );
192 }
GAUDI_API std::string path(const AIDA::IBaseHistogram *aida)
get the path in THS for AIDA histogram
RegistryEntry(const std::string &path, RegistryEntry *parent=0)
Standard Constructor.
Store m_store
Store of leaves.
Definition: RegistryEntry.h:60
list i
Definition: ana.py:128
RegistryEntry * i_add(const std::string &name)
Internal method to add entries.
IRegistry * DataSvcHelpers::RegistryEntry::i_find ( const IRegistry pDirectory) const
private

Internal method to retrieve data directory.

Try to find an object identified by its pointer.

Definition at line 246 of file RegistryEntry.cpp.

246  {
247  Store::const_iterator i = std::find(m_store.begin(),m_store.end(),obj);
248  return (i==m_store.end()) ? 0 : (*i);
249 }
Store m_store
Store of leaves.
Definition: RegistryEntry.h:60
list i
Definition: ana.py:128
DataSvcHelpers::RegistryEntry * DataSvcHelpers::RegistryEntry::i_find ( const std::string &  path) const
private

Internal method to retrieve data directory.

Find identified leaf in this registry node.

Definition at line 252 of file RegistryEntry.cpp.

252  {
253  if ( path[0] != SEPARATOR ) {
254  std::string thePath = path;
255  thePath.insert(thePath.begin(), SEPARATOR);
256  return i_find(thePath);
257  }
258  else {
259  std::string::size_type len = path.length();
260  std::string::size_type loc1 = path.find(SEPARATOR,1);
261  std::string::size_type len2 = loc1 != std::string::npos ? loc1 : len;
262  for (Store::const_iterator i = m_store.begin(); i != m_store.end(); i++ ) {
264  const std::string& nam = regEnt->name();
265  // check that the first len2 chars of path are the same as nam
266  // (i.e. match {len2:3 nam:"/Ab" path:"/Ab/C"}
267  // but not {len2:3 nam:"/Abc" path:"/Ab/C"})
268  if ( path.compare(0, len2, nam) == 0 ) {
269  try {
270  if ( loc1 != std::string::npos ) {
271  std::string search_path(path, loc1, len);
272  IRegistry* pDir = regEnt->find(search_path);
273  if ( 0 != pDir ) {
274  return CAST_REGENTRY(RegistryEntry*, pDir);
275  }
276  return 0;
277  }
278  else {
279  return CAST_REGENTRY(RegistryEntry*, *i);
280  }
281  }
282  catch (...) {
283  }
284  }
285  }
286  // If this node is "/NodeA", this part allows to find "/NodeA/NodeB" as
287  // our "/NodeB" child.
288  if ( path.compare(0, len2, m_path) == 0 ) {
289  if (len2 < len) {
290  std::string search_path(path, loc1, len);
291  return i_find(search_path);
292  }
293  }
294  }
295  return 0;
296 }
#define CAST_REGENTRY(x, y)
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
GAUDI_API std::string path(const AIDA::IBaseHistogram *aida)
get the path in THS for AIDA histogram
RegistryEntry(const std::string &path, RegistryEntry *parent=0)
Standard Constructor.
Store m_store
Store of leaves.
Definition: RegistryEntry.h:60
std::string m_path
Path name.
Definition: RegistryEntry.h:50
list i
Definition: ana.py:128
IRegistry * i_find(const IRegistry *pDirectory) const
Internal method to retrieve data directory.
DataSvcHelpers::RegistryEntry * DataSvcHelpers::RegistryEntry::i_find ( const DataObject pObject) const
private

Internal method to locate object entry.

Find identified leaf in this registry node.

Definition at line 299 of file RegistryEntry.cpp.

299  {
300  if ( 0 != key ) {
301  if ( key == m_pObject ) {
302  return const_cast<RegistryEntry*>(this);
303  }
304  // Look in the immediate level:
305  RegistryEntry *result = CAST_REGENTRY(RegistryEntry*, i_find(key->registry()));
306  if ( 0 != result ) return result;
307  // Go levels down
308  for (Store::const_iterator i = m_store.begin(); i != m_store.end(); i++ ) {
309  try {
310  const RegistryEntry *entry = CAST_REGENTRY(RegistryEntry*, *i);
311  if( 0 != (result = entry->i_find(key)) )
312  return result;
313  }
314  catch ( ... ) { }
315  }
316  }
317  return 0;
318 }
#define CAST_REGENTRY(x, y)
RegistryEntry(const std::string &path, RegistryEntry *parent=0)
Standard Constructor.
DataObject * m_pObject
Pointer to object.
Definition: RegistryEntry.h:56
Store m_store
Store of leaves.
Definition: RegistryEntry.h:60
list i
Definition: ana.py:128
IRegistry * i_find(const IRegistry *pDirectory) const
Internal method to retrieve data directory.
virtual const std::string& DataSvcHelpers::RegistryEntry::identifier ( ) const
inlinevirtual

Full identifier (or key)

Implements IRegistry.

Definition at line 120 of file RegistryEntry.h.

120  {
121  return m_fullpath;
122  }
std::string m_fullpath
String containing full path of the object (volatile)
Definition: RegistryEntry.h:48
virtual bool DataSvcHelpers::RegistryEntry::isEmpty ( ) const
inlinevirtual

Simple check if the Container is empty.

Definition at line 152 of file RegistryEntry.h.

152  {
153  return m_store.size() == 0;
154  }
Store m_store
Store of leaves.
Definition: RegistryEntry.h:60
virtual bool DataSvcHelpers::RegistryEntry::isSoft ( ) const
inlinevirtual

Is the link soft or hard.

Definition at line 140 of file RegistryEntry.h.

140  {
141  return m_isSoft;
142  }
bool m_isSoft
Is the link soft or hard?
Definition: RegistryEntry.h:46
const Store& DataSvcHelpers::RegistryEntry::leaves ( ) const
inline

Access the leaves of the object.

Definition at line 144 of file RegistryEntry.h.

144  {
145  return m_store;
146  }
Store m_store
Store of leaves.
Definition: RegistryEntry.h:60
void DataSvcHelpers::RegistryEntry::makeHard ( DataObject pObject)
private

Initialize link as hard link.

Create hard link.

Definition at line 110 of file RegistryEntry.cpp.

110  {
111  makeSoft(pObject);
112  m_isSoft = false;
113  if ( 0 != m_pObject ) {
114  m_pObject->setRegistry(this);
115  }
116  if ( 0 != m_pAddress ) {
117  m_pAddress->setRegistry(this);
118  }
119 }
void setRegistry(IRegistry *pRegistry)
Set pointer to Registry.
Definition: DataObject.h:65
IOpaqueAddress * m_pAddress
Pointer to opaque address (load info)
Definition: RegistryEntry.h:54
void makeSoft(DataObject *pObject)
Initialize link as soft link.
bool m_isSoft
Is the link soft or hard?
Definition: RegistryEntry.h:46
DataObject * m_pObject
Pointer to object.
Definition: RegistryEntry.h:56
virtual void setRegistry(IRegistry *r)=0
Update directory pointer.
void DataSvcHelpers::RegistryEntry::makeHard ( IOpaqueAddress pAddress)
private

Initialize link as hard link.

Create hard link.

Definition at line 122 of file RegistryEntry.cpp.

122  {
123  m_isSoft = false;
124  setAddress(pAddress);
125 }
void setAddress(IOpaqueAddress *pAddress)
Set/Update Opaque address.
bool m_isSoft
Is the link soft or hard?
Definition: RegistryEntry.h:46
void DataSvcHelpers::RegistryEntry::makeSoft ( DataObject pObject)
private

Initialize link as soft link.

Create soft link.

Definition at line 95 of file RegistryEntry.cpp.

95  {
96  m_isSoft = true;
97  setObject(pObject);
98 // if ( 0 != m_pObject ) { // Useless: This justs sets my own address again...
99 // setAddress(m_pObject->address());
100 // }
101 }
void setObject(DataObject *obj)
Set/Update object address.
bool m_isSoft
Is the link soft or hard?
Definition: RegistryEntry.h:46
void DataSvcHelpers::RegistryEntry::makeSoft ( IOpaqueAddress pAddress)
private

Initialize link as soft link.

Create soft link.

Definition at line 104 of file RegistryEntry.cpp.

104  {
105  m_isSoft = true;
106  setAddress(pAddress);
107 }
void setAddress(IOpaqueAddress *pAddress)
Set/Update Opaque address.
bool m_isSoft
Is the link soft or hard?
Definition: RegistryEntry.h:46
const std::string& DataSvcHelpers::RegistryEntry::name ( ) const
inlinevirtual

Retrieve name of the entry.

Implements IRegistry.

Definition at line 116 of file RegistryEntry.h.

116  {
117  return m_path;
118  }
std::string m_path
Path name.
Definition: RegistryEntry.h:50
virtual DataObject* DataSvcHelpers::RegistryEntry::object ( ) const
inlinevirtual

Retrive object behind the link.

Implements IRegistry.

Definition at line 128 of file RegistryEntry.h.

128  {
129  return m_pObject;
130  }
DataObject * m_pObject
Pointer to object.
Definition: RegistryEntry.h:56
virtual IRegistry* DataSvcHelpers::RegistryEntry::parent ( ) const
inlinevirtual

Pointer to parent directory entry.

Definition at line 136 of file RegistryEntry.h.

136  {
137  return m_pParent;
138  }
RegistryEntry * m_pParent
Pointer to parent.
Definition: RegistryEntry.h:52
virtual RegistryEntry* DataSvcHelpers::RegistryEntry::parentEntry ( )
inlineprivatevirtual

Pointer to parent registry entry.

Definition at line 85 of file RegistryEntry.h.

85  {
86  return m_pParent;
87  }
RegistryEntry * m_pParent
Pointer to parent.
Definition: RegistryEntry.h:52
unsigned long DataSvcHelpers::RegistryEntry::release ( )
virtual

IInterface implementation: Reference the object.

Release entry.

Implements IRegistry.

Definition at line 79 of file RegistryEntry.cpp.

79  {
80  unsigned long cnt = --m_refCount;
81  if ( 0 == m_refCount ) {
82  delete this;
83  }
84  return cnt;
85 }
unsigned long m_refCount
Reference counter.
Definition: RegistryEntry.h:44
long DataSvcHelpers::RegistryEntry::remove ( const std::string &  name)
virtual

Remove an entry from the store.

Remove entry from data store.

Definition at line 162 of file RegistryEntry.cpp.

162  {
163  if ( nam[0] != SEPARATOR ) {
164  std::string path = nam;
165  path.insert(path.begin(), SEPARATOR);
166  return remove(path);
167  }
168  // if this object is already present, this is an error....
169  for (Store::iterator i = m_store.begin(); i != m_store.end(); i++ ) {
170  if ( nam == (*i)->name() ) {
171  remove(*i);
172  return StatusCode::SUCCESS;
173  }
174  }
175  return StatusCode::FAILURE;
176 }
GAUDI_API std::string path(const AIDA::IBaseHistogram *aida)
get the path in THS for AIDA histogram
Store m_store
Store of leaves.
Definition: RegistryEntry.h:60
list i
Definition: ana.py:128
long DataSvcHelpers::RegistryEntry::remove ( IRegistry obj)
virtual

Remove an object from the container.

Definition at line 148 of file RegistryEntry.cpp.

148  {
149  try {
150  RegistryEntry* pEntry = dynamic_cast<RegistryEntry*>(obj);
151  Store::iterator i = std::remove(m_store.begin(), m_store.end(), pEntry);
152  if (i != m_store.end()) {
153  pEntry->release();
154  m_store.erase( i, m_store.end() );
155  }
156  }
157  catch ( ... ) { }
158  return m_store.size();
159 }
def remove
Definition: install.py:153
RegistryEntry(const std::string &path, RegistryEntry *parent=0)
Standard Constructor.
Store m_store
Store of leaves.
Definition: RegistryEntry.h:60
list i
Definition: ana.py:128
void DataSvcHelpers::RegistryEntry::setAddress ( IOpaqueAddress pAddress)
virtual

Set/Update Opaque address.

Update Opaque address of registry entry.

Implements IRegistry.

Definition at line 128 of file RegistryEntry.cpp.

128  {
129  if ( 0 != pAddress ) {
130  pAddress->addRef();
131  pAddress->setRegistry(this);
132  }
133  if ( 0 != m_pAddress ) m_pAddress->release();
134  m_pAddress = pAddress;
135 }
virtual unsigned long release()=0
release reference to object
IOpaqueAddress * m_pAddress
Pointer to opaque address (load info)
Definition: RegistryEntry.h:54
virtual void setRegistry(IRegistry *r)=0
Update directory pointer.
virtual unsigned long addRef()=0
Add reference to object.
void DataSvcHelpers::RegistryEntry::setDataSvc ( IDataProviderSvc s)
inlineprivate

Set the transient data store.

Definition at line 81 of file RegistryEntry.h.

81  {
83  }
IDataProviderSvc * m_pDataProviderSvc
Pointer to hosting transient store.
Definition: RegistryEntry.h:58
string s
Definition: gaudirun.py:210
void DataSvcHelpers::RegistryEntry::setObject ( DataObject obj)

Set/Update object address.

Set object pointer of data store item.

Definition at line 138 of file RegistryEntry.cpp.

138  {
139  if ( 0 != pObject ) {
140  pObject->addRef();
141  if ( !isSoft() ) pObject->setRegistry(this);
142  }
143  if ( 0 != m_pObject ) m_pObject->release();
144  m_pObject = pObject;
145 }
virtual bool isSoft() const
Is the link soft or hard.
virtual unsigned long release()
release reference to object
Definition: DataObject.cpp:44
DataObject * m_pObject
Pointer to object.
Definition: RegistryEntry.h:56
void DataSvcHelpers::RegistryEntry::setParent ( RegistryEntry pParent)
private

Set new parent pointer.

Definition at line 88 of file RegistryEntry.cpp.

88  {
89  m_pParent = pParent;
90  m_fullpath = "";
92 }
RegistryEntry * m_pParent
Pointer to parent.
Definition: RegistryEntry.h:52
std::string m_fullpath
String containing full path of the object (volatile)
Definition: RegistryEntry.h:48
void assemblePath(std::string &buffer) const
The following entries serve two aspects: 1) They are faster for recursive calls, because they are non...
virtual int DataSvcHelpers::RegistryEntry::size ( ) const
inlinevirtual

Return the size of the container(=number of objects)

Definition at line 148 of file RegistryEntry.h.

148  {
149  return m_store.size();
150  }
Store m_store
Store of leaves.
Definition: RegistryEntry.h:60
long DataSvcHelpers::RegistryEntry::traverseTree ( IDataStoreAgent pAgent,
int  level = 0 
)
virtual

traverse data tree

Definition at line 321 of file RegistryEntry.cpp.

321  {
322  bool go_down = pAgent->analyse(this, level);
323  long status = StatusCode::SUCCESS;
324  if ( go_down ) {
325  for ( Store::iterator i = m_store.begin(); i != m_store.end(); i++ ) {
326  try {
328  entry->traverseTree(pAgent, level+1);
329  }
330  catch (...) {
331  status = StatusCode::FAILURE;
332  }
333  }
334  }
335  return status;
336 }
virtual bool analyse(IRegistry *pObject, int level)=0
Analyse the data object.
#define CAST_REGENTRY(x, y)
RegistryEntry(const std::string &path, RegistryEntry *parent=0)
Standard Constructor.
Store m_store
Store of leaves.
Definition: RegistryEntry.h:60
list i
Definition: ana.py:128

Friends And Related Function Documentation

friend class ::DataSvc
friend

Definition at line 39 of file RegistryEntry.h.

Member Data Documentation

std::string DataSvcHelpers::RegistryEntry::m_fullpath
private

String containing full path of the object (volatile)

Definition at line 48 of file RegistryEntry.h.

bool DataSvcHelpers::RegistryEntry::m_isSoft
private

Is the link soft or hard?

Definition at line 46 of file RegistryEntry.h.

IOpaqueAddress* DataSvcHelpers::RegistryEntry::m_pAddress
private

Pointer to opaque address (load info)

Definition at line 54 of file RegistryEntry.h.

std::string DataSvcHelpers::RegistryEntry::m_path
private

Path name.

Definition at line 50 of file RegistryEntry.h.

IDataProviderSvc* DataSvcHelpers::RegistryEntry::m_pDataProviderSvc
private

Pointer to hosting transient store.

Definition at line 58 of file RegistryEntry.h.

DataObject* DataSvcHelpers::RegistryEntry::m_pObject
private

Pointer to object.

Definition at line 56 of file RegistryEntry.h.

RegistryEntry* DataSvcHelpers::RegistryEntry::m_pParent
private

Pointer to parent.

Definition at line 52 of file RegistryEntry.h.

unsigned long DataSvcHelpers::RegistryEntry::m_refCount
private

Reference counter.

Definition at line 44 of file RegistryEntry.h.

Store DataSvcHelpers::RegistryEntry::m_store
private

Store of leaves.

Definition at line 60 of file RegistryEntry.h.


The documentation for this class was generated from the following files: