expression_tree  3.2
 All Classes Files Functions Variables Typedefs
Public Member Functions
expression_tree::node< T, CachingPolicy, ThreadingPolicy > Class Template Reference

The tree's node class. More...

#include <expression_tree.h>

Inheritance diagram for expression_tree::node< T, CachingPolicy, ThreadingPolicy >:
Inheritance graph
[legend]

List of all members.

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.

Detailed Description

template<typename T, template< typename, typename > class CachingPolicy = no_caching, class ThreadingPolicy = sequential>
class expression_tree::node< T, CachingPolicy, ThreadingPolicy >

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.


Constructor & Destructor Documentation

template<typename T, template< typename, typename > class CachingPolicy = no_caching, class ThreadingPolicy = sequential>
expression_tree::node< T, CachingPolicy, ThreadingPolicy >::node ( node< T, CachingPolicy, ThreadingPolicy > *  parent = 0) [inline]

Default constructor.

Parameters:
parentPointer to this node's parent.

Member Function Documentation

template<typename T, template< typename, typename > class CachingPolicy = no_caching, class ThreadingPolicy = sequential>
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.

template<typename T, template< typename, typename > class CachingPolicy = no_caching, class ThreadingPolicy = sequential>
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.

template<typename T, template< typename, typename > class CachingPolicy = no_caching, class ThreadingPolicy = sequential>
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.

template<typename T, template< typename, typename > class CachingPolicy = no_caching, class ThreadingPolicy = sequential>
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.

template<typename T, template< typename, typename > class CachingPolicy = no_caching, class ThreadingPolicy = sequential>
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.

template<typename T, template< typename, typename > class CachingPolicy = no_caching, class ThreadingPolicy = sequential>
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.


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