1 #include "hmbdc/Copyright.hpp" 4 #include "hmbdc/app/MessageHandler.hpp" 5 #include "hmbdc/Compile.hpp" 9 namespace hmbdc {
namespace app {
44 template <
typename CcClient,
typename ... Messages>
48 REGISTERED_MESSAGE_SIZE =
sizeof...(Messages),
50 using Interests = std::tuple<Messages ...>;
68 return std::make_tuple<char const*, int>(
nullptr, 0);
144 void stopped(std::exception
const&e) noexcept {
150 bool dropped() noexcept {
158 template <
typename Iterator>
159 void handleRangeImpl(Iterator it,
160 Iterator end, uint16_t threadId) {
161 CcClient& c =
static_cast<CcClient&
>(*this);
162 for (;it != end; ++it) {
163 c.MessageHandler<CcClient, Messages ...>::handleMessage(*static_cast<MessageHead*>(*it));
char const * hmbdcName() const
return the name of thread that runs this client, override if necessary
Definition: Client.hpp:57
virtual ~Client()
trivial
Definition: Client.hpp:139
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:67
virtual bool droppedCb()
callback called after the Client is safely taken out of the Context
Definition: Client.hpp:115
virtual void invokedCb(uint16_t threadSerialNumber)
this callback is called all the time (frequently) - the exact timing is after a batch of messages are...
Definition: Client.hpp:132
void stopped(std::exception const &e) noexcept
internal use, don't change or override
Definition: Client.hpp:144
size_t maxBatchMessageCount() const
an overridable method. client receives events in batches and the max batch size is controllable when ...
Definition: Client.hpp:79
virtual void stoppedCb(std::exception const &e)
callback called when this Client is taken out of message dispatching
Definition: Client.hpp:105
virtual void messageDispatchingStartedCb(uint16_t threadSerialNumber)
called before any messages got dispatched - only once
Definition: Client.hpp:91
a trait class, if a Client can only run on a single specific thread in Pool, derive the Client from i...
Definition: Client.hpp:15
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:45
a std tuple holding messages types it can dispatch
Definition: BlockingContext.hpp:157
Definition: MessageHandler.hpp:39