19 #ifndef TYPECONTAINER_FUNCTIONS_H
20 #define TYPECONTAINER_FUNCTIONS_H
31 #include <unordered_map>
37 template<
class SPECIFIC_TYPE,
class KEY_TYPE>
40 auto i = elements.
_element.find(handle);
48 ASSERT(i->second == obj,
"Object with certain key already in but objects are different!");
53 template<
class SPECIFIC_TYPE,
class KEY_TYPE>
59 template<
class SPECIFIC_TYPE,
class KEY_TYPE,
class T>
65 template<
class SPECIFIC_TYPE,
class KEY_TYPE,
class H,
class T>
68 bool ret =
Insert(elements._elements, handle, obj);
69 return ret ? ret :
Insert(elements._TailElements, handle, obj);
73 template<
class SPECIFIC_TYPE,
class KEY_TYPE>
76 auto i = elements.
_element.find(handle);
83 template<
class SPECIFIC_TYPE,
class KEY_TYPE>
89 template<
class SPECIFIC_TYPE,
class KEY_TYPE,
class T>
95 template<
class SPECIFIC_TYPE,
class KEY_TYPE,
class H,
class T>
98 SPECIFIC_TYPE* ret =
Find(elements._elements, handle, (SPECIFIC_TYPE*)
nullptr);
99 return ret ? ret :
Find(elements._TailElements, handle, (SPECIFIC_TYPE*)
nullptr);
103 template<
class SPECIFIC_TYPE,
class KEY_TYPE>
110 template<
class SPECIFIC_TYPE,
class KEY_TYPE>
116 template<
class SPECIFIC_TYPE,
class KEY_TYPE,
class T>
122 template<
class SPECIFIC_TYPE,
class KEY_TYPE,
class H,
class T>
125 bool ret =
Remove(elements._elements, handle, (SPECIFIC_TYPE*)
nullptr);
126 return ret ? ret :
Remove(elements._TailElements, handle, (SPECIFIC_TYPE*)
nullptr);
131 template<
class SPECIFIC_TYPE>
137 template<
class SPECIFIC_TYPE>
143 template<
class SPECIFIC_TYPE,
class T>
149 template<
class SPECIFIC_TYPE,
class T>
152 return Count(elements._elements, fake);
155 template<
class SPECIFIC_TYPE,
class H,
class T>
158 return Count(elements._TailElements, fake);
162 template<
class SPECIFIC_TYPE>
170 template<
class SPECIFIC_TYPE>
177 template<
class SPECIFIC_TYPE,
class T>
184 template<
class SPECIFIC_TYPE,
class H,
class T>
187 SPECIFIC_TYPE* t =
Insert(elements._elements, obj);
188 return (t !=
nullptr ? t :
Insert(elements._TailElements, obj));
bool Remove(ContainerUnorderedMap< SPECIFIC_TYPE, KEY_TYPE > &elements, KEY_TYPE const &handle, SPECIFIC_TYPE *)
Definition: TypeContainerFunctions.h:104
Definition: TypeList.h:31
Definition: TypeContainer.h:47
Definition: TypeContainer.h:65
size_t Count(ContainerMapList< SPECIFIC_TYPE > const &elements, SPECIFIC_TYPE *)
Definition: TypeContainerFunctions.h:132
GridRefManager< OBJECT > _element
Definition: TypeContainer.h:43
bool Insert(ContainerUnorderedMap< SPECIFIC_TYPE, KEY_TYPE > &elements, KEY_TYPE const &handle, SPECIFIC_TYPE *obj)
Definition: TypeContainerFunctions.h:38
SPECIFIC_TYPE * Find(ContainerUnorderedMap< SPECIFIC_TYPE, KEY_TYPE > const &elements, KEY_TYPE const &handle, SPECIFIC_TYPE *)
Definition: TypeContainerFunctions.h:74
Definition: TypeContainer.h:59
#define ASSERT
Definition: Errors.h:55
std::unordered_map< KEY_TYPE, OBJECT * > _element
Definition: TypeContainer.h:61
Definition: TypeContainer.h:40