1 #include "hmbdc/Copyright.hpp" 4 #include "hmbdc/app/MessageHandler.hpp" 5 #include "hmbdc/pattern/PoolConsumer.hpp" 6 #include "hmbdc/pattern/LockFreeBufferMisc.hpp" 7 #include "hmbdc/Compile.hpp" 11 namespace hmbdc {
namespace app {
46 template <
typename CcClient,
typename ... Messages>
51 REGISTERED_MESSAGE_SIZE =
sizeof...(Messages),
58 :
hmbdc::pattern::PoolConsumer(REGISTERED_MESSAGE_SIZE) {
127 return std::make_tuple<char const*, int>(
nullptr, 0);
144 BufIt const& end, uint16_t threadSerialNumber)
override {
145 CcClient& c =
static_cast<CcClient&
>(*this);
146 for (;it != end; ++it) {
147 c.MessageHandler<CcClient, Messages ...>::handleMessage(*static_cast<MessageHead*>(*it));
void handleRangeImpl(BufIt &it, BufIt const &end, uint16_t threadSerialNumber) override
internal use, don't change or override
Definition: Client.hpp:143
void stoppedCb(std::exception const &e) override
callback called when this Client is taken out of message dispatching
Definition: Client.hpp:84
Client()
trivial constructor
Definition: Client.hpp:57
std::tuple< char const *, int > schedSpec() const
an overrideable method. returns the schedule policy and priority, override if necessary priority is o...
Definition: Client.hpp:126
char const * hmbdcName() const
return the name of thread that runs this client, override if necessary
Definition: Client.hpp:116
size_t maxBatchMessageCount() const
an overridable method. client receives events in batches and the max batch size is controllable when ...
Definition: Client.hpp:138
void messageDispatchingStartedCb(uint16_t threadSerialNumber) override
called before any messages got dispatched - only once
Definition: Client.hpp:70
void invokedCb(uint16_t threadSerialNumber) override
this callback is called all the time (frequently)
Definition: Client.hpp:107
bool droppedCb() override
callback called after the Client is safely taken out of the Context
Definition: Client.hpp:94
Definition: PoolConsumer.hpp:13
a trait class, if a Client can only run on a single specific thread in Pool, derive the Client from i...
Definition: Client.hpp:17
A Client represents a thread of execution/a task. The execution is managed by a Context. a Client object could participate in message dispatching as the receiver of specifed message types.
Definition: Client.hpp:47
Definition: MessageHandler.hpp:36
Definition: LockFreeBufferMisc.hpp:73