The tree's node class. More...
#include <expression_tree.h>
Public Member Functions | |
node (node< T, CachingPolicy, ThreadingPolicy > *parent=0) | |
Default constructor. | |
node (const node< T, CachingPolicy, ThreadingPolicy > &other) | |
Copy constructor. | |
node< T, CachingPolicy, ThreadingPolicy > & | operator= (const node< T, CachingPolicy, ThreadingPolicy > &other) |
Assignment operator. | |
node< T, CachingPolicy, ThreadingPolicy > & | operator= (const T &t) |
Assign a value to this node. | |
node< T, CachingPolicy, ThreadingPolicy > & | operator= (const T *t) |
Assign a pointer to this node. | |
node< T, CachingPolicy, ThreadingPolicy > & | operator= (const typename detail::operation< T >::t &f) |
Assign an operation to this node. | |
node< T, CachingPolicy, ThreadingPolicy > & | left () |
This node's left child. | |
node< T, CachingPolicy, ThreadingPolicy > & | right () |
This node's right child. | |
bool | constant () const |
Constness of this node. | |
T | evaluate () const |
Evaluates the value of this node. | |
void | grow () |
Called when this node is assigned to. |
The tree's node class.
This class stores a pointer to its implementation. The implementation node's type is derived at runtime when it is assigned to.
expression_tree::node< T, CachingPolicy, ThreadingPolicy >::node | ( | node< T, CachingPolicy, ThreadingPolicy > * | parent = 0 | ) | [inline] |
Default constructor.
parent | Pointer to this node's parent. |
void expression_tree::node< T, CachingPolicy, ThreadingPolicy >::grow | ( | ) | [inline] |
Called when this node is assigned to.
Recursively notifies parent nodes of the growth that happened.
node<T, CachingPolicy, ThreadingPolicy>& expression_tree::node< T, CachingPolicy, ThreadingPolicy >::left | ( | ) | [inline] |
This node's left child.
Note that if this node is a leaf node, behavior is undefined.
node<T, CachingPolicy, ThreadingPolicy>& expression_tree::node< T, CachingPolicy, ThreadingPolicy >::operator= | ( | const T & | t | ) | [inline] |
Assign a value to this node.
The assignment of a T
designates this node as a leaf node. A leaf can still be changed to a branch by assigning an operation to it.
node<T, CachingPolicy, ThreadingPolicy>& expression_tree::node< T, CachingPolicy, ThreadingPolicy >::operator= | ( | const T * | t | ) | [inline] |
Assign a pointer to this node.
The assignment of a T*
designates this node as a leaf node. A leaf can still be changed to a branch by assigning an operation to it.
node<T, CachingPolicy, ThreadingPolicy>& expression_tree::node< T, CachingPolicy, ThreadingPolicy >::operator= | ( | const typename detail::operation< T >::t & | f | ) | [inline] |
Assign an operation to this node.
The assignment of an operation designates this node as a branch. A branch can still be changed to a leaf by assigning data to it.
node<T, CachingPolicy, ThreadingPolicy>& expression_tree::node< T, CachingPolicy, ThreadingPolicy >::right | ( | ) | [inline] |
This node's right child.
Note that if this node is a leaf node, behavior is undefined.