Implementation of a branch class that performs caching on assignment of its children. More...
#include <expression_tree.h>


Public Member Functions | |
| branch (const typename detail::operation< T >::t &f, const node< T, expression_tree::cache_on_assignment, ThreadingPolicy > &l, const node< T, expression_tree::cache_on_assignment, ThreadingPolicy > &r) | |
| Default constructor. | |
| branch (const branch &o) | |
| Copy constructor. | |
| virtual T | evaluate () const |
| If the value of this branch has been cached already, return it. | |
| virtual void | grow () |
Public Member Functions inherited from expression_tree::detail::default_branch< T, expression_tree::cache_on_assignment, ThreadingPolicy > | |
| default_branch (const typename operation< T >::t &f, const node< T, expression_tree::cache_on_assignment, ThreadingPolicy > &l, const node< T, expression_tree::cache_on_assignment, ThreadingPolicy > &r) | |
| Constructor. | |
| default_branch (const default_branch< T, expression_tree::cache_on_assignment, 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 node< T, expression_tree::cache_on_assignment, ThreadingPolicy > & | left () |
| This branch's left child. | |
|
virtual node< T, expression_tree::cache_on_assignment, ThreadingPolicy > & | right () |
| This branch's right child. | |
Additional Inherited Members | |
Public Attributes inherited from expression_tree::detail::default_branch< T, expression_tree::cache_on_assignment, ThreadingPolicy > | |
|
node< T, expression_tree::cache_on_assignment, ThreadingPolicy > | l |
| This branch's left child. | |
|
node< T, expression_tree::cache_on_assignment, ThreadingPolicy > | r |
| This branch's right child. | |
| operation< T >::t | f |
| Operation to be applied to this node's children. | |
Implementation of a branch class that performs caching on assignment of its children.
When a caching-on-assignment branch' children are assigned to, the branch checks whether its children are constant. If they are, it applies its operation on them and caches that value.
|
inlinevirtual |
When this branch has its children modified, check if they are constant. If they are, perform the operation and cache the value.
Reimplemented from expression_tree::detail::default_branch< T, expression_tree::cache_on_assignment, ThreadingPolicy >.
1.8.2