| The Gaudi Framework v32r1 (f65d50dc)

Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
DataSvcHelpers::RegistryEntry Class Referencefinal

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

`#include <GaudiKernel/RegistryEntry.h>`

Inheritance diagram for DataSvcHelpers::RegistryEntry:
[legend]
Collaboration diagram for DataSvcHelpers::RegistryEntry:
[legend]

## 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 (std::string path, RegistryEntry *parent=nullptr)
| Standard Constructor. More...
| ~RegistryEntry () override
| Standard Destructor. More...
unsigned long | release () override
| IInterface implementation: Reference the object. More...
unsigned long | addRef () override
| IInterface implementation: Dereference the object. More...
const std::string & | name () const override
| Retrieve name of the entry. More...
const std::string & | identifier () const override
| Full identifier (or key) More...
IDataProviderSvc * | dataSvc () const override
| Retrieve pointer to Transient Store. More...
DataObject * | object () const override
| Retrive object behind the link. More...
IOpaqueAddress * | address () const override
| Retrieve opaque storage address. More...
IRegistry * | parent () const
| Pointer to parent directory entry. More...
bool | isSoft () const
| Is the link soft or hard. More...
const Store & | leaves () const
| Access the leaves of the object. More...
int | size () const
| Return the size of the container(=number of objects) More...
bool | isEmpty () const
| Simple check if the Container is empty. More...
Iterator | begin () const
| Return starting point for container iteration. More...
Iterator | end () const
| Return end elemtn if the container. More...
IRegistry * | find (const IRegistry *obj) const
| Try to find an object identified by its pointer. More...
IRegistry * | find (std::string_view path) const
| Try to find an object identified by its relative name to the directory. More...
void | setAddress (IOpaqueAddress *pAddress) override
| Set/Update Opaque address. More...
void | setObject (DataObject *obj)
| Set/Update object address. More...
StatusCode | add (std::string name, DataObject *pObject, bool is_soft=false)
| Add entry to data store. More...
StatusCode | add (std::string name, IOpaqueAddress *pAddress, bool is_soft=false)
| Add entry to data store. More...
StatusCode | remove (std::string_view name)
| Remove an entry from the store. More...
long | add (IRegistry *obj)
| Add object to the container. More...
long | remove (IRegistry *obj)
| Remove an object from the container. More...
long | deleteElements ()
| Delete all contained elements. More...
StatusCode | traverseTree (IDataStoreAgent *pAgent, int level=0)
| traverse data tree More...
Public Member Functions inherited from IRegistry
virtual | ~IRegistry ()=default
| 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...
IRegistry * | i_find (const IRegistry *pDirectory) const
| Internal method to retrieve data directory. More...
RegistryEntry * | i_find (std::string_view path) const
| Internal method to retrieve data directory. More...
RegistryEntry * | i_find (const DataObject *pObject) const
| Internal method to locate object entry. More...
RegistryEntry * | i_create (std::string name)
| Internal method to create entries. More...
long | i_add (RegistryEntry *entry)
| 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...
RegistryEntry * | parentEntry ()
| Pointer to parent registry entry. More...
RegistryEntry * | findLeaf (std::string_view path) const
| Find identified leaf in this registry node. More...
RegistryEntry * | findLeaf (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 = 0
| Reference counter. More...
bool | m_isSoft = false
| 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...
RegistryEntry * | m_pParent = nullptr
| Pointer to parent. More...
IOpaqueAddress * | m_pAddress = nullptr
| Pointer to opaque address (load info) More...
DataObject * | m_pObject = nullptr
| Pointer to object. More...
IDataProviderSvc * | m_pDataProviderSvc = nullptr
| Pointer to hosting transient store. More...
Store | m_store
| Store of leaves. More...

## Friends
class | ::DataSvc
class | ::TsDataSvc

## 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 36 of file RegistryEntry.h.

## Member Typedef Documentation

## ◆ Iterator

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

Iterator definition.

Definition at line 46 of file RegistryEntry.h.

## ◆ Store

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

Definition of datastore type.

Definition at line 39 of file RegistryEntry.h.

## Constructor & Destructor Documentation

## ◆ RegistryEntry()

DataSvcHelpers::RegistryEntry::RegistryEntry | ( | std::string | path,
|  | RegistryEntry * | parent = `nullptr`
| ) |  |

Standard Constructor.

Definition at line 43 of file RegistryEntry.cpp.

44 : m_path( std::move( path ) ), m_pParent( parent ) {
45 std::string::size_type sep = m_path.rfind( SEPARATOR );
46 if ( m_path.front() != SEPARATOR ) m_path.insert( 0, 1, SEPARATOR );
47 if ( sep != std::string::npos ) m_path.erase( 0, sep );
48 assemblePath( m_fullpath );
49 addRef();
50 }
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:932
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:40
std::string::front
T front(T... args)
DataSvcHelpers::RegistryEntry::addRef
unsigned long addRef() override
IInterface implementation: Dereference the object.
Definition: RegistryEntry.h:113
std::string::rfind
T rfind(T... args)
DataSvcHelpers::RegistryEntry::m_pParent
RegistryEntry * m_pParent
Pointer to parent.
Definition: RegistryEntry.h:58
DataSvcHelpers::RegistryEntry::parent
IRegistry * parent() const
Pointer to parent directory entry.
Definition: RegistryEntry.h:125
DataSvcHelpers::RegistryEntry::m_fullpath
std::string m_fullpath
String containing full path of the object (volatile)
Definition: RegistryEntry.h:54
DataSvcHelpers::RegistryEntry::assemblePath
void assemblePath(std::string &buffer) const
The following entries serve two aspects: 1) They are faster for recursive calls, because they are non...
Definition: RegistryEntry.cpp:286
std::string::erase
T erase(T... args)
std::move
T move(T... args)
std::string::insert
T insert(T... args)
DataSvcHelpers::RegistryEntry::m_path
std::string m_path
Path name.
Definition: RegistryEntry.h:56

