hmbdc
simplify-high-performance-messaging-programming
Public Member Functions | List of all members
hmbdc::app::tcpcast::recvtransportengine_detail::RecvTransportEngine< OutputBuffer, MsgArbitrator > Struct Template Reference

impl class More...

#include <RecvTransportEngine.hpp>

Inheritance diagram for hmbdc::app::tcpcast::recvtransportengine_detail::RecvTransportEngine< OutputBuffer, MsgArbitrator >:
hmbdc::app::tcpcast::RecvTransport hmbdc::time::TimerManager hmbdc::time::ReoccuringTimer hmbdc::app::single_thread_powered_client hmbdc::app::Client< RecvTransportEngine< OutputBuffer, MsgArbitrator > > hmbdc::app::MessageHandler< RecvTransportEngine< OutputBuffer, MsgArbitrator >, Subscribe, Unsubscribe, TopicSource > hmbdc::app::tcpcast::Transport hmbdc::time::Timer hmbdc::app::MessageHandler< RecvTransportEngine< OutputBuffer, MsgArbitrator >, Messages... > hmbdc::pattern::PoolConsumer

Public Member Functions

 RecvTransportEngine (Config const &cfg, OutputBuffer &outputBuffer, MsgArbitrator arb=NoOpArb())
 ctor More...
 
void tryTopicSource (TopicSource const &s)
 in the environment that multicast cannot be enabled on either the sender or the receiver side, the sender info cannot be automatically detected by the receiver. User can use this method to explicitedly tell the receiver about the sender information More...
 
void messageDispatchingStartedCb (uint16_t threadSerialNumber) override
 start the show by schedule the message recv
 
void stoppedCb (std::exception const &e) override
 should not happen ever unless an exception thrown More...
 
void invokedCb (uint16_t threadSerialNumber) HMBDC_RESTRICT override
 power the io_service and other things
 
void handleMessageCb (Subscribe const &t)
 only used by MH
 
void handleMessageCb (Unsubscribe const &t)
 only used by MH
 
void handleMessageCb (TopicSource const &t)
 only used by MH
 
- Public Member Functions inherited from hmbdc::time::TimerManager
void cancel (Timer &timer)
 cancel a timer previously scheduled with the TimerManager More...
 
- Public Member Functions inherited from hmbdc::app::Client< RecvTransportEngine< OutputBuffer, MsgArbitrator > >
 Client ()
 trivial constructor
 
void messageDispatchingStartedCb (uint16_t threadSerialNumber) override
 called before any messages got dispatched - only once More...
 
void stoppedCb (std::exception const &e) override
 callback called when this Client is taken out of message dispatching More...
 
bool droppedCb () override
 callback called after the Client is safely taken out of the Context More...
 
void invokedCb (uint16_t threadSerialNumber) override
 this callback is called all the time (frequently) More...
 
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...
 
void handleRangeImpl (BufIt &it, BufIt const &end, uint16_t threadSerialNumber) override
 internal use, don't change or override
 

Detailed Description

template<typename OutputBuffer, typename MsgArbitrator>
struct hmbdc::app::tcpcast::recvtransportengine_detail::RecvTransportEngine< OutputBuffer, MsgArbitrator >

impl class

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

Template Parameters
OutputBuffertype of buffer to hold resulting network messages

Constructor & Destructor Documentation

template<typename OutputBuffer, typename MsgArbitrator>
hmbdc::app::tcpcast::recvtransportengine_detail::RecvTransportEngine< OutputBuffer, MsgArbitrator >::RecvTransportEngine ( Config const &  cfg,
OutputBuffer &  outputBuffer,
MsgArbitrator  arb = NoOpArb() 
)
inline

ctor

io_service could be passed in by user, in this case NO more than two threads should power this io_service instance since that would violate the thread garantee of Client, which is no callbacks are called in parallel

Parameters
cfgspecify the details of the tcpcast transport
outputBufferholding the results
arbarbitrator instance to decide which messages to drop and keep; it ONLY supports hmbdc message (AFTER topic filtering) level (NO packet level since it is tcp)

Member Function Documentation

template<typename OutputBuffer, typename MsgArbitrator>
void hmbdc::app::tcpcast::recvtransportengine_detail::RecvTransportEngine< OutputBuffer, MsgArbitrator >::stoppedCb ( std::exception const &  e)
inlineoverridevirtual

should not happen ever unless an exception thrown

Parameters
eexception thown

Reimplemented from hmbdc::pattern::PoolConsumer.

template<typename OutputBuffer, typename MsgArbitrator>
void hmbdc::app::tcpcast::recvtransportengine_detail::RecvTransportEngine< OutputBuffer, MsgArbitrator >::tryTopicSource ( TopicSource const &  s)
inline

in the environment that multicast cannot be enabled on either the sender or the receiver side, the sender info cannot be automatically detected by the receiver. User can use this method to explicitedly tell the receiver about the sender information

not like additionalTopicSources config which will periodically retry, this call has no effect if the sender is not up and fully ready

Parameters
sdescribing the sender

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