All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DataSvcHelpers::RegistryEntry Class Reference

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

#include <GaudiKernel/RegistryEntry.h>

Inheritance diagram for DataSvcHelpers::RegistryEntry:
Collaboration diagram for DataSvcHelpers::RegistryEntry:

Public Types

typedef Store::const_iterator Iterator
 Iterator definition.
 
typedef Store::const_iterator Iterator
 Iterator definition.
 
- Public Types inherited from IRegistry
typedef std::string name_type
 Type definitions Name type.
 
typedef std::string id_type
 Identifier Key type.
 
typedef std::string name_type
 Type definitions Name type.
 
typedef std::string id_type
 Identifier Key type.
 

Public Member Functions

 RegistryEntry (std::string path, RegistryEntry *parent=0)
 Standard Constructor.
 
virtual ~RegistryEntry ()
 Standard Destructor.
 
virtual unsigned long release ()
 IInterface implementation: Reference the object.
 
virtual unsigned long addRef ()
 IInterface implementation: Dereference the object.
 
const std::string & name () const
 Retrieve name of the entry.
 
virtual const std::string & identifier () const
 Full identifier (or key)
 
virtual IDataProviderSvcdataSvc () const
 Retrieve pointer to Transient Store.
 
virtual DataObjectobject () const
 Retrive object behind the link.
 
virtual IOpaqueAddressaddress () const
 Retrieve opaque storage address.
 
virtual IRegistryparent () const
 Pointer to parent directory entry.
 
virtual bool isSoft () const
 Is the link soft or hard.
 
const Storeleaves () const
 Access the leaves of the object.
 
virtual int size () const
 Return the size of the container(=number of objects)
 
virtual bool isEmpty () const
 Simple check if the Container is empty.
 
virtual Iterator begin () const
 Return starting point for container iteration.
 
virtual Iterator end () const
 Return end elemtn if the container.
 
virtual IRegistryfind (const IRegistry *obj) const
 Try to find an object identified by its pointer.
 
virtual IRegistryfind (const std::string &path) const
 Try to find an object identified by its relative name to the directory.
 
void setAddress (IOpaqueAddress *pAddress)
 Set/Update Opaque address.
 
void setObject (DataObject *obj)
 Set/Update object address.
 
virtual long add (const std::string &name, DataObject *pObject, bool is_soft=false)
 Add entry to data store.
 
virtual long add (const std::string &name, IOpaqueAddress *pAddress, bool is_soft=false)
 Add entry to data store.
 
virtual long remove (const std::string &name)
 Remove an entry from the store.
 
virtual long add (IRegistry *obj)
 Add object to the container.
 
virtual long remove (IRegistry *obj)
 Remove an object from the container.
 
virtual long deleteElements ()
 Delete all contained elements.
 
virtual long traverseTree (IDataStoreAgent *pAgent, int level=0)
 traverse data tree
 
 RegistryEntry (std::string path, RegistryEntry *parent=0)
 Standard Constructor.
 
virtual ~RegistryEntry ()
 Standard Destructor.
 
virtual unsigned long release ()
 IInterface implementation: Reference the object.
 
virtual unsigned long addRef ()
 IInterface implementation: Dereference the object.
 
const std::string & name () const
 Retrieve name of the entry.
 
virtual const std::string & identifier () const
 Full identifier (or key)
 
virtual IDataProviderSvcdataSvc () const
 Retrieve pointer to Transient Store.
 
virtual DataObjectobject () const
 Retrive object behind the link.
 
virtual IOpaqueAddressaddress () const
 Retrieve opaque storage address.
 
virtual IRegistryparent () const
 Pointer to parent directory entry.
 
virtual bool isSoft () const
 Is the link soft or hard.
 
const Storeleaves () const
 Access the leaves of the object.
 
virtual int size () const
 Return the size of the container(=number of objects)
 
virtual bool isEmpty () const
 Simple check if the Container is empty.
 
virtual Iterator begin () const
 Return starting point for container iteration.
 
virtual Iterator end () const
 Return end elemtn if the container.
 
virtual IRegistryfind (const IRegistry *obj) const
 Try to find an object identified by its pointer.
 
virtual IRegistryfind (const std::string &path) const
 Try to find an object identified by its relative name to the directory.
 
void setAddress (IOpaqueAddress *pAddress)
 Set/Update Opaque address.
 
