TEC
A lightweight C++ library enabling safe, efficient execution in multithreaded and concurrent systems.
Loading...
Searching...
No Matches
tec::ActorWorker< TParams, TActor >::Builder< WorkerDerived, ActorDerived > Struct Template Reference

Factory for constructing ActorWorker as a Daemon pointer. More...

#include <tec_actor_worker.hpp>

Public Member Functions

std::unique_ptr< Daemonoperator() (const typename WorkerDerived::Params &params) const
 Creates a std::unique_ptr<Daemon> owning the worker.
 

Detailed Description

template<typename TParams, typename TActor>
template<typename WorkerDerived, typename ActorDerived>
struct tec::ActorWorker< TParams, TActor >::Builder< WorkerDerived, ActorDerived >

Factory for constructing ActorWorker as a Daemon pointer.

Enables polymorphic creation of derived worker/actor pairs while preserving type safety via static_assert.

Template Parameters
WorkerDerivedFinal ActorWorker specialization.
ActorDerivedFinal Actor implementation.

Member Function Documentation

◆ operator()()

std::unique_ptr< Daemon > tec::ActorWorker< TParams, TActor >::Builder< WorkerDerived, ActorDerived >::operator() ( const typename WorkerDerived::Params &  params) const
inline

Creates a std::unique_ptr<Daemon> owning the worker.

Parameters
paramsParameters used to construct both worker and actor.
Returns
std::unique_ptr<Daemon> Polymorphic pointer to the worker.
Precondition
WorkerDerived must inherit from ActorWorker.
ActorDerived must inherit from Actor.

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