rpt_value Class Reference

#include <value.h>

Inheritance diagram for rpt_value:

rpt_value_boolean rpt_value_cstate rpt_value_enumeration rpt_value_error rpt_value_fstate rpt_value_func rpt_value_group rpt_value_gstate rpt_value_integer rpt_value_list rpt_value_null rpt_value_passwd rpt_value_pconf rpt_value_pstate rpt_value_real rpt_value_reference rpt_value_string rpt_value_struct rpt_value_time rpt_value_uconf rpt_value_void

Public Types

typedef aegis_shared_ptr
< rpt_value
pointer

Public Member Functions

virtual ~rpt_value ()
virtual const char * name () const =0
virtual bool is_an_error () const
virtual bool is_a_struct () const
virtual rpt_value::pointer lookup (const rpt_value::pointer &rhs, bool lvalue) const
virtual rpt_value::pointer keys () const
virtual rpt_value::pointer count () const
virtual const char * type_of () const

Static Public Member Functions

static rpt_value::pointer integerize (const rpt_value::pointer &vp)
static rpt_value::pointer realize (const rpt_value::pointer &vp)
static rpt_value::pointer arithmetic (const rpt_value::pointer &vp)
static rpt_value::pointer undefer (const rpt_value::pointer &vp)
static rpt_value::pointer stringize (const rpt_value::pointer &vp)
static rpt_value::pointer booleanize (const rpt_value::pointer &vp)

Protected Member Functions

 rpt_value ()
virtual rpt_value::pointer integerize_or_null () const
virtual rpt_value::pointer realize_or_null () const
virtual rpt_value::pointer arithmetic_or_null () const
virtual rpt_value::pointer undefer_or_null () const
virtual rpt_value::pointer stringize_or_null () const
virtual rpt_value::pointer booleanize_or_null () const

Private Member Functions

 rpt_value (const rpt_value &)
rpt_valueoperator= (const rpt_value &)

Detailed Description

The rpt_value abstract base class is used to represent a generic value, constructed during report generation.

Definition at line 31 of file value.h.


Member Typedef Documentation

Definition at line 34 of file value.h.


Constructor & Destructor Documentation

virtual rpt_value::~rpt_value (  )  [virtual]

The destructor.

rpt_value::rpt_value (  )  [protected]

The default constructor.

rpt_value::rpt_value ( const rpt_value  )  [private]

The copy constructor. Do not use.


Member Function Documentation

static rpt_value::pointer rpt_value::integerize ( const rpt_value::pointer vp  )  [static]

The integerize class method is used to convert a value to integer, if possible. If not possible, the value will be returned unchanged.

Parameters:
vp The value to convert to an integer.
Returns:
the integer equaivalent, or unchanged

static rpt_value::pointer rpt_value::realize ( const rpt_value::pointer vp  )  [static]

The realize class method is used to convert a value to real, if possible. If not possible, the value will be returned unchanged.

Parameters:
vp The value to convert to an real.
Returns:
the real equaivalent, or unchanged

static rpt_value::pointer rpt_value::arithmetic ( const rpt_value::pointer vp  )  [static]

The arithmetic class method is used to convert a value to an arithmetic type, if possible. If not possible, the value will be returned unchanged.

Parameters:
vp The value to convert to an arithmetic type.
Returns:
the arithmetic equivalent, or unchanged

static rpt_value::pointer rpt_value::undefer ( const rpt_value::pointer vp  )  [static]

The undefer class method is used to evaluate a deferred value, if necessary. If not necessary, the value will be returned unchanged.

Parameters:
vp The deferred value to evaluate.
Returns:
the calculated result, or unchanged

static rpt_value::pointer rpt_value::stringize ( const rpt_value::pointer vp  )  [static]

The stringize class method is used to convert a value to a string, if possible. If not possible, the value will be returned unchanged.

Parameters:
vp The value to convert to a string.
Returns:
the string result, or unchanged

static rpt_value::pointer rpt_value::booleanize ( const rpt_value::pointer vp  )  [static]

The booleanize class method is used to convert a value to a boolean, if possible. If not possible, the value will be returned unchanged.

Parameters:
vp The value to convert to a boolean.
Returns:
the boolean result, or unchanged

virtual const char* rpt_value::name (  )  const [pure virtual]

virtual bool rpt_value::is_an_error (  )  const [virtual]

The is_an_error method may be used to determine whether or not an object instance is an error instance. This happens often enoygh that the code is clear this way than using a dynamic_cast<rpt_value_error *>

Returns:
true for error instances, false for everything else

Reimplemented in rpt_value_error.

virtual bool rpt_value::is_a_struct (  )  const [virtual]

