Back to index

scribus-ng  1.3.4.dfsg+svn20071115
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes
desaxe::Transform_body< Obj_Type, Arg_Type > Class Template Reference

Transforms the topmost object to the topmost object but one on the stack. More...

#include <simple_actions.h>

Inheritance diagram for desaxe::Transform_body< Obj_Type, Arg_Type >:
Inheritance graph
[legend]
Collaboration diagram for desaxe::Transform_body< Obj_Type, Arg_Type >:
Collaboration graph
[legend]

List of all members.

Classes

struct  Cell

Public Types

typedef Obj_Type(* FunType )(const Arg_Type &)

Public Member Functions

 Transform_body (FunType fun)
void begin (const Xml_string &, Xml_attr)
void end (const Xml_string &)

Protected Member Functions

virtual void chars (const Xml_string &)

Protected Attributes

Digesterdig

Private Attributes

FunType fun_
std::vector< Cellstack

Detailed Description

template<class Obj_Type, class Arg_Type>
class desaxe::Transform_body< Obj_Type, Arg_Type >

Transforms the topmost object to the topmost object but one on the stack.

// FIXME: this should just be a getter...

Definition at line 721 of file simple_actions.h.


Class Documentation

struct desaxe::Transform_body::Cell

template<class Obj_Type, class Arg_Type>
struct desaxe::Transform_body< Obj_Type, Arg_Type >::Cell

Definition at line 752 of file simple_actions.h.

Class Members
Arg_Type * arg
Obj_Type obj

Member Typedef Documentation

template<class Obj_Type , class Arg_Type >
typedef Obj_Type(* desaxe::Transform_body< Obj_Type, Arg_Type >::FunType)(const Arg_Type &)

Definition at line 724 of file simple_actions.h.


Constructor & Destructor Documentation

template<class Obj_Type , class Arg_Type >
desaxe::Transform_body< Obj_Type, Arg_Type >::Transform_body ( FunType  fun) [inline]

Definition at line 726 of file simple_actions.h.

              : fun_(fun), stack()
       {}

Member Function Documentation

template<class Obj_Type , class Arg_Type >
void desaxe::Transform_body< Obj_Type, Arg_Type >::begin ( const Xml_string ,
Xml_attr   
) [inline, virtual]

Reimplemented from desaxe::Action_body.

Definition at line 730 of file simple_actions.h.

       { 
              Cell cell;
              cell.arg = this->dig->template top<Arg_Type>(); 
              cell.obj = fun_(*cell.arg);
#ifdef DESAXE_DEBUG
              std::cerr << "transform: " << cell.arg << " -> " << cell.obj << ")\n";
#endif
              stack.push_back(cell);
              this->dig->pop();
              this->dig->push(&cell.obj); 
       }      

Here is the call graph for this function:

virtual void desaxe::Action_body::chars ( const Xml_string ) [inline, protected, virtual, inherited]

Reimplemented in AppendText_body, desaxe::SetText_body< Obj_Type >, and desaxe::AddText_body< Obj_Type >.

Definition at line 36 of file actions.h.

{}

Here is the caller graph for this function:

template<class Obj_Type , class Arg_Type >
void desaxe::Transform_body< Obj_Type, Arg_Type >::end ( const Xml_string ) [inline, virtual]

Reimplemented from desaxe::Action_body.

Definition at line 743 of file simple_actions.h.

       {
              Cell cell = stack.back();
              stack.pop_back();
              this->dig->pop();
              this->dig->push(cell.arg); 
       }

Here is the call graph for this function:


Member Data Documentation

Digester* desaxe::Action_body::dig [protected, inherited]

Definition at line 38 of file actions.h.

template<class Obj_Type , class Arg_Type >
FunType desaxe::Transform_body< Obj_Type, Arg_Type >::fun_ [private]

Definition at line 751 of file simple_actions.h.

template<class Obj_Type , class Arg_Type >
std::vector<Cell> desaxe::Transform_body< Obj_Type, Arg_Type >::stack [private]

Definition at line 753 of file simple_actions.h.


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