Lumiera  0.pre.03
»edit your freedom«
ThreadWrapperLifecycle_test Class Reference

Description

Test:
verify lifecycle behaviour of threads managed by thread-wrapper.
See also
thread.hpp
ThreadWrapperBackground_test
ThreadWrapperJoin_test

Definition at line 52 of file thread-wrapper-lifecycle-test.cpp.

Private Member Functions

void defaultWrapperLifecycle ()
 
void demonstrateExplicitThreadLifecycle ()
 
virtual void run (Arg)
 
void verifyThreadLifecycleHooks ()
 

Additional Inherited Members

- Public Member Functions inherited from Test
virtual ~Test ()=default
 this is an interface
 
lib::Random makeRandGen ()
 build a dedicated new RandomGen, seeded from the default-Gen
 
virtual void run (Arg arg)=0
 
void seedRand ()
 draw a new random seed from a common nucleus, and re-seed the default-Gen.
 
- Static Public Member Functions inherited from Test
static string firstTok (Arg)
 conveniently pick the first token from the argument line
 
static uint firstVal (Arg, uint=1)
 conveniently use some number given as argument, with optional default
 

Member Function Documentation

◆ defaultWrapperLifecycle()

void defaultWrapperLifecycle ( )
inlineprivate
Test:
demonstrate terms of lifecycle for the default case

Definition at line 66 of file thread-wrapper-lifecycle-test.cpp.

◆ verifyThreadLifecycleHooks()

void verifyThreadLifecycleHooks ( )
inlineprivate
Test:
attach user provided callback hooks to the thread lifecycle.

Definition at line 93 of file thread-wrapper-lifecycle-test.cpp.

◆ demonstrateExplicitThreadLifecycle()

void demonstrateExplicitThreadLifecycle ( )
inlineprivate
Test:
verify a special setup to start a thread explicitly and to track the thread's lifecycle state.
  • use a component to encapsulate the thread
  • this TestThread component is managed in a unique_ptr
  • thus it is explicitly possible to be not in running state
  • when starting the TestThread, a lifecycle callback is bound
  • at termination this callback will clear the unique_ptr
  • thus allocation and running state is tied to the lifecycle

Definition at line 124 of file thread-wrapper-lifecycle-test.cpp.

+ Inheritance diagram for ThreadWrapperLifecycle_test:
+ Collaboration diagram for ThreadWrapperLifecycle_test:

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