void setObject (DataObject *obj)
 Set/Update object address.
 
virtual long add (const std::string &name, DataObject *pObject, bool is_soft=false)
 Add entry to data store.
 
virtual long add (const std::string &name, IOpaqueAddress *pAddress, bool is_soft=false)
 Add entry to data store.
 
virtual long remove (const std::string &name)
 Remove an entry from the store.
 
virtual long add (IRegistry *obj)
 Add object to the container.
 
virtual long remove (IRegistry *obj)
 Remove an object from the container.
 
virtual long deleteElements ()
 Delete all contained elements.
 
virtual long traverseTree (IDataStoreAgent *pAgent, int level=0)
 traverse data tree
 
- Public Member Functions inherited from IRegistry
virtual ~IRegistry ()
 destructor
 
virtual ~IRegistry ()
 destructor
 

Private Types

typedef std::vector< IRegistry * > Store
 Definition of datastore type.
 
typedef std::vector< IRegistry * > Store
 Definition of datastore type.
 

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.
 
IRegistryi_find (const IRegistry *pDirectory) const
 Internal method to retrieve data directory.
 
RegistryEntryi_find (boost::string_ref path) const
 Internal method to retrieve data directory.
 
RegistryEntryi_find (const DataObject *pObject) const
 Internal method to locate object entry.
 
RegistryEntryi_create (std::string name)
 Internal method to create entries.
 
long i_add (RegistryEntry *entry)
 Internal method to add entries.
 
void setParent (RegistryEntry *pParent)
 Set new parent pointer.
 
void setDataSvc (IDataProviderSvc *s)
 Set the transient data store.
 
virtual RegistryEntryparentEntry ()
 Pointer to parent registry entry.
 
RegistryEntryfindLeaf (boost::string_ref path) const
 Find identified leaf in this registry node.
 
RegistryEntryfindLeaf (const DataObject *key) const
 Find identified leaf in this registry node.
 
void makeHard (DataObject *pObject)
 Initialize link as hard link.
 
void makeHard (IOpaqueAddress *pAddress)
 Initialize link as hard link.
 
void makeSoft (DataObject *pObject)
 Initialize link as soft link.
 
void makeSoft (IOpaqueAddress *pAddress)
 Initialize link as soft link.
 
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.
 
IRegistryi_find (const IRegistry *pDirectory) const
 Internal method to retrieve data directory.
 
RegistryEntryi_find (boost::string_ref path) const
 Internal method to retrieve data directory.
 
RegistryEntryi_find (const DataObject *pObject) const
 Internal method to locate object entry.
 
RegistryEntryi_create (std::string name)
 Internal method to create entries.
 
long i_add (RegistryEntry *entry)
 Internal method to add entries.
 
void setParent (RegistryEntry *pParent)
 Set new parent pointer.
 
void setDataSvc (IDataProviderSvc *s)
 Set the transient data store.
 
virtual RegistryEntryparentEntry ()
 Pointer to parent registry entry.
 
RegistryEntryfindLeaf (boost::string_ref path) const
 Find identified leaf in this registry node.
 
RegistryEntryfindLeaf (const DataObject *key) const
 Find identified leaf in this registry node.
 
void makeHard (DataObject *pObject)
 Initialize link as hard link.
 
void makeHard (IOpaqueAddress *pAddress)
 Initialize link as hard link.
 
void makeSoft (DataObject *pObject)
 Initialize link as soft link.
 
void makeSoft (IOpaqueAddress *pAddress)
 Initialize link as soft link.
 

Private Attributes

unsigned long m_refCount
 Reference counter.
 
bool m_isSoft
 Is the link soft or hard?
 
std::string m_fullpath
 String containing full path of the object (volatile)
 
std::string m_path
 Path name.
 
RegistryEntrym_pParent
 Pointer to parent.
 
IOpaqueAddressm_pAddress
 Pointer to opaque address (load info)
 
DataObjectm_pObject
 Pointer to object.
 
IDataProviderSvcm_pDataProviderSvc
 Pointer to hosting transient store.
 
Store m_store
 Store of leaves.
 

Friends

class ::DataSvc
 

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

Member Typedef Documentation

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

Iterator definition.

Definition at line 42 of file RegistryEntry.h.

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

Iterator definition.

