hmbdc
simplify-high-performance-messaging-programming
Public Member Functions | Friends | List of all members
hmbdc::app::netmap::sendtransportengine_detail::SendTransportEngine Struct Reference

power a netmap port sending functions More...

#include <SendTransportEngine.hpp>

Inheritance diagram for hmbdc::app::netmap::sendtransportengine_detail::SendTransportEngine:
hmbdc::app::Client< SendTransportEngine > hmbdc::app::MessageHandler< SendTransportEngine, Messages... >

Public Member Functions

bool droppedCb () override
 callback called after the Client is safely taken out of the Context More...
 
void invokedCb (uint16_t threadSerialNumber) HMBDC_RESTRICT override
 this callback is called all the time (frequently) - the exact timing is after a batch of messages are dispatched. After this call returns, the previously dispatched message's addresses are no longer valid, which means if you cache the event addresses in the previous handleMessageCb()s, you cannot use those after the return of the next invokeCb function. More...
 
void stoppedCb (std::exception const &e) override
 callback called when this Client is taken out of message dispatching More...
 
- Public Member Functions inherited from hmbdc::app::Client< SendTransportEngine >
char const * hmbdcName () const
 return the name of thread that runs this client, override if necessary More...
 
std::tuple< char const *, int > schedSpec () const
 an overrideable method. returns the schedule policy and priority, override if necessary priority is only used when policy is "SCHED_RR", or "SCHED_FIFO" More...
 
size_t maxBatchMessageCount () const
 an overridable method. client receives events in batches and the max batch size is controllable when running in direct mode Context. Here is to specify the max size. More...
 
virtual void messageDispatchingStartedCb (uint16_t threadSerialNumber)
 called before any messages got dispatched - only once More...
 
virtual ~Client ()
 trivial
 
void stopped (std::exception const &e) noexcept
 internal use, don't change or override
 

Friends

struct hmbdc::app::netmap::NetContext
 
struct hmbdc::app::netmap::Sender
 

Detailed Description

power a netmap port sending functions

this needs to be created using NetContext and start in an app::Context

Member Function Documentation

bool hmbdc::app::netmap::sendtransportengine_detail::SendTransportEngine::droppedCb ( )
overridevirtual

callback called after the Client is safely taken out of the Context

exception thrown here is ignored and return true is assumed

Returns
if false, this Client is added back to the Context to process messages otherwise, no more callback. You could even safely "delete this; return true;"

Reimplemented from hmbdc::app::Client< SendTransportEngine >.

void hmbdc::app::netmap::sendtransportengine_detail::SendTransportEngine::invokedCb ( uint16_t  threadSerialNumber)
inlineoverridevirtual

this callback is called all the time (frequently) - the exact timing is after a batch of messages are dispatched. After this call returns, the previously dispatched message's addresses are no longer valid, which means if you cache the event addresses in the previous handleMessageCb()s, you cannot use those after the return of the next invokeCb function.

you can collectively process the messages received/cached so far here, or do something needs to be done all the time like powering another message loop

Parameters
threadSerialNumberthe number indicating which thread is in action

Reimplemented from hmbdc::app::Client< SendTransportEngine >.

void hmbdc::app::netmap::sendtransportengine_detail::SendTransportEngine::stoppedCb ( std::exception const &  e)
overridevirtual

callback called when this Client is taken out of message dispatching

after this call the Client is still at hook from the Context point of view (until droppedCb is called), so don't delete this Client yet or add it back to the Context. any exception thrown here is ignored,

Parameters
ethe exception that caused the Client to be taken out of message dispatching e could be thrown by the Client itself in a callback function to voluntarily take itself out

Reimplemented from hmbdc::app::Client< SendTransportEngine >.


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