rpt_value_struct Class Reference

#include <struct.h>

Inheritance diagram for rpt_value_struct:

rpt_value

Public Member Functions

virtual ~rpt_value_struct ()
 rpt_value_struct ()
void assign (const nstring &name, const rpt_value::pointer &value)
rpt_value::pointer lookup (const char *name) const
rpt_value::pointer lookup (const nstring &name) const
rpt_value::pointer lookup (string_ty *name) const

Static Public Member Functions

static rpt_value::pointer create ()

Protected Member Functions

const char * name () const
bool is_a_struct () const
rpt_value::pointer undefer () const
rpt_value::pointer lookup (const rpt_value::pointer &rhs, bool lvalue) const
rpt_value::pointer keys () const
rpt_value::pointer count () const

Private Member Functions

 rpt_value_struct (const rpt_value_struct &)
rpt_value_structoperator= (const rpt_value_struct &)

Private Attributes

symtab< rpt_value::pointermembers

Detailed Description

The rpt_value_struct class is used to represent a vales consisting of zero or more name-value pairs.

Definition at line 30 of file struct.h.


Constructor & Destructor Documentation

virtual rpt_value_struct::~rpt_value_struct (  )  [virtual]

The destructor.

rpt_value_struct::rpt_value_struct (  ) 

The constructor. Use the "create" class method instead.

Note:
This method is only public so that rpt_expr_struct::evaluate can use it. No other objects shall use this constructor.

rpt_value_struct::rpt_value_struct ( const rpt_value_struct  )  [private]

The copy constructor. Do not use.


Member Function Documentation

static rpt_value::pointer rpt_value_struct::create (  )  [static]

The create class method is used to create new dynamically allocated instances of this class.

void rpt_value_struct::assign ( const nstring name,
const rpt_value::pointer value 
)

The assign method is used to set a struct member by name.

Parameters:
name The name of the struct member.
value The value of the struct member.

rpt_value::pointer rpt_value_struct::lookup ( const char *  name  )  const

The lookup method is used to obtain the vale of the named struct member.

Parameters:
name The name of the member to look for.
Returns:
the value of the member, or nul if not present.

rpt_value::pointer rpt_value_struct::lookup ( const nstring name  )  const

The lookup method is used to obtain the vale of the named struct member.

Parameters:
name The name of the member to look for.
Returns:
the value of the member, or nul if not present.

rpt_value::pointer rpt_value_struct::lookup ( string_ty name  )  const

The lookup method is used to obtain the vale of the named struct member.

Parameters:
name The name of the member to look for.
Returns:
the value of the member, or nul if not present.

const char* rpt_value_struct::name (  )  const [protected, virtual]

The name method is used to obtain the name of the type of the value.

Implements rpt_value.

bool rpt_value_struct::is_a_struct (  )  const [protected, 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 from rpt_value.

rpt_value::pointer rpt_value_struct::undefer (  )  const [protected]

rpt_value::pointer rpt_value_struct::lookup ( const rpt_value::pointer rhs,
bool  lvalue 
) const [protected, 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 from rpt_value.

rpt_value::pointer rpt_value_struct::keys (  )  const [protected, virtual]

The keys method is used to obtain a list of keys of an associative array.

Reimplemented from rpt_value.

rpt_value::pointer rpt_value_struct::count (  )  const [protected, virtual]

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

Reimplemented from rpt_value.

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

The assignment operator. Do not use.


Field Documentation

The members instance variable is used ro remember the value of each member of the struct.

It is mutable in that there are times when lookup() will create an entry with a nul value, as if it contains an infinite set of nul values.

Definition at line 125 of file struct.h.


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