Definition at line 42 of file RegistryEntry.h.

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

Definition of datastore type.

Definition at line 38 of file RegistryEntry.h.

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

Definition of datastore type.

Definition at line 38 of file RegistryEntry.h.

Constructor & Destructor Documentation

DataSvcHelpers::RegistryEntry::RegistryEntry ( std::string  path,
RegistryEntry parent = 0 
)

Standard Constructor.

Definition at line 50 of file RegistryEntry.cpp.

m_isSoft(false),
m_path(std::move(path)),
m_pAddress(nullptr),
m_pObject(nullptr),
{
std::string::size_type sep = m_path.rfind(SEPARATOR);
if ( m_path.front() != SEPARATOR ) m_path.insert(0,1,SEPARATOR);
if ( sep != std::string::npos ) m_path.erase(0,sep);
addRef();
}
DataSvcHelpers::RegistryEntry::~RegistryEntry ( )
virtual

Standard Destructor.

Standard destructor.

Definition at line 67 of file RegistryEntry.cpp.

{
if ( m_pObject ) {
if ( !m_isSoft ) m_pObject->setRegistry(nullptr);
}
if ( m_pAddress ) {
if ( !m_isSoft ) m_pAddress->setRegistry(nullptr);
}
}
DataSvcHelpers::RegistryEntry::RegistryEntry ( std::string  path,
RegistryEntry parent = 0 
)

Standard Constructor.

virtual DataSvcHelpers::RegistryEntry::~RegistryEntry ( )
virtual

Standard Destructor.

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.

Definition at line 208 of file RegistryEntry.cpp.

{
if ( !entry ) return StatusCode::FAILURE;
( is_soft ) ? entry->makeSoft(pObject) : entry->makeHard(pObject);
i_add( entry );
}
virtual long DataSvcHelpers::RegistryEntry::add ( const std::string &  name,
DataObject pObject,
bool  is_soft = false 
)
virtual

Add entry to data store.

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.

Definition at line 217 of file RegistryEntry.cpp.

{
if ( !entry ) return StatusCode::FAILURE;
( is_soft ) ? entry->makeSoft(pAddress) : entry->makeHard(pAddress);
i_add( entry );
}
virtual long DataSvcHelpers::RegistryEntry::add ( const std::string &  name,
IOpaqueAddress pAddress,
bool  is_soft = false 
)
virtual

Add entry to data store.

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

Add object to the container.

Definition at line 180 of file RegistryEntry.cpp.

{
return i_add(pEntry);
}
virtual long DataSvcHelpers::RegistryEntry::add ( IRegistry obj)
virtual

Add object to the container.

virtual unsigned long DataSvcHelpers::RegistryEntry::addRef ( )
inlinevirtual

IInterface implementation: Dereference the object.

Implements IRegistry.

Definition at line 115 of file RegistryEntry.h.

{
return ++m_refCount;
}
virtual unsigned long DataSvcHelpers::RegistryEntry::addRef ( )
inlinevirtual

IInterface implementation: Dereference the object.

Implements IRegistry.

Definition at line 115 of file RegistryEntry.h.

{
return ++m_refCount;
}
virtual IOpaqueAddress* DataSvcHelpers::RegistryEntry::address ( ) const
inlinevirtual

Retrieve opaque storage address.

Implements IRegistry.

Definition at line 135 of file RegistryEntry.h.

{
return m_pAddress;
}
virtual IOpaqueAddress* DataSvcHelpers::RegistryEntry::address ( void  ) const
inlinevirtual

Retrieve opaque storage address.

Implements IRegistry.

Definition at line 135 of file RegistryEntry.h.

{
return m_pAddress;
}
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 314 of file RegistryEntry.cpp.

{
if ( m_pParent ) m_pParent->assemblePath(buffer);
buffer += m_path;
}
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

virtual Iterator DataSvcHelpers::RegistryEntry::begin ( ) const
inlinevirtual

Return starting point for container iteration.

Definition at line 159 of file RegistryEntry.h.

{
return m_store.begin();
}
virtual Iterator DataSvcHelpers::RegistryEntry::begin ( ) const
inlinevirtual

Return starting point for container iteration.

Definition at line 159 of file RegistryEntry.h.

{
return m_store.begin();
}
virtual IDataProviderSvc* DataSvcHelpers::RegistryEntry::dataSvc ( ) const
inlinevirtual

