| The Gaudi Framework v27r1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

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

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...
virtual IRegistry * | parent () const
| Pointer to parent directory entry. More...
virtual bool | isSoft () const
| Is the link soft or hard. More...
const Store & | leaves () 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 IRegistry * | find (const IRegistry *obj) const
| Try to find an object identified by its pointer. More...
virtual IRegistry * | find (const std::string &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...
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 ()=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 (boost::string_ref 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...
virtual RegistryEntry * | parentEntry ()
| Pointer to parent registry entry. More...
RegistryEntry * | findLeaf (boost::string_ref 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

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

Iterator definition.

Definition at line 45 of file RegistryEntry.h.

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

Definition of datastore type.

Definition at line 39 of file RegistryEntry.h.

## Constructor & Destructor Documentation

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

Standard Constructor.

Definition at line 44 of file RegistryEntry.cpp.

44 :
45 m_path(std::move(path)),
46 m_pParent(parent)
47 {
48 std::string::size_type sep = m_path.rfind(SEPARATOR);
49 if ( m_path.front() != SEPARATOR ) m_path.insert(0,1,SEPARATOR);
50 if ( sep != std::string::npos ) m_path.erase(0,sep);
51 assemblePath(m_fullpath);
52 addRef();
53 }
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:41
std::string::front
T front(T...args)
DataSvcHelpers::RegistryEntry::addRef
unsigned long addRef() override
IInterface implementation: Dereference the object.
Definition: RegistryEntry.h:118
std::string::rfind
T rfind(T...args)
DataSvcHelpers::RegistryEntry::m_pParent
RegistryEntry * m_pParent
Pointer to parent.
Definition: RegistryEntry.h:56
DataSvcHelpers::RegistryEntry::m_fullpath
std::string m_fullpath
String containing full path of the object (volatile)
Definition: RegistryEntry.h:52
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:303
std::string::erase
T erase(T...args)
std::move
T move(T...args)
std::string::insert
T insert(T...args)
DataSvcHelpers::RegistryEntry::parent
virtual IRegistry * parent() const
Pointer to parent directory entry.
Definition: RegistryEntry.h:142
DataSvcHelpers::RegistryEntry::m_path
std::string m_path
Path name.
Definition: RegistryEntry.h:54

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

Standard Destructor.

Standard destructor.

Definition at line 56 of file RegistryEntry.cpp.

56 {
57 deleteElements();
58 if ( m_pObject ) {
59 if ( !m_isSoft ) m_pObject->setRegistry(nullptr);
60 m_pObject->release();
61 }
62 if ( m_pAddress ) {
63 if ( !m_isSoft ) m_pAddress->setRegistry(nullptr);
64 m_pAddress->release();
65 }
66 }
DataSvcHelpers::RegistryEntry::deleteElements
virtual long deleteElements()
Delete all contained elements.
Definition: RegistryEntry.cpp:215
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:58
DataSvcHelpers::RegistryEntry::m_isSoft
bool m_isSoft
Is the link soft or hard?
Definition: RegistryEntry.h:50
DataObject::release
virtual unsigned long release()
release reference to object
Definition: DataObject.cpp:56
DataSvcHelpers::RegistryEntry::m_pObject
DataObject * m_pObject
Pointer to object.
Definition: RegistryEntry.h:60
IOpaqueAddress::setRegistry
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.

Reimplemented in Hive::HiveEventRegistryEntry.

Definition at line 197 of file RegistryEntry.cpp.

197 {
198 RegistryEntry* entry = i_create(name);
199 if ( !entry ) return StatusCode::FAILURE;
200 ( is_soft ) ? entry->makeSoft(pObject) : entry->makeHard(pObject);
201 i_add( entry );
202 return StatusCode::SUCCESS;
203 }
DataSvcHelpers::RegistryEntry::i_add
long i_add(RegistryEntry *entry)
Internal method to add entries.
Definition: RegistryEntry.cpp:175
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::SUCCESS
Definition: StatusCode.h:30
DataSvcHelpers::RegistryEntry::i_create
RegistryEntry * i_create(std::string name)
Internal method to create entries.
Definition: RegistryEntry.cpp:159
DataSvcHelpers::RegistryEntry::RegistryEntry
RegistryEntry(std::string path, RegistryEntry *parent=nullptr)
Standard Constructor.
Definition: RegistryEntry.cpp:44

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.

Reimplemented in Hive::HiveEventRegistryEntry.

Definition at line 206 of file RegistryEntry.cpp.

206 {
207 RegistryEntry* entry = i_create(name);
208 if ( !entry ) return StatusCode::FAILURE;
209 ( is_soft ) ? entry->makeSoft(pAddress) : entry->makeHard(pAddress);
210 i_add( entry );
211 return StatusCode::SUCCESS;
212 }
DataSvcHelpers::RegistryEntry::i_add
long i_add(RegistryEntry *entry)
Internal method to add entries.
Definition: RegistryEntry.cpp:175
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::SUCCESS
Definition: StatusCode.h:30
DataSvcHelpers::RegistryEntry::i_create
RegistryEntry * i_create(std::string name)
Internal method to create entries.
Definition: RegistryEntry.cpp:159
DataSvcHelpers::RegistryEntry::RegistryEntry
RegistryEntry(std::string path, RegistryEntry *parent=nullptr)
Standard Constructor.
Definition: RegistryEntry.cpp:44

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

Add object to the container.

Reimplemented in Hive::HiveEventRegistryEntry.

Definition at line 169 of file RegistryEntry.cpp.

169 {
170 RegistryEntry* pEntry = CAST_REGENTRY(RegistryEntry*, obj);
171 return i_add(pEntry);
172 }
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: RegistryEntry.cpp:39
DataSvcHelpers::RegistryEntry::i_add
long i_add(RegistryEntry *entry)
Internal method to add entries.
Definition: RegistryEntry.cpp:175
DataSvcHelpers::RegistryEntry::RegistryEntry
RegistryEntry(std::string path, RegistryEntry *parent=nullptr)
Standard Constructor.
Definition: RegistryEntry.cpp:44

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

IInterface implementation: Dereference the object.

Implements IRegistry.

Definition at line 118 of file RegistryEntry.h.

118 {
119 return ++m_refCount;
120 }
DataSvcHelpers::RegistryEntry::m_refCount
unsigned long m_refCount
Reference counter.
Definition: RegistryEntry.h:48

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

Retrieve opaque storage address.

Implements IRegistry.

Definition at line 138 of file RegistryEntry.h.

138 {
139 return m_pAddress;
140 }
DataSvcHelpers::RegistryEntry::m_pAddress
IOpaqueAddress * m_pAddress
Pointer to opaque address (load info)
Definition: RegistryEntry.h:58

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

303 {
304 if ( m_pParent ) m_pParent->assemblePath(buffer);
305 buffer += m_path;
306 }
DataSvcHelpers::RegistryEntry::m_pParent
RegistryEntry * m_pParent
Pointer to parent.
Definition: RegistryEntry.h:56
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:303
DataSvcHelpers::RegistryEntry::m_path
std::string m_path
Path name.
Definition: RegistryEntry.h:54

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

Return starting point for container iteration.

Definition at line 162 of file RegistryEntry.h.

162 {
163 return m_store.begin();
164 }
std::vector::begin
T begin(T...args)
DataSvcHelpers::RegistryEntry::m_store
Store m_store
Store of leaves.
Definition: RegistryEntry.h:64

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

Retrieve pointer to Transient Store.

Implements IRegistry.

Definition at line 130 of file RegistryEntry.h.

130 {
131 return m_pDataProviderSvc;
132 }
DataSvcHelpers::RegistryEntry::m_pDataProviderSvc
IDataProviderSvc * m_pDataProviderSvc
Pointer to hosting transient store.
Definition: RegistryEntry.h:62

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

Delete all contained elements.

Delete recursively all elements pending from the current store item.

Definition at line 215 of file RegistryEntry.cpp.

215 {
216 for (auto& i : m_store ) {
217 RegistryEntry* entry = CAST_REGENTRY(RegistryEntry*, i);
218 if ( entry ) {
219 entry->deleteElements();
220 entry->release();
221 }
222 }
223 m_store.erase(m_store.begin(), m_store.end());
224 return 0;
225 }
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: RegistryEntry.cpp:39
DataSvcHelpers::RegistryEntry::m_store
Store m_store
Store of leaves.
Definition: RegistryEntry.h:64
DataSvcHelpers::RegistryEntry::RegistryEntry
RegistryEntry(std::string path, RegistryEntry *parent=nullptr)
Standard Constructor.
Definition: RegistryEntry.cpp:44
ana.i
list i
Definition: ana.py:128

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

Return end elemtn if the container.

Definition at line 166 of file RegistryEntry.h.

166 {
167 return m_store.end();
168 }
std::vector::end
T end(T...args)
DataSvcHelpers::RegistryEntry::m_store
Store m_store
Store of leaves.
Definition: RegistryEntry.h:64

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

Try to find an object identified by its pointer.

Definition at line 170 of file RegistryEntry.h.

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

virtual IRegistry* DataSvcHelpers::RegistryEntry::find | ( | const std::string & | path | ) | const
| inline virtual

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

Definition at line 174 of file RegistryEntry.h.

174 {
175 return i_find(path);
176 }
DataSvcHelpers::RegistryEntry::i_find
IRegistry * i_find(const IRegistry *pDirectory) const
Internal method to retrieve data directory.
Definition: RegistryEntry.cpp:228

RegistryEntry* DataSvcHelpers::RegistryEntry::findLeaf | ( | boost::string_ref | path | ) | const
| inline private

Find identified leaf in this registry node.

Definition at line 95 of file RegistryEntry.h.

95 {
96 return i_find(path);
97 }
Gaudi::Utils::Histos::path
GAUDI_API std::string path(const AIDA::IBaseHistogram *aida)
get the path in THS for AIDA histogram
Definition: HistoTableFormat.cpp:191
DataSvcHelpers::RegistryEntry::i_find
IRegistry * i_find(const IRegistry *pDirectory) const
Internal method to retrieve data directory.
Definition: RegistryEntry.cpp:228

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

Find identified leaf in this registry node.

Definition at line 99 of file RegistryEntry.h.

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

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

Internal method to add entries.

Add object to the container.

Definition at line 175 of file RegistryEntry.cpp.

175 {
176 //TODO: if this is the sole place where items are added to m_store,
177 // and we know here that they must be RegisteryEntry, can we
178 // drop the dynamic_cast every where else???
179 //TODO: if so, can we also change m_store to be std::vector<RegistryEntry*>
180 // instead
181 //TODO: if so, can we not make it std::vector<RegistryEntry> instead?
182 //TODO: if so, should make sure that a RegistryEntry can be std::move'ed
183 try {
184 pEntry->setDataSvc(m_pDataProviderSvc);
185 m_store.push_back(pEntry);
186 pEntry->setParent(this);
187 if ( !pEntry->isSoft() && pEntry->address() ) {
188 pEntry->address()->setRegistry(pEntry);
189 }
190 }
191 catch ( ... ) {
192 }
193 return m_store.size();
194 }
std::vector::push_back
T push_back(T...args)
DataSvcHelpers::RegistryEntry::m_pDataProviderSvc
IDataProviderSvc * m_pDataProviderSvc
Pointer to hosting transient store.
Definition: RegistryEntry.h:62
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:64
IOpaqueAddress::setRegistry
virtual void setRegistry(IRegistry *r)=0
Update directory pointer.

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

Internal method to create entries.

Internal method to add entries.

Definition at line 159 of file RegistryEntry.cpp.

159 {
160 if ( nam.front() != SEPARATOR ) nam.insert(0,1,SEPARATOR);
161 // if this object is already present, this is an error....
162 auto not_present = std::none_of( std::begin(m_store), std::end(m_store),
163 [&](IRegistry* i) { return nam == i->name();
164 } );
165 return not_present ? new RegistryEntry( std::move(nam), this ) : nullptr;
166 }
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:41
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:64
DataSvcHelpers::RegistryEntry::RegistryEntry
RegistryEntry(std::string path, RegistryEntry *parent=nullptr)
Standard Constructor.
Definition: RegistryEntry.cpp:44
ana.i
list i
Definition: ana.py:128

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

228 {
229 auto i = std::find(m_store.begin(),m_store.end(),obj);
230 return (i!=m_store.end()) ? (*i) : nullptr;
231 }
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:64
ana.i
list i
Definition: ana.py:128

DataSvcHelpers::RegistryEntry * DataSvcHelpers::RegistryEntry::i_find | ( | boost::string_ref | path | ) | const
| private

Internal method to retrieve data directory.

Find identified leaf in this registry node.

Definition at line 234 of file RegistryEntry.cpp.

234 {
235 if ( path.front() == SEPARATOR ) path.remove_prefix(1); // strip leading '/', if present
236 while (!path.empty()) {
237 // check that the chars of path prior to / are the same as regEnt->name()
238 // (i.e. match { nam:"/Ab" path:"/Ab/C"}
239 // but not { nam:"/Abc" path:"/Ab/C"})
240 auto loc1 = path.find(SEPARATOR);
241 auto cpath = path.substr(0,loc1);
242 if (loc1 != boost::string_ref::npos) {
243 path.remove_prefix(loc1+1);
244 } else {
245 path.clear();
246 }
247 auto i = std::find_if( std::begin(m_store), std::end(m_store),
248 [&](decltype(m_store)::const_reference reg) {
249 return cpath == boost::string_ref{reg->name()}.substr(1);
250 });
251 if ( i!=std::end(m_store) ) {
252 RegistryEntry* regEnt = CAST_REGENTRY(RegistryEntry*, *i);
253 return path.empty() ? regEnt : regEnt->i_find(path);
254 }
255 // If this node is "/NodeA", this part allows to find "/NodeA/NodeB" as
256 // our "/NodeB" child.
257 if ( cpath != boost::string_ref{m_path}.substr(1) ) break;
258 }
259 return nullptr;
260 }
std::string::empty
T empty(T...args)
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:41
std::string::front
T front(T...args)
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: RegistryEntry.cpp:39
std::end
T end(T...args)
std::string::clear
T clear(T...args)
Gaudi::Utils::Histos::path
GAUDI_API std::string path(const AIDA::IBaseHistogram *aida)
get the path in THS for AIDA histogram
Definition: HistoTableFormat.cpp:191
std::string::find
T find(T...args)
std::begin
T begin(T...args)
DataSvcHelpers::RegistryEntry::m_store
Store m_store
Store of leaves.
Definition: RegistryEntry.h:64
DataSvcHelpers::RegistryEntry::RegistryEntry
RegistryEntry(std::string path, RegistryEntry *parent=nullptr)
Standard Constructor.
Definition: RegistryEntry.cpp:44
DataSvcHelpers::RegistryEntry::m_path
std::string m_path
Path name.
Definition: RegistryEntry.h:54
std::string::substr
T substr(T...args)
ana.i
list i
Definition: ana.py:128

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

263 {
264 if ( key ) {
265 if ( key == m_pObject ) {
266 return const_cast<RegistryEntry*>(this);
267 }
268 // Look in the immediate level:
269 RegistryEntry *result = CAST_REGENTRY(RegistryEntry*, i_find(key->registry()));
270 if ( result ) return result;
271 // Go levels down
272 for (const auto& i : m_store) {
273 try {
274 const RegistryEntry *entry = CAST_REGENTRY(RegistryEntry*, i);
275 result = entry->i_find(key);
276 if( result ) return result;
277 }
278 catch ( ... ) { }
279 }
280 }
281 return nullptr;
282 }
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: RegistryEntry.cpp:39
DataSvcHelpers::RegistryEntry::m_pObject
DataObject * m_pObject
Pointer to object.
Definition: RegistryEntry.h:60
DataSvcHelpers::RegistryEntry::m_store
Store m_store
Store of leaves.
Definition: RegistryEntry.h:64
DataSvcHelpers::RegistryEntry::RegistryEntry
RegistryEntry(std::string path, RegistryEntry *parent=nullptr)
Standard Constructor.
Definition: RegistryEntry.cpp:44
ana.i
list i
Definition: ana.py:128
DataSvcHelpers::RegistryEntry::i_find
IRegistry * i_find(const IRegistry *pDirectory) const
Internal method to retrieve data directory.
Definition: RegistryEntry.cpp:228

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

Full identifier (or key)

Implements IRegistry.

Definition at line 126 of file RegistryEntry.h.

126 {
127 return m_fullpath;
128 }
DataSvcHelpers::RegistryEntry::m_fullpath
std::string m_fullpath
String containing full path of the object (volatile)
Definition: RegistryEntry.h:52

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

Simple check if the Container is empty.

Definition at line 158 of file RegistryEntry.h.

158 {
159 return m_store.size() == 0;
160 }
std::vector::size
T size(T...args)
DataSvcHelpers::RegistryEntry::m_store
Store m_store
Store of leaves.
Definition: RegistryEntry.h:64

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

Is the link soft or hard.

Definition at line 146 of file RegistryEntry.h.

146 {
147 return m_isSoft;
148 }
DataSvcHelpers::RegistryEntry::m_isSoft
bool m_isSoft
Is the link soft or hard?
Definition: RegistryEntry.h:50

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

Access the leaves of the object.

Definition at line 150 of file RegistryEntry.h.

150 {
151 return m_store;
152 }
DataSvcHelpers::RegistryEntry::m_store
Store m_store
Store of leaves.
Definition: RegistryEntry.h:64

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

Initialize link as hard link.

Create hard link.

Definition at line 98 of file RegistryEntry.cpp.

98 {
99 makeSoft(pObject);
100 m_isSoft = false;
101 if ( m_pObject ) m_pObject->setRegistry(this);
102 if ( m_pAddress ) m_pAddress->setRegistry(this);
103 }
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:58
DataSvcHelpers::RegistryEntry::makeSoft
void makeSoft(DataObject *pObject)
Initialize link as soft link.
Definition: RegistryEntry.cpp:83
DataSvcHelpers::RegistryEntry::m_isSoft
bool m_isSoft
Is the link soft or hard?
Definition: RegistryEntry.h:50
DataSvcHelpers::RegistryEntry::m_pObject
DataObject * m_pObject
Pointer to object.
Definition: RegistryEntry.h:60
IOpaqueAddress::setRegistry
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 106 of file RegistryEntry.cpp.

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

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

Initialize link as soft link.

Create soft link.

Definition at line 83 of file RegistryEntry.cpp.

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

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

Initialize link as soft link.

Create soft link.

Definition at line 92 of file RegistryEntry.cpp.

92 {
93 m_isSoft = true;
94 setAddress(pAddress);
95 }
DataSvcHelpers::RegistryEntry::setAddress
void setAddress(IOpaqueAddress *pAddress) override
Set/Update Opaque address.
Definition: RegistryEntry.cpp:112
DataSvcHelpers::RegistryEntry::m_isSoft
bool m_isSoft
Is the link soft or hard?
Definition: RegistryEntry.h:50

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

Retrieve name of the entry.

Implements IRegistry.

Definition at line 122 of file RegistryEntry.h.

122 {
123 return m_path;
124 }
DataSvcHelpers::RegistryEntry::m_path
std::string m_path
Path name.
Definition: RegistryEntry.h:54

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

Retrive object behind the link.

Implements IRegistry.

Definition at line 134 of file RegistryEntry.h.

134 {
135 return m_pObject;
136 }
DataSvcHelpers::RegistryEntry::m_pObject
DataObject * m_pObject
Pointer to object.
Definition: RegistryEntry.h:60

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

Pointer to parent directory entry.

Definition at line 142 of file RegistryEntry.h.

142 {
143 return m_pParent;
144 }
DataSvcHelpers::RegistryEntry::m_pParent
RegistryEntry * m_pParent
Pointer to parent.
Definition: RegistryEntry.h:56

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

Pointer to parent registry entry.

Definition at line 91 of file RegistryEntry.h.

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

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

IInterface implementation: Reference the object.

Release entry.

Implements IRegistry.

Definition at line 69 of file RegistryEntry.cpp.

69 {
70 unsigned long cnt = --m_refCount;
71 if ( !m_refCount ) delete this;
72 return cnt;
73 }
DataSvcHelpers::RegistryEntry::m_refCount
unsigned long m_refCount
Reference counter.
Definition: RegistryEntry.h:48

long DataSvcHelpers::RegistryEntry::remove | ( | const std::string & | name | ) |
| virtual

Remove an entry from the store.

Remove entry from data store.

Definition at line 146 of file RegistryEntry.cpp.

146 {
147 if ( nam.front() != SEPARATOR ) return remove( SEPARATOR+nam );
148 // if this object is already present, this is an error....
149 for (auto& i : m_store ) {
150 if ( nam == i->name() ) {
151 remove(i);
152 return StatusCode::SUCCESS;
153 }
154 }
155 return StatusCode::FAILURE;
156 }
SEPARATOR
constexpr char SEPARATOR
Definition: RegistryEntry.cpp:41
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::SUCCESS
Definition: StatusCode.h:30
DataSvcHelpers::RegistryEntry::m_store
Store m_store
Store of leaves.
Definition: RegistryEntry.h:64
ana.i
list i
Definition: ana.py:128

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

Remove an object from the container.

Definition at line 132 of file RegistryEntry.cpp.

132 {
133 try {
134 RegistryEntry* pEntry = dynamic_cast<RegistryEntry*>(obj);
135 auto i = std::remove(std::begin(m_store), std::end(m_store), pEntry);
136 if (i != std::end(m_store)) {
137 pEntry->release();
138 m_store.erase( i, std::end(m_store) );
139 }
140 }
141 catch ( ... ) { }
142 return m_store.size();
143 }
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:64
DataSvcHelpers::RegistryEntry::RegistryEntry
RegistryEntry(std::string path, RegistryEntry *parent=nullptr)
Standard Constructor.
Definition: RegistryEntry.cpp:44
ana.i
list i
Definition: ana.py:128

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

Set/Update Opaque address.

Update Opaque address of registry entry.

Implements IRegistry.

Definition at line 112 of file RegistryEntry.cpp.

112 {
113 if ( pAddress ) {
114 pAddress->addRef();
115 pAddress->setRegistry(this);
116 }
117 if ( m_pAddress ) m_pAddress->release();
118 m_pAddress = pAddress;
119 }
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:58
IOpaqueAddress::setRegistry
virtual void setRegistry(IRegistry *r)=0
Update directory pointer.
IOpaqueAddress::addRef
virtual unsigned long addRef()=0
Add reference to object.

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

Set the transient data store.

Definition at line 87 of file RegistryEntry.h.

87 {
88 m_pDataProviderSvc = s;
89 }
DataSvcHelpers::RegistryEntry::m_pDataProviderSvc
IDataProviderSvc * m_pDataProviderSvc
Pointer to hosting transient store.
Definition: RegistryEntry.h:62
gaudirun.s
string s
Definition: gaudirun.py:245

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

Set/Update object address.

Set object pointer of data store item.

Definition at line 122 of file RegistryEntry.cpp.

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

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

Set new parent pointer.

Definition at line 76 of file RegistryEntry.cpp.

76 {
77 m_pParent = pParent;
78 m_fullpath.clear();
79 assemblePath(m_fullpath);
80 }
DataSvcHelpers::RegistryEntry::m_pParent
RegistryEntry * m_pParent
Pointer to parent.
Definition: RegistryEntry.h:56
DataSvcHelpers::RegistryEntry::m_fullpath
std::string m_fullpath
String containing full path of the object (volatile)
Definition: RegistryEntry.h:52
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:303
std::string::clear
T clear(T...args)

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

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

Definition at line 154 of file RegistryEntry.h.

154 {
155 return m_store.size();
156 }
std::vector::size
T size(T...args)
DataSvcHelpers::RegistryEntry::m_store
Store m_store
Store of leaves.
Definition: RegistryEntry.h:64

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

traverse data tree

Definition at line 285 of file RegistryEntry.cpp.

285 {
286 bool go_down = pAgent->analyse(this, level);
287 long status = StatusCode::SUCCESS;
288 if ( go_down ) {
289 for ( auto& i : m_store ) {
290 try {
291 RegistryEntry* entry = CAST_REGENTRY(RegistryEntry*, i);
292 entry->traverseTree(pAgent, level+1);
293 }
294 catch (...) {
295 status = StatusCode::FAILURE;
296 }
297 }
298 }
299 return status;
300 }
IDataStoreAgent::analyse
virtual bool analyse(IRegistry *pObject, int level)=0
Analyse the data object.
CAST_REGENTRY
#define CAST_REGENTRY(x, y)
Definition: RegistryEntry.cpp:39
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::SUCCESS
Definition: StatusCode.h:30
DataSvcHelpers::RegistryEntry::m_store
Store m_store
Store of leaves.
Definition: RegistryEntry.h:64
DataSvcHelpers::RegistryEntry::RegistryEntry
RegistryEntry(std::string path, RegistryEntry *parent=nullptr)
Standard Constructor.
Definition: RegistryEntry.cpp:44
gaudirun.level
level
Definition: gaudirun.py:261
ana.i
list i
Definition: ana.py:128

## Friends And Related Function Documentation

friend class ::DataSvc
| friend

Definition at line 41 of file RegistryEntry.h.

friend class ::TsDataSvc
| friend

Definition at line 43 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 52 of file RegistryEntry.h.

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

Is the link soft or hard?

Definition at line 50 of file RegistryEntry.h.

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

Pointer to opaque address (load info)

Definition at line 58 of file RegistryEntry.h.

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

Path name.

Definition at line 54 of file RegistryEntry.h.

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

Pointer to hosting transient store.

Definition at line 62 of file RegistryEntry.h.

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

Pointer to object.

Definition at line 60 of file RegistryEntry.h.

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

Pointer to parent.

Definition at line 56 of file RegistryEntry.h.

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

Reference counter.

Definition at line 48 of file RegistryEntry.h.

Store DataSvcHelpers::RegistryEntry::m_store
| private

Store of leaves.

Definition at line 64 of file RegistryEntry.h.

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

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