Template class for managing named values. More...
#include <SNamedValue.h>
Public Types | |
| typedef TNAMEDVALUE< T > | NAMEDVALUE |
Public Member Functions | |
| virtual BOOL | Init (SXmlNode xmlNode) |
| Initializes the named values from an XML node. | |
| T | String2Value (const SStringW &strName) const |
| Converts a string name to its corresponding value. | |
| BOOL | FindValue (const SStringW &strName, T &value) const |
| Finds the value associated with a given name. | |
| T | GetAt (const int idx) const |
| Retrieves the value at a specific index. | |
| size_t | Merge (const SNamedValue &src) |
| Merges the named values from another SNamedValue object. | |
| UINT | GetCount () const |
| Retrieves the number of named values. | |
Static Protected Member Functions | |
| static int | Compare (const void *p1, const void *p2) |
| Comparison function for sorting and searching. | |
Protected Attributes | |
| SArray< NAMEDVALUE > | m_lstNamedValue |
Template class for managing named values.
This class manages a list of named values, allowing for initialization from XML, retrieval by name, and merging of values.
| T | Type of the value. |
| ValueParser | Class responsible for parsing the value from a string. |
Definition at line 35 of file SNamedValue.h.
| typedef TNAMEDVALUE<T> SNamedValue< T, ValueParser >::NAMEDVALUE |
Definition at line 37 of file SNamedValue.h.
|
inlinestaticprotected |
Comparison function for sorting and searching.
| p1 | Pointer to the first NAMEDVALUE. |
| p2 | Pointer to the second NAMEDVALUE. |
Definition at line 157 of file SNamedValue.h.
|
inline |
Finds the value associated with a given name.
| strName | Name of the value. |
| value | Variable to store the found value. |
Definition at line 90 of file SNamedValue.h.
|
inline |
Retrieves the value at a specific index.
| idx | Index of the value. |
Definition at line 106 of file SNamedValue.h.
|
inline |
Retrieves the number of named values.
Definition at line 145 of file SNamedValue.h.
|
inlinevirtual |
Initializes the named values from an XML node.
| xmlNode | XML node containing the named values. |
Definition at line 44 of file SNamedValue.h.
|
inline |
Merges the named values from another SNamedValue object.
| src | Source SNamedValue object. |
Definition at line 117 of file SNamedValue.h.
|
inline |
Converts a string name to its corresponding value.
| strName | Name of the value. |
Definition at line 75 of file SNamedValue.h.
|
protected |
Definition at line 164 of file SNamedValue.h.