#include <glue.h>
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_glue & | operator= (const sub_functor_glue &) |
Private Attributes | |
func_p | what |
bool | resub |
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.
typedef wstring(* sub_functor_glue::func_p)(sub_context_ty *scp, const wstring_list &arg) |
virtual sub_functor_glue::~sub_functor_glue | ( | ) | [virtual] |
The destructor.
The constructor. May not be called directly, you must always go via the create class method.
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.
The create class method is used to create a new instance of this class. This ensures that smart pointers are always used.
name | The name of this substitution | |
what | The function to perform the substitution |
The create class method is used to create a new instance of this class. This ensures that smart pointers are always used.
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.
scp | Substitution context | |
arg | The list of arguments |
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.
func_p sub_functor_glue::what [private] |
bool sub_functor_glue::resub [private] |