cttl_impl::xst_stack< StackT > Struct Template Reference

Implements stack lambda primitive. More...

#include <xst_stack.h>

List of all members.

Public Types

enum  { const_value_, depth_ = 1, capacity_ = 1, primitive_id_ = primitive_id_stack }
typedef value_T dereferenced_value_T
 Defines type of dereferenced stack primitive, which is type of object stored in the stack.
typedef xst_stack< StackT > left_T
 Defines type of left scalar primitive of lambda compound.
typedef xst_stack< typename
xst_storage_adaptor< StackT >
::reference > 
reference_T
 Defines reference type for stack primitive.
typedef xst_stack< StackT > right_T
 Defines type of right scalar primitive of lambda compound.
typedef xst_storage_adaptor
< StackT >::value_type 
stack_T
 Defines type of encapsulated stack object.
typedef stack_T::value_type value_T
 Defines type of object stored in the stack.

Public Member Functions

template<int LocationT>
dereferenced_value_Tdereferenced_value (xst_lambda_wrap< xst_const_scalar< LocationT > > subscript_)
 Dereferenced stack primitive returns top stack element.
left_T const & left_lambda () const
 Direct constant access to left-hand-side stack lambda compound node.
left_Tleft_lambda ()
 Direct mutable access to left-hand-side stack lambda compound node.
reference_T make_reference () const
 Manufactures copy of reference object for stack primitive.
template<int LocationT>
void pop (xst_lambda_wrap< xst_const_scalar< LocationT > >)
 Push data from stack.
template<int LocationT, typename InputValueT >
void push (xst_lambda_wrap< xst_const_scalar< LocationT > >, InputValueT const &data_)
 Push data to stack.
right_T const & right_lambda () const
 Direct constant access to right-hand-side stack lambda compound node.
right_Tright_lambda ()
 Direct mutable access to right-hand-side stack lambda compound node.
template<int LocationT>
size_t size (xst_lambda_wrap< xst_const_scalar< LocationT > >) const
 Get stack size.
template<int LocationT>
stack_Tstack_ptr (xst_lambda_wrap< xst_const_scalar< LocationT > >)
 Get mutable pointer to stack encapsulated by lambda compound node.
template<int LocationT>
stack_T const * stack_ptr (xst_lambda_wrap< xst_const_scalar< LocationT > >) const
 Get constant pointer to stack encapsulated by lambda compound node.
template<int LocationT>
value_Ttop (xst_lambda_wrap< xst_const_scalar< LocationT > >)
 Mutable access to top element of stack.
template<int LocationT>
value_T const & top (xst_lambda_wrap< xst_const_scalar< LocationT > >) const
 Constant access to top element of stack.
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_stack (xst_stack< StackT > const &other_)
 Copy constructor.
 xst_stack (value_T const &)
 Constructs stack primitive from type of object stored in the stack.
 xst_stack (StackT stack_)
 Constructs stack primitive from stack or reference to stack.
 xst_stack ()
 Default constructor.

Static Public Member Functions

template<typename FunctorT >
static void subscript_bottom_up (FunctorT &functor_)
 Subscript bottom-up traversal algorithm.
template<typename FunctorT >
static void subscript_top_down (FunctorT &functor_)
 Subscript top-down subscript traversal algorithm.

Friends

struct xst_lambda_wrap
struct xst_translator


Detailed Description

template<typename StackT>
struct cttl_impl::xst_stack< StackT >

Implements stack lambda primitive.

Template Parameters:
StackT specifies type of stack or reference to stack.
Warning:
This is internal CTTL header file and should not be included by user programs.

Definition at line 57 of file xst_stack.h.


Member Typedef Documentation

template<typename StackT>
typedef value_T cttl_impl::xst_stack< StackT >::dereferenced_value_T

Defines type of dereferenced stack primitive, which is type of object stored in the stack.

Definition at line 86 of file xst_stack.h.

template<typename StackT>
typedef xst_stack< StackT > cttl_impl::xst_stack< StackT >::left_T

Defines type of left scalar primitive of lambda compound.

Definition at line 89 of file xst_stack.h.

template<typename StackT>
typedef xst_stack< typename xst_storage_adaptor< StackT >::reference > cttl_impl::xst_stack< StackT >::reference_T

Defines reference type for stack primitive.

Definition at line 95 of file xst_stack.h.

template<typename StackT>
typedef xst_stack< StackT > cttl_impl::xst_stack< StackT >::right_T

Defines type of right scalar primitive of lambda compound.

Definition at line 92 of file xst_stack.h.

template<typename StackT>
typedef xst_storage_adaptor< StackT >::value_type cttl_impl::xst_stack< StackT >::stack_T

Defines type of encapsulated stack object.

Definition at line 80 of file xst_stack.h.

template<typename StackT>
typedef stack_T::value_type cttl_impl::xst_stack< StackT >::value_T

Defines type of object stored in the stack.

Definition at line 83 of file xst_stack.h.


Member Enumeration Documentation

template<typename StackT>
anonymous enum

Enumerator:
const_value_  Constant required to compile algorithms for subscript-based access to lambda compound.

depth_  Number of nodes inside stack primitive.

capacity_  Capacity of stack primitive.

primitive_id_  Unique identifier of stack primitive.

Definition at line 65 of file xst_stack.h.

00065          {
00067         const_value_,
00068 
00070         depth_ = 1,
00071 
00073         capacity_ = 1,
00074 
00076         primitive_id_ = primitive_id_stack
00077     };


Constructor & Destructor Documentation

template<typename StackT>
cttl_impl::xst_stack< StackT >::xst_stack (  ) 

Default constructor.

Definition at line 98 of file xst_stack.h.

00099     {
00100     }

template<typename StackT>
cttl_impl::xst_stack< StackT >::xst_stack ( StackT  stack_  ) 

Constructs stack primitive from stack or reference to stack.

Definition at line 103 of file xst_stack.h.

00104         :
00105     m_stack( stack_ )
00106     {
00107     }

template<typename StackT>
cttl_impl::xst_stack< StackT >::xst_stack ( value_T const &   ) 

Constructs stack primitive from type of object stored in the stack.

Postcondition:
Note that an empty stack is created, the object type is used only for template resolution.

Definition at line 115 of file xst_stack.h.

00116     {
00117     }

template<typename StackT>
cttl_impl::xst_stack< StackT >::xst_stack ( xst_stack< StackT > const &  other_  ) 

Copy constructor.

Definition at line 120 of file xst_stack.h.

00121         :
00122     m_stack( other_.m_stack )
00123     {
00124     }


Member Function Documentation

template<typename StackT>
template<int LocationT>
dereferenced_value_T& cttl_impl::xst_stack< StackT >::dereferenced_value ( xst_lambda_wrap< xst_const_scalar< LocationT > >  subscript_  ) 

Dereferenced stack primitive returns top stack element.

Definition at line 136 of file xst_stack.h.

00137     {
00138         return top( subscript_ );
00139     }

template<typename StackT>
left_T const& cttl_impl::xst_stack< StackT >::left_lambda (  )  const

Direct constant access to left-hand-side stack lambda compound node.

Definition at line 153 of file xst_stack.h.

00154     {
00155         return *this;
00156     }

template<typename StackT>
left_T& cttl_impl::xst_stack< StackT >::left_lambda (  ) 

Direct mutable access to left-hand-side stack lambda compound node.

Definition at line 146 of file xst_stack.h.

00147     {
00148         return *this;
00149     }

template<typename StackT>
reference_T cttl_impl::xst_stack< StackT >::make_reference (  )  const

Manufactures copy of reference object for stack primitive.

Definition at line 127 of file xst_stack.h.

00128     {
00129         return reference_T( const_cast< xst_stack< StackT >* >( this )->m_stack.value() );
00130     }

template<typename StackT>
template<int LocationT>
void cttl_impl::xst_stack< StackT >::pop ( xst_lambda_wrap< xst_const_scalar< LocationT > >   ) 

Push data from stack.

Definition at line 250 of file xst_stack.h.

00254     {
00255         xpop_descend< LocationT >();
00256     }

template<typename StackT>
template<int LocationT, typename InputValueT >
void cttl_impl::xst_stack< StackT >::push ( xst_lambda_wrap< xst_const_scalar< LocationT > >  ,
InputValueT const &  data_ 
)

Push data to stack.

Definition at line 232 of file xst_stack.h.

00236     {
00237         CTTL_TRACE_DEPOSIT_TEXT( "->" );
00238         CTTL_TRACE_DEPOSIT_TEXT( xst_storage_adaptor< StackT >::trace_char() );
00239         CTTL_TRACE_DEPOSIT_TEXT( "push$" );
00240         CTTL_TRACE_DEPOSIT_TEXT( xst_non_scalar_traits< InputValueT >::identity( data_ ) );
00241         CTTL_TRACE_DEPOSIT_TEXT( ' ' );
00242         xpush_descend< LocationT >( data_ );
00243     }

