#include <multicontext.h>
Inheritance diagram for MultiContext:
Public Member Functions | |
MultiContext (RuleContext *isuperContext, const int icontrolVariableId, const string icontrolVariableName) | |
Constructor. | |
MultiContext (RuleContext *isuperContext, const int icontrolVariableId) | |
Constructor, that generates name for a control varaible. | |
virtual const string | getVariableNameSufix (const bool stripControlVariableDollar) |
Returns a sufix for of a varaible name. | |
virtual const string | getVariableNamePrefix () |
Returns a sufix for of a varaible name. | |
virtual void | generateVariableNames (const Node::VariableList &vlist, Node::Assignment &phpAssign, Node::Assignment &tplAssign) |
Generates appropriate names to variables and stores them in assignments. | |
virtual void | enterContext (List *phpOut, List *tplOut) |
Run at the begining of RuleContext::execute. | |
virtual const string | generateVariableName () |
Generates one variable name. | |
virtual void | registerSmartyVariable (const string &variable) |
Registers smarty varaible in the context. | |
virtual void | processSmartyAssign (SmartyAssign *smartyAssign) |
Processes one SmartyAssign. | |
virtual void | processTemplate (Node *tpl) const |
Processes template after refactoring. | |
Private Attributes | |
RuleContext * | superContext |
A pointer to super context. | |
int | usedNames |
Number of generated variable names. | |
const string | namePrefix |
A name prefix for the variables. | |
const string | controlVariableName |
The name of the control variable. | |
const int | controlVariableId |
The id of the control variable. |
In this context the valuses of exported variables have to be stored in arrays, with appropriate names. The arrays are indexed by given control variable. The names of these arrays are registered.
Definition at line 11 of file multicontext.h.
|
Constructor.
Definition at line 3 of file multicontext.cpp. |
|
Constructor, that generates name for a control varaible.
Definition at line 12 of file multicontext.cpp. |
|
Run at the begining of RuleContext::execute.
Reimplemented from RuleContext. Definition at line 56 of file multicontext.cpp. References namePrefix, and registerSmartyVariable(). |
|
Generates one variable name.
Implements RuleContext. Definition at line 64 of file multicontext.cpp. References getVariableNamePrefix(), registerSmartyVariable(), and usedNames. Referenced by generateVariableNames(). |
|
Generates appropriate names to variables and stores them in assignments.
Implements RuleContext. Definition at line 36 of file multicontext.cpp. References controlVariableId, controlVariableName, generateVariableName(), getVariableNameSufix(), RuleContext::getVariableNameSufix(), namePrefix, and superContext. |
|
Returns a sufix for of a varaible name.
Implements RuleContext. Definition at line 29 of file multicontext.cpp. References namePrefix. Referenced by generateVariableName(). |
|
Returns a sufix for of a varaible name. In case of control variables e.g. in for statement, a leading dollar may be skiped, when exporting control variable to template. Implements RuleContext. Definition at line 21 of file multicontext.cpp. References controlVariableName, RuleContext::getVariableNameSufix(), and superContext. Referenced by generateVariableNames(). |
|
Processes one SmartyAssign.
Implements RuleContext. Definition at line 76 of file multicontext.cpp. References SmartyAssign::getAssignment(), SmartyAssign::getVariable(), and SmartyAssign::setPHPOut(). |
|
Processes template after refactoring.
Implements RuleContext. Definition at line 83 of file multicontext.cpp. References controlVariableId, controlVariableName, and substituteNode(). |
|
Registers smarty varaible in the context.
Implements RuleContext. Definition at line 72 of file multicontext.cpp. References RuleContext::registerSmartyVariable(), and superContext. Referenced by enterContext(), and generateVariableName(). |
|
The id of the control variable.
Definition at line 21 of file multicontext.h. Referenced by generateVariableNames(), and processTemplate(). |
|
The name of the control variable.
Definition at line 19 of file multicontext.h. Referenced by generateVariableNames(), getVariableNameSufix(), and processTemplate(). |
|
A name prefix for the variables.
Definition at line 17 of file multicontext.h. Referenced by enterContext(), generateVariableNames(), and getVariableNamePrefix(). |
|
A pointer to super context.
Definition at line 13 of file multicontext.h. Referenced by generateVariableNames(), getVariableNameSufix(), and registerSmartyVariable(). |
|
Number of generated variable names.
Definition at line 15 of file multicontext.h. Referenced by generateVariableName(). |