sub_functor_variable Class Reference

#include <variable.h>

Inheritance diagram for sub_functor_variable:

sub_functor

Public Member Functions

virtual ~sub_functor_variable ()

Static Public Member Functions

static pointer create (const nstring &name, const nstring &value)

Protected Member Functions

wstring evaluate (sub_context_ty *, const wstring_list &)
bool append_if_unused () const
bool override () const
bool resubstitute () const
bool must_be_used () const
void resubstitute_set ()
void override_set ()
void optional_set ()
void append_if_unused_set ()

Private Member Functions

 sub_functor_variable (const nstring &name, const nstring &value)
 sub_functor_variable ()
 sub_functor_variable (const sub_functor_variable &)
sub_functor_variableoperator= (const sub_functor_variable &)

Private Attributes

wstring value
bool used
bool append_if_unused_flag
bool override_flag
bool resubstitute_flag

Detailed Description

The sub_functor_variable class is used to represent a substitution which inserts a string.

Definition at line 29 of file variable.h.


Constructor & Destructor Documentation

virtual sub_functor_variable::~sub_functor_variable (  )  [virtual]

The destructor.

sub_functor_variable::sub_functor_variable ( const nstring name,
const nstring value 
) [private]

The constructor. It is private on purpose: always use the create class method.

Parameters:
name The name of the variable
value The value to assign to the variable.

sub_functor_variable::sub_functor_variable (  )  [private]

The default constructor.

sub_functor_variable::sub_functor_variable ( const sub_functor_variable  )  [private]

The copy constructor.


Member Function Documentation

static pointer sub_functor_variable::create ( const nstring name,
const nstring value 
) [static]

The create class method is used to allocate new instances of this class. It exists to ensure that only smart pointers are used.

Parameters:
name The name of the variable
value The value to assign to the variable.
Returns:
pointer to new instance

wstring sub_functor_variable::evaluate ( sub_context_ty cp,
const wstring_list arg 
) [protected, virtual]

The evaluate method is used to evaluate this functor in the given context, with the given arguments.

Parameters:
scp Substitution context
arg The list of arguments
Returns:
a wide string containng the text to be substituted

Implements sub_functor.

bool sub_functor_variable::append_if_unused (  )  const [protected, virtual]

The append_if_unused method is used to determine hether or not the value of this fucntor should be appended to the current substitution if it is not used at all in the substitution. Almost always false.

Implements sub_functor.

bool sub_functor_variable::override (  )  const [protected, virtual]

The override method is used to determine whether or not this functor overrides an arlier functor of the same name. Almost always false.

Implements sub_functor.

bool sub_functor_variable::resubstitute (  )  const [protected, virtual]

The override method is used to determine whether or not the output of this functor should be rescanned for substitutions. Almost always false (making it an error to be ambiguous).

Implements sub_functor.

bool sub_functor_variable::must_be_used (  )  const [protected, virtual]

The must_be_used method is used to determine whether or not it is an error if this functor is not used in the current substitution. Almost always true for non-builtins.

Implements sub_functor.

void sub_functor_variable::resubstitute_set (  )  [protected, virtual]

The resubstitute_set method is used to request that the output be resubstituted. This is sticky until the context is reset.

Implements sub_functor.

void sub_functor_variable::override_set (  )  [protected, virtual]

The override_set method is used to request that this functor be considereed to override the value of an earlier functor of the same name. This is sticky until the context is reset.

Implements sub_functor.

void sub_functor_variable::optional_set (  )  [protected, virtual]

The optional_set method is used to request that the non-use of this fucntor be a non-error. This is sticky until the context is reset.

Implements sub_functor.

void sub_functor_variable::append_if_unused_set (  )  [protected, virtual]

The append_if_unused_set method is used to request that the value of this fucntor be appended to the substitution if this functor has not been used anywhere in the current substitution. This is sticky until the context is reset.

Implements sub_functor.

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

The assignment operator.


Field Documentation

The value instance variable is used to remember the value of this variable.

Definition at line 98 of file variable.h.

The used instance variable is used to remember whether or not this variable has been used.

Definition at line 104 of file variable.h.

The append_if_unused_flag instance variable is used to remember whether or not the value of this variable should be appended to the substitution if it has not yet been used.

Definition at line 111 of file variable.h.

The override_flag instance variable is used to remember whether or not this variable is deliberately overriding a builtin substitution.

Definition at line 118 of file variable.h.

The resubstitute_flag instance variable is used to remember whether or not the outrput of this functor shall be rescanned for more substitutions. Almost always false.

Definition at line 125 of file variable.h.


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

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