45 MetaClassManager::MetaClassManager()
50 MetaClassManager::~MetaClassManager()
58 MetaClassManager& MetaClassManager::GetInstance()
60 static MetaClassManager manager;
66 if ((m_pPrivate->m_MetaClassByName.find(rName) != m_pPrivate->m_MetaClassByName.end()) || (m_pPrivate->m_MetaClassById.find(rId) != m_pPrivate->m_MetaClassById.end()))
68 throw karto::Exception(
"MetaClass already exists for class with name: " + rName);
72 m_pPrivate->m_MetaClassByName[rName] = newClass;
73 m_pPrivate->m_MetaClassById[rId] = newClass;
80 MetaClassManagerPrivate::ClassByNameTable::const_iterator iter = m_pPrivate->m_MetaClassByName.find(rName);
81 if (iter == m_pPrivate->m_MetaClassByName.end())
91 MetaClassManagerPrivate::ClassByIdTable::const_iterator iter = m_pPrivate->m_MetaClassById.find(rId);
92 if (iter == m_pPrivate->m_MetaClassById.end())
102 return m_pPrivate->m_MetaClassById.find(rId) != m_pPrivate->m_MetaClassById.end();
105 kt_size_t MetaClassManager::GetSize()
const 107 return m_pPrivate->m_MetaClassByName.size();
112 if (index >= m_pPrivate->m_MetaClassByName.size())
117 MetaClassManagerPrivate::ClassByNameTable::const_iterator iter = m_pPrivate->m_MetaClassByName.begin();
118 std::advance(iter, index);
120 return *iter->second;
123 void MetaClassManager::Clear()
125 m_pPrivate->m_MetaClassById.clear();
126 m_pPrivate->m_MetaClassByName.clear();