#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 46 of file RegistryEntry.h.
◆ Iterator
◆ Store
◆ RegistryEntry()
◆ ~RegistryEntry()
DataSvcHelpers::RegistryEntry::~RegistryEntry |
( |
| ) |
|
|
override |
◆ add() [1/3]
long DataSvcHelpers::RegistryEntry::add |
( |
IRegistry * |
obj | ) |
|
◆ add() [2/3]
Add entry to data store.
Add entry to the current data store item.
Definition at line 198 of file RegistryEntry.cpp.
201 ( 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 207 of file RegistryEntry.cpp.
210 ( 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 296 of file RegistryEntry.cpp.
◆ begin()
Iterator DataSvcHelpers::RegistryEntry::begin |
( |
| ) |
const |
|
inline |
Return starting point for container iteration.
Definition at line 145 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 216 of file RegistryEntry.cpp.
220 entry->deleteElements();
◆ end()
Iterator DataSvcHelpers::RegistryEntry::end |
( |
| ) |
const |
|
inline |
◆ find() [1/2]
Try to find an object identified by its pointer.
Definition at line 149 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 151 of file RegistryEntry.h.
◆ findLeaf() [1/2]
Find identified leaf in this registry node.
Definition at line 105 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 103 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 180 of file RegistryEntry.cpp.
191 pEntry->setParent(
this );
192 if ( !pEntry->isSoft() && pEntry->address() ) { pEntry->
address()->
setRegistry( pEntry ); }
◆ i_create()
Internal method to create entries.
Internal method to add entries.
Definition at line 165 of file RegistryEntry.cpp.
◆ i_find() [1/3]
Internal method to locate object entry.
Find identified leaf in this registry node.
Definition at line 262 of file RegistryEntry.cpp.
267 if ( result )
return result;
269 for (
const auto& i :
m_store ) {
272 result = entry->i_find(
key );
273 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 229 of file RegistryEntry.cpp.
231 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 235 of file RegistryEntry.cpp.
237 while ( !
path.empty() ) {
242 auto cpath =
path.substr( 0, loc1 );
243 if ( loc1 != std::string_view::npos ) {
244 path.remove_prefix( loc1 + 1 );
246 path = std::string_view{};
249 [&](
const auto& reg ) {
return cpath == std::string_view{ reg->name() }.substr( 1 ); } );
252 return path.empty() ? regEnt : regEnt->i_find(
path );
256 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 |
◆ makeHard() [2/2]
void DataSvcHelpers::RegistryEntry::makeHard |
( |
IOpaqueAddress * |
pAddress | ) |
|
|
private |
◆ makeSoft() [1/2]
void DataSvcHelpers::RegistryEntry::makeSoft |
( |
DataObject * |
pObject | ) |
|
|
private |
Initialize link as soft link.
Create soft link.
Definition at line 90 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 99 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 152 of file RegistryEntry.cpp.
153 if ( nam.front() ==
SEPARATOR ) nam.remove_prefix( 1 );
156 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 129 of file RegistryEntry.cpp.
132 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 141 of file RegistryEntry.h.
◆ traverseTree()
◆ ::DataSvc
◆ ::TsDataSvc
◆ m_fullpath
String containing full path of the object (volatile)
Definition at line 64 of file RegistryEntry.h.
◆ m_isSoft
bool DataSvcHelpers::RegistryEntry::m_isSoft = false |
|
private |
◆ m_pAddress
◆ m_path
◆ 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)
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.
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
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)