SXEval 1.0.3
A generic s-expression interpreter library.
Loading...
Searching...
No Matches
sxeval::Variable< T > Class Template Reference

The Variable class represents a variable in the SXEval library. More...

#include <Variable.hpp>

Inheritance diagram for sxeval::Variable< T >:
sxeval::IOperand< T > sxeval::IInstruction< T >

Public Member Functions

 Variable (T &var, const std::string &name)
 Default constructor.
 
TgetResult () override
 Get a reference to the variable.
 
std::string toString () const override
 String representation of the variable.
 
- Public Member Functions inherited from sxeval::IOperand< T >
virtual ~IOperand () override=default
 Default destructor.
 
- Public Member Functions inherited from sxeval::IInstruction< T >
virtual ~IInstruction ()=default
 Default destructor.
 

Detailed Description

template<typename T>
class sxeval::Variable< T >

The Variable class represents a variable in the SXEval library.

Template Parameters
TThe type of the variable. The supported types are int, signed char, short int, long int, unsigned int, unsigned char, unsigned long int, float, double and long double.

Constructor & Destructor Documentation

◆ Variable()

template<typename T >
sxeval::Variable< T >::Variable ( T var,
const std::string &  name 
)
inline

Default constructor.

Parameters
varThe variable to store.
nameThe name of the variable.
Note
The name is used for debugging and string representation purposes.

Member Function Documentation

◆ getResult()

template<typename T >
T & sxeval::Variable< T >::getResult ( )
inlineoverridevirtual

Get a reference to the variable.

Returns
A reference to the variable.

Implements sxeval::IInstruction< T >.

◆ toString()

template<typename T >
std::string sxeval::Variable< T >::toString ( ) const
inlineoverridevirtual

String representation of the variable.

Returns
The name of the variable.

Implements sxeval::IInstruction< T >.


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