Retrieve pointer to Transient Store.

Implements IRegistry.

Definition at line 127 of file RegistryEntry.h.

{
}
virtual IDataProviderSvc* DataSvcHelpers::RegistryEntry::dataSvc ( ) const
inlinevirtual

Retrieve pointer to Transient Store.

Implements IRegistry.

Definition at line 127 of file RegistryEntry.h.

{
}
long DataSvcHelpers::RegistryEntry::deleteElements ( )
virtual

Delete all contained elements.

Delete recursively all elements pending from the current store item.

Definition at line 226 of file RegistryEntry.cpp.

{
for (auto& i : m_store ) {
if ( entry ) {
entry->deleteElements();
entry->release();
}
}
m_store.erase(m_store.begin(), m_store.end());
return 0;
}
virtual long DataSvcHelpers::RegistryEntry::deleteElements ( )
virtual

Delete all contained elements.

virtual Iterator DataSvcHelpers::RegistryEntry::end ( ) const
inlinevirtual

Return end elemtn if the container.

Definition at line 163 of file RegistryEntry.h.

{
return m_store.end();
}
virtual Iterator DataSvcHelpers::RegistryEntry::end ( ) const
inlinevirtual

Return end elemtn if the container.

Definition at line 163 of file RegistryEntry.h.

{
return m_store.end();
}
virtual IRegistry* DataSvcHelpers::RegistryEntry::find ( const IRegistry obj) const
inlinevirtual

Try to find an object identified by its pointer.

Definition at line 167 of file RegistryEntry.h.

{
return i_find(obj);
}
virtual IRegistry* DataSvcHelpers::RegistryEntry::find ( const IRegistry obj) const
inlinevirtual

Try to find an object identified by its pointer.

Definition at line 167 of file RegistryEntry.h.

{
return i_find(obj);
}
virtual IRegistry* DataSvcHelpers::RegistryEntry::find ( const std::string &  path) const
inlinevirtual

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

Definition at line 171 of file RegistryEntry.h.

{
return i_find(path);
}
virtual IRegistry* DataSvcHelpers::RegistryEntry::find ( const std::string &  path) const
inlinevirtual

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

Definition at line 171 of file RegistryEntry.h.

{
return i_find(path);
}
RegistryEntry* DataSvcHelpers::RegistryEntry::findLeaf ( boost::string_ref  path) const
inlineprivate

Find identified leaf in this registry node.

Definition at line 92 of file RegistryEntry.h.

{
return i_find(path);
}
RegistryEntry* DataSvcHelpers::RegistryEntry::findLeaf ( boost::string_ref  path) const
inlineprivate

Find identified leaf in this registry node.

Definition at line 92 of file RegistryEntry.h.

{
return i_find(path);
}
RegistryEntry* DataSvcHelpers::RegistryEntry::findLeaf ( const DataObject key) const
inlineprivate

Find identified leaf in this registry node.

Definition at line 96 of file RegistryEntry.h.

{
return i_find(key);
}
RegistryEntry* DataSvcHelpers::RegistryEntry::findLeaf ( const DataObject key) const
inlineprivate

Find identified leaf in this registry node.

Definition at line 96 of file RegistryEntry.h.

{
return i_find(key);
}
long DataSvcHelpers::RegistryEntry::i_add ( RegistryEntry entry)
private

Internal method to add entries.

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

Internal method to add entries.

Add object to the container.

Definition at line 186 of file RegistryEntry.cpp.

{
//TODO: if this is the sole place where items are added to m_store,
// and we know here that they must be RegisteryEntry, can we
// drop the dynamic_cast every where else???
//TODO: if so, can we also change m_store to be std::vector<RegistryEntry*>
// instead
//TODO: if so, can we not make it std::vector<RegistryEntry> instead?
//TODO: if so, should make sure that a RegistryEntry can be std::move'ed
try {
pEntry->setDataSvc(m_pDataProviderSvc);
m_store.push_back(pEntry);
pEntry->setParent(this);
if ( !pEntry->isSoft() && pEntry->address() ) {
pEntry->address()->setRegistry(pEntry);
}
}
catch ( ... ) {
}
return m_store.size();
}
DataSvcHelpers::RegistryEntry * DataSvcHelpers::RegistryEntry::i_create ( std::string  name)
private

