Zen
A cross-platform functional programming language

Continuation Class Reference

Base class for continuations. More...

#include <zrt.hpp>

Inheritance diagram for Continuation:
ContinuationT< int > ContinuationT< ReturnT > TestFactoryT< T, ImplT >::TcontinuationT

List of all members.

Public Types

typedef z::scopedptr
< zbl::Continuation
Ptr
 Scoped pointer type for continuations.
typedef z::list< Runner * > JoinerList
 Type for list of joiners.

Public Member Functions

virtual ~Continuation ()
 Destructor.
bool goNext (const Closure::Action::T &action)
 Post-run handling of current closure.
ClosuregetCurrentClosure ()
 Get current closure in continuation.
virtual void setParent (Closure *parent)=0
 Set parent closure.
Closure::Action::T run (zbl::RunContext &_ctx)
 Run current closure in continuation.
virtual void clone (zbl::Continuation::Ptr &continuation) const =0
 Create a clone of current continuation.
bool hasChild ()
 Check if continuation has a child continuation.
void setChild (Continuation *child)
 Set child continuation.
void getChild (zbl::Continuation::Ptr &continuation)
 Get child continuation for this continuation.
JoinerListgetJoinerList ()
 Get joiner list for continuation.

Protected Member Functions

 Continuation ()
 Default constructor.
 Continuation (const Continuation &src)
 Copy constructor.

Protected Attributes

int _idx
 Continuation index.
z::list< Closure * > _closureList
 List of closures in this list.
JoinerList _joinerList
 List of joiners in this list.

Private Attributes

Continuation_child
 Child continuation if exists, else 0.

Detailed Description

Base class for continuations.


Constructor & Destructor Documentation

Continuation ( const Continuation src) [inline, protected]

Copy constructor.

Parameters:
srcSource instance

Member Function Documentation

virtual void clone ( zbl::Continuation::Ptr continuation) const [pure virtual]

Create a clone of current continuation.

Parameters:
continuationAutoptr for new instance

Implemented in TestFactoryT< T, ImplT >::TcontinuationT.

void getChild ( zbl::Continuation::Ptr continuation) [inline]

Get child continuation for this continuation.

Parameters:
continuationAutoptr for continuation
zbl::Closure & getCurrentClosure ( ) [inline]

Get current closure in continuation.

Returns:
Reference to current closure
JoinerList& getJoinerList ( ) [inline]

Get joiner list for continuation.

Returns:
Reference to joine list
bool goNext ( const Closure::Action::T action) [inline]

Post-run handling of current closure.

Parameters:
actionThe action to take
Returns:
True if success, else false
bool hasChild ( ) [inline]

Check if continuation has a child continuation.

Returns:
True if child continuation exists, else false

Run current closure in continuation.

Parameters:
_ctxThe RunContext instance
Returns:
The post-action
void setChild ( Continuation child) [inline]

Set child continuation.

Parameters:
childChild continuation
virtual void setParent ( Closure parent) [pure virtual]

Set parent closure.

Parameters:
parentParent closure

Implemented in ContinuationT< ReturnT >, and ContinuationT< int >.


Member Data Documentation

int _idx [protected]

Continuation index.

Todo:
Eliminate continuation index

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines