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

Factory for creating daemon instances. More...

#include <tec_daemon.hpp>

Public Member Functions

std::unique_ptr< Daemonoperator() (typename Derived::Params const &params)
 Creates a unique pointer to a derived daemon instance.
 

Detailed Description

template<typename Derived>
struct tec::Daemon::Builder< Derived >

Factory for creating daemon instances.

Provides a templated builder to create instances of derived daemon classes, hiding implementation details and ensuring type safety through static assertions.

Template Parameters
DerivedThe derived daemon class type.

Member Function Documentation

◆ operator()()

template<typename Derived >
std::unique_ptr< Daemon > tec::Daemon::Builder< Derived >::operator() ( typename Derived::Params const params)
inline

Creates a unique pointer to a derived daemon instance.

Constructs a new instance of the specified Derived class using the provided parameters. Ensures Derived is a subclass of Daemon.

Parameters
paramsThe parameters for constructing the Derived daemon.
Returns
std::unique_ptr<Daemon> A unique pointer to the created daemon instance.

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