Zth (libzth)
|
#include <async.h>
Public Types | |
typedef R | Return |
typedef F | Function |
typedef Future< Return > | Future_type |
Public Types inherited from zth::Fiber | |
enum | State { Uninitialized = 0 , New , Ready , Running , Waiting , Suspended , Dead } |
typedef void() | FiberHook(Fiber &) |
typedef ContextAttr::EntryArg | EntryArg |
typedef void(* | Entry) (EntryArg) |
Public Types inherited from zth::Listable< Fiber > | |
typedef Fiber | type |
Public Member Functions | |
TypedFiber (Function function) | |
virtual | ~TypedFiber () override=default |
void | registerFuture (Future_type *future) |
Future_type * | future () const |
SharedPointer< Future_type > | withFuture () |
Public Member Functions inherited from zth::Fiber | |
Fiber (Entry entry, EntryArg arg=EntryArg()) | |
virtual | ~Fiber () override |
int | setStackSize (size_t size) noexcept |
size_t | stackSize () const noexcept |
size_t | stackUsage () const |
Context * | context () const noexcept |
State | state () const noexcept |
void * | fls () const noexcept |
void | setFls (void *data=nullptr) noexcept |
Timestamp const & | runningSince () const noexcept |
Timestamp const & | stateEnd () const noexcept |
TimeInterval const & | totalTime () const noexcept |
void | addCleanup (void(*f)(Fiber &, void *), void *arg) |
int | init (Timestamp const &now=Timestamp::now()) |
int | run (Fiber &from, Timestamp now=Timestamp::now()) |
bool | allowYield (Timestamp const &now=Timestamp::now()) const noexcept |
void | kill () noexcept |
void | nap (Timestamp const &sleepUntil=Timestamp::null()) noexcept |
void | wakeup () noexcept |
void | suspend () noexcept |
void | resume () noexcept |
string | str () const |
Public Member Functions inherited from zth::Listable< Fiber > | |
constexpr | Listable () noexcept |
constexpr | Listable (Listable const &e) noexcept |
Listable (Listable &&l) noexcept | |
Listable & | operator= (Listable const &rhs) noexcept |
Listable & | operator= (Listable &&l) noexcept |
type * | listNext () const noexcept |
type * | listPrev () const noexcept |
Public Member Functions inherited from zth::UniqueID< Fiber > | |
UniqueID (UniqueID const &)=delete | |
UniqueID (UniqueID &&u) noexcept | |
UniqueID (string const &name) | |
UniqueID (string &&name) | |
UniqueID (char const *name=nullptr) | |
UniqueID & | operator= (UniqueID const &)=delete |
UniqueID & | operator= (UniqueID &&u) noexcept |
virtual | ~UniqueID ()=default |
void const * | normptr () const noexcept |
uint64_t | id () const noexcept |
string const & | name () const noexcept |
void | setName (string const &name) |
void | setName (char const *name) |
void | setName (string &&name) |
virtual char const * | id_str () const override |
Protected Member Functions | |
virtual void | entry_ ()=0 |
template<typename T > | |
void | setFuture (T const &r) |
void | setFuture () |
Function | function () const noexcept |
Protected Member Functions inherited from zth::Fiber | |
virtual void | changedName (string const &name) override |
void | setState (State state, Timestamp const &t=Timestamp::now()) noexcept |
void | fiberEntry_ () noexcept |
Protected Member Functions inherited from zth::UniqueIDBase | |
virtual | ~UniqueIDBase ()=default |
Static Protected Member Functions | |
static void | entry (void *that) |
Static Protected Member Functions inherited from zth::Fiber | |
static void | fiberEntry (void *that) noexcept |
Additional Inherited Members | |
Static Public Member Functions inherited from zth::UniqueID< Fiber > | |
static uint64_t | getID () noexcept |
Public Attributes inherited from zth::Listable< Fiber > | |
Listable * | prev |
Listable * | left |
Listable * | next |
Listable * | right |
Static Public Attributes inherited from zth::Fiber | |
static FiberHook * | hookNew = nullptr |
Hook to be called when a Fiber is created. More... | |
static FiberHook * | hookDead = nullptr |
Hook to be called when a Fiber is destroyed. More... | |
static uintptr_t const | ExitUnknown = (uintptr_t)-1 |
typedef F zth::TypedFiber< R, F >::Function |
typedef Future<Return> zth::TypedFiber< R, F >::Future_type |
typedef R zth::TypedFiber< R, F >::Return |
|
inlineexplicit |
|
overridevirtualdefault |
|
inlinestaticprotected |
|
protectedpure virtual |
Implemented in zth::TypedFiberN< void, Args... >, and zth::TypedFiberN< R, Args >.
|
inlineprotectednoexcept |
|
inline |
|
inline |
|
inlineprotected |
|
inlineprotected |
|
inline |