|
ATLAS Offline Software
|
Go to the documentation of this file.
10 #include "GaudiKernel/IMessageSvc.h"
11 #include "GaudiKernel/MsgStream.h"
12 #include "GaudiKernel/ISvcLocator.h"
15 #include "GaudiKernel/IClassIDSvc.h"
28 const std::string&
name,
29 const IInterface*
parent) :
31 m_pCLIDSvc(
"ClassIDSvc",
name),
35 " list of data objects identified by a class name (or clid)#key pairs. One can use '*' as key value to add all objects of a given type to the Folder. If the type name ends with !, then write the object as exactly that type (and not as any derived class). ");
38 "check if item types are known to ClassIDSvc");
50 return StatusCode::SUCCESS;
52 return AthAlgTool::queryInterface( riid, ppvIf );
62 std::vector< std::string >::const_iterator
68 assert( !
item.empty() );
72 std::cout <<
"Folder::decodeItem("<<
item<<
") called" << std::endl;
74 std::string::size_type
sep(
item.rfind(
'#'));
77 if (
sep != std::string::npos) skey =
item.substr(
sep+1);
85 }
else add(clid, skey, checkValid,
false).ignore();
92 if (tn.size() > 0 && tn[tn.size()-1] ==
'!') {
94 tn.erase (tn.end()-1);
101 if (
sc.isSuccess())
sc=
add(clid, skey,
false, exact);
104 log << MSG::WARNING <<
"add: can not find type ["
112 bool checkValid,
bool exact)
115 if ( !checkValid ||
m_pCLIDSvc->isIDInUse(clid) ) {
117 sc = StatusCode::SUCCESS;
118 }
else if (0 != clid) {
120 log << MSG::WARNING <<
"add: can not find clid "
121 << clid <<
" in clid db" <<
endmsg;
123 #ifdef SGFOLDER_DEBUG
124 std::cout <<
"SG::Folder::add(" << clid <<
",\"" << skey <<
"\") returns "
125 << (
sc.isSuccess() ?
"SUCCESS" :
"FAILURE") << std::endl;
a run-time configurable list of data objects
virtual ~Folder() override
virtual void updateItemList(bool checkValidCLID) override final
update contents of the ItemList
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
virtual StatusCode queryInterface(const InterfaceID &, void **) override
Query for a given interface.
ServiceHandle< IClassIDSvc > m_pCLIDSvc
StringArrayProperty m_itemList
property: the list of items (data objects identified by a class name/key pair)
a run-time configurable list of data objects
msgSvc
Provide convenience handles for various services.
a traits class that associates a CLID to a type T It also detects whether T inherits from Gaudi DataO...
Folder(const std::string &type, const std::string &name, const IInterface *parent)
::StatusCode StatusCode
StatusCode definition for legacy code.
void decodeItemList(Gaudi::Details::PropertyBase &)
uint32_t CLID
The Class ID type.
BooleanProperty m_checkItems
property: check if item types are known to ClassIDSvc
virtual StatusCode add(const std::string &typeName, const std::string &skey) override
add a data object identifier to the list.
virtual StatusCode initialize() override
static const InterfaceID & interfaceID()
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
void decodeItem(const std::string &item, bool checkValidCLID)
a Folder item (data object) is identified by the clid/key pair