|
Math Type Library (libmath++) 0.0.3
|
#include <nodes.h>
Public Types | |
| enum | TNodeType { NUMBER_NODE , SYMBOL_NODE , PARAM_NODE , PLUS_NODE , NEG_NODE , MUL_NODE , DIV_NODE , MOD_NODE , POW_NODE , EQU_NODE , UNEQU_NODE , LESS_EQU_NODE , GREATER_EQU_NODE , LESS_NODE , GREATER_NODE , FUNC_NODE , SQRT_NODE , SIN_NODE , COS_NODE , TAN_NODE , LN_NODE , IF_NODE } |
| typedef TNodeIterator< T > | iterator |
| typedef const TNodeIterator< T > | const_iterator |
| typedef TOperandIter< TNode< T > > | operand_iterator |
| typedef TOperandIter< const TNode< T > > | const_operand_iterator |
Public Member Functions | |
| virtual | ~TNode () |
| each virtual class needs a virtual destructor (this one does nothing) | |
| TNodeType | nodeType () const |
| returns the type of this node | |
| short | priority () const |
| returns the node priority | |
| TNode< T > * | parent () const |
| returns the parent node (returns 0 if this node is the root node) | |
| virtual TNode< T > * | left () const |
| returns the left child node (returns 0 if this node doesn't support one) | |
| virtual TNode< T > * | right () const |
| returns the right child node (returns 0 if this node doesn't support one) | |
| virtual void | accept (TNodeVisitor< T > &)=0 |
| calls the visit method in TNodeVisitor<> | |
| virtual TNode< T > * | clone () const =0 |
| clones that node | |
| iterator | begin () |
| iterator access to the first value node in this operator level | |
| iterator | end () |
| iterator access to the end | |
| virtual bool | equals (const TNode< T > *ANode) const =0 |
| returns true, if given node equals to this one | |
Protected Member Functions | |
| TNode (TNodeType ANodeType, short APriority, TNode< T > *AParentNode=0) | |
| initializes this node for given node type. | |
| TNode (const TNode< T > &n) | |
| void | parent (TNode< T > *AParent) |
| initializes the parent node with the given one | |
Friends | |
| class | TUnaryNodeOp< T > |
| class | TBinaryNodeOp< T > |
TNode<T> represents the abstract node base.
| const TNodeIterator<T> math::TNode< class >::const_iterator |
| TOperandIter<const TNode<T> > math::TNode< class >::const_operand_iterator |
| TNodeIterator<T> math::TNode< class >::iterator |
| TOperandIter<TNode<T> > math::TNode< class >::operand_iterator |
| enum math::TNode::TNodeType |
This enumeration, TNodeType, is implemented for node type access. This makes it also faster because it replaces the dynamic_cast<> operator.
Definition at line 240 of file nodes.h.
|
pure virtual |
calls the visit method in TNodeVisitor<>
Implemented in math::TCosNode< class >, math::TDivNode< class >, math::TEquNode< class >, math::TFuncNode< class >, math::TGreaterEquNode< class >, math::TGreaterNode< class >, math::TIfNode< class >, math::TLessEquNode< class >, math::TLessNode< class >, math::TLnNode< class >, math::TMulNode< class >, math::TNegNode< class >, math::TNumberNode< class >, math::TParamNode< class >, math::TPlusNode< class >, math::TPowNode< class >, math::TSinNode< class >, math::TSqrtNode< class >, math::TSymbolNode< class >, math::TTanNode< class >, and math::TUnEquNode< class >.
|
inline |
|
pure virtual |
clones that node
Implemented in math::TCosNode< class >, math::TDivNode< class >, math::TEquNode< class >, math::TFuncNode< class >, math::TGreaterEquNode< class >, math::TGreaterNode< class >, math::TIfNode< class >, math::TLessEquNode< class >, math::TLessNode< class >, math::TLnNode< class >, math::TMulNode< class >, math::TNegNode< class >, math::TNumberNode< class >, math::TParamNode< class >, math::TPlusNode< class >, math::TPowNode< class >, math::TSinNode< class >, math::TSqrtNode< class >, math::TSymbolNode< class >, math::TTanNode< class >, and math::TUnEquNode< class >.
|
inline |
|
pure virtual |
returns true, if given node equals to this one
Implemented in math::TBinaryNodeOp< T >, math::TNumberNode< class >, math::TParamNode< class >, math::TSymbolNode< class >, and math::TUnaryNodeOp< T >.
|
virtual |
returns the left child node (returns 0 if this node doesn't support one)
Reimplemented in math::TBinaryNodeOp< T >.
|
virtual |
returns the right child node (returns 0 if this node doesn't support one)
Reimplemented in math::TBinaryNodeOp< T >, and math::TUnaryNodeOp< T >.
|
friend |
|
friend |