28 #ifndef ELEMENTREGISTRY_H
29 #define ELEMENTREGISTRY_H
60 typedef typename CC::ATOM_TYPE T;
61 typedef typename CC::PARAM_CONFIG P;
72 bool IsRegistered(
const UUID & uuid)
const;
74 bool IsLoaded(
const UUID & uuid)
const;
76 bool Load(
const UUID & uuid) ;
86 void AddPath(
const char * path) ;
106 return m_registeredElementsCount;
121 FAIL(ARRAY_INDEX_OUT_OF_BOUNDS);
122 return m_registeredElements[entryIdx].m_uuid;
137 FAIL(ARRAY_INDEX_OUT_OF_BOUNDS);
138 return m_registeredElements[entryIdx].m_element;
143 struct ElementEntry {
148 ElementEntry() : m_element(0), m_pathIndex(-1) { }
149 } m_registeredElements[TABLE_SIZE];
150 u32 m_registeredElementsCount;
152 const ElementEntry * FindMatching(
const UUID & uuid)
const {
153 for (u32 i = 0; i < m_registeredElementsCount; ++i) {
154 if (m_registeredElements[i].m_uuid == uuid)
155 return &m_registeredElements[i];
160 ElementEntry * FindMatching(
const UUID & uuid) {
161 for (u32 i = 0; i < m_registeredElementsCount; ++i) {
162 if (m_registeredElements[i].m_uuid == uuid)
163 return &m_registeredElements[i];
168 s32 FindCompatibleIndex(
const UUID & uuid, s32 lastIndex)
const {
170 FAIL(ILLEGAL_ARGUMENT);
171 for (s32 i = lastIndex + 1; i < (s32) m_registeredElementsCount; ++i) {
172 if (m_registeredElements[i].m_uuid.Compatible(uuid))
178 PathString m_searchPaths[MAX_PATHS];
179 u32 m_searchPathsCount;
185 #include "ElementRegistry.tcc"
bool RegisterElement(Element< CC > &e)
Definition: ElementRegistry.tcc:70
bool RegisterUUID(const UUID &uuid)
Definition: ElementRegistry.tcc:83
void AddPath(const char *path)
Definition: ElementRegistry.tcc:139
Definition: ElementRegistry.h:48
u32 GetEntryCount() const
Definition: ElementRegistry.h:104
const UUID & GetEntryUUID(u32 entryIdx) const
Definition: ElementRegistry.h:118
const Element< CC > * GetEntryElement(u32 entryIdx) const
Definition: ElementRegistry.h:134