## ◆ ~RegistryEntry()

DataSvcHelpers::RegistryEntry::~RegistryEntry | ( |  | ) |
| override

Standard Destructor.

Standard destructor.

Definition at line 53 of file RegistryEntry.cpp.

53 {
54 deleteElements();
55 if ( m_pObject ) {
56 if ( !m_isSoft ) m_pObject->setRegistry( nullptr );
57 m_pObject->release();
58 }
59 if ( m_pAddress ) {
60 if ( !m_isSoft ) m_pAddress->setRegistry( nullptr );
61 m_pAddress->release();
62 }
63 }
DataSvcHelpers::RegistryEntry::deleteElements
long deleteElements()
Delete all contained elements.
Definition: RegistryEntry.cpp:206
DataObject::setRegistry
void setRegistry(IRegistry *pRegistry)
Set pointer to Registry.
Definition: DataObject.h:70
IOpaqueAddress::release
virtual unsigned long release()=0
release reference to object
DataSvcHelpers::RegistryEntry::m_pAddress
IOpaqueAddress * m_pAddress
Pointer to opaque address (load info)
Definition: RegistryEntry.h:60
DataSvcHelpers::RegistryEntry::m_isSoft
bool m_isSoft
Is the link soft or hard?
Definition: RegistryEntry.h:52
DataObject::release
virtual unsigned long release()
release reference to object
Definition: DataObject.cpp:46
DataSvcHelpers::RegistryEntry::m_pObject
DataObject * m_pObject
Pointer to object.
Definition: RegistryEntry.h:62
IOpaqueAddress::setRegistry
virtual void setRegistry(IRegistry *r)=0
Update directory pointer.

## Member Function Documentation

## ◆ add() [1/3]

StatusCode DataSvcHelpers::RegistryEntry::add | ( | std::string | name,
|  | DataObject * | pObject,
|  | bool | is_soft = `false`
| ) |  |

Add entry to data store.

Add entry to the current data store item.

Definition at line 188 of file RegistryEntry.cpp.

188 {
189 RegistryEntry* entry = i_create( std::move( name ) );
190 if ( !entry ) return StatusCode::FAILURE;
191 ( is_soft ) ? entry->makeSoft( pObject ) : entry->makeHard( pObject );
192 i_add( entry );
193 return StatusCode::SUCCESS;
194 }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
DataSvcHelpers::RegistryEntry::i_add
long i_add(RegistryEntry *entry)
Internal method to add entries.
Definition: RegistryEntry.cpp:170
DataSvcHelpers::RegistryEntry::name
const std::string & name() const override
Retrieve name of the entry.
Definition: RegistryEntry.h:115
DataSvcHelpers::RegistryEntry::i_create
RegistryEntry * i_create(std::string name)
Internal method to create entries.
Definition: RegistryEntry.cpp:155
std::move
T move(T... args)
DataSvcHelpers::RegistryEntry::RegistryEntry
RegistryEntry(std::string path, RegistryEntry *parent=nullptr)
Standard Constructor.
Definition: RegistryEntry.cpp:43
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86

## ◆ add() [2/3]

StatusCode DataSvcHelpers::RegistryEntry::add | ( | std::string | name,
|  | IOpaqueAddress * | pAddress,
|  | bool | is_soft = `false`
| ) |  |

Add entry to data store.

Add entry to the current data store item.

Definition at line 197 of file RegistryEntry.cpp.

197 {
198 RegistryEntry* entry = i_create( std::move( name ) );
199 if ( !entry ) return StatusCode::FAILURE;
200 ( is_soft ) ? entry->makeSoft( pAddress ) : entry->makeHard( pAddress );
201 i_add( entry );
202 return StatusCode::SUCCESS;
203 }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
DataSvcHelpers::RegistryEntry::i_add
long i_add(RegistryEntry *entry)
Internal method to add entries.
Definition: RegistryEntry.cpp:170
DataSvcHelpers::RegistryEntry::name
const std::string & name() const override
Retrieve name of the entry.
Definition: RegistryEntry.h:115
DataSvcHelpers::RegistryEntry::i_create
RegistryEntry * i_create(std::string name)
Internal method to create entries.
Definition: RegistryEntry.cpp:155
std::move
T move(T... args)
DataSvcHelpers::RegistryEntry::RegistryEntry
RegistryEntry(std::string path, RegistryEntry *parent=nullptr)
Standard Constructor.
Definition: RegistryEntry.cpp:43
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86

