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
nmspcThe 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
nmspcThe namespace the container resides in.
parentThe parent enum container.

Member Function Documentation

◆ GetNamespace()

String Murl::EnumContainer::GetNamespace ( ) const

Get the container's namespace.

Returns
The namespace.

◆ Add()

Bool Murl::EnumContainer::Add ( const String name,
const Enum< SInt32 > *  e 
)

Add an enumeration object.

Parameters
nameThe name of the object.
eThe enumeration object.
Returns
true if successful.

Referenced by Murl::Enum< EnumType >::Enum().

◆ Remove()

Bool Murl::EnumContainer::Remove ( const String name,
const Enum< SInt32 > *  e 
)

Remove an enumeration object.

Parameters
nameThe name of the object.
eThe enumeration object.
Returns
true if successful.

Referenced by Murl::Enum< EnumType >::operator=(), and Murl::Enum< EnumType >::~Enum().

◆ Find()

const Enum<SInt32>* Murl::EnumContainer::Find ( const String scopedName) const

Try to get an enumeration object by its name.

Parameters
scopedNameThe 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()

String Murl::EnumContainer::GetName ( UInt32  index) const

Get the name of an enumeration object at a given index.

Parameters
indexThe index, from 0 to GetCount()-1.
Returns
The object name, or an empty string if index is out of range.

◆ Get()

const Enum<SInt32>* Murl::EnumContainer::Get ( UInt32  index) const

Get the enumeration object at a given index.

Parameters
indexThe 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


Copyright © 2011-2024 Spraylight GmbH.