Base class for the node class internal implementation. More...
#include <expression_tree.h>
Public Member Functions | |
virtual node_impl< T > * | clone () const =0 |
Clones this object. | |
virtual bool | constant () const =0 |
Constness of the node. | |
virtual T | evaluate () const =0 |
All nodes must evaluate. |
Base class for the node class internal implementation.
virtual node_impl<T>* expression_tree::detail::node_impl< T >::clone | ( | ) | const [pure virtual] |
Clones this object.
Necessary for assignment operator of classes that will own concrete instances of this base class.
Implemented in expression_tree::detail::default_branch< T, CachingPolicy, ThreadingPolicy >, expression_tree::detail::default_branch< T, expression_tree::no_caching, ThreadingPolicy >, expression_tree::detail::default_branch< T, expression_tree::cache_on_assignment, ThreadingPolicy >, expression_tree::detail::default_branch< T, expression_tree::cache_on_evaluation, ThreadingPolicy >, expression_tree::detail::leaf< T * >, and expression_tree::detail::leaf< T >.
virtual bool expression_tree::detail::node_impl< T >::constant | ( | ) | const [pure virtual] |
Constness of the node.
A leaf node is constant if its data is constant. A branch node is constant if all its leaf nodes are constant.
Implemented in expression_tree::detail::default_branch< T, CachingPolicy, ThreadingPolicy >, expression_tree::detail::default_branch< T, expression_tree::no_caching, ThreadingPolicy >, expression_tree::detail::default_branch< T, expression_tree::cache_on_assignment, ThreadingPolicy >, expression_tree::detail::default_branch< T, expression_tree::cache_on_evaluation, ThreadingPolicy >, expression_tree::detail::leaf< T * >, and expression_tree::detail::leaf< T >.
virtual T expression_tree::detail::node_impl< T >::evaluate | ( | ) | const [pure virtual] |
All nodes must evaluate.
A leaf will evaluate to itself. A branch will evaluate to its operation applied to its left and right children.
Implemented in expression_tree::cache_on_assignment< T, ThreadingPolicy >::branch, expression_tree::cache_on_evaluation< T, ThreadingPolicy >::branch, expression_tree::detail::default_branch< T, CachingPolicy, ThreadingPolicy >, expression_tree::detail::default_branch< T, expression_tree::no_caching, ThreadingPolicy >, expression_tree::detail::default_branch< T, expression_tree::cache_on_assignment, ThreadingPolicy >, expression_tree::detail::default_branch< T, expression_tree::cache_on_evaluation, ThreadingPolicy >, expression_tree::detail::leaf< T * >, and expression_tree::detail::leaf< T >.