Lumiera  0.pre.03
»edit your freedom«
ThreadLifecycle< POL, RES >::Launch Struct Reference

#include "lib/thread.hpp"

Description

template<template< class, class > class POL, typename RES = void>
struct lib::thread::ThreadLifecycle< POL, RES >::Launch

Configuration builder to define the operation running within the thread, and possibly configure further details, depending on the actual Policy used.

Remarks
the primary ThreadLifecycle-ctor accepts such a Launch-instance and invokes a chain of λ-functions collected in the member #launch

Definition at line 463 of file thread.hpp.

Public Types

using Act = function< void(ThreadLifecycle &)>
 

Public Member Functions

template<class FUN , typename... ARGS>
 Launch (FUN &&threadFunction, ARGS &&...args)
 
template<class TAR , typename... ARGS>
 Launch (RES(TAR::*memFun)(ARGS...), ARGS ...args)
 
template<typename HOOK >
Launch && atExit (HOOK &&hook)
 
template<typename HOOK >
Launch && atStart (HOOK &&hook)
 
Launch && decorateCounter ()
 
template<typename HOOK >
Launch && onOrphan (HOOK &&hook)
 
Launch && threadID (string const &threadID)
 

Public Attributes

string id
 
Act launch
 

Private Member Functions

template<typename HOOK , class FUN >
auto adaptedHook (FUN Policy::*, HOOK &&hook)
 Helper to adapt a user provided hook to be usable as lifecycle hook. More...
 
template<typename HOOK , class FUN >
Launch && addHook (FUN Policy::*storedHook, HOOK &&hook)
 add a config layer to store a user-provided functor into the polic baseclass(es)
 
Launch && addLayer (Act action)
 generic helper to add another »onion layer« to this config builder
 

Additional Inherited Members

- Protected Member Functions inherited from MoveOnly
 MoveOnly (MoveOnly &&)=default
 
 MoveOnly (MoveOnly const &)=delete
 
MoveOnlyoperator= (MoveOnly &&)=delete
 
MoveOnlyoperator= (MoveOnly const &)=delete
 

Constructor & Destructor Documentation

◆ Launch()

Launch ( RES(TAR::*)(ARGS...)  memFun,
ARGS ...  args 
)
inline
Parameters
argsctor variant to bind a member function

Definition at line 477 of file thread.hpp.

Member Function Documentation

◆ adaptedHook()

auto adaptedHook ( FUN Policy::*  ,
HOOK &&  hook 
)
inlineprivate

Helper to adapt a user provided hook to be usable as lifecycle hook.

Template Parameters
HOOKtype of the user provided λ or functor
FUNtype of the function maintained in #PolicyLifecycleHook
Note
the user provided functor can take any type as argument, which is reachable by static cast from the thread-wrapper. Especially this allows both for low-level and userclass-internal hooks.

Definition at line 529 of file thread.hpp.

+ Inheritance diagram for ThreadLifecycle< POL, RES >::Launch:
+ Collaboration diagram for ThreadLifecycle< POL, RES >::Launch:

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