libelemental  1.2.0
Public Types | Public Member Functions | Public Attributes | Protected Member Functions
Elemental::Block Class Reference

A qualified value representing a periodic table block. More...

#include <value-types.hh>

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

List of all members.

Public Types

enum  Value {
  S,
  P,
  D,
  F
}
 The possible lattice type values. More...

Public Member Functions

 Block (const Value &source, Qualifier qualifier=Q_NEUTRAL) throw ()
 Constructs a new defined block.
 Block (Qualifier qualifier=Q_UNK) throw ()
 Constructs a new undefined or default block.
virtual int compare (const value_base &other) const throw ()
 Compares two qualified values.
virtual color get_color () const throw ()
 Returns a color representing the value.

Public Attributes

Value 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

A qualified value representing a periodic table block.


Member Enumeration Documentation

The possible lattice type values.

Enumerator:
S 

s-block (sharp)

P 

p-block (principal)

D 

d-block (diffuse)

F 

f-block (fundamental)


Constructor & Destructor Documentation

Elemental::Block::Block ( const Value source,
Qualifier  qualifier = Q_NEUTRAL 
) throw ()

Constructs a new defined block.

Parameters:
sourceThe initial definition.
qualifierThe qualification of the initial value.
Elemental::Block::Block ( Qualifier  qualifier = Q_UNK) throw ()

Constructs a new undefined or default block.

Parameters:
qualifierThe qualification of the initial value.

Member Function Documentation

virtual int Elemental::Block::compare ( const value_base other) const throw () [virtual]

Compares two qualified values.

Derived classes may override this function, first calling compare_base, and use a dynamic_cast to check other.

Parameters:
otherThe qualified value for comparison.
Returns:
-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 from Elemental::value_base.

virtual ustring Elemental::Block::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:
formatA 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 color Elemental::Block::get_color ( ) const throw () [virtual]

Returns a color representing the value.

Derived classes must implement this function, returning a color that corresponds to the defined value. A special color should be returned if has_value() is false.

Returns:
A color structure.

Implements Elemental::color_value_base.


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