Elemental::Event Class Reference

A qualified value representing the time and location of an event. More...

#include <value-types.hh>

Inheritance diagram for Elemental::Event:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 Event (int when, const ustring &where, Qualifier qualifier=Q_NEUTRAL) throw ()
 Constructs a new defined event.
 Event (Qualifier qualifier=Q_UNK) throw ()
 Constructs a new undefined or empty event.
virtual int compare (const value_base &other) const throw ()
virtual ustring get_string (const ustring &format=ustring()) const throw ()
 Returns a localized text representation of the event.

Public Attributes

int when
 The year in which the event occurred, if defined.
ustring where
 The place in which the event occurred, if defined.

Protected Member Functions

virtual ustring do_get_string (const ustring &format) const throw ()
 Returns a localized text representation of a defined value.
virtual int compare_base (const value_base &other) const throw ()
 Compares the qualifications of two events.

Detailed Description

A qualified value representing the time and location of an event.

Events are compared by year of occurrence.


Constructor & Destructor Documentation

Elemental::Event::Event ( int  when,
const ustring &  where,
Qualifier  qualifier = Q_NEUTRAL 
) throw ()

Constructs a new defined event.

Parameters:
when The year in which the event occurred.
where The place in which the event occurred.
qualifier The qualification of the event.
Elemental::Event::Event ( Qualifier  qualifier = Q_UNK  )  throw ()

Constructs a new undefined or empty event.

Parameters:
qualifier The qualification of the event.

Member Function Documentation

virtual ustring Elemental::Event::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.

virtual ustring Elemental::Event::get_string ( const ustring &  format = ustring()  )  const throw () [virtual]

Returns a localized text representation of the event.

Parameters:
format An optional compose-style format string with which to output the value. The year is "%1" and the place is "%2". By default, the format is the localized version of "%1 (%2)".
Returns:
A UTF-8 string containing the localized representation.

Reimplemented from Elemental::value_base.


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

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