## ◆ add() [3/3]

long DataSvcHelpers::RegistryEntry::add | ( | IRegistry * | obj | ) |

Add object to the container.

Definition at line 164 of file RegistryEntry.cpp.

164 {
165 RegistryEntry* pEntry = CAST_REGENTRY( RegistryEntry*, obj );
166 return i_add( pEntry );
167 }
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: RegistryEntry.cpp:38
DataSvcHelpers::RegistryEntry::i_add
long i_add(RegistryEntry *entry)
Internal method to add entries.
Definition: RegistryEntry.cpp:170
DataSvcHelpers::RegistryEntry::RegistryEntry
RegistryEntry(std::string path, RegistryEntry *parent=nullptr)
Standard Constructor.
Definition: RegistryEntry.cpp:43

## ◆ addRef()

unsigned long DataSvcHelpers::RegistryEntry::addRef | ( |  | ) |
| inline override virtual

IInterface implementation: Dereference the object.

Implements IRegistry.

Definition at line 113 of file RegistryEntry.h.

113 { return ++m_refCount; }
DataSvcHelpers::RegistryEntry::m_refCount
unsigned long m_refCount
Reference counter.
Definition: RegistryEntry.h:50

## ◆ address()

IOpaqueAddress* DataSvcHelpers::RegistryEntry::address | ( |  | ) | const
| inline override virtual

Retrieve opaque storage address.

Implements IRegistry.

Definition at line 123 of file RegistryEntry.h.

123 { return m_pAddress; }
DataSvcHelpers::RegistryEntry::m_pAddress
IOpaqueAddress * m_pAddress
Pointer to opaque address (load info)
Definition: RegistryEntry.h:60

## ◆ assemblePath()

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 286 of file RegistryEntry.cpp.

286 {
287 if ( m_pParent ) m_pParent->assemblePath( buffer );
288 buffer += m_path;
289 }
DataSvcHelpers::RegistryEntry::m_pParent
RegistryEntry * m_pParent
Pointer to parent.
Definition: RegistryEntry.h:58
DataSvcHelpers::RegistryEntry::assemblePath
void assemblePath(std::string &buffer) const
The following entries serve two aspects: 1) They are faster for recursive calls, because they are non...
Definition: RegistryEntry.cpp:286
DataSvcHelpers::RegistryEntry::m_path
std::string m_path
Path name.
Definition: RegistryEntry.h:56

## ◆ begin()

Iterator DataSvcHelpers::RegistryEntry::begin | ( |  | ) | const
| inline

Return starting point for container iteration.

Definition at line 135 of file RegistryEntry.h.

135 { return m_store.begin(); }
std::vector::begin
T begin(T... args)
DataSvcHelpers::RegistryEntry::m_store
Store m_store
Store of leaves.
Definition: RegistryEntry.h:66

## ◆ dataSvc()

IDataProviderSvc* DataSvcHelpers::RegistryEntry::dataSvc | ( |  | ) | const
| inline override virtual

Retrieve pointer to Transient Store.

Implements IRegistry.

Definition at line 119 of file RegistryEntry.h.

119 { return m_pDataProviderSvc; }
DataSvcHelpers::RegistryEntry::m_pDataProviderSvc
IDataProviderSvc * m_pDataProviderSvc
Pointer to hosting transient store.
Definition: RegistryEntry.h:64

## ◆ deleteElements()

long DataSvcHelpers::RegistryEntry::deleteElements | ( |  | ) |

Delete all contained elements.

Delete recursively all elements pending from the current store item.

Definition at line 206 of file RegistryEntry.cpp.

206 {
207 for ( auto& i : m_store ) {
208 RegistryEntry* entry = CAST_REGENTRY( RegistryEntry*, i );
209 if ( entry ) {
210 entry->deleteElements();
211 entry->release();
212 }
213 }
214 m_store.erase( m_store.begin(), m_store.end() );
215 return 0;
216 }
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: RegistryEntry.cpp:38
std::vector::end
T end(T... args)
std::vector::erase
T erase(T... args)
std::vector::begin
T begin(T... args)
DataSvcHelpers::RegistryEntry::m_store
Store m_store
Store of leaves.
Definition: RegistryEntry.h:66
DataSvcHelpers::RegistryEntry::RegistryEntry
RegistryEntry(std::string path, RegistryEntry *parent=nullptr)
Standard Constructor.
Definition: RegistryEntry.cpp:43

## ◆ end()

Iterator DataSvcHelpers::RegistryEntry::end | ( |  | ) | const
| inline

Return end elemtn if the container.

Definition at line 137 of file RegistryEntry.h.

137 { return m_store.end(); }
std::vector::end
T end(T... args)
DataSvcHelpers::RegistryEntry::m_store
Store m_store
Store of leaves.
Definition: RegistryEntry.h:66

## ◆ find() [1/2]

IRegistry* DataSvcHelpers::RegistryEntry::find | ( | const IRegistry * | obj | ) | const
| inline

Try to find an object identified by its pointer.

