hmbdc
simplify-high-performance-messaging-programming
Public Types | Public Member Functions | Friends | 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 Types

using SELF = RecvTransportEngine
 
using MH = MessageHandler< SELF, Subscribe, Unsubscribe, TopicSource >
 
- Public Types inherited from hmbdc::app::tcpcast::RecvTransport
using ptr = std::shared_ptr< RecvTransport >
 
- Public Types inherited from hmbdc::app::tcpcast::Transport
using ptr = std::shared_ptr< Transport >
 
- Public Types inherited from hmbdc::time::Timer
using Callback = std::function< void(TimerManager &, SysTime const &)>
 
- Public Types inherited from hmbdc::app::Client< RecvTransportEngine< OutputBuffer, MsgArbitrator > >
enum  
 

Public Member Functions

 RecvTransportEngine (Config const &cfg, OutputBuffer &outputBuffer, MsgArbitrator arb=NoOpArb())
 ctor More...
 
void messageDispatchingStartedCb (uint16_t threadSerialNumber) override
 start the show by schedule the message recv
 
char const * hmbdcName () const
 
std::tuple< char const *, int > schedSpec () const
 
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::app::tcpcast::Transport
 Transport (Config const &cfg)
 
void initInThread ()
 
bool operator== (Transport const &other) const
 
bool operator< (Transport const &other) const
 
- Public Member Functions inherited from hmbdc::time::TimerManager
void schedule (SysTime fireAt, Timer &timer)
 
void cancel (Timer &timer)
 cancel a timer previously scheduled with the TimerManager More...
 
void checkTimers (time::SysTime)
 
- Public Member Functions inherited from hmbdc::time::ReoccuringTimer
 ReoccuringTimer (Duration const &interval, Callback callback=timers_detail::noop)
 
- Public Member Functions inherited from hmbdc::time::Timer
 Timer (Callback cb=timers_detail::noop)
 
void setCallback (Callback cb)
 
bool operator< (Timer const &other) const
 
bool operator<= (SysTime const &t) const
 
- 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
 
- Public Member Functions inherited from hmbdc::app::MessageHandler< RecvTransportEngine< OutputBuffer, MsgArbitrator >, Messages... >
void handleMessage (MessageHead &w)
 
- Public Member Functions inherited from hmbdc::pattern::PoolConsumer
 PoolConsumer (bool interestedInMessages=true)
 
void stopped (std::exception const &) noexcept
 
bool dropped () noexcept
 
void messageDispatchingStarted (uint16_t threadId)
 
void invoked (uint16_t threadId)
 
- Public Member Functions inherited from hmbdc::app::MessageHandler< RecvTransportEngine< OutputBuffer, MsgArbitrator >, Subscribe, Unsubscribe, TopicSource >
void handleMessage (MessageHead &w)
 

Friends

struct NetContext
 

Additional Inherited Members

- Static Public Member Functions inherited from hmbdc::app::MessageHandler< RecvTransportEngine< OutputBuffer, MsgArbitrator >, Messages... >
static void tryDispatch (RecvTransportEngine< OutputBuffer, MsgArbitrator > *p, MessageHead &w)
 
- Static Public Member Functions inherited from hmbdc::app::MessageHandler< RecvTransportEngine< OutputBuffer, MsgArbitrator >, Subscribe, Unsubscribe, TopicSource >
static void tryDispatch (RecvTransportEngine< OutputBuffer, MsgArbitrator > *p, MessageHead &w)
 
- Public Attributes inherited from hmbdc::time::ReoccuringTimer
const Duration interval
 
- Protected Types inherited from hmbdc::pattern::PoolConsumer
using BufIt = lf_misc::iterator< HMBDC_SEQ_TYPE >
 
- Protected Member Functions inherited from hmbdc::time::Timer
SysTime getFireAt () const
 
- Protected Attributes inherited from hmbdc::app::tcpcast::Transport
Config const config_
 
std::string hmbdcName_
 
std::string schedPolicy_
 
int schedPriority_
 
boost::asio::ip::udp::endpoint endpoint_
 
std::shared_ptr< boost::asio::io_service > pIos_
 
Topic const tcpcastAdTopic_
 

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.


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