sub_functor Class Reference

#include <functor.h>

Inheritance diagram for sub_functor:

sub_functor_glue sub_functor_variable

Public Types

typedef aegis_shared_ptr
< sub_functor
pointer

Public Member Functions

virtual ~sub_functor ()
nstring name_get () const
virtual wstring evaluate (sub_context_ty *cp, const wstring_list &arg)=0
wstring operator() (sub_context_ty *cp, const wstring_list &arg)
virtual bool append_if_unused () const =0
virtual bool override () const =0
virtual bool resubstitute () const =0
virtual bool must_be_used () const =0
virtual void resubstitute_set ()=0
virtual void override_set ()=0
virtual void optional_set ()=0
virtual void append_if_unused_set ()=0

Protected Member Functions

 sub_functor (const nstring &name)

Private Member Functions

 sub_functor ()
 sub_functor (const sub_functor &)
sub_functoroperator= (const sub_functor &)

Private Attributes

nstring name

Detailed Description

The sub_functor class is used to represent an abstract substitution to be applied by a substitution context.

Definition at line 35 of file functor.h.


Member Typedef Documentation

The pointer typedef makes it easier to write pointers to instances of this class. It also permits the pointer implementation to change without having to edit every client of this API.

Definition at line 44 of file functor.h.


Constructor & Destructor Documentation

virtual sub_functor::~sub_functor (  )  [virtual]

The destructor.

sub_functor::sub_functor ( const nstring name  )  [protected]

The constructor.

sub_functor::sub_functor (  )  [private]

The default constructor. Do not use.

sub_functor::sub_functor ( const sub_functor  )  [private]

The copy constructor. Do not use.


Member Function Documentation

nstring sub_functor::name_get (  )  const [inline]

The name_get method is used to obtain the name of this functor.

Definition at line 54 of file functor.h.

virtual wstring sub_functor::evaluate ( sub_context_ty cp,
const wstring_list arg 
) [pure 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

Implemented in sub_functor_glue, and sub_functor_variable.

wstring sub_functor::operator() ( sub_context_ty cp,
const wstring_list arg 
) [inline]

This is why it's a functor: it can be called like a function. The functioncall operator 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

Definition at line 82 of file functor.h.

virtual bool sub_functor::append_if_unused (  )  const [pure 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.

Implemented in sub_functor_glue, and sub_functor_variable.

virtual bool sub_functor::override (  )  const [pure virtual]

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

Implemented in sub_functor_glue, and sub_functor_variable.

virtual bool sub_functor::resubstitute (  )  const [pure 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).

Implemented in sub_functor_glue, and sub_functor_variable.

virtual bool sub_functor::must_be_used (  )  const [pure 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.

Implemented in sub_functor_glue, and sub_functor_variable.

virtual void sub_functor::resubstitute_set (  )  [pure virtual]

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

Implemented in sub_functor_glue, and sub_functor_variable.

virtual void sub_functor::override_set (  )  [pure 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.

Implemented in sub_functor_glue, and sub_functor_variable.

virtual void sub_functor::optional_set (  )  [pure 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.

Implemented in sub_functor_glue, and sub_functor_variable.

virtual void sub_functor::append_if_unused_set (  )  [pure 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.

Implemented in sub_functor_glue, and sub_functor_variable.

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

The assignment operator. Do not use.


Field Documentation

The name instance variable is used to remember the name of this substitution. The name also doubles as an arglex_compare pattern.

Definition at line 156 of file functor.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