19 #define DATASVC_REGISTRYENTRY_CPP 38 #define CAST_REGENTRY( x, y ) dynamic_cast<x>( y ) 44 : m_path(
std::move( path ) ), m_pParent( parent )
48 if ( sep != std::string::npos )
m_path.
erase( 0, sep );
156 if ( nam.front() ==
SEPARATOR ) nam.remove_prefix( 1 );
159 return entry->
name().
compare( 1, std::string::npos, nam.data(), nam.size() ) == 0;
181 return i_add( pEntry );
236 m_store.erase( m_store.begin(), m_store.end() );
244 return ( i !=
m_store.
end() ) ? ( *i ) :
nullptr;
250 if ( path.front() ==
SEPARATOR ) path.remove_prefix( 1 );
251 while ( !path.empty() ) {
256 auto cpath = path.substr( 0, loc1 );
257 if ( loc1 != boost::string_ref::npos ) {
258 path.remove_prefix( loc1 + 1 );
263 [&](
const auto& reg ) {
return cpath == boost::string_ref{reg->name()}.substr( 1 ); } );
266 return path.empty() ? regEnt : regEnt->
i_find( path );
270 if ( cpath != boost::string_ref{
m_path}.
substr( 1 ) )
break;
282 if ( result )
return result;
284 for (
const auto& i :
m_store ) {
287 result = entry->
i_find( key );
288 if ( result )
return result;
299 bool go_down = pAgent->
analyse(
this, level );
constexpr static const auto FAILURE
long deleteElements()
Delete all contained elements.
const std::string & name() const override
Retrieve name of the entry.
StatusCode traverseTree(IDataStoreAgent *pAgent, int level=0)
traverse data tree
virtual bool analyse(IRegistry *pObject, int level)=0
Analyse the data object.
unsigned long addRef() override
IInterface implementation: Dereference the object.
RegistryEntry * m_pParent
Pointer to parent.
~RegistryEntry() override
Standard Destructor.
void setRegistry(IRegistry *pRegistry)
Set pointer to Registry.
unsigned long release() override
IInterface implementation: Reference the object.
#define CAST_REGENTRY(x, y)
virtual const name_type & name() const =0
Name of the directory (or key)
virtual unsigned long release()=0
release reference to object
bool isSoft() const
Is the link soft or hard.
void setAddress(IOpaqueAddress *pAddress) override
Set/Update Opaque address.
IRegistry * registry() const
Get pointer to Registry.
long i_add(RegistryEntry *entry)
Internal method to add entries.
std::string m_fullpath
String containing full path of the object (volatile)
void assemblePath(std::string &buffer) const
The following entries serve two aspects: 1) They are faster for recursive calls, because they are non...
void setParent(RegistryEntry *pParent)
Set new parent pointer.
virtual unsigned long addRef()
Add reference to object.
void setObject(DataObject *obj)
Set/Update object address.
This class is used for returning status codes from appropriate routines.
IDataProviderSvc * m_pDataProviderSvc
Pointer to hosting transient store.
void setDataSvc(IDataProviderSvc *s)
Set the transient data store.
The IRegistry represents the entry door to the environment any data object residing in a transient da...
IOpaqueAddress * address() const override
Retrieve opaque storage address.
IOpaqueAddress * m_pAddress
Pointer to opaque address (load info)
void makeSoft(DataObject *pObject)
Initialize link as soft link.
RegistryEntry * i_create(std::string name)
Internal method to create entries.
bool m_isSoft
Is the link soft or hard?
constexpr static const auto SUCCESS
Definition of an entry in the transient data store.
virtual unsigned long release()
release reference to object
DataObject * m_pObject
Pointer to object.
unsigned long m_refCount
Reference counter.
StatusCode add(std::string name, DataObject *pObject, bool is_soft=false)
Add entry to data store.
Generic data agent interface.
const StatusCode & ignore() const
Ignore/check StatusCode.
Store m_store
Store of leaves.
RegistryEntry(std::string path, RegistryEntry *parent=nullptr)
Standard Constructor.
std::string m_path
Path name.
StatusCode remove(boost::string_ref name)
Remove an entry from the store.
virtual void setRegistry(IRegistry *r)=0
Update directory pointer.
Opaque address interface definition.
A DataObject is the base class of any identifiable object on any data store.
IRegistry * i_find(const IRegistry *pDirectory) const
Internal method to retrieve data directory.
virtual unsigned long addRef()=0
Add reference to object.
void makeHard(DataObject *pObject)
Initialize link as hard link.