Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

xst_translator Struct Template Reference

#include <xst_translator.h>

List of all members.


Detailed Description

template<typename LambdaT, typename TranslatorT>
struct cttl_impl::xst_translator< LambdaT, TranslatorT >

Placeholder for higher-order-function expression.

Higher-order-function expression permits data transformations of different types by conversion function f():

    D ^ f 
This compile-time expression is equivalent to run-time expression
    D.push( f( x ) )
where x is the input value. Since higher-order-function behaves exactly as lambda primitive, transformation functions can be nested:
    D ^ f ^ g ^ ... ^ k
This type of transformation is known as functional composition.

LambdaT
Template parameter specifying type of lambda primitive.
TranslatorT
Template parameter specifying type of nested function or function object.

Definition at line 69 of file xst_translator.h.

Public Types

enum  { const_value_ = LambdaT::const_value_, depth_ = LambdaT::depth_, capacity_ = LambdaT::capacity_, primitive_id_ = primitive_id_translator }
typedef LambdaT::dereferenced_value_T dereferenced_value_T
 Defines type of dereferenced object encapsulated by lambda primitive.
typedef LambdaT lambda_T
 Defines C++ type of lambda primitive.
typedef xst_translator< LambdaT,
TranslatorT > 
left_T
 Defines type of left scalar primitive of lambda compound.
typedef xst_translator< LambdaT,
TranslatorT > 
reference_T
 Defines lambda reference type for this primitive.
typedef xst_translator< LambdaT,
TranslatorT > 
right_T
 Defines type of right scalar primitive of lambda compound.
typedef TranslatorT translator_T
 Defines the type of the translator function or functor.
typedef LambdaT::value_T value_T
 Defines C++ type of object encapsulated by lambda primitive.

Public Member Functions

template<int LocationT>
dereferenced_value_Tdereferenced_value (xst_lambda_wrap< xst_const_scalar< LocationT > > subscript_)
 Dereferenced value of the lambda compound node.
left_T const & left_lambda () const
 Direct constant access to the left-hand-side lambda compound nodes.
left_Tleft_lambda ()
 Direct mutable access to the left-hand-side lambda compound nodes.
reference_T make_reference () const
 Manufactures lambda reference for this translator.
template<typename SubscriptLambdaT>
void pop (SubscriptLambdaT subscript_)
 Pop data from specified lambda compound location.
template<typename SubscriptLambdaT, typename InputValueT>
void push (SubscriptLambdaT subscript_, InputValueT const &data_)
 Push data at specified lambda compound location.
right_T const & right_lambda () const
 Direct constant access to the right-hand-side lambda compound nodes.
right_Tright_lambda ()
 Direct mutable access to the right-hand-side lambda compound nodes.
template<typename SubscriptLambdaT>
size_t size (SubscriptLambdaT subscript_) const
 Get size of stack at specified lambda compound location.
template<typename SubscriptLambdaT>
std::stack< value_T > const * stack_ptr (SubscriptLambdaT subscript_) const
 Get constant stack pointer at specified lambda compound location.
template<typename SubscriptLambdaT>
std::stack< value_T > * stack_ptr (SubscriptLambdaT subscript_)
 Get stack pointer at specified lambda compound location.
template<typename FunctorT>
void subscript_bottom_up (FunctorT &functor_) const
 Subscript bottom-up traversal algorithm.
template<typename FunctorT>
void subscript_top_down (FunctorT &functor_) const
 Lambda compound top-down subscript traversal algorithm.
template<typename SubscriptLambdaT>
value_Ttop (SubscriptLambdaT subscript_)
 Mutable access to data at specified lambda compound location.
template<typename SubscriptLambdaT>
value_T const & top (SubscriptLambdaT subscript_) const
 Constant access to data at specified lambda compound location.
template<typename FunctorT>
void traverse_bottom_up (FunctorT &functor_) const
 Lambda compound bottom up traversal algorithm with constant access to terminal nodes.
template<typename FunctorT>
void traverse_bottom_up (FunctorT &functor_)
 Lambda compound bottom up traversal algorithm with mutable access to terminal nodes.
template<typename FunctorT>
void traverse_top_down (FunctorT &functor_) const
 Lambda compound top-down traversal algorithm with constant access to terminal nodes.
template<typename FunctorT>
void traverse_top_down (FunctorT &functor_)
 Lambda compound top-down traversal algorithm with mutable access to terminal nodes.
 xst_translator (xst_translator< LambdaT, TranslatorT > const &other_)
 Copy constructor.
 xst_translator (LambdaT const &lambda_, TranslatorT const &translator_)
 Constructs translator object.


Member Typedef Documentation

typedef LambdaT::dereferenced_value_T dereferenced_value_T
 

Defines type of dereferenced object encapsulated by lambda primitive.

Definition at line 101 of file xst_translator.h.

typedef LambdaT lambda_T
 

Defines C++ type of lambda primitive.

Definition at line 92 of file xst_translator.h.

typedef xst_translator< LambdaT, TranslatorT > left_T
 

Defines type of left scalar primitive of lambda compound.

Definition at line 104 of file xst_translator.h.

typedef xst_translator< LambdaT, TranslatorT > reference_T
 

