Doxygen XLinks
by
V: 2511R0
Website: doxygen
Loading...
Searching...
No Matches
threadpool.hpp
Go to the documentation of this file.
1//==================================================================================================
2/// \file
3/// This header-file is part of \dxl - A doxygen post-processor that allows to define smarter
4/// <b>Doxygen</b>-links.
5///
6/// \emoji :copyright: 2025-2026 A-Worx GmbH, Germany.
7/// Published under \ref mainpage_license "Boost Software License".
8//==================================================================================================
9#ifndef HPP_DXL_THREADPOOL
10#define HPP_DXL_THREADPOOL
11#pragma once
12#include "mappedfile.hpp"
13#include "ALib.ThreadModel.H"
14
15namespace dxl {
16struct DXLPoolWorker;
17class DXLThreadPool;
18
19/// The base class \dxl-jobs.
21 using Job::Job;
22 DXLPoolWorker* poolWorker; ///< The pool worker that executes this job.
23};
24
25
26/// A customized \alib thread-pool worker.
28 /// A mono allocator. This is reset with every job execution.
30
31 /// A read buffer. This is never shrunk but growing each time a larger file is loaded.
33
34 /// A write buffer. This is never shrunk but growing each time a larger file is written.
36
37 /// Constructor
38 /// @param pool The pool we belong to.
39 /// @param pName This worker's name.
40 DXLPoolWorker(DXLThreadPool& pool, const alib::character* pName);
41
42 /// Attaches a pointer to ourselves to the Job.
43 ///@param job The job to prepare.
44 virtual void PrepareJob(alib::threadmodel::Job* job) override {
45 dynamic_cast<DXLJob*>(job)->poolWorker= this;
46 TMA .Reset();
47 WriteBuffer.Reset();
48 }
49
50};
51
52/// A customized \alib thread-pool.
54
55 /// Creates a custom worker of type #"DXLPoolWorker".
56 /// @return A pool worker.
58 return pool().New<DXLPoolWorker>( *this, alib::String128("DXLPoolWorker")
59 << alib::Dec(nextWorkerID++, 3, nullptr) );
60 }
61
62};
63
64} //namespace [dxl]
65
66#endif // HPP_DXL_THREADPOOL
A customized ALib thread-pool.
alib::threadmodel::PoolWorker * CreateWorker() override
monomem::TMonoAllocator< lang::HeapAllocator > MonoAllocator
strings::TDec< character > Dec
LocalString< 128 > String128
strings::TAString< character, lang::HeapAllocator > AString
characters::character character
todox
Definition doxyfile.cpp:20
The base class DoxygenXLinks-jobs.
DXLPoolWorker * poolWorker
The pool worker that executes this job.
A customized ALib thread-pool worker.
DXLPoolWorker(DXLThreadPool &pool, const alib::character *pName)
MappedFile InputFile
A read buffer. This is never shrunk but growing each time a larger file is loaded.
alib::MonoAllocator TMA
A mono allocator. This is reset with every job execution.
virtual void PrepareJob(alib::threadmodel::Job *job) override
alib::AString WriteBuffer
A write buffer. This is never shrunk but growing each time a larger file is written.