Definition at line 139 of file RegistryEntry.h.

139 { return i_find( obj ); }
DataSvcHelpers::RegistryEntry::i_find
IRegistry * i_find(const IRegistry *pDirectory) const
Internal method to retrieve data directory.
Definition: RegistryEntry.cpp:219

## ◆ find() [2/2]

IRegistry* DataSvcHelpers::RegistryEntry::find | ( | std::string_view | path | ) | const
| inline

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

Definition at line 141 of file RegistryEntry.h.

141 { return i_find( path ); }
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:932
DataSvcHelpers::RegistryEntry::i_find
IRegistry * i_find(const IRegistry *pDirectory) const
Internal method to retrieve data directory.
Definition: RegistryEntry.cpp:219

## ◆ findLeaf() [1/2]

RegistryEntry* DataSvcHelpers::RegistryEntry::findLeaf | ( | std::string_view | path | ) | const
| inline private

Find identified leaf in this registry node.

Definition at line 93 of file RegistryEntry.h.

93 { return i_find( path ); }
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:932
DataSvcHelpers::RegistryEntry::i_find
IRegistry * i_find(const IRegistry *pDirectory) const
Internal method to retrieve data directory.
Definition: RegistryEntry.cpp:219

## ◆ findLeaf() [2/2]

RegistryEntry* DataSvcHelpers::RegistryEntry::findLeaf | ( | const DataObject * | key | ) | const
| inline private

Find identified leaf in this registry node.

Definition at line 95 of file RegistryEntry.h.

95 { return i_find( key ); }
DataSvcHelpers::RegistryEntry::i_find
IRegistry * i_find(const IRegistry *pDirectory) const
Internal method to retrieve data directory.
Definition: RegistryEntry.cpp:219

## ◆ i_add()

long DataSvcHelpers::RegistryEntry::i_add | ( | RegistryEntry * | entry | ) |
| private

Internal method to add entries.

Add object to the container.

Definition at line 170 of file RegistryEntry.cpp.

170 {
171 // TODO: if this is the sole place where items are added to m_store,
172 // and we know here that they must be RegisteryEntry, can we
173 // drop the dynamic_cast every where else???
174 // TODO: if so, can we also change m_store to be std::vector<RegistryEntry*>
175 // instead
176 // TODO: if so, can we not make it std::vector<RegistryEntry> instead?
177 // TODO: if so, should make sure that a RegistryEntry can be std::move'ed
178 try {
179 pEntry->setDataSvc( m_pDataProviderSvc );
180 m_store.push_back( pEntry );
181 pEntry->setParent( this );
182 if ( !pEntry->isSoft() && pEntry->address() ) { pEntry->address()->setRegistry( pEntry ); }
183 } catch ( ... ) {}
184 return m_store.size();
185 }
std::vector::push_back
T push_back(T... args)
DataSvcHelpers::RegistryEntry::m_pDataProviderSvc
IDataProviderSvc * m_pDataProviderSvc
Pointer to hosting transient store.
Definition: RegistryEntry.h:64
IRegistry::address
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
std::vector::size
T size(T... args)
DataSvcHelpers::RegistryEntry::m_store
Store m_store
Store of leaves.
Definition: RegistryEntry.h:66
IOpaqueAddress::setRegistry
virtual void setRegistry(IRegistry *r)=0
Update directory pointer.

## ◆ i_create()

DataSvcHelpers::RegistryEntry * DataSvcHelpers::RegistryEntry::i_create | ( | std::string | name | ) |
| private

Internal method to create entries.

Internal method to add entries.

Definition at line 155 of file RegistryEntry.cpp.

155 {
156 if ( nam.front() != SEPARATOR ) nam.insert( 0, 1, SEPARATOR );
157 // if this object is already present, this is an error....
158 auto not_present =
159 std::none_of( std::begin( m_store ), std::end( m_store ), [&]( IRegistry* i ) { return nam == i->name(); } );
160 return not_present ? new RegistryEntry( std::move( nam ), this ) : nullptr;
161 }
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:40
IRegistry::name
virtual const name_type & name() const =0
Name of the directory (or key)
std::end
T end(T... args)
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
std::move
T move(T... args)
std::begin
T begin(T... args)
std::none_of
T none_of(T... args)
DataSvcHelpers::RegistryEntry::m_store
Store m_store
Store of leaves.
Definition: RegistryEntry.h:66
DataSvcHelpers::RegistryEntry::RegistryEntry
RegistryEntry(std::string path, RegistryEntry *parent=nullptr)
Standard Constructor.
Definition: RegistryEntry.cpp:43

## ◆ i_find() [1/3]

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 219 of file RegistryEntry.cpp.

219 {
220 auto i = std::find( m_store.begin(), m_store.end(), obj );
221 return ( i != m_store.end() ) ? ( *i ) : nullptr;
222 }
std::vector::end
T end(T... args)
std::find
T find(T... args)
std::vector::begin
T begin(T... args)
DataSvcHelpers::RegistryEntry::m_store
Store m_store
Store of leaves.
Definition: RegistryEntry.h:66

## ◆ i_find() [2/3]

DataSvcHelpers::RegistryEntry * DataSvcHelpers::RegistryEntry::i_find | ( | std::string_view | path | ) | const
| private

Internal method to retrieve data directory.

Find identified leaf in this registry node.

Definition at line 225 of file RegistryEntry.cpp.

225 {
226 if ( path.front() == SEPARATOR ) path.remove_prefix( 1 ); // strip leading '/', if present
227 while ( !path.empty() ) {
228 // check that the chars of path prior to / are the same as regEnt->name()
229 // (i.e. match { nam:"/Ab" path:"/Ab/C"}
230 // but not { nam:"/Abc" path:"/Ab/C"})
231 auto loc1 = path.find( SEPARATOR );
232 auto cpath = path.substr( 0, loc1 );
233 if ( loc1 != std::string_view::npos ) {
234 path.remove_prefix( loc1 + 1 );
235 } else {
236 path = std::string_view{};
237 }
238 auto i = std::find_if( std::begin( m_store ), std::end( m_store ),
239 [&]( const auto& reg ) { return cpath == std::string_view{reg->name()}.substr( 1 ); } );
240 if ( i != std::end( m_store ) ) {
241 RegistryEntry* regEnt = CAST_REGENTRY( RegistryEntry*, *i );
242 return path.empty() ? regEnt : regEnt->i_find( path );
243 }
244 // If this node is "/NodeA", this part allows to find "/NodeA/NodeB" as
245 // our "/NodeB" child.
246 if ( cpath != std::string_view{m_path}.substr( 1 ) ) break;
247 }
248 return nullptr;
249 }
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:932
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:40
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: RegistryEntry.cpp:38
std::end
T end(T... args)
std::find_if
T find_if(T... args)
std::begin
T begin(T... args)
DataSvcHelpers::RegistryEntry::m_store
Store m_store
Store of leaves.
Definition: RegistryEntry.h:66
DataSvcHelpers::RegistryEntry::RegistryEntry
RegistryEntry(std::string path, RegistryEntry *parent=nullptr)
Standard Constructor.
Definition: RegistryEntry.cpp:43
DataSvcHelpers::RegistryEntry::m_path
std::string m_path
Path name.
Definition: RegistryEntry.h:56
std::string::substr
T substr(T... args)

## ◆ i_find() [3/3]

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 252 of file RegistryEntry.cpp.

252 {
253 if ( key ) {
254 if ( key == m_pObject ) return const_cast<RegistryEntry*>( this );
255 // Look in the immediate level:
256 RegistryEntry* result = CAST_REGENTRY( RegistryEntry*, i_find( key->registry() ) );
257 if ( result ) return result;
258 // Go levels down
259 for ( const auto& i : m_store ) {
260 try {
261 const RegistryEntry* entry = CAST_REGENTRY( RegistryEntry*, i );
262 result = entry->i_find( key );
263 if ( result ) return result;
264 } catch ( ... ) {}
265 }
266 }
267 return nullptr;
268 }
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: RegistryEntry.cpp:38
DataSvcHelpers::RegistryEntry::i_find
IRegistry * i_find(const IRegistry *pDirectory) const
Internal method to retrieve data directory.
Definition: RegistryEntry.cpp:219
DataSvcHelpers::RegistryEntry::m_pObject
DataObject * m_pObject
Pointer to object.
Definition: RegistryEntry.h:62
DataSvcHelpers::RegistryEntry::m_store
Store m_store
Store of leaves.
Definition: RegistryEntry.h:66
DataSvcHelpers::RegistryEntry::RegistryEntry
RegistryEntry(std::string path, RegistryEntry *parent=nullptr)
Standard Constructor.
Definition: RegistryEntry.cpp:43

## ◆ identifier()

const std::string& DataSvcHelpers::RegistryEntry::identifier | ( |  | ) | const
| inline override virtual

Full identifier (or key)

Implements IRegistry.

Definition at line 117 of file RegistryEntry.h.

117 { return m_fullpath; }
DataSvcHelpers::RegistryEntry::m_fullpath
std::string m_fullpath
String containing full path of the object (volatile)
Definition: RegistryEntry.h:54

## ◆ isEmpty()

bool DataSvcHelpers::RegistryEntry::isEmpty | ( |  | ) | const
| inline

Simple check if the Container is empty.

Definition at line 133 of file RegistryEntry.h.

133 { return m_store.size() == 0; }
std::vector::size
T size(T... args)
DataSvcHelpers::RegistryEntry::m_store
Store m_store
Store of leaves.
Definition: RegistryEntry.h:66

## ◆ isSoft()

bool DataSvcHelpers::RegistryEntry::isSoft | ( |  | ) | const
| inline

Is the link soft or hard.

Definition at line 127 of file RegistryEntry.h.

127 { return m_isSoft; }
DataSvcHelpers::RegistryEntry::m_isSoft
bool m_isSoft
Is the link soft or hard?
Definition: RegistryEntry.h:52

## ◆ leaves()

const Store& DataSvcHelpers::RegistryEntry::leaves | ( |  | ) | const
| inline

Access the leaves of the object.

Definition at line 129 of file RegistryEntry.h.

