Xalan-C++ API Reference  1.12.0
Classes | Public Types | Public Member Functions | Friends | List of all members
xalanc::VariablesStack Class Reference

Defines a class to keep track of a stack for macro arguments. More...

#include <xalanc/XSLT/VariablesStack.hpp>

Classes

class  InvalidStackContextException
 
struct  ParamsVectorEntry
 
class  PushParamFunctor
 
class  StackEntry
 

Public Types

enum  { eDefaultStackSize = 100 }
 
typedef unsigned long size_type
 
typedef XalanVector< ParamsVectorEntryParamsVectorType
 
typedef XalanVector< const ElemVariable * > RecursionGuardStackType
 
typedef XalanVector< const ElemTemplateElement * > ElemTemplateElementStackType
 
typedef XalanVector< StackEntryVariableStackStackType
 

Public Member Functions

 VariablesStack (MemoryManager &theManager)
 Constructor for a variable stack. More...
 
 ~VariablesStack ()
 
void reset ()
 Reset the stack. More...
 
void pushElementFrame (const ElemTemplateElement *elem)
 Push a frame marker for an element. More...
 
void popElementFrame ()
 Pop a frame marker for an element. More...
 
void pushContextMarker ()
 Push a context marker onto the stack to let us know when to stop searching for a var. More...
 
void popContextMarker ()
 Pop the current context from the current context stack. More...
 
void pushParams (const ParamsVectorType &theParams)
 Push the provided objects as parameters. More...
 
const XObjectPtr getParamVariable (const XalanQName &qname, StylesheetExecutionContext &executionContext, bool &fNameFound)
 Given a name, return a string representing the value, but don't look in the global space. More...
 
const XObjectPtr getVariable (const XalanQName &qname, StylesheetExecutionContext &executionContext, bool &fNameFound)
 Given a name, find the corresponding XObject. More...
 
void pushVariable (const XalanQName &name, const ElemVariable *var, const ElemTemplateElement *e)
 Push a named variable onto the processor variable stack. More...
 
void pushVariable (const XalanQName &name, const XObjectPtr &val, const ElemTemplateElement *e)
 Push a named variable onto the processor variable stack. More...
 
void start ()
 Mark the top of the stack. More...
 
void resetParams ()
 Reset all params in the current stack frame. More...
 
void markGlobalStackFrame ()
 Mark the top of the global stack frame. More...
 
void unmarkGlobalStackFrame ()
 Clear the marking of the global stack frame. More...
 
void setCurrentStackFrameIndex (size_type currentStackFrameIndex=~0u)
 Set the top of the stack frame from where a search for a variable or param should take place. More...
 
size_type getCurrentStackFrameIndex () const
 Get the top of the stack frame from where a search for a variable or param should take place. More...
 
size_type getGlobalStackFrameIndex () const
 Get the top of the global stack frame. More...
 
size_type getStackSize () const
 

Friends

class CommitPushParams
 
class CommitPushElementFrame
 
class EnsurePop
 
class PushParamFunctor
 
class SetAndRestoreForceGlobalSearch
 

Detailed Description

Defines a class to keep track of a stack for macro arguments.

Definition at line 60 of file VariablesStack.hpp.

Member Typedef Documentation

◆ ElemTemplateElementStackType

Definition at line 148 of file VariablesStack.hpp.

◆ ParamsVectorType

Definition at line 146 of file VariablesStack.hpp.

◆ RecursionGuardStackType

Definition at line 147 of file VariablesStack.hpp.

◆ size_type

typedef unsigned long xalanc::VariablesStack::size_type

Definition at line 64 of file VariablesStack.hpp.

◆ VariableStackStackType

Definition at line 481 of file VariablesStack.hpp.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
eDefaultStackSize 

Definition at line 489 of file VariablesStack.hpp.

Constructor & Destructor Documentation

◆ VariablesStack()

xalanc::VariablesStack::VariablesStack ( MemoryManager &  theManager)
explicit

Constructor for a variable stack.

◆ ~VariablesStack()

xalanc::VariablesStack::~VariablesStack ( )

Member Function Documentation

◆ getCurrentStackFrameIndex()

size_type xalanc::VariablesStack::getCurrentStackFrameIndex ( ) const
inline

Get the top of the stack frame from where a search for a variable or param should take place.

Returns
current value of index

Definition at line 281 of file VariablesStack.hpp.

◆ getGlobalStackFrameIndex()

size_type xalanc::VariablesStack::getGlobalStackFrameIndex ( ) const
inline

Get the top of the global stack frame.

Returns
current value of index

Definition at line 292 of file VariablesStack.hpp.

◆ getParamVariable()

const XObjectPtr xalanc::VariablesStack::getParamVariable ( const XalanQName qname,
StylesheetExecutionContext executionContext,
bool &  fNameFound 
)
inline

Given a name, return a string representing the value, but don't look in the global space.

Since the variable may not yet have been evaluated, this may return a null XObjectPtr.

Parameters
theNamename of variable
exeuctionContextthe current execution context
fNameFoundset to true if the name was found, false if not.
Returns
pointer to XObject for variable

Definition at line 170 of file VariablesStack.hpp.

◆ getStackSize()

size_type xalanc::VariablesStack::getStackSize ( ) const
inline

Definition at line 484 of file VariablesStack.hpp.

◆ getVariable()

const XObjectPtr xalanc::VariablesStack::getVariable ( const XalanQName qname,
StylesheetExecutionContext executionContext,
bool &  fNameFound 
)
inline

Given a name, find the corresponding XObject.

If the variable exists, but has not yet been evaluated, the variable will be evaluated and the result returned. This may return a null XObjectPtr, if the variable was not found.

Parameters
qnamename of variable
exeuctionContextthe current execution context
fNameFoundset to true if the name was found, false if not.
Returns
pointer to the corresponding XObject

Definition at line 190 of file VariablesStack.hpp.

◆ markGlobalStackFrame()

void xalanc::VariablesStack::markGlobalStackFrame ( )

Mark the top of the global stack frame.

◆ popContextMarker()

void xalanc::VariablesStack::popContextMarker ( )

Pop the current context from the current context stack.

◆ popElementFrame()

void xalanc::VariablesStack::popElementFrame ( )

Pop a frame marker for an element.

Parameters
elemthe element

◆ pushContextMarker()

void xalanc::VariablesStack::pushContextMarker ( )

Push a context marker onto the stack to let us know when to stop searching for a var.

Parameters
callercaller node
sourceNodesource node

◆ pushElementFrame()

void xalanc::VariablesStack::pushElementFrame ( const ElemTemplateElement elem)

Push a frame marker for an element.

Parameters
elemthe element

◆ pushParams()

void xalanc::VariablesStack::pushParams ( const ParamsVectorType theParams)

Push the provided objects as parameters.

You must call popContextMarker() when you are done with the arguments.

Parameters
theParamThe vector containing the parameters.

◆ pushVariable() [1/2]

void xalanc::VariablesStack::pushVariable ( const XalanQName name,
const ElemVariable var,
const ElemTemplateElement e 
)

Push a named variable onto the processor variable stack.

Don't forget to call startContext before pushing a series of arguments for a given template.

Parameters
namename of variable
valpointer to ElemVariable
eelement marker for variable

◆ pushVariable() [2/2]

void xalanc::VariablesStack::pushVariable ( const XalanQName name,
const XObjectPtr val,
const ElemTemplateElement e 
)

Push a named variable onto the processor variable stack.

Don't forget to call startContext before pushing a series of arguments for a given template.

Parameters
namename of variable
valpointer to XObject value
eelement marker for variable

◆ reset()

void xalanc::VariablesStack::reset ( )

Reset the stack.

◆ resetParams()

void xalanc::VariablesStack::resetParams ( )

Reset all params in the current stack frame.

◆ setCurrentStackFrameIndex()

void xalanc::VariablesStack::setCurrentStackFrameIndex ( size_type  currentStackFrameIndex = ~0u)
inline

Set the top of the stack frame from where a search for a variable or param should take place.

Calling with no parameter will cause the index to be set to the size of the stack.

Parameters
currentStackFrameIndexnew value of index

Definition at line 260 of file VariablesStack.hpp.

◆ start()

void xalanc::VariablesStack::start ( )

Mark the top of the stack.

◆ unmarkGlobalStackFrame()

void xalanc::VariablesStack::unmarkGlobalStackFrame ( )

Clear the marking of the global stack frame.

Friends And Related Function Documentation

◆ CommitPushElementFrame

friend class CommitPushElementFrame
friend

Definition at line 553 of file VariablesStack.hpp.

◆ CommitPushParams

friend class CommitPushParams
friend

Definition at line 514 of file VariablesStack.hpp.

◆ EnsurePop

friend class EnsurePop
friend

Definition at line 554 of file VariablesStack.hpp.

◆ PushParamFunctor

friend class PushParamFunctor
friend

Definition at line 555 of file VariablesStack.hpp.

◆ SetAndRestoreForceGlobalSearch

friend class SetAndRestoreForceGlobalSearch
friend

Definition at line 556 of file VariablesStack.hpp.


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