Zen
A cross-platform functional programming language
|
Base class for continuations. More...
#include <zrt.hpp>
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. | |
Closure & | getCurrentClosure () |
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. | |
JoinerList & | getJoinerList () |
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. |
Base class for continuations.
Continuation | ( | const Continuation & | src | ) | [inline, protected] |
Copy constructor.
src | Source instance |
virtual void clone | ( | zbl::Continuation::Ptr & | continuation | ) | const [pure virtual] |
Create a clone of current continuation.
continuation | Autoptr for new instance |
Implemented in TestFactoryT< T, ImplT >::TcontinuationT.
void getChild | ( | zbl::Continuation::Ptr & | continuation | ) | [inline] |
Get child continuation for this continuation.
continuation | Autoptr for continuation |
zbl::Closure & getCurrentClosure | ( | ) | [inline] |
Get current closure in continuation.
JoinerList& getJoinerList | ( | ) | [inline] |
Get joiner list for continuation.
bool goNext | ( | const Closure::Action::T & | action | ) | [inline] |
Post-run handling of current closure.
action | The action to take |
bool hasChild | ( | ) | [inline] |
Check if continuation has a child continuation.
zbl::Closure::Action::T run | ( | zbl::RunContext & | _ctx | ) |
Run current closure in continuation.
_ctx | The RunContext instance |
void setChild | ( | Continuation * | child | ) | [inline] |
Set child continuation.
child | Child continuation |
virtual void setParent | ( | Closure * | parent | ) | [pure virtual] |
Set parent closure.
parent | Parent closure |
Implemented in ContinuationT< ReturnT >, and ContinuationT< int >.
int _idx [protected] |
Continuation index.