129 { return m_store; }
DataSvcHelpers::RegistryEntry::m_store
Store m_store
Store of leaves.
Definition: RegistryEntry.h:66

## ◆ makeHard() [1/2]

void DataSvcHelpers::RegistryEntry::makeHard | ( | DataObject * | pObject | ) |
| private

Initialize link as hard link.

Create hard link.

Definition at line 95 of file RegistryEntry.cpp.

95 {
96 makeSoft( pObject );
97 m_isSoft = false;
98 if ( m_pObject ) m_pObject->setRegistry( this );
99 if ( m_pAddress ) m_pAddress->setRegistry( this );
100 }
DataObject::setRegistry
void setRegistry(IRegistry *pRegistry)
Set pointer to Registry.
Definition: DataObject.h:70
DataSvcHelpers::RegistryEntry::m_pAddress
IOpaqueAddress * m_pAddress
Pointer to opaque address (load info)
Definition: RegistryEntry.h:60
DataSvcHelpers::RegistryEntry::makeSoft
void makeSoft(DataObject *pObject)
Initialize link as soft link.
Definition: RegistryEntry.cpp:80
DataSvcHelpers::RegistryEntry::m_isSoft
bool m_isSoft
Is the link soft or hard?
Definition: RegistryEntry.h:52
DataSvcHelpers::RegistryEntry::m_pObject
DataObject * m_pObject
Pointer to object.
Definition: RegistryEntry.h:62
IOpaqueAddress::setRegistry
virtual void setRegistry(IRegistry *r)=0
Update directory pointer.

## ◆ makeHard() [2/2]

void DataSvcHelpers::RegistryEntry::makeHard | ( | IOpaqueAddress * | pAddress | ) |
| private

Initialize link as hard link.

Create hard link.

Definition at line 103 of file RegistryEntry.cpp.

103 {
104 m_isSoft = false;
105 setAddress( pAddress );
106 }
DataSvcHelpers::RegistryEntry::setAddress
void setAddress(IOpaqueAddress *pAddress) override
Set/Update Opaque address.
Definition: RegistryEntry.cpp:109
DataSvcHelpers::RegistryEntry::m_isSoft
bool m_isSoft
Is the link soft or hard?
Definition: RegistryEntry.h:52

## ◆ makeSoft() [1/2]

void DataSvcHelpers::RegistryEntry::makeSoft | ( | DataObject * | pObject | ) |
| private

Initialize link as soft link.

Create soft link.

Definition at line 80 of file RegistryEntry.cpp.

80 {
81 m_isSoft = true;
82 setObject( pObject );
83 // if ( 0 != m_pObject ) { // Useless: This justs sets my own address again...
84 // setAddress(m_pObject->address());
85 // }
86 }
DataSvcHelpers::RegistryEntry::setObject
void setObject(DataObject *obj)
Set/Update object address.
Definition: RegistryEntry.cpp:119
DataSvcHelpers::RegistryEntry::m_isSoft
bool m_isSoft
Is the link soft or hard?
Definition: RegistryEntry.h:52

## ◆ makeSoft() [2/2]

void DataSvcHelpers::RegistryEntry::makeSoft | ( | IOpaqueAddress * | pAddress | ) |
| private

Initialize link as soft link.

Create soft link.

Definition at line 89 of file RegistryEntry.cpp.

89 {
90 m_isSoft = true;
91 setAddress( pAddress );
92 }
DataSvcHelpers::RegistryEntry::setAddress
void setAddress(IOpaqueAddress *pAddress) override
Set/Update Opaque address.
Definition: RegistryEntry.cpp:109
DataSvcHelpers::RegistryEntry::m_isSoft
bool m_isSoft
Is the link soft or hard?
Definition: RegistryEntry.h:52

## ◆ name()

const std::string& DataSvcHelpers::RegistryEntry::name | ( |  | ) | const
| inline override virtual

Retrieve name of the entry.

Implements IRegistry.

Definition at line 115 of file RegistryEntry.h.

115 { return m_path; }
DataSvcHelpers::RegistryEntry::m_path
std::string m_path
Path name.
Definition: RegistryEntry.h:56

## ◆ object()

DataObject* DataSvcHelpers::RegistryEntry::object | ( |  | ) | const
| inline override virtual

Retrive object behind the link.

Implements IRegistry.

Definition at line 121 of file RegistryEntry.h.

121 { return m_pObject; }
DataSvcHelpers::RegistryEntry::m_pObject
DataObject * m_pObject
Pointer to object.
Definition: RegistryEntry.h:62

## ◆ parent()

IRegistry* DataSvcHelpers::RegistryEntry::parent | ( |  | ) | const
| inline

Pointer to parent directory entry.

Definition at line 125 of file RegistryEntry.h.

125 { return m_pParent; }
DataSvcHelpers::RegistryEntry::m_pParent
RegistryEntry * m_pParent
Pointer to parent.
Definition: RegistryEntry.h:58

## ◆ parentEntry()

RegistryEntry* DataSvcHelpers::RegistryEntry::parentEntry | ( |  | ) |
| inline private

Pointer to parent registry entry.

Definition at line 91 of file RegistryEntry.h.

