6 #include <ext/alloc_traits.h> 12 os << n.
ns() <<
':' << n.
name();
17 : id_( registerName(
std::make_pair( name, ns ))->
second )
24 if( result.second.empty()) {
35 std::pair< std::string, std::string >
result =
DDSplit( name );
36 if( result.second.empty()) {
80 DDName::Registry::iterator
89 idToName.emplace_back( reg.begin());
93 std::pair<Registry::iterator, bool>
result = reg.insert( val );
95 idToName.emplace_back( result.first );
std::ostream & operator<<(std::ostream &os, const DDName &n)
std::map< std::pair< std::string, std::string >, id_type > Registry
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)
static value_type & instance()
Container::value_type value_type
std::vector< Registry::const_iterator > IdToName
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.