5 #include <boost/tokenizer.hpp>
6 #include <boost/algorithm/string.hpp>
9 #include "GaudiKernel/DataObjIDProperty.h"
11 using namespace Gaudi;
27 typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
28 boost::char_separator<char> sep(
"(), ");
29 tokenizer tokens(prop, sep);
30 int nToks(distance(tokens.begin(), tokens.end()));
31 auto it = tokens.begin();
36 boost::erase_all(k,
"'");
39 }
else if (nToks == 2) {
47 }
catch (
const std::invalid_argument& ) {
49 boost::erase_all(cn,
"'");
55 boost::erase_all(k,
"'");
64 std::cerr <<
"Unable to instantiate a DataObjID from a Property " << s
65 <<
" :: Format is bad" << std::endl;
92 if (s.find(
"(") != std::string::npos) {
97 typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
98 boost::char_separator<char> sep(
"[](), ");
99 tokenizer tokens(prop, sep);
100 auto it = tokens.begin();
105 while (it != tokens.end()) {
115 }
catch (
const std::invalid_argument& ) {
118 boost::erase_all(cn,
"'");
124 boost::erase_all(k,
"'");
147 o <<
"'" << v.
key() <<
"'";
149 o <<
"(" << v.
clid() <<
",'" << v.
key() <<
"')";
210 std::ostringstream o;
266 std::ostringstream o;
virtual StatusCode fromString(const std::string &s)
string -> value
virtual void useReadHandler() const
use the call-back function at reading
DataObjIDProperty(const std::string &name, DataObjID &ref)
bool isSuccess() const
Test for a status code of SUCCESS.
bool setValue(const DataObjID &value)
StatusCode parse(GaudiUtils::HashMap< K, V > &result, const std::string &input)
Basic parser for the types of HashMap used in DODBasicMapper.
virtual void toStream(std::ostream &out) const
value -> stream
virtual void toStream(std::ostream &out) const
value -> stream
std::ostream & toStream(ITERATOR first, ITERATOR last, std::ostream &s, const std::string &open, const std::string &close, const std::string &delim)
the helper function to print the sequence
bool setValue(const DataObjIDColl &value)
virtual bool useUpdateHandler()
use the call-back function at update
This class is used for returning status codes from appropriate routines.
virtual ~DataObjIDProperty()
const std::string & key() const
const DataObjID & value() const
DataObjIDColl * m_pValue
Pointer to the real property.
virtual std::string toString() const
value -> string
virtual StatusCode fromString(const std::string &s)
string -> value
virtual std::string toString() const
value -> string
virtual ~DataObjIDCollProperty()
DataObjID * m_pValue
Pointer to the real property.
const DataObjIDColl & value() const
unsigned int CLID
Class ID definition.
DataObjIDCollProperty(const std::string &name, DataObjIDColl &ref)
Helper functions to set/get the application return code.
std::unordered_set< DataObjID, DataObjID_Hasher > DataObjIDColl