91 { return m_pParent; }
DataSvcHelpers::RegistryEntry::m_pParent
RegistryEntry * m_pParent
Pointer to parent.
Definition: RegistryEntry.h:58

## ◆ release()

unsigned long DataSvcHelpers::RegistryEntry::release | ( |  | ) |
| override virtual

IInterface implementation: Reference the object.

Release entry.

Implements IRegistry.

Definition at line 66 of file RegistryEntry.cpp.

66 {
67 unsigned long cnt = --m_refCount;
68 if ( !m_refCount ) delete this;
69 return cnt;
70 }
DataSvcHelpers::RegistryEntry::m_refCount
unsigned long m_refCount
Reference counter.
Definition: RegistryEntry.h:50

## ◆ remove() [1/2]

StatusCode DataSvcHelpers::RegistryEntry::remove | ( | std::string_view | name | ) |

Remove an entry from the store.

Remove entry from data store.

Definition at line 142 of file RegistryEntry.cpp.

142 {
143 if ( nam.front() == SEPARATOR ) nam.remove_prefix( 1 );
144 auto i = std::find_if( m_store.begin(), m_store.end(), [&]( const auto* entry ) {
145 // skip leading SEPARATOR
146 return entry->name().compare( 1, std::string::npos, nam.data(), nam.size() ) == 0;
147 } );
148 // if the requested object is not present, this is an error....
149 if ( i == m_store.end() ) return StatusCode::FAILURE;
150 remove( *i );
151 return StatusCode::SUCCESS;
152 }
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:40
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
IRegistry::name
virtual const name_type & name() const =0
Name of the directory (or key)
std::vector::end
T end(T... args)
DataSvcHelpers::RegistryEntry::remove
StatusCode remove(std::string_view name)
Remove an entry from the store.
Definition: RegistryEntry.cpp:142
std::find_if
T find_if(T... args)
std::vector::begin
T begin(T... args)
DataSvcHelpers::RegistryEntry::m_store
Store m_store
Store of leaves.
Definition: RegistryEntry.h:66
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
std::string::compare
T compare(T... args)

## ◆ remove() [2/2]

long DataSvcHelpers::RegistryEntry::remove | ( | IRegistry * | obj | ) |

Remove an object from the container.

Definition at line 129 of file RegistryEntry.cpp.

129 {
130 try {
131 RegistryEntry* pEntry = dynamic_cast<RegistryEntry*>( obj );
132 auto i = std::remove( std::begin( m_store ), std::end( m_store ), pEntry );
133 if ( i != std::end( m_store ) ) {
134 pEntry->release();
135 m_store.erase( i, std::end( m_store ) );
136 }
137 } catch ( ... ) {}
138 return m_store.size();
139 }
std::end
T end(T... args)
std::remove
T remove(T... args)
std::vector::erase
T erase(T... args)
std::vector::size
T size(T... args)
std::begin
T begin(T... args)
DataSvcHelpers::RegistryEntry::m_store
Store m_store
Store of leaves.
Definition: RegistryEntry.h:66
DataSvcHelpers::RegistryEntry::RegistryEntry
RegistryEntry(std::string path, RegistryEntry *parent=nullptr)
Standard Constructor.
Definition: RegistryEntry.cpp:43

## ◆ setAddress()

void DataSvcHelpers::RegistryEntry::setAddress | ( | IOpaqueAddress * | pAddress | ) |
| override virtual

Set/Update Opaque address.

Update Opaque address of registry entry.

Implements IRegistry.

Definition at line 109 of file RegistryEntry.cpp.

109 {
110 if ( pAddress ) {
111 pAddress->addRef();
112 pAddress->setRegistry( this );
113 }
114 if ( m_pAddress ) m_pAddress->release();
115 m_pAddress = pAddress;
116 }
IOpaqueAddress::release
virtual unsigned long release()=0
release reference to object
DataSvcHelpers::RegistryEntry::m_pAddress
IOpaqueAddress * m_pAddress
Pointer to opaque address (load info)
Definition: RegistryEntry.h:60
IOpaqueAddress::setRegistry
virtual void setRegistry(IRegistry *r)=0
Update directory pointer.
IOpaqueAddress::addRef
virtual unsigned long addRef()=0
Add reference to object.

## ◆ setDataSvc()

void DataSvcHelpers::RegistryEntry::setDataSvc | ( | IDataProviderSvc * | s | ) |
| inline private

Set the transient data store.

Definition at line 89 of file RegistryEntry.h.

89 { m_pDataProviderSvc = s; }
DataSvcHelpers::RegistryEntry::m_pDataProviderSvc
IDataProviderSvc * m_pDataProviderSvc
Pointer to hosting transient store.
Definition: RegistryEntry.h:64
gaudirun.s
string s
Definition: gaudirun.py:316

## ◆ setObject()

void DataSvcHelpers::RegistryEntry::setObject | ( | DataObject * | obj | ) |

Set/Update object address.

Set object pointer of data store item.

Definition at line 119 of file RegistryEntry.cpp.