Defines lambda reference type for this primitive.

Definition at line 110 of file xst_translator.h.

typedef xst_translator< LambdaT, TranslatorT > right_T
 

Defines type of right scalar primitive of lambda compound.

Definition at line 107 of file xst_translator.h.

typedef TranslatorT translator_T
 

Defines the type of the translator function or functor.

Definition at line 95 of file xst_translator.h.

typedef LambdaT::value_T value_T
 

Defines C++ type of object encapsulated by lambda primitive.

Definition at line 98 of file xst_translator.h.


Member Enumeration Documentation

anonymous enum
 

Enumeration values:
const_value_  Constant required to compile algorithms for subscript-based access to lambda compound.
depth_  Number of nodes at current level of subtree.
capacity_  Cumulative capacity of lambda primitive.
primitive_id_  Unique identifier of lambda primitive type for template resolution.

Definition at line 77 of file xst_translator.h.


Constructor & Destructor Documentation

xst_translator LambdaT const &  lambda_,
TranslatorT const &  translator_
[inline]
 

Constructs translator object.

Definition at line 113 of file xst_translator.h.

xst_translator xst_translator< LambdaT, TranslatorT > const &  other_  )  [inline]
 

Copy constructor.

Definition at line 121 of file xst_translator.h.


Member Function Documentation

dereferenced_value_T& dereferenced_value xst_lambda_wrap< xst_const_scalar< LocationT > >  subscript_  )  [inline]
 

Dereferenced value of the lambda compound node.

Definition at line 138 of file xst_translator.h.

left_T const& left_lambda  )  const [inline]
 

Direct constant access to the left-hand-side lambda compound nodes.

Definition at line 150 of file xst_translator.h.

left_T& left_lambda  )  [inline]
 

Direct mutable access to the left-hand-side lambda compound nodes.

Definition at line 144 of file xst_translator.h.

reference_T make_reference  )  const [inline]
 

Manufactures lambda reference for this translator.

Definition at line 129 of file xst_translator.h.

void pop SubscriptLambdaT  subscript_  )  [inline]
 

Pop data from specified lambda compound location.

Definition at line 226 of file xst_translator.h.

void push SubscriptLambdaT  subscript_,
InputValueT const &  data_
[inline]
 

Push data at specified lambda compound location.

Definition at line 219 of file xst_translator.h.

right_T const& right_lambda  )  const [inline]
 

Direct constant access to the right-hand-side lambda compound nodes.

Definition at line 162 of file xst_translator.h.

right_T& right_lambda  )  [inline]
 

Direct mutable access to the right-hand-side lambda compound nodes.

Definition at line 156 of file xst_translator.h.

size_t size SubscriptLambdaT  subscript_  )  const [inline]
 

Get size of stack at specified lambda compound location.

Definition at line 247 of file xst_translator.h.

std::stack< value_T > const* stack_ptr SubscriptLambdaT  subscript_  )  const [inline]
 

Get constant stack pointer at specified lambda compound location.

Definition at line 261 of file xst_translator.h.

References xst_translator::stack_ptr().

std::stack< value_T >* stack_ptr SubscriptLambdaT  subscript_  )  [inline]
 

Get stack pointer at specified lambda compound location.

Definition at line 254 of file xst_translator.h.

Referenced by xst_translator::stack_ptr().

void subscript_bottom_up FunctorT &  functor_  )  const [inline]
 

Subscript bottom-up traversal algorithm.

Definition at line 208 of file xst_translator.h.

void subscript_top_down FunctorT &  functor_  )  const [inline]
 

Lambda compound top-down subscript traversal algorithm.

Definition at line 201 of file xst_translator.h.

value_T& top SubscriptLambdaT  subscript_  )  [inline]
 

Mutable access to data at specified lambda compound location.

Definition at line 240 of file xst_translator.h.

References xst_translator::top().

value_T const& top SubscriptLambdaT  subscript_  )  const [inline]
 

Constant access to data at specified lambda compound location.

Definition at line 233 of file xst_translator.h.

Referenced by xst_translator::top().

void traverse_bottom_up FunctorT &  functor_  )  const [inline]
 

Lambda compound bottom up traversal algorithm with constant access to terminal nodes.

Definition at line 187 of file xst_translator.h.

References xst_translator::traverse_bottom_up().

void traverse_bottom_up FunctorT &  functor_  )  [inline]
 

Lambda compound bottom up traversal algorithm with mutable access to terminal nodes.

Definition at line 173 of file xst_translator.h.

Referenced by xst_translator::traverse_bottom_up().

void traverse_top_down FunctorT &  functor_  )  const [inline]
 

Lambda compound top-down traversal algorithm with constant access to terminal nodes.

Definition at line 194 of file xst_translator.h.

References xst_translator::traverse_top_down().

void traverse_top_down FunctorT &  functor_  )  [inline]
 

Lambda compound top-down traversal algorithm with mutable access to terminal nodes.

Definition at line 180 of file xst_translator.h.

Referenced by xst_translator::traverse_top_down().


The documentation for this struct was generated from the following file:
Generated on Thu Nov 2 17:49:09 2006 for CTTL Lambda Expression by  doxygen 1.3.9.1