A qualified list of values of a generic type. More...
#include <value.hh>
Public Member Functions | |
template<class S > | |
ValueList (const S source[], int count, Qualifier qualifier=Q_NEUTRAL) | |
Constructs a new defined value list. | |
template<class S > | |
ValueList (const ValueList< S > &source) | |
Constructs a new value list based on another value list. | |
ValueList (Qualifier qualifier=Q_UNK) throw () | |
Constructs a new undefined or empty value list. | |
virtual int | compare (const value_base &other) const throw () |
Public Attributes | |
std::vector< T > | values |
The values, if defined. | |
Protected Member Functions | |
virtual ustring | do_get_string (const ustring &format) const throw () |
Returns a localized text representation of a defined value. |
A qualified list of values of a generic type.
This template requires a class with default and copy constructors and less-than, greater-than, and stream insertion operators. Compiler-generated functions are acceptable.
Elemental::ValueList< T >::ValueList | ( | const S | source[], | |
int | count, | |||
Qualifier | qualifier = Q_NEUTRAL | |||
) | [inline] |
Constructs a new defined value list.
source | An array of the initial values. | |
count | The length of the source array. | |
qualifier | The qualification of the initial values. |
Elemental::ValueList< T >::ValueList | ( | const ValueList< S > & | source | ) | [inline] |
Constructs a new value list based on another value list.
source | The value list to be copied. |
Elemental::ValueList< T >::ValueList | ( | Qualifier | qualifier = Q_UNK |
) | throw () |
Constructs a new undefined or empty value list.
qualifier | The qualification of the initial values. |
virtual ustring Elemental::ValueList< T >::do_get_string | ( | const ustring & | format | ) | const throw () [protected, virtual] |
Returns a localized text representation of a defined value.
Derived classes must implement this function to produce a text representation based on the format. It will be called by get_string(), which will then decorate its output as appropriate for the current qualifier. If has_value() is false
, the behavior is undefined.
format | A compose-style format string. Derived classes may define the number of argument references expected in the string; the default is one. If format is empty, a minimal default should be used. |
Implements Elemental::value_base.