The is_a_struct method may be used to determine whether or not the value is a struct (or associative array). Superficially, this should be simple, but it is complicated by things like deferred project and change states.

Returns:
true of struct-like values, false for everything else

Reimplemented in rpt_value_cstate, rpt_value_fstate, rpt_value_group, rpt_value_gstate, rpt_value_passwd, rpt_value_pconf, rpt_value_pstate, rpt_value_struct, and rpt_value_uconf.

virtual rpt_value::pointer rpt_value::lookup ( const rpt_value::pointer rhs,
bool  lvalue 
) const [virtual]

The lookup method is used to index an associate array, or locate a member within a struct.

Parameters:
rhs The member name, or array index
lvalue The result is to be used of an l-value

Reimplemented in rpt_value_cstate, rpt_value_fstate, rpt_value_group, rpt_value_gstate, rpt_value_null, rpt_value_passwd, rpt_value_pconf, rpt_value_pstate, rpt_value_reference, rpt_value_struct, and rpt_value_uconf.

virtual rpt_value::pointer rpt_value::keys (  )  const [virtual]

virtual rpt_value::pointer rpt_value::count (  )  const [virtual]

The count method is used to count the number of elements of an associative array.

Reimplemented in rpt_value_cstate, rpt_value_fstate, rpt_value_group, rpt_value_gstate, rpt_value_list, rpt_value_null, rpt_value_passwd, rpt_value_pconf, rpt_value_pstate, rpt_value_reference, rpt_value_struct, and rpt_value_uconf.

virtual const char* rpt_value::type_of (  )  const [virtual]

The type_of method is used to obtain the name of the type of the value. It differs from the name method in that it resolves references and deferred values.

Reimplemented in rpt_value_cstate, rpt_value_fstate, rpt_value_group, rpt_value_gstate, rpt_value_passwd, rpt_value_pconf, rpt_value_pstate, rpt_value_reference, and rpt_value_uconf.

virtual rpt_value::pointer rpt_value::integerize_or_null (  )  const [protected, virtual]

The integerize_or_null method is used to convert a value to an integer, if possible, or return NULL if it is not possible. This NULL is used by the integerize class method to return the unchanged value if no conversion is possible.

Reimplemented in rpt_value_boolean, rpt_value_enumeration, rpt_value_null, rpt_value_real, rpt_value_reference, rpt_value_string, and rpt_value_time.

virtual rpt_value::pointer rpt_value::realize_or_null (  )  const [protected, virtual]

The realize_or_null method is used to convert a value to an real, if possible, or return NULL if it is not possible. This NULL is used by the realize class method to return the unchanged value if no conversion is possible.

Reimplemented in rpt_value_boolean, rpt_value_enumeration, rpt_value_integer, rpt_value_null, rpt_value_reference, rpt_value_string, and rpt_value_time.

virtual rpt_value::pointer rpt_value::arithmetic_or_null (  )  const [protected, virtual]

The arithmetic_or_null method is used to convert a value to an arithmetic type (real or integer), if possible, or return NULL if it is not possible. This NULL is used by the integerize class method to return the unchanged value if no conversion is possible.

Reimplemented in rpt_value_boolean, rpt_value_enumeration, rpt_value_null, rpt_value_reference, rpt_value_string, and rpt_value_time.

virtual rpt_value::pointer rpt_value::undefer_or_null (  )  const [protected, virtual]

The undefer_or_null method is used to evaluate a deferred value, if necessary, or return NULL if it is not possible or not necessary. This NULL is used by the undefer class method to return the unchanged value if no conversion is possible.

Reimplemented in rpt_value_fstate, rpt_value_pconf, and rpt_value_pstate.

virtual rpt_value::pointer rpt_value::stringize_or_null (  )  const [protected, virtual]

The stringize_or_null method is used to convert a value to a string, if possible, or return NULL if it is not possible. This NULL is used by the stringize class method to return the unchanged value if no conversion is possible.

Reimplemented in rpt_value_boolean, rpt_value_enumeration, rpt_value_func, rpt_value_integer, rpt_value_null, rpt_value_real, rpt_value_reference, and rpt_value_time.

virtual rpt_value::pointer rpt_value::booleanize_or_null (  )  const [protected, virtual]

The booleanize_or_null method is used to convert a value to a boolean, if possible, or return NULL if it is not possible. This NULL is used by the booleanize class method to return the unchanged value if no conversion is possible.

Reimplemented in rpt_value_enumeration, rpt_value_integer, rpt_value_null, rpt_value_real, rpt_value_reference, rpt_value_string, and rpt_value_time.

rpt_value& rpt_value::operator= ( const rpt_value  )  [private]

The assignment operator. Do not use.


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

Generated on Wed Mar 12 23:37:44 2008 for Aegis by  doxygen 1.5.5