8#ifndef HPP_ALIB_THREADMODEL_JOBS
9#define HPP_ALIB_THREADMODEL_JOBS
18#include "alib/strings/localstring.hpp"
23namespace alib {
namespace threadmodel
76 const std::type_info&
ID;
80 Job(
const std::type_info&
id )
117 template<
typename TOther>
118 bool Is() {
return ID ==
typeid(TOther); }
123 template<
typename TOther>
133 template<
typename TJob>
138 " Job type: <" <<
ID <<
">\n"
139 " Requested type: <" <<
typeid(TJob) <<
">" )
141 auto* result=
dynamic_cast<TJob*
>(
this);
144 "Job casting failed.\n"
145 " Job type: <" <<
ID <<
">\n"
146 " Requested type: <" <<
typeid(TJob) <<
">" )
158 virtual bool Do() {
return false; }
198#if !ALIB_CAMP || DOXYGEN
void DbgOmitDestructionWarning()
#define ALIB_ASSERT_MODULE(modulename)
#define ALIB_ASSERT_ERROR(cond,...)
ALIB_API void Bootstrap()
Priority
Possible priorities of jobs assigned to an DedicatedWorker.
@ DeferredDeletion
As the name indicates.
@ Low
As the name indicates.
@ Highest
As the name indicates.
@ High
As the name indicates.
@ Lowest
As the name indicates.
@ Standard
As the name indicates.
threadmodel::ThreadPool ThreadPool
Type alias in namespace alib.
threadmodel::JPromise JPromise
Type alias in namespace alib.
NLocalString< 2048 > NString2K
Type alias name for TLocalString<nchar,2048>.
threadmodel::DWManager DWManager
Type alias in namespace alib.
threadmodel::DedicatedWorker DedicatedWorker
Type alias in namespace alib.
threadmodel::Job Job
Type alias in namespace alib.
A simple encapsulated promise.
virtual void PrepareDeferredDeletion() override
virtual ~JPromise() override=default
Virtual destructor.
JPromise(const std::type_info &id)
virtual size_t SizeOf() override
virtual void PrepareDeferredDeletion()
const std::type_info & ID
Job(const std::type_info &id)
virtual ~Job()=default
Protected destructor.