Elemental::Value< T > Class Template Reference

A qualified value of a generic type. More...

#include <value.hh>

Inheritance diagram for Elemental::Value< T >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

template<class S >
 Value (const S &source, Qualifier qualifier=Q_NEUTRAL)
 Constructs a new defined value.
template<class S >
 Value (const Value< S > &source)
 Constructs a new value based on another value.
 Value (Qualifier qualifier=Q_UNK) throw ()
 Constructs a new undefined or default value.
virtual int compare (const value_base &other) const throw ()

Public Attributes

value
 The value, if defined.

Protected Member Functions

virtual ustring do_get_string (const ustring &format) const throw ()
 Returns a localized text representation of a defined value.

Detailed Description

template<class T>
class Elemental::Value< T >

A qualified value 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.


Constructor & Destructor Documentation

template<class T>
template<class S >
Elemental::Value< T >::Value ( const S &  source,
Qualifier  qualifier = Q_NEUTRAL 
) [inline]

Constructs a new defined value.

Parameters:
source The initial definition.
qualifier The qualification of the initial value.
template<class T>
template<class S >
Elemental::Value< T >::Value ( const Value< S > &  source  )  [inline]

Constructs a new value based on another value.

Parameters:
source The value to be copied.
template<class T>
Elemental::Value< T >::Value ( Qualifier  qualifier = Q_UNK  )  throw ()

Constructs a new undefined or default value.

Parameters:
qualifier The qualification of the initial value.

Member Function Documentation

template<class T>
virtual ustring Elemental::Value< 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.

Parameters:
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.
Returns:
A UTF-8 string containing the localized representation.

Implements Elemental::value_base.


The documentation for this class was generated from the following file:

Generated on Sun Oct 4 18:34:14 2009 for libelemental by  doxygen 1.6.1