Internal method to create entries.

Internal method to add entries.

Definition at line 170 of file RegistryEntry.cpp.

{
if ( nam.front() != SEPARATOR ) nam.insert(0,1,SEPARATOR);
// if this object is already present, this is an error....
auto not_present = std::none_of( std::begin(m_store), std::end(m_store),
[&](IRegistry* i) { return nam == i->name();
} );
return not_present ? new RegistryEntry( std::move(nam), this ) : nullptr;
}
RegistryEntry* DataSvcHelpers::RegistryEntry::i_create ( std::string  name)
private

Internal method to create entries.

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

{
auto i = std::find(m_store.begin(),m_store.end(),obj);
return (i!=m_store.end()) ? (*i) : nullptr;
}
IRegistry* DataSvcHelpers::RegistryEntry::i_find ( const IRegistry pDirectory) const
private

Internal method to retrieve data directory.

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

Internal method to retrieve data directory.

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

{
if ( path.front() == SEPARATOR ) path.remove_prefix(1); // strip leading '/', if present
while (!path.empty()) {
// check that the chars of path prior to / are the same as regEnt->name()
// (i.e. match { nam:"/Ab" path:"/Ab/C"}
// but not { nam:"/Abc" path:"/Ab/C"})
auto loc1 = path.find(SEPARATOR);
auto cpath = path.substr(0,loc1);
if (loc1 != boost::string_ref::npos) {
path.remove_prefix(loc1+1);
} else {
path.clear();
}
auto i = std::find_if( std::begin(m_store), std::end(m_store),
[&](decltype(m_store)::const_reference reg) {
return cpath == boost::string_ref{reg->name()}.substr(1);
});
if ( i!=std::end(m_store) ) {
return path.empty() ? regEnt : regEnt->i_find(path);
}
// If this node is "/NodeA", this part allows to find "/NodeA/NodeB" as
// our "/NodeB" child.
if ( cpath != boost::string_ref{m_path}.substr(1) ) break;
}
return nullptr;
}
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 274 of file RegistryEntry.cpp.

{
if ( key ) {
if ( key == m_pObject ) {
return const_cast<RegistryEntry*>(this);
}
// Look in the immediate level:
RegistryEntry *result = CAST_REGENTRY(RegistryEntry*, i_find(key->registry()));
if ( result ) return result;
// Go levels down
for (const auto& i : m_store) {
try {
result = entry->i_find(key);
if( result ) return result;
}
catch ( ... ) { }
}
}
return nullptr;
}
RegistryEntry* DataSvcHelpers::RegistryEntry::i_find ( const DataObject pObject) const
private

Internal method to locate object entry.

virtual const std::string& DataSvcHelpers::RegistryEntry::identifier ( ) const
inlinevirtual

Full identifier (or key)

Implements IRegistry.

Definition at line 123 of file RegistryEntry.h.

{
return m_fullpath;
}
virtual const std::string& DataSvcHelpers::RegistryEntry::identifier ( ) const
inlinevirtual

Full identifier (or key)

Implements IRegistry.

Definition at line 123 of file RegistryEntry.h.

{
return m_fullpath;
}
virtual bool DataSvcHelpers::RegistryEntry::isEmpty ( ) const
inlinevirtual

Simple check if the Container is empty.

Definition at line 155 of file RegistryEntry.h.

{
return m_store.size() == 0;
}
virtual bool DataSvcHelpers::RegistryEntry::isEmpty ( ) const
inlinevirtual

Simple check if the Container is empty.

Definition at line 155 of file RegistryEntry.h.

{
return m_store.size() == 0;
}
virtual bool DataSvcHelpers::RegistryEntry::isSoft ( ) const
inlinevirtual

Is the link soft or hard.

Definition at line 143 of file RegistryEntry.h.

{
return m_isSoft;
}
virtual bool DataSvcHelpers::RegistryEntry::isSoft ( ) const
inlinevirtual

Is the link soft or hard.

Definition at line 143 of file RegistryEntry.h.

{
return m_isSoft;
}
const Store& DataSvcHelpers::RegistryEntry::leaves ( ) const
inline

Access the leaves of the object.

Definition at line 147 of file RegistryEntry.h.

{
return m_store;
}
const Store& DataSvcHelpers::RegistryEntry::leaves ( ) const
inline

