3 #include <ext/alloc_traits.h> 14 os << n.
ns() <<
':' << n.
name();
15 static const char *
ev = getenv(
"DDNAMEID");
16 if (ev) os <<
'[' << n.
id() <<
']';
23 : id_(registerName(
std::make_pair(name,ns))->
second)
31 if (result.second ==
"") {
44 if (result.second ==
"") {
76 if (
id <
id_type(id2n.size()) ) {
77 if(id2n[
id]->
first != nm) {
80 throw cms::Exception(
"DDException") <<
"DDName::DDName(std::pair<std::string,std::string>,id_type): id=" + s.str() +
" reg-name=?";
121 const std::pair<std::string,std::string>
p(name,ns);
133 idToName.emplace_back(reg_.begin());
137 std::pair<Registry::iterator,bool>
result = reg_.insert(val);
139 idToName.emplace_back(result.first);
std::ostream & operator<<(std::ostream &os, const DDName &n)
const std::string & ns() const
Returns the namespace.
DDName is used to identify DDD entities uniquely.
static std::string & ns()
U second(std::pair< T, U > const &p)
std::map< std::pair< std::string, std::string >, id_type > Registry
static value_type & instance()
Container::value_type value_type
static void defineId(const std::pair< std::string, std::string > &, id_type id)
register pre-defined ids
std::vector< Registry::const_iterator > IdToName
static bool exists(const std::string &name, const std::string &ns)
true, if a DDName with given name and namespace (ns) already is registerd, otherwise false ...
static Registry::iterator registerName(const std::pair< std::string, std::string > &s)
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = ':'
const std::string & name() const
Returns the name.