Calculator
Extensible stack-based calculator primarily in library form
|
Variable Modifier for Variable Operations. More...
#include <VariableManipulator.h>
Public Types | |
enum class | Operation { WRITE , READ } |
Operations supported. More... | |
typedef std::shared_ptr< VariableManipulator > | Ptr |
Public Types inherited from Calculator::StackOperator | |
typedef std::shared_ptr< StackOperator > | Ptr |
Public Member Functions | |
~VariableManipulator () | |
Public Member Functions inherited from Calculator::StackOperator | |
virtual | ~StackOperator () |
Static Public Member Functions | |
static VariableManipulator::Ptr | create (Operation op) |
Create to perform operation. More... | |
Protected Member Functions | |
VariableManipulator (Operation op) | |
Create to perform operation. More... | |
VariableManipulator (const VariableManipulator &)=delete | |
VariableManipulator (VariableManipulator &&)=delete | |
VariableManipulator & | operator= (const VariableManipulator &)=delete |
VariableManipulator & | operator= (VariableManipulator &&)=delete |
virtual Result | operator() (Stack &stack, StackOperator::Ptr ofThis) |
Execute this operator on stack. More... | |
Protected Member Functions inherited from Calculator::StackOperator | |
StackOperator ()=default | |
StackOperator (const StackOperator &)=delete | |
StackOperator (StackOperator &&)=delete | |
StackOperator & | operator= (const StackOperator &)=delete |
StackOperator & | operator= (StackOperator &&)=delete |
Variable Modifier for Variable Operations.
Support multiple operations distinguished by the Operation parameter.
Operations support separate variable-element manipulations
Definition at line 29 of file VariableManipulator.h.
typedef std::shared_ptr<VariableManipulator> Calculator::VariableManipulator::Ptr |
Definition at line 31 of file VariableManipulator.h.
|
strong |
Operations supported.
Enumerator | |
---|---|
WRITE | Write the value in next-to-top to variable in top. |
READ | Replace the top variable with its value. |
Definition at line 34 of file VariableManipulator.h.
Calculator::VariableManipulator::~VariableManipulator | ( | ) |
Definition at line 31 of file VariableManipulator.cpp.
|
protected |
Create to perform operation.
op | to perform |
Definition at line 34 of file VariableManipulator.cpp.
|
protecteddelete |
|
protecteddelete |
|
static |
Create to perform operation.
op | to perform |
Definition at line 27 of file VariableManipulator.cpp.
|
protectedvirtual |
Execute this operator on stack.
stack | to operate on |
ofThis | is this in a copied StackOperator::Ptr to maintain integrity of the shared_ptrs. |
Implements Calculator::StackOperator.
Definition at line 39 of file VariableManipulator.cpp.
|
protecteddelete |
|
protecteddelete |