|
libelemental 2.0.2
|
A base class for qualified values. More...
#include <value.hh>

Public Member Functions | |
| bool | has_value () const throw () |
| Returns whether the value is defined. More... | |
| virtual ustring | get_string (const ustring &format=ustring()) const throw () |
| Returns a localized text representation of the value. More... | |
| ustring | get_tip () const throw () |
| Returns a localized message to be displayed as a tooltip. More... | |
| void | make_entry (EntriesView &view, const ustring &name, const ustring &format=ustring()) const throw () |
| Possibly adds the result of get_string() to an EntriesView. More... | |
| virtual int | compare (const value_base &other) const throw () |
| Compares two qualified values. More... | |
Public Attributes | |
| Qualifier | qualifier |
| The qualification of the value's meaning. | |
Protected Member Functions | |
| value_base (Qualifier qualifier) throw () | |
| virtual ustring | do_get_string (const ustring &format) const =0 throw () |
| Returns a localized text representation of a defined value. More... | |
| virtual int | compare_base (const value_base &other) const throw () |
| Compares the qualifications of two values. More... | |
Protected Attributes | |
| bool | always |
| Whether an undefined value should make an entry. More... | |
Static Protected Attributes | |
| static const int | YIELD_COMPARE |
| Indicates that comparison should be based on values, not definedness. More... | |
A base class for qualified values.
|
protected | ||||||||||||||
| qualifier | The qualification of the initial value. |
|
virtual | ||||||||||||||
Compares two qualified values.
Derived classes may override this function, first calling compare_base, and use a dynamic_cast to check other.
| other | The qualified value for comparison. |
-1 if this value is undefined or is less than other; 0 if the values are equal; or 1 if other is undefined or this value is greater than other. Reimplemented in Elemental::Message, Elemental::Event, Elemental::Series, Elemental::Block, Elemental::Phase, Elemental::LatticeType, Elemental::ColorValue, Elemental::Value< T >, Elemental::Value< ustring >, Elemental::Value< double >, and Elemental::ValueList< T >.
|
protectedvirtual | ||||||||||||||
Compares the qualifications of two values.
This base function handles definedness only. Derived classes may override this function to handle qualifiers more specifically.
| other | The qualified value for comparison. |
-1 if this value sorts before other; 0 if the values sort equally; 1 if this value sorts after other; or YIELD_COMPARE if the result should be determined based on values. Reimplemented in Elemental::Event.
|
protectedpure 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. |
Implemented in Elemental::Message, Elemental::Event, Elemental::Series, Elemental::Block, Elemental::Phase, Elemental::LatticeType, Elemental::ColorValue, Elemental::Value< T >, Elemental::Value< ustring >, Elemental::Value< double >, and Elemental::ValueList< T >.
|
virtual | ||||||||||||||
Returns a localized text representation of the value.
| format | An optional compose-style format string with which to output the value. If not otherwise specified, the value is argument reference %%1. |
Reimplemented in Elemental::Message, and Elemental::Event.
| ustring Elemental::value_base::get_tip | ( | ) | const | |
| throw | ( | |||
| ) | ||||
Returns a localized message to be displayed as a tooltip.
The message may also be displayed parenthetically to the value.
| bool Elemental::value_base::has_value | ( | ) | const | |
| throw | ( | |||
| ) | ||||
Returns whether the value is defined.
false if the value is unknown or inapplicable; else true | void Elemental::value_base::make_entry | ( | EntriesView & | view, |
| const ustring & | name, | ||
| const ustring & | format = ustring() |
||
| ) | const | ||
| throw | ( | ||
| ) | |||
Possibly adds the result of get_string() to an EntriesView.
An entry will only be made if the value is defined or if always is true.
| view | The EntriesView to be populated. |
| name | The name of the value to be passed. |
| format | An optional compose-style format for get_string(). |
|
protected |
Whether an undefined value should make an entry.
May be set by derived classes. If set to false (default), make_entry() will only populate an EntriesView if has_value() returns true. If set to true, an EntriesView will always be populated.
|
staticprotected |
Indicates that comparison should be based on values, not definedness.
Returned by compare_base() when qualifiers are equivalent.