51 "test access to objects (DataObject and ContainedObject)" };
69 if ( !p )
return "Access FAILED.";
70 std::string result = std::accumulate(
71 std::begin( *p ), std::end( *p ), std::string{}, [&](
const std::string& s,
typename T::const_reference i ) {
72 return s + std::to_string( p->index( i ) ) +
":" + std::to_string( i->clID() ) +
",";
74 return result.substr( 0, result.length() - 2 );
80 for (
size_t j = 1; j < flg.size(); j++ ) {
81 if ( !flg[j - 1] && flg[j] )
88 log <<
"+--> " << pReg->
name();
90 log <<
" [Address: CLID=" << std::showbase << std::hex << pReg->
address()->
clID()
93 log <<
" [No Address]";
100 log <<
" " << typ.substr( 0, 32 );
101 }
catch ( ... ) { log <<
"Access test FAILED"; }
103 log <<
" (Unloaded) ";
108 int numObj = base->numberOfObjects();
110 log <<
" [" << numObj <<
"]";
114 case CLID_ObjectList >> 16:
117 case CLID_ObjectVector >> 16:
120 case ( CLID_ObjectVector + 0x00030000 ) >> 16:
123 case ( CLID_ObjectVector + 0x00040000 ) >> 16:
126 case ( CLID_ObjectVector + 0x00050000 ) >> 16:
131 }
catch ( ... ) { log <<
"Access test FAILED"; }
141 std::vector<IRegistry*> leaves;
142 StatusCode sc = mgr->objectLeaves( pObj, leaves );
143 const std::string* par0 =
nullptr;
146 for (
auto i = leaves.begin(); i != leaves.end(); i++ ) {
147 const std::string&
id = ( *i )->identifier();
151 const std::string* par1 = ( *i )->address()->par();
152 if ( par1 && par0[0] != par1[0] )
continue;
162 flg.push_back( i + 1 == leaves.end() );
167 flg.push_back( i + 1 == leaves.end() );
187 error() <<
"Failed to retrieve IDataManagerSvc interface." <<
endmsg;
205 std::string store_name =
"Unknown";
209 if ( isvc ) store_name = isvc->name();
211 info() <<
"========= " <<
m_rootName <<
"[" << std::showbase << std::hex << (
unsigned long)root.ptr() << std::dec
212 <<
"@" << store_name <<
"]:" <<
endmsg;
213 std::vector<bool> flg( 1,
true );
214 explore( root->registry(), flg );
219 error() <<
"Cannot retrieve \"/Event\"!" <<
endmsg;
unsigned int CLID
Class ID definition.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
#define DECLARE_COMPONENT(type)
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
A DataObject is the base class of any identifiable object on any data store.
virtual const CLID & clID() const
Retrieve reference to class definition structure.
SmartIF< IDataProviderSvc > & eventSvc() const
The standard event data service.
Algorithm(std::string name, ISvcLocator *svcloc, std::string version=PACKAGE_VERSION)
Constructor.
SmartIF< IService > service(std::string_view name, const bool createIf=true, const bool quiet=false) const
Return a pointer to the service identified by name (or "type/name")
Implementation of property with value of concrete type.
virtual StatusCode retrieveObject(IRegistry *pDirectory, std::string_view path, DataObject *&pObject)=0
Retrieve object identified by its directory entry.
virtual StatusCode findObject(IRegistry *pDirectory, std::string_view path, DataObject *&pObject)=0
Find object identified by its directory entry.
virtual long svcType() const =0
Retrieve service type.
virtual const CLID & clID() const =0
Retrieve class information from link.
virtual const std::string * par() const =0
Retrieve String parameters.
The IRegistry represents the entry door to the environment any data object residing in a transient da...
virtual const name_type & name() const =0
Name of the directory (or key)
virtual DataObject * object() const =0
Retrieve object behind the link.
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
virtual IDataProviderSvc * dataSvc() const =0
Retrieve pointer to Transient Store.
template class KeyedContainer, KeyedContainer.h
Definition of the templated KeyedObject class.
ObjectContainerBase is the base class for Gaudi container classes.
ObjectList is one of the basic Gaudi container classes capable of being registered in Data Stores.
ObjectVector is one of the basic Gaudi container classes capable of being registered in Data Stores.
A small class used to access easily (and efficiently) data items residing in data stores.
Small smart pointer class with automatic reference counting for IInterface.
SmartIF< IFace > as() const
return a new SmartIF instance to another interface
This class is used for returning status codes from appropriate routines.
constexpr static const auto SUCCESS
constexpr static const auto FAILURE
Small algorith, which traverses the data store and prints generic information about all leaves,...
Gaudi::Property< std::string > m_dataSvcName
StatusCode execute() override
Execute procedure.
SmartIF< IDataProviderSvc > m_dataSvc
Reference to data provider service.
StatusCode initialize() override
Initialize.
Gaudi::Property< bool > m_testAccess
void explore(IRegistry *pObj, std::vector< bool > &flg)
void printObj(IRegistry *pReg, std::vector< bool > &flg)
Print datastore leaf.
Gaudi::Property< long > m_printMissing
Gaudi::Property< bool > m_accessForeign
long m_total
Internal counter to trigger printouts.
std::string m_rootName
Name of the root leaf (obtained at initialize)
StatusCode finalize() override
Finalize.
Gaudi::Property< long > m_print
long m_frqPrint
Internal counter to adjust printout frequency.
Gaudi::Property< bool > m_exploreRelations
Gaudi::Property< double > m_frequency
Gaudi::Property< bool > m_load
KeyedObjectManager< hashmap > HashMap
Forward declaration of specialized std::hashmap-like object manager.
KeyedObjectManager< map > Map
Forward declaration of specialized std::map-like object manager.
KeyedObjectManager< array > Array
Forward declaration of specialized redirection array object manager.
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.