Branch class. More...
#include <expression_tree.h>
Public Member Functions | |
default_branch (const typename operation< T >::t &f, const node< T, CachingPolicy, ThreadingPolicy > &l, const node< T, CachingPolicy, ThreadingPolicy > &r) | |
Constructor. | |
default_branch (const default_branch< T, CachingPolicy, ThreadingPolicy > &other) | |
Copy constructor. | |
virtual std::unique_ptr < node_impl< T > > | clone () const |
Clones this object. | |
virtual bool | constant () const |
The constness of a branch is determined by the constness of its children. | |
virtual T | evaluate () const |
Evaluating a branch applies its operation on its children. | |
virtual node< T, CachingPolicy, ThreadingPolicy > & | left () |
This branch's left child. | |
virtual node< T, CachingPolicy, ThreadingPolicy > & | right () |
This branch's right child. | |
virtual void | grow () |
Public Attributes | |
node< T, CachingPolicy, ThreadingPolicy > | l |
This branch's left child. | |
node< T, CachingPolicy, ThreadingPolicy > | r |
This branch's right child. | |
operation< T >::t | f |
Operation to be applied to this node's children. | |
Branch class.
This class stores an operation and two children nodes. This default implementation does no caching optimization.
|
inline |
Constructor.
f | The operation to apply to this branch's children, |
l | This branch's left child. |
r | This branch's right child. |
|
inlinevirtual |
This function is called when anyone of this branch's children is modified. This default implementation does nothing when that happens.
Reimplemented in expression_tree::cache_on_assignment< T, ThreadingPolicy >::branch, and expression_tree::cache_on_evaluation< T, ThreadingPolicy >::branch.