Murl::EnumContainer Class Reference
A container holding individual enumeration objects by name. More...
#include "murl_enum_container.h"
Public Member Functions | |
EnumContainer (const String &nmspc) | |
Constructor taking a namespace name. More... | |
EnumContainer (const String &nmspc, EnumContainer &parent) | |
Constructor taking a namespace name and a parent container. More... | |
String | GetNamespace () const |
Get the container's namespace. More... | |
Bool | Add (const String &name, const Enum< SInt32 > *e) |
Add an enumeration object. More... | |
Bool | Remove (const String &name, const Enum< SInt32 > *e) |
Remove an enumeration object. More... | |
const Enum< SInt32 > * | Find (const String &scopedName) const |
Try to get an enumeration object by its name. More... | |
UInt32 | GetCount () const |
Get the number of enumeration objects in the container. More... | |
String | GetName (UInt32 index) const |
Get the name of an enumeration object at a given index. More... | |
const Enum< SInt32 > * | Get (UInt32 index) const |
Get the enumeration object at a given index. More... | |
Detailed Description
A container holding individual enumeration objects by name.
Constructor & Destructor Documentation
◆ EnumContainer() [1/2]
Murl::EnumContainer::EnumContainer | ( | const String & | nmspc | ) |
Constructor taking a namespace name.
- Parameters
-
nmspc The namespace the container resides in.
◆ EnumContainer() [2/2]
Murl::EnumContainer::EnumContainer | ( | const String & | nmspc, |
EnumContainer & | parent | ||
) |
Constructor taking a namespace name and a parent container.
- Parameters
-
nmspc The namespace the container resides in. parent The parent enum container.
Member Function Documentation
◆ GetNamespace()
String Murl::EnumContainer::GetNamespace | ( | ) | const |
Get the container's namespace.
- Returns
- The namespace.
◆ Add()
Add an enumeration object.
- Parameters
-
name The name of the object. e The enumeration object.
- Returns
- true if successful.
Referenced by Murl::Enum< EnumType >::Enum().
◆ Remove()
Remove an enumeration object.
- Parameters
-
name The name of the object. e The enumeration object.
- Returns
- true if successful.
Referenced by Murl::Enum< EnumType >::operator=(), and Murl::Enum< EnumType >::~Enum().
◆ Find()
Try to get an enumeration object by its name.
- Parameters
-
scopedName The name to query.
- Returns
- A pointer to the enumeration object, or null if not found.
◆ GetCount()
UInt32 Murl::EnumContainer::GetCount | ( | ) | const |
Get the number of enumeration objects in the container.
- Returns
- The number of registered objects.
◆ GetName()
Get the name of an enumeration object at a given index.
- Parameters
-
index The index, from 0 to GetCount()-1.
- Returns
- The object name, or an empty string if index is out of range.
◆ Get()
Get the enumeration object at a given index.
- Parameters
-
index The index, from 0 to GetCount()-1.
- Returns
- The object, or null if index is out of range.
The documentation for this class was generated from the following file:
- murl_enum_container.h