sub_functor_glue Class Reference

#include <glue.h>

Inheritance diagram for sub_functor_glue:

sub_functor

Public Types

typedef wstring(* func_p )(sub_context_ty *scp, const wstring_list &arg)

Public Member Functions

virtual ~sub_functor_glue ()

Static Public Member Functions

static pointer create (const nstring &name, func_p what)
static pointer create (const nstring &name, func_p what, bool resub)

Protected Member Functions

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

Private Member Functions

 sub_functor_glue (const nstring &name, func_p what, bool resub)
 sub_functor_glue ()
 sub_functor_glue (const sub_functor_glue &)
sub_functor_glueoperator= (const sub_functor_glue &)

Private Attributes

func_p what
bool resub

Detailed Description

The sub_functor_glue class is used to represent calling a function to do the work of the functor.

DO NOT write new substitutions using this class. New substitutions should always be implemented by derving from the sub_functor abstract base class.

Definition at line 33 of file glue.h.


Member Typedef Documentation


Constructor & Destructor Documentation

virtual sub_functor_glue::~sub_functor_glue (  )  [virtual]

The destructor.

sub_functor_glue::sub_functor_glue ( const nstring name,
func_p  what,
bool  resub 
) [private]

The constructor. May not be called directly, you must always go via the create class method.

Parameters:
name The name of this substitution
what The function to perform the substitution
resub the output of the substitution is to be re-interpreted again for substitutions

sub_functor_glue::sub_functor_glue (  )  [private]

The default constructor. Do not use.

sub_functor_glue::sub_functor_glue ( const sub_functor_glue  )  [private]

The copy constructor. Do not use.


Member Function Documentation

static pointer sub_functor_glue::create ( const nstring name,
func_p  what 
) [static]

The create class method is used to create a new instance of this class. This ensures that smart pointers are always used.

Parameters:
name The name of this substitution
what The function to perform the substitution

static pointer sub_functor_glue::create ( const nstring name,
func_p  what,
bool  resub 
) [static]

The create class method is used to create a new instance of this class. This ensures that smart pointers are always used.

Parameters:
name The name of this substitution
what The function to perform the substitution
resub the output of the substitution is to be re-interpreted again for substitutions

wstring sub_functor_glue::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_glue::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_glue::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_glue::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_glue::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_glue::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_glue::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_glue::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.

void sub_functor_glue::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.

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

The assignment operator. Do not use.


Field Documentation

The what instance variable is used to remember the function to call to perform the substitution.

Definition at line 118 of file glue.h.

bool sub_functor_glue::resub [private]

The resub instance variable is used to remeber whether or not the output of this substritution is to be reexamined fro substitutions.

Definition at line 125 of file glue.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