#include <GaudiKernel/RegistryEntry.h>
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 41 of file RegistryEntry.h.
◆ Iterator
◆ Store
◆ RegistryEntry()
| DataSvcHelpers::RegistryEntry::RegistryEntry |
( |
std::string |
path, |
|
|
RegistryEntry * |
parent = nullptr |
|
) |
| |
Standard Constructor.
Definition at line 28 of file RegistryEntry.cpp.
32 if ( sep != std::string::npos )
m_path.erase( 0, sep );
◆ ~RegistryEntry()
| DataSvcHelpers::RegistryEntry::~RegistryEntry |
( |
| ) |
|
|
override |
◆ add() [1/3]
| long DataSvcHelpers::RegistryEntry::add |
( |
IRegistry * |
obj | ) |
|
◆ add() [2/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 173 of file RegistryEntry.cpp.
176 ( is_soft ) ? entry->makeSoft( pObject ) : entry->makeHard( pObject );
◆ add() [3/3]
Add entry to data store.
Add entry to the current data store item.
Definition at line 182 of file RegistryEntry.cpp.
185 ( is_soft ) ? entry->makeSoft( pAddress ) : entry->makeHard( pAddress );
◆ addRef()
| unsigned long DataSvcHelpers::RegistryEntry::addRef |
( |
| ) |
|
|
inlineoverridevirtual |
◆ address()
◆ 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 271 of file RegistryEntry.cpp.
◆ begin()
| Iterator DataSvcHelpers::RegistryEntry::begin |
( |
| ) |
const |
|
inline |
Return starting point for container iteration.
Definition at line 140 of file RegistryEntry.h.
◆ dataSvc()
◆ deleteElements()
| long DataSvcHelpers::RegistryEntry::deleteElements |
( |
| ) |
|
Delete all contained elements.
Delete recursively all elements pending from the current store item.
Definition at line 191 of file RegistryEntry.cpp.
195 entry->deleteElements();
◆ end()
| Iterator DataSvcHelpers::RegistryEntry::end |
( |
| ) |
const |
|
inline |
◆ find() [1/2]
Try to find an object identified by its pointer.
Definition at line 144 of file RegistryEntry.h.
◆ 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 146 of file RegistryEntry.h.
◆ findLeaf() [1/2]
Find identified leaf in this registry node.
Definition at line 100 of file RegistryEntry.h.
◆ findLeaf() [2/2]
| RegistryEntry* DataSvcHelpers::RegistryEntry::findLeaf |
( |
std::string_view |
path | ) |
const |
|
inlineprivate |
Find identified leaf in this registry node.
Definition at line 98 of file RegistryEntry.h.
◆ i_add()
| long DataSvcHelpers::RegistryEntry::i_add |
( |
RegistryEntry * |
entry | ) |
|
|
private |
Internal method to add entries.
Add object to the container.
Definition at line 155 of file RegistryEntry.cpp.
166 pEntry->setParent(
this );
167 if ( !pEntry->isSoft() && pEntry->address() ) { pEntry->address()->setRegistry( pEntry ); }
◆ i_create()
Internal method to create entries.
Internal method to add entries.
Definition at line 140 of file RegistryEntry.cpp.
◆ i_find() [1/3]
Internal method to locate object entry.
Find identified leaf in this registry node.
Definition at line 237 of file RegistryEntry.cpp.
242 if ( result )
return result;
244 for (
const auto& i :
m_store ) {
247 result = entry->i_find(
key );
248 if ( result )
return result;
◆ i_find() [2/3]
Internal method to retrieve data directory.
Try to find an object identified by its pointer.
Definition at line 204 of file RegistryEntry.cpp.
206 return ( i !=
m_store.end() ) ? ( *i ) :
nullptr;
◆ i_find() [3/3]
Internal method to retrieve data directory.
Find identified leaf in this registry node.
Definition at line 210 of file RegistryEntry.cpp.
212 while ( !
path.empty() ) {
217 auto cpath =
path.substr( 0, loc1 );
218 if ( loc1 != std::string_view::npos ) {
219 path.remove_prefix( loc1 + 1 );
221 path = std::string_view{};
224 [&](
const auto& reg ) {
return cpath == std::string_view{ reg->name() }.substr( 1 ); } );
227 return path.empty() ? regEnt : regEnt->i_find(
path );
231 if ( cpath != std::string_view{
m_path }.substr( 1 ) )
break;
◆ identifier()
| const std::string& DataSvcHelpers::RegistryEntry::identifier |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ isEmpty()
| bool DataSvcHelpers::RegistryEntry::isEmpty |
( |
| ) |
const |
|
inline |
◆ isSoft()
| bool DataSvcHelpers::RegistryEntry::isSoft |
( |
| ) |
const |
|
inline |
◆ leaves()
| const Store& DataSvcHelpers::RegistryEntry::leaves |
( |
| ) |
const |
|
inline |
◆ makeHard() [1/2]
| void DataSvcHelpers::RegistryEntry::makeHard |
( |
DataObject * |
pObject | ) |
|
|
private |
Initialize link as hard link.
Create hard link.
Definition at line 80 of file RegistryEntry.cpp.
◆ makeHard() [2/2]
| void DataSvcHelpers::RegistryEntry::makeHard |
( |
IOpaqueAddress * |
pAddress | ) |
|
|
private |
Initialize link as hard link.
Create hard link.
Definition at line 88 of file RegistryEntry.cpp.
◆ makeSoft() [1/2]
| void DataSvcHelpers::RegistryEntry::makeSoft |
( |
DataObject * |
pObject | ) |
|
|
private |
Initialize link as soft link.
Create soft link.
Definition at line 65 of file RegistryEntry.cpp.
◆ makeSoft() [2/2]
| void DataSvcHelpers::RegistryEntry::makeSoft |
( |
IOpaqueAddress * |
pAddress | ) |
|
|
private |
Initialize link as soft link.
Create soft link.
Definition at line 74 of file RegistryEntry.cpp.
◆ name()
| const std::string& DataSvcHelpers::RegistryEntry::name |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ object()
| DataObject* DataSvcHelpers::RegistryEntry::object |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ parent()
| IRegistry* DataSvcHelpers::RegistryEntry::parent |
( |
| ) |
const |
|
inline |
◆ parentEntry()
◆ release()
| unsigned long DataSvcHelpers::RegistryEntry::release |
( |
| ) |
|
|
overridevirtual |
◆ remove() [1/2]
| long DataSvcHelpers::RegistryEntry::remove |
( |
IRegistry * |
obj | ) |
|
◆ remove() [2/2]
| StatusCode DataSvcHelpers::RegistryEntry::remove |
( |
std::string_view |
name | ) |
|
Remove an entry from the store.
Remove entry from data store.
Definition at line 127 of file RegistryEntry.cpp.
128 if ( nam.front() ==
SEPARATOR ) nam.remove_prefix( 1 );
129 auto i = std::find_if(
m_store.begin(),
m_store.end(), [&](
const auto* entry ) {
131 return entry->name().compare( 1, std::string::npos, nam.data(), nam.size() ) == 0;
◆ setAddress()
| void DataSvcHelpers::RegistryEntry::setAddress |
( |
IOpaqueAddress * |
pAddress | ) |
|
|
overridevirtual |
◆ setDataSvc()
◆ setObject()
| void DataSvcHelpers::RegistryEntry::setObject |
( |
DataObject * |
obj | ) |
|
Set/Update object address.
Set object pointer of data store item.
Definition at line 104 of file RegistryEntry.cpp.
107 if ( !
isSoft() ) pObject->setRegistry(
this );
◆ setParent()
| void DataSvcHelpers::RegistryEntry::setParent |
( |
RegistryEntry * |
pParent | ) |
|
|
private |
◆ size()
| size_t DataSvcHelpers::RegistryEntry::size |
( |
| ) |
const |
|
inline |
Return the size of the container(=number of objects)
Definition at line 136 of file RegistryEntry.h.
◆ traverseTree()
◆ ::DataSvc
◆ ::TsDataSvc
◆ m_fullpath
| std::string DataSvcHelpers::RegistryEntry::m_fullpath |
|
private |
String containing full path of the object (volatile)
Definition at line 59 of file RegistryEntry.h.
◆ m_isSoft
| bool DataSvcHelpers::RegistryEntry::m_isSoft = false |
|
private |
◆ m_pAddress
◆ m_path
| std::string DataSvcHelpers::RegistryEntry::m_path |
|
private |
◆ m_pDataProviderSvc
◆ m_pObject
| DataObject* DataSvcHelpers::RegistryEntry::m_pObject = nullptr |
|
private |
◆ m_pParent
| RegistryEntry* DataSvcHelpers::RegistryEntry::m_pParent = nullptr |
|
private |
◆ m_refCount
| unsigned long DataSvcHelpers::RegistryEntry::m_refCount = 0 |
|
private |
◆ m_store
| Store DataSvcHelpers::RegistryEntry::m_store |
|
private |
The documentation for this class was generated from the following files:
void setRegistry(IRegistry *pRegistry)
Set pointer to Registry.
void setAddress(IOpaqueAddress *pAddress) override
Set/Update Opaque address.
long i_add(RegistryEntry *entry)
Internal method to add entries.
std::string m_path
Path name.
bool isSoft() const
Is the link soft or hard.
virtual unsigned long addRef()=0
Add reference to object.
virtual bool analyse(IRegistry *pObject, int level)=0
Analyse the data object.
virtual unsigned long release()
release reference to object
virtual unsigned long release()=0
release reference to object
IRegistry * i_find(const IRegistry *pDirectory) const
Internal method to retrieve data directory.
std::string m_fullpath
String containing full path of the object (volatile)
unsigned long addRef() override
IInterface implementation: Dereference the object.
RegistryEntry * m_pParent
Pointer to parent.
virtual const name_type & name() const =0
Name of the directory (or key)
AttribStringParser::Iterator begin(const AttribStringParser &parser)
StatusCode remove(std::string_view name)
Remove an entry from the store.
void setObject(DataObject *obj)
Set/Update object address.
Store m_store
Store of leaves.
#define CAST_REGENTRY(x, y)
const std::string & name() const override
Retrieve name of the entry.
void assemblePath(std::string &buffer) const
The following entries serve two aspects: 1) They are faster for recursive calls, because they are non...
IRegistry * parent() const
Pointer to parent directory entry.
void makeSoft(DataObject *pObject)
Initialize link as soft link.
RegistryEntry(std::string path, RegistryEntry *parent=nullptr)
Standard Constructor.
virtual void setRegistry(IRegistry *r)=0
Update directory pointer.
constexpr static const auto SUCCESS
unsigned long m_refCount
Reference counter.
DataObject * m_pObject
Pointer to object.
long deleteElements()
Delete all contained elements.
IDataProviderSvc * m_pDataProviderSvc
Pointer to hosting transient store.
constexpr static const auto FAILURE
RegistryEntry * i_create(std::string name)
Internal method to create entries.
bool m_isSoft
Is the link soft or hard?
IOpaqueAddress * m_pAddress
Pointer to opaque address (load info)