Calculator
Extensible stack-based calculator primarily in library form
Calculator Namespace Reference

Container of Calculator resources. More...

Namespaces

 Error
 Error / Return values of Stack Operations to ensure consistency.
 
 Factories
 

Classes

class  StackIteratorPimpl
 
class  StackPimpl
 
class  StackOperatorFactoryPimpl
 
class  VariableSetPimpl
 
class  BinaryMathOperator
 Stack Modifier for Binary Math Operations. More...
 
class  BinaryMathCreator
 Create BinaryMathOperation from a string. More...
 
class  Executive
 Drivable class to run the calculator with a variable factory per process call to support changing command sets. More...
 
class  FixedOperatorExecutive
 Drivable class to run the calculator with a single set of commands. More...
 
class  Number
 StackItem representing a number. More...
 
class  NumberCreator
 Creates Numbers from strings that convert to numbers. More...
 
class  Result
 Collection of Result information for an operation. More...
 
class  StackIterator
 Iterator over a Stack from top to bottom. More...
 
class  Stack
 Stack of values to process from. More...
 
class  StackItem
 Base class of all items that can be on the stack. More...
 
class  StackManipulator
 Stack Modifier for Stack Operations. More...
 
class  StackManipulatorCreator
 Create StackManipulator from a string. More...
 
class  StackOperator
 Base class for all operators. More...
 
class  StackOperatorCreator
 Factory creators of StackOperator::Ptrs. More...
 
class  StackOperatorFactory
 Factory to create StackOperators and help from StackOperatorCreators. More...
 
class  Variable
 StackItem representing a variable. More...
 
class  VariableCreator
 Creates Variables from strings that convert to variables. More...
 
class  VariableManipulator
 Variable Modifier for Variable Operations. More...
 
class  VariableManipulatorCreator
 Create VariableManipulator from a string. More...
 
class  VariableSet
 All variables belonging to a Stack. More...
 

Functions

StackIteratoroperator>> (StackIterator &iter, StackIterator::Hint hint)
 Set the iter's hint and return the iter. More...
 
StackIteratoroperator>> (StackIterator &iter, StackItem::Ptr &t)
 
StackIteratoroperator>> (StackIterator &iter, std::shared_ptr< StackItem > &t)
 Set t to *iter and return iter. More...
 
template<typename T >
StackIteratoroperator>> (StackIterator &iter, T &t)
 Convenience function to read the current value of iter by the template as() (respecting the current hint) and set to t. More...
 

Detailed Description

Container of Calculator resources.

Function Documentation

◆ operator>>() [1/4]

StackIterator& Calculator::operator>> ( StackIterator iter,
StackItem::Ptr t 
)

Definition at line 171 of file Stack.cpp.

◆ operator>>() [2/4]

StackIterator & Calculator::operator>> ( StackIterator iter,
StackIterator::Hint  hint 
)

Set the iter's hint and return the iter.

Parameters
iterto set hint on
hintto set
Returns
iter

Definition at line 166 of file Stack.cpp.

◆ operator>>() [3/4]

StackIterator& Calculator::operator>> ( StackIterator iter,
std::shared_ptr< StackItem > &  t 
)

Set t to *iter and return iter.

Parameters
iterto read from
tto set *iter into
Returns
iter

◆ operator>>() [4/4]

template<typename T >
StackIterator& Calculator::operator>> ( StackIterator iter,
T &  t 
)

Convenience function to read the current value of iter by the template as() (respecting the current hint) and set to t.

If the cast fails in t, the set value is empty

Template Parameters
Tdesired type to cast the value to
Parameters
iterto read from
tto set iter.as<T>() into
Returns
iter

Definition at line 190 of file Stack.h.