Calculator
Extensible stack-based calculator primarily in library form
Calculator::StackOperator Class Referenceabstract

Base class for all operators. More...

#include <StackOperator.h>

Inheritance diagram for Calculator::StackOperator:

Public Types

typedef std::shared_ptr< StackOperatorPtr
 

Public Member Functions

virtual ~StackOperator ()
 
virtual Result operator() (Stack &stack, StackOperator::Ptr ofThis)=0
 Execute this operator on stack. More...
 

Protected Member Functions

 StackOperator ()=default
 
 StackOperator (const StackOperator &)=delete
 
 StackOperator (StackOperator &&)=delete
 
StackOperatoroperator= (const StackOperator &)=delete
 
StackOperatoroperator= (StackOperator &&)=delete
 

Detailed Description

Base class for all operators.

StackOperatorCreators and the StackFactory will return StackOperator::Ptr.

Definition at line 29 of file StackOperator.h.

Member Typedef Documentation

◆ Ptr

Definition at line 31 of file StackOperator.h.

Constructor & Destructor Documentation

◆ ~StackOperator()

virtual Calculator::StackOperator::~StackOperator ( )
inlinevirtual

Definition at line 33 of file StackOperator.h.

◆ StackOperator() [1/3]

Calculator::StackOperator::StackOperator ( )
protecteddefault

◆ StackOperator() [2/3]

Calculator::StackOperator::StackOperator ( const StackOperator )
protecteddelete

◆ StackOperator() [3/3]

Calculator::StackOperator::StackOperator ( StackOperator &&  )
protecteddelete

Member Function Documentation

◆ operator()()

virtual Result Calculator::StackOperator::operator() ( Stack stack,
StackOperator::Ptr  ofThis 
)
pure virtual

Execute this operator on stack.

Parameters
stackto operate on
ofThisis this in a copied StackOperator::Ptr to maintain integrity of the shared_ptrs.
Returns
Result of execution

Implemented in Calculator::VariableManipulator, Calculator::StackManipulator, Calculator::StackItem, and Calculator::BinaryMathOperator.

◆ operator=() [1/2]

StackOperator& Calculator::StackOperator::operator= ( const StackOperator )
protecteddelete

◆ operator=() [2/2]

StackOperator& Calculator::StackOperator::operator= ( StackOperator &&  )
protecteddelete

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