Murl::Util::Evaluator Class Reference

An expression evaluator. More...

#include "murl_util_evaluator.h"

Public Member Functions

 Evaluator ()
 The constructor.
 
virtual ~Evaluator ()
 The destructor.
 
virtual Bool AddConstants (const IAttributes *constants)
 Add a set of user-defined constants used during evaluation. More...
 
virtual Bool AddVariables (IAttributes *variables)
 Add a set of user-defined variables used during evaluation. More...
 
virtual Bool Update ()
 Update the evaluator. More...
 
virtual Bool Evaluate (const String &expression, String &result)
 Evaluate a given expression string. More...
 
virtual UInt32 GetNumberOfConstantSets () const
 Get the number of known constant sets. More...
 
virtual UInt32 GetNumberOfConstants (UInt32 constantSetIndex) const
 Get the number of known constants for a given set. More...
 
virtual String GetConstantName (UInt32 constantSetIndex, UInt32 constantIndex) const
 Get the name of a given constant. More...
 
virtual String GetConstantValue (UInt32 constantSetIndex, UInt32 constantIndex) const
 Get the value of a given constant. More...
 
virtual UInt32 GetNumberOfVariableSets () const
 Get the number of known variable sets. More...
 
virtual UInt32 GetNumberOfVariables (UInt32 variableSetIndex) const
 Get the number of known variables for a given set. More...
 
virtual String GetVariableName (UInt32 variableSetIndex, UInt32 variableIndex) const
 Get the name of a given variable. More...
 
virtual String GetVariableValue (UInt32 variableSetIndex, UInt32 variableIndex) const
 Get the value of a given variable. More...
 
virtual UInt32 GetNumberOfFunctionSets () const
 Get the number of known function sets. More...
 
virtual UInt32 GetNumberOfFunctions (UInt32 functionSetIndex) const
 Get the number of known functions for a given set. More...
 
virtual String GetFunctionName (UInt32 functionSetIndex, UInt32 functionIndex) const
 Get the name of a given function. More...
 
virtual SInt32 GetFunctionMinNumberOfArguments (UInt32 functionSetIndex, UInt32 functionIndex) const
 Get the minimum number of arguments for a given function. More...
 
virtual SInt32 GetFunctionMaxNumberOfArguments (UInt32 functionSetIndex, UInt32 functionIndex) const
 Get the maximum number of arguments for a given function. More...
 
virtual String GetFunctionArgumentName (UInt32 functionSetIndex, UInt32 functionIndex, UInt32 argumentIndex) const
 Get the name of a given function's argument. More...
 

Detailed Description

An expression evaluator.

Member Function Documentation

◆ AddConstants()

virtual Bool Murl::Util::Evaluator::AddConstants ( const IAttributes constants)
virtual

Add a set of user-defined constants used during evaluation.

Parameters
constantsThe user-defined constants.
Returns
true if successful.

◆ AddVariables()

virtual Bool Murl::Util::Evaluator::AddVariables ( IAttributes variables)
virtual

Add a set of user-defined variables used during evaluation.

Parameters
variablesThe user-defined variables.
Returns
true if successful.

◆ Update()

virtual Bool Murl::Util::Evaluator::Update ( )
virtual

Update the evaluator.

Whenever an input constant or variable has changed, this method must be called prior to Evaluate() to reflect the actual changes.

Returns
true if successful.

◆ Evaluate()

virtual Bool Murl::Util::Evaluator::Evaluate ( const String expression,
String result 
)
virtual

Evaluate a given expression string.

Parameters
expressionThe expression string to evaluate
resultA reference to a string receiving the result.
Returns
true if successful.

◆ GetNumberOfConstantSets()

virtual UInt32 Murl::Util::Evaluator::GetNumberOfConstantSets ( ) const
virtual

Get the number of known constant sets.

Returns
The number of constant sets.

◆ GetNumberOfConstants()

virtual UInt32 Murl::Util::Evaluator::GetNumberOfConstants ( UInt32  constantSetIndex) const
virtual

Get the number of known constants for a given set.

