# SystemElementContainer `class SystemElementContainer` โ€” inherits [SystemElement](../classes/SystemElement.md) Defined in [syselmts.hpp:32](../../../../src/system/syselmts.hpp#L32) A container for managing system elements of type T. ## Public Types ### `using SystemElementContainer< T >::MapType = unordered_map` ๐Ÿ“ [syselmts.hpp:35](../../../../src/system/syselmts.hpp#L35) ### `using SystemElementContainer< T >::iterator = typename MapType::iterator` ๐Ÿ“ [syselmts.hpp:36](../../../../src/system/syselmts.hpp#L36) ### `using SystemElementContainer< T >::const_iterator = typename MapType::const_iterator` ๐Ÿ“ [syselmts.hpp:37](../../../../src/system/syselmts.hpp#L37) ## Protected Attributes ### `unsigned int iter_count` ๐Ÿ“ [syselmts.hpp:40](../../../../src/system/syselmts.hpp#L40) ### `MapType content` ๐Ÿ“ [syselmts.hpp:41](../../../../src/system/syselmts.hpp#L41) ## Protected Functions ### `void add(MapType el_content)` ๐Ÿ“ [syselmts.hpp:47](../../../../src/system/syselmts.hpp#L47) Adds elements from a map to the container. **Parameters** - `el_content` โ€” Map of elements to add. ## Public Functions ### `SystemElementContainer(string name)` ๐Ÿ“ [syselmts.hpp:60](../../../../src/system/syselmts.hpp#L60) Constructor for an empty container. **Parameters** - `` โ€” Name of the container. ### `SystemElementContainer(string name, vector< T * > elements)` ๐Ÿ“ [syselmts.hpp:67](../../../../src/system/syselmts.hpp#L67) Constructor with initial elements. **Parameters** - `` โ€” Name of the container. - `elements` โ€” Vector of elements to add. ### `void add(string name, T *element)` ๐Ÿ“ [syselmts.hpp:78](../../../../src/system/syselmts.hpp#L78) Adds a single element to the container with a given name. **Parameters** - `` โ€” Name of the element to add. - `element` โ€” Pointer to the element to add. **Throws** - `runtime_error` โ€” If the element's name is empty or already exists. ### `void add(T *element)` ๐Ÿ“ [syselmts.hpp:96](../../../../src/system/syselmts.hpp#L96) Adds a single element to the container. **Parameters** - `element` โ€” Pointer to the element to add. **Throws** - `runtime_error` โ€” If the element's name is empty or already exists. ### `bool exists(string name)` ๐Ÿ“ [syselmts.hpp:106](../../../../src/system/syselmts.hpp#L106) Checks if an element exists in the container. **Parameters** - `` โ€” Name of the element to check. **Returns** True if the element exists, false otherwise. ### `void add(SystemElementContainer< T > *elements)` ๐Ÿ“ [syselmts.hpp:123](../../../../src/system/syselmts.hpp#L123) Adds elements from another container. **Parameters** - `elements` โ€” Pointer to another container. ### `void add(vector< T * > elements)` ๐Ÿ“ [syselmts.hpp:132](../../../../src/system/syselmts.hpp#L132) Adds multiple elements from a vector. **Parameters** - `elements` โ€” Vector of elements to add. ### `T * get(string name)` ๐Ÿ“ [syselmts.hpp:146](../../../../src/system/syselmts.hpp#L146) Retrieves an element by its name. **Parameters** - `` โ€” Name of the element to retrieve. **Returns** Pointer to the element. **Throws** - `runtime_error` โ€” If the element is not found. ### `T * merge(string name)` ๐Ÿ“ [syselmts.hpp:164](../../../../src/system/syselmts.hpp#L164) Merges an element by retrieving it or creating a new one if it doesn't exist. **Parameters** - `` โ€” Name of the element. **Returns** Pointer to the merged or newly created element. ### `size_t size() const` ๐Ÿ“ [syselmts.hpp:178](../../../../src/system/syselmts.hpp#L178) ### `iterator begin()` ๐Ÿ“ [syselmts.hpp:184](../../../../src/system/syselmts.hpp#L184) Returns an iterator to the beginning of the container. **Returns** Iterator to the beginning. ### `iterator end()` ๐Ÿ“ [syselmts.hpp:190](../../../../src/system/syselmts.hpp#L190) Returns an iterator to the end of the container. **Returns** Iterator to the end. ### `const_iterator begin() const` ๐Ÿ“ [syselmts.hpp:196](../../../../src/system/syselmts.hpp#L196) Returns a constant iterator to the beginning of the container. **Returns** Constant iterator to the beginning. ### `const_iterator end() const` ๐Ÿ“ [syselmts.hpp:202](../../../../src/system/syselmts.hpp#L202) Returns a constant iterator to the end of the container. **Returns** Constant iterator to the end. --- โ† [Back to classes](index.md) ยท [Top](../index.md)