expression_tree  3.2
 All Classes Files Functions Variables Typedefs
Public Member Functions
expression_tree::cache_on_assignment< T, ThreadingPolicy >::branch Class Reference

Implementation of a branch class that performs caching on assignment of its children. More...

#include <expression_tree.h>

Inheritance diagram for expression_tree::cache_on_assignment< T, ThreadingPolicy >::branch:
Inheritance graph
[legend]
Collaboration diagram for expression_tree::cache_on_assignment< T, ThreadingPolicy >::branch:
Collaboration graph
[legend]

List of all members.

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 ()

Detailed Description

template<typename T, class ThreadingPolicy>
class expression_tree::cache_on_assignment< T, ThreadingPolicy >::branch

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.


Member Function Documentation

template<typename T , class ThreadingPolicy >
virtual void expression_tree::cache_on_assignment< T, ThreadingPolicy >::branch::grow ( ) [inline, virtual]

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 >.


The documentation for this class was generated from the following file: