20 #define DATASVC_REGISTRYENTRY_CPP
40 #define CAST_REGENTRY(x,y) dynamic_cast<x>(y)
58 if ( sep != std::string::npos ) {
68 if ( 0 != m_pObject ) {
69 if ( !m_isSoft ) m_pObject->setRegistry(0);
72 if ( 0 != m_pAddress ) {
73 if ( !m_isSoft ) m_pAddress->setRegistry(0);
74 m_pAddress->release();
80 unsigned long cnt = --m_refCount;
81 if ( 0 == m_refCount ) {
91 assemblePath(m_fullpath);
106 setAddress(pAddress);
113 if ( 0 != m_pObject ) {
114 m_pObject->setRegistry(
this);
116 if ( 0 != m_pAddress ) {
117 m_pAddress->setRegistry(
this);
124 setAddress(pAddress);
129 if ( 0 != pAddress ) {
133 if ( 0 != m_pAddress ) m_pAddress->release();
134 m_pAddress = pAddress;
139 if ( 0 != pObject ) {
143 if ( 0 != m_pObject ) m_pObject->release();
151 Store::iterator
i =
std::remove(m_store.begin(), m_store.end(), pEntry);
152 if (i != m_store.end()) {
154 m_store.erase( i, m_store.end() );
158 return m_store.size();
164 std::string
path = nam;
169 for (Store::iterator
i = m_store.begin();
i != m_store.end();
i++ ) {
170 if ( nam == (*i)->name() ) {
181 std::string
path = nam;
186 for (Store::iterator
i = m_store.begin();
i != m_store.end();
i++ ) {
187 if ( nam == (*i)->name() ) {
199 m_store.push_back(pEntry);
207 return m_store.size();
234 for (Store::iterator
i = m_store.begin();
i != m_store.end();
i++ ) {
241 m_store.erase(m_store.begin(), m_store.end());
247 Store::const_iterator
i = std::find(m_store.begin(),m_store.end(),obj);
248 return (i==m_store.end()) ? 0 : (*i);
254 std::string thePath =
path;
255 thePath.insert(thePath.begin(),
SEPARATOR);
256 return i_find(thePath);
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();
268 if ( path.compare(0, len2, nam) == 0 ) {
270 if ( loc1 != std::string::npos ) {
271 std::string search_path(path, loc1, len);
288 if ( path.compare(0, len2, m_path) == 0 ) {
290 std::string search_path(path, loc1, len);
291 return i_find(search_path);
301 if ( key == m_pObject ) {
306 if ( 0 != result )
return result;
308 for (Store::const_iterator
i = m_store.begin();
i != m_store.end();
i++ ) {
311 if( 0 != (result = entry->
i_find(key)) )
322 bool go_down = pAgent->
analyse(
this, level);
325 for ( Store::iterator
i = m_store.begin();
i != m_store.end();
i++ ) {
340 if ( m_pParent != 0 ) {
341 m_pParent->assemblePath(buffer);
virtual unsigned long addRef()
IInterface implementation: Dereference the object.
virtual long deleteElements()
Delete all contained elements.
virtual bool analyse(IRegistry *pObject, int level)=0
Analyse the data object.
virtual long add(const std::string &name, DataObject *pObject, bool is_soft=false)
Add entry to data store.
virtual long traverseTree(IDataStoreAgent *pAgent, int level=0)
traverse data tree
void setRegistry(IRegistry *pRegistry)
Set pointer to Registry.
#define CAST_REGENTRY(x, y)
virtual long remove(const std::string &name)
Remove an entry from the store.
virtual unsigned long release()
IInterface implementation: Reference the object.
IRegistry * registry() const
Get pointer to Registry.
std::string m_fullpath
String containing full path of the object (volatile)
void assemblePath(std::string &buffer) const
The following entries serve two aspects: 1) They are faster for recursive calls, because they are non...
virtual bool isSoft() const
Is the link soft or hard.
void setParent(RegistryEntry *pParent)
Set new parent pointer.
virtual unsigned long addRef()
Add reference to object.
void setObject(DataObject *obj)
Set/Update object address.
virtual IOpaqueAddress * address() const
Retrieve opaque storage address.
void setDataSvc(IDataProviderSvc *s)
Set the transient data store.
The IRegistry represents the entry door to the environment any data object residing in a transient da...
void makeSoft(DataObject *pObject)
Initialize link as soft link.
void setAddress(IOpaqueAddress *pAddress)
Set/Update Opaque address.
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.
Definition of an entry in the transient data store.
const std::string & name() const
Retrieve name of the entry.
Generic data agent interface.
std::string m_path
Path name.
virtual ~RegistryEntry()
Standard Destructor.
virtual void setRegistry(IRegistry *r)=0
Update directory pointer.
Opaque address interface definition.
A DataObject is the base class of any identifiable object on any data store.
virtual IRegistry * find(const IRegistry *obj) const
Try to find an object identified by its pointer.
IRegistry * i_find(const IRegistry *pDirectory) const
Internal method to retrieve data directory.
RegistryEntry * i_add(const std::string &name)
Internal method to add entries.
virtual unsigned long addRef()=0
Add reference to object.
void makeHard(DataObject *pObject)
Initialize link as hard link.