template<typename StackT>
right_T const& cttl_impl::xst_stack< StackT >::right_lambda (  )  const

Direct constant access to right-hand-side stack lambda compound node.

Definition at line 165 of file xst_stack.h.

00166     {
00167         return *this;
00168     }

template<typename StackT>
right_T& cttl_impl::xst_stack< StackT >::right_lambda (  ) 

Direct mutable access to right-hand-side stack lambda compound node.

Definition at line 159 of file xst_stack.h.

00160     {
00161         return *this;
00162     }

template<typename StackT>
template<int LocationT>
size_t cttl_impl::xst_stack< StackT >::size ( xst_lambda_wrap< xst_const_scalar< LocationT > >   )  const

Get stack size.

Definition at line 287 of file xst_stack.h.

00291     {
00292         return xsize_at_location< LocationT >();
00293     }

template<typename StackT>
template<int LocationT>
stack_T* cttl_impl::xst_stack< StackT >::stack_ptr ( xst_lambda_wrap< xst_const_scalar< LocationT > >   ) 

Get mutable pointer to stack encapsulated by lambda compound node.

Definition at line 313 of file xst_stack.h.

00316     {
00317         return xstack_ptr_at_location< LocationT >();
00318     }

template<typename StackT>
template<int LocationT>
stack_T const* cttl_impl::xst_stack< StackT >::stack_ptr ( xst_lambda_wrap< xst_const_scalar< LocationT > >   )  const

Get constant pointer to stack encapsulated by lambda compound node.

Definition at line 300 of file xst_stack.h.

00304     {
00305         return xstack_ptr_at_location< LocationT >();
00306     }

template<typename StackT>
template<typename FunctorT >
static void cttl_impl::xst_stack< StackT >::subscript_bottom_up ( FunctorT &  functor_  )  [static]

Subscript bottom-up traversal algorithm.

Definition at line 184 of file xst_stack.h.

00185     {
00186         functor_( const_scalar( 0 ) );
00187     }

template<typename StackT>
template<typename FunctorT >
static void cttl_impl::xst_stack< StackT >::subscript_top_down ( FunctorT &  functor_  )  [static]

Subscript top-down subscript traversal algorithm.

Definition at line 177 of file xst_stack.h.

00178     {
00179         functor_( const_scalar( 0 ) );
00180     }

template<typename StackT>
template<int LocationT>
value_T& cttl_impl::xst_stack< StackT >::top ( xst_lambda_wrap< xst_const_scalar< LocationT > >   ) 

Mutable access to top element of stack.

Definition at line 274 of file xst_stack.h.

00278     {
00279         return xtop_descend< LocationT >();
00280     }

template<typename StackT>
template<int LocationT>
value_T const& cttl_impl::xst_stack< StackT >::top ( xst_lambda_wrap< xst_const_scalar< LocationT > >   )  const

Constant access to top element of stack.

Definition at line 262 of file xst_stack.h.

00266     {
00267         return xtop_descend< LocationT >();
00268     }

template<typename StackT>
template<typename FunctorT >
void cttl_impl::xst_stack< StackT >::traverse_bottom_up ( FunctorT &  functor_  )  const

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

Definition at line 209 of file xst_stack.h.

00210     {
00211         functor_( *this );
00212     }

template<typename StackT>
template<typename FunctorT >
void cttl_impl::xst_stack< StackT >::traverse_bottom_up ( FunctorT &  functor_  ) 

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

Definition at line 195 of file xst_stack.h.

00196     {
00197         functor_( *this );
00198     }

template<typename StackT>
template<typename FunctorT >
void cttl_impl::xst_stack< StackT >::traverse_top_down ( FunctorT &  functor_  )  const

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

Definition at line 216 of file xst_stack.h.

00217     {
00218         functor_( *this );
00219     }

template<typename StackT>
template<typename FunctorT >
void cttl_impl::xst_stack< StackT >::traverse_top_down ( FunctorT &  functor_  ) 

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

Definition at line 202 of file xst_stack.h.

00203     {
00204         functor_( *this );
00205     }


Friends And Related Function Documentation

template<typename StackT>
friend struct xst_lambda_wrap [friend]

Definition at line 60 of file xst_stack.h.

template<typename StackT>
friend struct xst_translator [friend]

Definition at line 63 of file xst_stack.h.


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

Generated on Sun Aug 23 13:44:17 2009 for Common Text Transformation Library by  doxygen 1.5.9