22 #ifndef _DescriptionScheme_hxx_
23 #define _DescriptionScheme_hxx_
64 typedef std::map<std::string, unsigned> ScopeMap;
65 typedef std::vector<DescriptionScope *> Scopes;
68 ScopeMap _scopeNameMap;
85 template <
typename DataType >
86 void AddAttribute(
const std::string &scope,
const std::string & name)
94 const unsigned nScopes = _scopes.size();
95 std::pair<ScopeMap::iterator,bool> result =
96 _scopeNameMap.insert(std::make_pair(scopeName,nScopes));
98 if (!result.second)
return *_scopes[result.first->second];
101 _scopes.push_back(theScope);
107 ScopeMap::const_iterator it = _scopeNameMap.find(name);
108 CLAM_ASSERT(it!=_scopeNameMap.end(), (
"Attribute scope '" + name +
"' not found").c_str());
114 CLAM_ASSERT(scopeIndex < _scopes.size(),
"Accessing an illegal scope index for the description scheme");
115 return *_scopes[scopeIndex];
125 return _scopes.size();
305 #endif// _DescriptionScheme_hxx_