|
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");
52 std::vector< std::string >::const_iterator
58 assert( !
item.empty() );
62 std::cout <<
"Folder::decodeItem("<<
item<<
") called" << std::endl;
64 std::string::size_type
sep(
item.rfind(
'#'));
67 if (
sep != std::string::npos) skey =
item.substr(
sep+1);
75 }
else add(clid, skey, checkValid,
false).ignore();
82 if (tn.size() > 0 && tn[tn.size()-1] ==
'!') {
84 tn.erase (tn.end()-1);
91 if (
sc.isSuccess())
sc=
add(clid, skey,
false, exact);
94 log << MSG::WARNING <<
"add: can not find type ["
102 bool checkValid,
bool exact)
105 if ( !checkValid ||
m_pCLIDSvc->isIDInUse(clid) ) {
107 sc = StatusCode::SUCCESS;
108 }
else if (0 != clid) {
110 log << MSG::WARNING <<
"add: can not find clid "
111 << clid <<
" in clid db" <<
endmsg;
113 #ifdef SGFOLDER_DEBUG
114 std::cout <<
"SG::Folder::add(" << clid <<
",\"" << skey <<
"\") returns "
115 << (
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
ServiceHandle< IClassIDSvc > m_pCLIDSvc
StringArrayProperty m_itemList
property: the list of items (data objects identified by a class name/key pair)
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
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