Access the leaves of the object.

Definition at line 147 of file RegistryEntry.h.

{
return m_store;
}
void DataSvcHelpers::RegistryEntry::makeHard ( DataObject pObject)
private

Initialize link as hard link.

Create hard link.

Definition at line 109 of file RegistryEntry.cpp.

{
makeSoft(pObject);
m_isSoft = false;
}
void DataSvcHelpers::RegistryEntry::makeHard ( DataObject pObject)
private

Initialize link as hard link.

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

Initialize link as hard link.

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

Initialize link as hard link.

Create hard link.

Definition at line 117 of file RegistryEntry.cpp.

{
m_isSoft = false;
setAddress(pAddress);
}
void DataSvcHelpers::RegistryEntry::makeSoft ( DataObject pObject)
private

Initialize link as soft link.

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

Initialize link as soft link.

Create soft link.

Definition at line 94 of file RegistryEntry.cpp.

{
m_isSoft = true;
setObject(pObject);
// if ( 0 != m_pObject ) { // Useless: This justs sets my own address again...
// setAddress(m_pObject->address());
// }
}
void DataSvcHelpers::RegistryEntry::makeSoft ( IOpaqueAddress pAddress)
private

Initialize link as soft link.

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

Initialize link as soft link.

Create soft link.

Definition at line 103 of file RegistryEntry.cpp.

{
m_isSoft = true;
setAddress(pAddress);
}
const std::string& DataSvcHelpers::RegistryEntry::name ( ) const
inlinevirtual

Retrieve name of the entry.

Implements IRegistry.

Definition at line 119 of file RegistryEntry.h.

{
return m_path;
}
const std::string& DataSvcHelpers::RegistryEntry::name ( ) const
inlinevirtual

Retrieve name of the entry.

Implements IRegistry.

Definition at line 119 of file RegistryEntry.h.

{
return m_path;
}
virtual DataObject* DataSvcHelpers::RegistryEntry::object ( ) const
inlinevirtual

Retrive object behind the link.

Implements IRegistry.

Definition at line 131 of file RegistryEntry.h.

{
return m_pObject;
}
virtual DataObject* DataSvcHelpers::RegistryEntry::object ( ) const
inlinevirtual

Retrive object behind the link.

Implements IRegistry.

Definition at line 131 of file RegistryEntry.h.

{
return m_pObject;
}
virtual IRegistry* DataSvcHelpers::RegistryEntry::parent ( ) const
inlinevirtual

Pointer to parent directory entry.

Definition at line 139 of file RegistryEntry.h.

{
return m_pParent;
}
virtual IRegistry* DataSvcHelpers::RegistryEntry::parent ( void  ) const
inlinevirtual

Pointer to parent directory entry.

Definition at line 139 of file RegistryEntry.h.

{
return m_pParent;
}
virtual RegistryEntry* DataSvcHelpers::RegistryEntry::parentEntry ( )
inlineprivatevirtual

Pointer to parent registry entry.

Definition at line 88 of file RegistryEntry.h.

{
return m_pParent;
}
virtual RegistryEntry* DataSvcHelpers::RegistryEntry::parentEntry ( )
inlineprivatevirtual

Pointer to parent registry entry.

Definition at line 88 of file RegistryEntry.h.

{
return m_pParent;
}
virtual unsigned long DataSvcHelpers::RegistryEntry::release ( )
virtual

IInterface implementation: Reference the object.

Implements IRegistry.

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

IInterface implementation: Reference the object.

Release entry.

Implements IRegistry.

Definition at line 80 of file RegistryEntry.cpp.

{
unsigned long cnt = --m_refCount;
if ( !m_refCount ) delete this;
return cnt;
}
long DataSvcHelpers::RegistryEntry::remove ( const std::string &  name)
virtual

Remove an entry from the store.

Remove entry from data store.

Definition at line 157 of file RegistryEntry.cpp.

{
if ( nam.front() != SEPARATOR ) return remove( SEPARATOR+nam );
// if this object is already present, this is an error....
for (auto& i : m_store ) {
if ( nam == i->name() ) {
remove(i);
}
}
}
virtual long DataSvcHelpers::RegistryEntry::remove ( const std::string &  name)
virtual

Remove an entry from the store.

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

Remove an object from the container.

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

