Zen
A cross-platform functional programming language

Fiber Class Reference

Fiber class. More...

#include <zrt.hpp>

List of all members.

Public Types

typedef z::scopedptr< FiberPtr
 Type of Fiber autoptr.

Public Member Functions

 Fiber ()
 Default constructor.
 ~Fiber ()
 Destructor.
zbl::Closure::Action::T run (zbl::RunContext &_ctx)
 Run the next closure in the fiber.
bool next (const Closure::Action::T &action)
 Execute post-action.
void clone (zbl::Fiber::Ptr &fiber) const
 Create clone of current fiber.
ContinuationpushContinuation (Continuation::Ptr &continuation)
 Push continuation on stack.
bool popContinuation (Continuation::Ptr &continuation)
 Pop continuation from stack.
ContinuationaddContinuation (Continuation::Ptr &continuation)
 Push continuation on stack.

Private Attributes

z::stack< Continuation * > _continuationList
 Continuation stack.

Detailed Description

Fiber class.


Member Function Documentation

zbl::Continuation * addContinuation ( Continuation::Ptr continuation)

Push continuation on stack.

Parameters:
continuationThe autoptr containing continuation
Returns:
Pointer to continuation just added
void clone ( zbl::Fiber::Ptr fiber) const

Create clone of current fiber.

Parameters:
fiberAutoptr to receive clone
bool next ( const Closure::Action::T action)

Execute post-action.

Parameters:
actionThe post-action to execute
Returns:
True if success, else false
bool popContinuation ( Continuation::Ptr continuation)

Pop continuation from stack.

Parameters:
continuationThe autoptr to receive continuation
Returns:
True if success, else false
zbl::Continuation * pushContinuation ( Continuation::Ptr continuation)

Push continuation on stack.

Parameters:
continuationThe autoptr containing continuation
Returns:
Pointer to continuation just added

Run the next closure in the fiber.

Parameters:
_ctxThe run context
Returns:
The post-action

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