Parameters
constantSetIndexThe index of the constant set.
Returns
The number of constant sets.

◆ GetConstantName()

virtual String Murl::Util::Evaluator::GetConstantName ( UInt32  constantSetIndex,
UInt32  constantIndex 
) const
virtual

Get the name of a given constant.

Parameters
constantSetIndexThe index of the constant set.
constantIndexThe index of the constant.
Returns
The name of the constant.

◆ GetConstantValue()

virtual String Murl::Util::Evaluator::GetConstantValue ( UInt32  constantSetIndex,
UInt32  constantIndex 
) const
virtual

Get the value of a given constant.

Parameters
constantSetIndexThe index of the constant set.
constantIndexThe index of the constant.
Returns
The value of the constant.

◆ GetNumberOfVariableSets()

virtual UInt32 Murl::Util::Evaluator::GetNumberOfVariableSets ( ) const
virtual

Get the number of known variable sets.

Returns
The number of variable sets.

◆ GetNumberOfVariables()

virtual UInt32 Murl::Util::Evaluator::GetNumberOfVariables ( UInt32  variableSetIndex) const
virtual

Get the number of known variables for a given set.

Parameters
variableSetIndexThe index of the variable set.
Returns
The number of variables.

◆ GetVariableName()

virtual String Murl::Util::Evaluator::GetVariableName ( UInt32  variableSetIndex,
UInt32  variableIndex 
) const
virtual

Get the name of a given variable.

Parameters
variableSetIndexThe index of the variable set.
variableIndexThe index of the variable.
Returns
The name of the variable.

◆ GetVariableValue()

virtual String Murl::Util::Evaluator::GetVariableValue ( UInt32  variableSetIndex,
UInt32  variableIndex 
) const
virtual

Get the value of a given variable.

Parameters
variableSetIndexThe index of the variable set.
variableIndexThe index of the variable.
Returns
The value of the variable.

◆ GetNumberOfFunctionSets()

virtual UInt32 Murl::Util::Evaluator::GetNumberOfFunctionSets ( ) const
virtual

Get the number of known function sets.

Returns
The number of function sets.

◆ GetNumberOfFunctions()

virtual UInt32 Murl::Util::Evaluator::GetNumberOfFunctions ( UInt32  functionSetIndex) const
virtual

Get the number of known functions for a given set.

Parameters
functionSetIndexThe index of the function set.
Returns
The number of functions.

◆ GetFunctionName()

virtual String Murl::Util::Evaluator::GetFunctionName ( UInt32  functionSetIndex,
UInt32  functionIndex 
) const
virtual

Get the name of a given function.

Parameters
functionSetIndexThe index of the function set.
functionIndexThe index of the function.
Returns
The name of the function.

◆ GetFunctionMinNumberOfArguments()

virtual SInt32 Murl::Util::Evaluator::GetFunctionMinNumberOfArguments ( UInt32  functionSetIndex,
UInt32  functionIndex 
) const
virtual

Get the minimum number of arguments for a given function.

Parameters
functionSetIndexThe index of the function set.
functionIndexThe index of the function.
Returns
The minimum argument count.

◆ GetFunctionMaxNumberOfArguments()

virtual SInt32 Murl::Util::Evaluator::GetFunctionMaxNumberOfArguments ( UInt32  functionSetIndex,
UInt32  functionIndex 
) const
virtual

Get the maximum number of arguments for a given function.

Parameters
functionSetIndexThe index of the function set.
functionIndexThe index of the function.
Returns
The maximum argument count.

◆ GetFunctionArgumentName()

virtual String Murl::Util::Evaluator::GetFunctionArgumentName ( UInt32  functionSetIndex,
UInt32  functionIndex,
UInt32  argumentIndex 
) const
virtual

Get the name of a given function's argument.

Parameters
functionSetIndexThe index of the function set.
functionIndexThe index of the function.
argumentIndexThe index of the argument.
Returns
The name of the argument.

The documentation for this class was generated from the following file:
  • murl_util_evaluator.h


Copyright © 2011-2024 Spraylight GmbH.