tin  1.5.9
tsm::runtime::actor_group< Actors > Struct Template Reference

#include <actor.h>

Inheritance diagram for tsm::runtime::actor_group< Actors >:
Inheritance graph
Collaboration diagram for tsm::runtime::actor_group< Actors >:
Collaboration graph

Public Member Functions

constexpr actor_group (Actors &... actors)
 
bool step ()
 
std::size_t drain ()
 
bool empty () const
 Report whether every actor currently has no pending work. More...
 
std::size_t pending_events () const
 Return the sum of each actor's pending-event count. More...
 

Detailed Description

template<actor_like... Actors>
struct tsm::runtime::actor_group< Actors >

Non-owning deterministic stepping view over several actors.

actor_group visits actors in declaration order. It does not own the actors, allocate, create threads, or register callbacks.

Constructor & Destructor Documentation

◆ actor_group()

template<actor_like... Actors>
constexpr tsm::runtime::actor_group< Actors >::actor_group ( Actors &...  actors)
inlineexplicitconstexpr

Bind the group to existing actors.

The group stores pointers. The referenced actors must outlive the group.

Member Function Documentation

◆ drain()

template<actor_like... Actors>
std::size_t tsm::runtime::actor_group< Actors >::drain ( )
inline

Repeatedly call step() until no actor reports progress.

Returns the number of successful stepping rounds. A round counts when at least one actor made progress.

◆ empty()

template<actor_like... Actors>
bool tsm::runtime::actor_group< Actors >::empty ( ) const
inline

Report whether every actor currently has no pending work.

◆ pending_events()

template<actor_like... Actors>
std::size_t tsm::runtime::actor_group< Actors >::pending_events ( ) const
inline

Return the sum of each actor's pending-event count.

◆ step()

template<actor_like... Actors>
bool tsm::runtime::actor_group< Actors >::step ( )
inline

Give each actor at most one chance to make immediate progress.

Returns true if any actor reports progress.


The documentation for this struct was generated from the following file: