muParserX 2.0.0
Loading...
Searching...
No Matches
mup::Variable Class Reference

The variable class represents a parser variable. More...

#include <mpVariable.h>

Inheritance diagram for mup::Variable:
Collaboration diagram for mup::Variable:

Public Member Functions

 Variable (IValue *pVal)
 Create a variable and bind a value to it.
 
virtual IValueoperator= (const Value &val)
 Assign a value to the variable.
 
virtual char_type GetType () const
 Returns a character representing the type of the variable.
 
IValueGetPtr () const
 Returns the Value pointer bound to this variable.
 
- Public Member Functions inherited from mup::IValue
int GetDim () const
 Returns the dimension of the value represented by a value object.
 
bool IsNonComplexScalar () const
 Returns true if the type is either floating point or interger.
 
bool IsScalar () const
 Returns true if the type is not a vector and not a string.
 
bool IsScalarOrBool () const
 Returns true if this value represents a scalar value or a boolean value.
 
bool IsInteger () const
 Returns true if this value is a noncomplex integer.
 
bool IsMatrix () const
 Returns true if this value is an array.
 
bool IsComplex () const
 Returns true if this value is a complex value.
 
bool IsString () const
 Returns true if this value is a string value.
 
- Public Member Functions inherited from mup::IToken
ECmdCode GetCode () const
 return the token code.
 
const string_typeGetIdent () const
 Return the token identifier string.
 

Additional Inherited Members

- Protected Member Functions inherited from mup::IToken
virtual ~IToken ()
 Destructor (trivial).
 
 IToken (const IToken &ref)
 Copy constructor.
 

Detailed Description

The variable class represents a parser variable.

This class stores a pointer to a value object and refers all operations to this value object.

Constructor & Destructor Documentation

◆ Variable()

mup::Variable::Variable ( IValue * pVal)

Create a variable and bind a value to it.

Parameters
pValPointer of the value to bind to this variable.

It is possible to create an empty variable object by setting pVal to nullptr. Such variable objects must be bound later in order to be of any use. The parser does NOT assume ownership over the pointer!

Here is the call graph for this function:

Member Function Documentation

◆ GetPtr()

IValue * mup::Variable::GetPtr ( ) const

Returns the Value pointer bound to this variable.

Exceptions
nothrow

◆ GetType()

char_type mup::Variable::GetType ( ) const
virtual

Returns a character representing the type of the variable.

Exceptions
nothrow

Implements mup::IValue.

◆ operator=()

IValue & mup::Variable::operator= ( const Value & ref)
virtual

Assign a value to the variable.

Parameters
refReference to the value to be assigned


muParserX documentation - (C) 2010 Ingo Berg