Remove an object from the container.

Definition at line 143 of file RegistryEntry.cpp.

{
try {
RegistryEntry* pEntry = dynamic_cast<RegistryEntry*>(obj);
auto i = std::remove(std::begin(m_store), std::end(m_store), pEntry);
if (i != std::end(m_store)) {
pEntry->release();
m_store.erase( i, std::end(m_store) );
}
}
catch ( ... ) { }
return m_store.size();
}
void DataSvcHelpers::RegistryEntry::setAddress ( IOpaqueAddress pAddress)
virtual

Set/Update Opaque address.

Update Opaque address of registry entry.

Implements IRegistry.

Definition at line 123 of file RegistryEntry.cpp.

{
if ( pAddress ) {
pAddress->addRef();
pAddress->setRegistry(this);
}
m_pAddress = pAddress;
}
void DataSvcHelpers::RegistryEntry::setAddress ( IOpaqueAddress pAddress)
virtual

Set/Update Opaque address.

Implements IRegistry.

void DataSvcHelpers::RegistryEntry::setDataSvc ( IDataProviderSvc s)
inlineprivate

Set the transient data store.

Definition at line 84 of file RegistryEntry.h.

void DataSvcHelpers::RegistryEntry::setDataSvc ( IDataProviderSvc s)
inlineprivate

Set the transient data store.

Definition at line 84 of file RegistryEntry.h.

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

Set/Update object address.

Set object pointer of data store item.

Definition at line 133 of file RegistryEntry.cpp.

{
if ( pObject ) {
pObject->addRef();
if ( !isSoft() ) pObject->setRegistry(this);
}
m_pObject = pObject;
}
void DataSvcHelpers::RegistryEntry::setObject ( DataObject obj)

Set/Update object address.

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

Set new parent pointer.

Definition at line 87 of file RegistryEntry.cpp.

{
m_pParent = pParent;
m_fullpath = "";
}
void DataSvcHelpers::RegistryEntry::setParent ( RegistryEntry pParent)
private

Set new parent pointer.

virtual int DataSvcHelpers::RegistryEntry::size ( ) const
inlinevirtual

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

Definition at line 151 of file RegistryEntry.h.

{
return m_store.size();
}
virtual int DataSvcHelpers::RegistryEntry::size ( ) const
inlinevirtual

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

Definition at line 151 of file RegistryEntry.h.

{
return m_store.size();
}
long DataSvcHelpers::RegistryEntry::traverseTree ( IDataStoreAgent pAgent,
int  level = 0 
)
virtual

traverse data tree

Definition at line 296 of file RegistryEntry.cpp.

{
bool go_down = pAgent->analyse(this, level);
long status = StatusCode::SUCCESS;
if ( go_down ) {
for ( auto& i : m_store ) {
try {
entry->traverseTree(pAgent, level+1);
}
catch (...) {
}
}
}
return status;
}
virtual long DataSvcHelpers::RegistryEntry::traverseTree ( IDataStoreAgent pAgent,
int  level = 0 
)
virtual

traverse data tree

Friends And Related Function Documentation

friend class ::DataSvc
friend

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

bool DataSvcHelpers::RegistryEntry::m_isSoft
private

Is the link soft or hard?

Definition at line 47 of file RegistryEntry.h.

IOpaqueAddress * DataSvcHelpers::RegistryEntry::m_pAddress
private

Pointer to opaque address (load info)

Definition at line 55 of file RegistryEntry.h.

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

Path name.

Definition at line 51 of file RegistryEntry.h.

IDataProviderSvc * DataSvcHelpers::RegistryEntry::m_pDataProviderSvc
private

Pointer to hosting transient store.

Definition at line 59 of file RegistryEntry.h.

DataObject * DataSvcHelpers::RegistryEntry::m_pObject
private

Pointer to object.

Definition at line 57 of file RegistryEntry.h.

RegistryEntry * DataSvcHelpers::RegistryEntry::m_pParent
private

Pointer to parent.

Definition at line 53 of file RegistryEntry.h.

unsigned long DataSvcHelpers::RegistryEntry::m_refCount
private

Reference counter.

Definition at line 45 of file RegistryEntry.h.

Store DataSvcHelpers::RegistryEntry::m_store
private

Store of leaves.

Definition at line 61 of file RegistryEntry.h.


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