Zth (libzth)
zth::Runnable Class Referenceabstract

An abstract class, that can be started as a fiber. More...

#include <fiber.h>

Inheritance diagram for zth::Runnable:
zth::PerfFiber zth::Waiter

Public Member Functions

virtual ~Runnable ()=default
 
int run ()
 
Fiberfiber () const noexcept
 
 operator Fiber & () const noexcept
 
char const * id_str () const
 

Protected Member Functions

constexpr Runnable () noexcept
 
virtual int fiberHook (Fiber &f)
 
virtual void cleanup ()
 
virtual void entry ()=0
 

Detailed Description

An abstract class, that can be started as a fiber.

Create a subclass of this class if you want to have an object that can be started as a fiber. In contrast to a zth::Fiber, this class does not have to be on the heap and exists before and after the actual fiber.

Definition at line 466 of file fiber.h.

Constructor & Destructor Documentation

◆ Runnable()

constexpr zth::Runnable::Runnable ( )
inlineconstexprprotectednoexcept

Definition at line 470 of file fiber.h.

◆ ~Runnable()

virtual zth::Runnable::~Runnable ( )
virtualdefault

Member Function Documentation

◆ cleanup()

virtual void zth::Runnable::cleanup ( )
inlineprotectedvirtual

Definition at line 503 of file fiber.h.

◆ entry()

virtual void zth::Runnable::entry ( )
protectedpure virtual

Implemented in zth::PerfFiber, and zth::Waiter.

◆ fiber()

Fiber* zth::Runnable::fiber ( ) const
inlinenoexcept

Definition at line 479 of file fiber.h.

◆ fiberHook()

virtual int zth::Runnable::fiberHook ( Fiber f)
inlineprotectedvirtual

Reimplemented in zth::PerfFiber, and zth::Waiter.

Definition at line 496 of file fiber.h.

◆ id_str()

char const* zth::Runnable::id_str ( ) const
inline

Definition at line 490 of file fiber.h.

◆ operator Fiber &()

zth::Runnable::operator Fiber & ( ) const
inlinenoexcept

Definition at line 484 of file fiber.h.

◆ run()

int zth::Runnable::run ( )

Definition at line 18 of file fiber.cpp.


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