119 {
120 if ( pObject ) {
121 pObject->addRef();
122 if ( !isSoft() ) pObject->setRegistry( this );
123 }
124 if ( m_pObject ) m_pObject->release();
125 m_pObject = pObject;
126 }
DataObject::release
virtual unsigned long release()
release reference to object
Definition: DataObject.cpp:46
DataSvcHelpers::RegistryEntry::m_pObject
DataObject * m_pObject
Pointer to object.
Definition: RegistryEntry.h:62
DataSvcHelpers::RegistryEntry::isSoft
bool isSoft() const
Is the link soft or hard.
Definition: RegistryEntry.h:127

## ◆ setParent()

void DataSvcHelpers::RegistryEntry::setParent | ( | RegistryEntry * | pParent | ) |
| private

Set new parent pointer.

Definition at line 73 of file RegistryEntry.cpp.

73 {
74 m_pParent = pParent;
75 m_fullpath.clear();
76 assemblePath( m_fullpath );
77 }
DataSvcHelpers::RegistryEntry::m_pParent
RegistryEntry * m_pParent
Pointer to parent.
Definition: RegistryEntry.h:58
DataSvcHelpers::RegistryEntry::m_fullpath
std::string m_fullpath
String containing full path of the object (volatile)
Definition: RegistryEntry.h:54
DataSvcHelpers::RegistryEntry::assemblePath
void assemblePath(std::string &buffer) const
The following entries serve two aspects: 1) They are faster for recursive calls, because they are non...
Definition: RegistryEntry.cpp:286
std::string::clear
T clear(T... args)

## ◆ size()

int DataSvcHelpers::RegistryEntry::size | ( |  | ) | const
| inline

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

Definition at line 131 of file RegistryEntry.h.

131 { return m_store.size(); }
std::vector::size
T size(T... args)
DataSvcHelpers::RegistryEntry::m_store
Store m_store
Store of leaves.
Definition: RegistryEntry.h:66

## ◆ traverseTree()

StatusCode DataSvcHelpers::RegistryEntry::traverseTree | ( | IDataStoreAgent * | pAgent,
|  | int | level = `0`
| ) |  |

traverse data tree

Definition at line 271 of file RegistryEntry.cpp.

271 {
272 bool go_down = pAgent->analyse( this, level );
273 StatusCode status;
274 if ( go_down ) {
275 for ( auto& i : m_store ) {
276 try {
277 RegistryEntry* entry = CAST_REGENTRY( RegistryEntry*, i );
278 entry->traverseTree( pAgent, level + 1 ).ignore();
279 } catch ( ... ) { status = StatusCode::FAILURE; }
280 }
281 }
282 return status;
283 }
IDataStoreAgent::analyse
virtual bool analyse(IRegistry *pObject, int level)=0
Analyse the data object.
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: RegistryEntry.cpp:38
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
DataSvcHelpers::RegistryEntry::m_store
Store m_store
Store of leaves.
Definition: RegistryEntry.h:66
DataSvcHelpers::RegistryEntry::RegistryEntry
RegistryEntry(std::string path, RegistryEntry *parent=nullptr)
Standard Constructor.
Definition: RegistryEntry.cpp:43
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
gaudirun.level
level
Definition: gaudirun.py:334

## Friends And Related Function Documentation

## ◆ ::DataSvc

friend class ::DataSvc
| friend

Definition at line 42 of file RegistryEntry.h.

## ◆ ::TsDataSvc

friend class ::TsDataSvc
| friend

Definition at line 44 of file RegistryEntry.h.

## Member Data Documentation

## ◆ m_fullpath

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

String containing full path of the object (volatile)

Definition at line 54 of file RegistryEntry.h.

## ◆ m_isSoft

bool DataSvcHelpers::RegistryEntry::m_isSoft = false
| private

Is the link soft or hard?

Definition at line 52 of file RegistryEntry.h.

## ◆ m_pAddress

IOpaqueAddress* DataSvcHelpers::RegistryEntry::m_pAddress = nullptr
| private

Pointer to opaque address (load info)

Definition at line 60 of file RegistryEntry.h.

## ◆ m_path

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

Path name.

Definition at line 56 of file RegistryEntry.h.

## ◆ m_pDataProviderSvc

IDataProviderSvc* DataSvcHelpers::RegistryEntry::m_pDataProviderSvc = nullptr
| private

Pointer to hosting transient store.

Definition at line 64 of file RegistryEntry.h.

## ◆ m_pObject

DataObject* DataSvcHelpers::RegistryEntry::m_pObject = nullptr
| private

Pointer to object.

Definition at line 62 of file RegistryEntry.h.

## ◆ m_pParent

RegistryEntry* DataSvcHelpers::RegistryEntry::m_pParent = nullptr
| private

Pointer to parent.

Definition at line 58 of file RegistryEntry.h.

## ◆ m_refCount

unsigned long DataSvcHelpers::RegistryEntry::m_refCount = 0
| private

Reference counter.

Definition at line 50 of file RegistryEntry.h.

## ◆ m_store

Store DataSvcHelpers::RegistryEntry::m_store
| private

Store of leaves.

Definition at line 66 of file RegistryEntry.h.

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

- GaudiKernel/GaudiKernel/RegistryEntry.h
- GaudiKernel/src/Lib/RegistryEntry.cpp