|
SXEval 1.0.3
A generic s-expression interpreter library.
|
The AOperation class is an abstract base class for operations in the SXEval library. More...
#include <AOperation.hpp>
Public Member Functions | |
| AOperation (const std::vector< IInstruction< T > * > &args) | |
| Constructor that initializes the operation. | |
| AOperation (const AOperation &other) | |
| Copy constructor. | |
| virtual | ~AOperation () override=default |
| Default destructor. | |
| T & | getResult () override |
| Get the result of the operation. | |
| virtual void | execute ()=0 |
| Execute the operation. | |
Public Member Functions inherited from sxeval::IInstruction< T > | |
| virtual | ~IInstruction ()=default |
| Default destructor. | |
| virtual std::string | toString () const =0 |
| String representation of the instruction. | |
Static Public Attributes | |
| static constexpr const int | UNLIMITED_ARITY = -1 |
| The value for an unlimited number of arguments. | |
| static constexpr const char * | KEY = "AOperation" |
| Default key for the operation. | |
| static constexpr const int | ARITY_MIN = 0 |
| Default minimum number of arguments for the operation. | |
| static constexpr const int | ARITY_MAX = UNLIMITED_ARITY |
| Default maximum number of arguments for the operation. | |
Protected Attributes | |
| T | _result |
| std::vector< std::reference_wrapper< T > > | _args |
The AOperation class is an abstract base class for operations in the SXEval library.
It represents an operation that can be executed with a variable number of arguments. The result of the operation is stored in a member variable.
| T | The type of values handled by the SXEval library. The supported types are int, signed char, short int, long int, unsigned int, unsigned char, unsigned long int, float, double and long double. |
| sxeval::AOperation< T >::AOperation | ( | const std::vector< IInstruction< T > * > & | args | ) |
Constructor that initializes the operation.
|
inline |
Copy constructor.
| other | The operation to copy. |
|
overridevirtualdefault |
Default destructor.
Execute the operation.
This method must be implemented by derived classes to perform the specific operation logic.
Implemented in sxeval::operations::AbsoluteValue< T >, sxeval::operations::Addition< T >, sxeval::operations::ArcCosh< T >, sxeval::operations::ArcCosine< T >, sxeval::operations::ArcSine< T >, sxeval::operations::ArcSinh< T >, sxeval::operations::ArcTangent< T >, sxeval::operations::ArcTangent2< T >, sxeval::operations::ArcTanh< T >, sxeval::operations::Average< T >, sxeval::operations::Ceiling< T >, sxeval::operations::Cosh< T >, sxeval::operations::Cosine< T >, sxeval::operations::DegreesToGradians< T >, sxeval::operations::DegreesToRadians< T >, sxeval::operations::Division< T >, sxeval::operations::Equal< T >, sxeval::operations::Exp< T >, sxeval::operations::Expm1< T >, sxeval::operations::Exponentiation< T >, sxeval::operations::Floor< T >, sxeval::operations::GradiansToDegrees< T >, sxeval::operations::Greater< T >, sxeval::operations::GreaterOrEqual< T >, sxeval::operations::Hypotenuse< T >, sxeval::operations::Less< T >, sxeval::operations::LessOrEqual< T >, sxeval::operations::Logarithm< T >, sxeval::operations::Logarithm10< T >, sxeval::operations::Logarithm1p< T >, sxeval::operations::Logarithm2< T >, sxeval::operations::LogarithmB< T >, sxeval::operations::LogicalAnd< T >, sxeval::operations::LogicalNand< T >, sxeval::operations::LogicalNor< T >, sxeval::operations::LogicalNot< T >, sxeval::operations::LogicalOr< T >, sxeval::operations::LogicalXnor< T >, sxeval::operations::LogicalXor< T >, sxeval::operations::Maximum< T >, sxeval::operations::Minimum< T >, sxeval::operations::Modulo< T >, sxeval::operations::Multiplication< T >, sxeval::operations::NaturalLogarithm< T >, sxeval::operations::NotEqual< T >, sxeval::operations::RadiansToDegrees< T >, sxeval::operations::Round< T >, sxeval::operations::Sine< T >, sxeval::operations::Sinh< T >, sxeval::operations::SquareRoot< T >, sxeval::operations::Subtraction< T >, sxeval::operations::Tangent< T >, sxeval::operations::Tanh< T >, and sxeval::operations::Truncate< T >.
|
inlineoverridevirtual |
Get the result of the operation.
Implements sxeval::IInstruction< T >.
|
protected |
|
protected |
|
staticconstexpr |
Default maximum number of arguments for the operation.
Default minimum number of arguments for the operation.
|
staticconstexpr |
Default key for the operation.
|
staticconstexpr |
The value for an unlimited number of arguments.