|
class | hmbdc::pattern::SingletonGuardian< NetContext > |
|
|
static NetContext & | instance () |
|
static bool | initialized () |
|
template<typename Buffer , typename MsgArbitrator = RecvTransport::NoOpArb>
auto hmbdc::app::mcast::NetContext::createRecvTransportEngine |
( |
Config const & |
cfgIn, |
|
|
Buffer & |
buffer, |
|
|
MsgArbitrator && |
arb = RecvTransport::NoOpArb() |
|
) |
| |
|
inline |
construct a send transport and remember it
After this, user is responsible to get it started within a hmbdc Context, if running in Context pool, it needs to pin at a single pool thread, CANNOT span more than one thread otherwise the transport is not functioing/running. Don't create the same thing twice
- Parameters
-
cfgIn | jason specifing the transport - see example, perf-mcast.cpp and DefaultUserConfig.hpp |
buffer | buffer that recv messages go, normally the one returned by app::Context::buffer() |
arb | optonally an arbitrator to decide which messages to keep and drop if arb is an rvalue, it is passed in value, if an lvalue, passed in as reference; it supports either udp packet (BEFORE topic filtering) or hmbdc message (AFTER topic filtering) level arbitration depending on which one of int operator()(void* bytes, size_t len) and int operator()(TransportMessageHeader const* header) presents in the arb passed in trasnport engines, see ctor of RecvTransportEngineImpl for details |
- Returns
- a pointer to the Engine
template<typename Buffer , typename ArgsTuple >
auto hmbdc::app::mcast::NetContext::createRecvTransportEngineTuply |
( |
Config const & |
cfg, |
|
|
Buffer & |
buffer, |
|
|
ArgsTuple && |
args |
|
) |
| |
|
inline |
same as above but to provide a unified interface - not preferred
use forward_as_tuple to make the tuple passed in
- Returns
- a pointer to the Engine
SendTransportEngine* hmbdc::app::mcast::NetContext::createSendTransportEngine |
( |
Config const & |
cfgIn, |
|
|
size_t |
maxMessageSize |
|
) |
| |
|
inline |
construct a send transport engine (and remember it within the class)
After this, user is responsible to get it started within a hmbdc Context, if running in Context pool, it needs to pin at a single pool thread, CANNOT span more than one thread otherwise the transport is not functioing/running. Don't create the same thing twice
- Parameters
-
cfgIn | config specifing the transport - see example in perf-mcast.cpp and DefaultUserConfig.hpp |
maxMessageSize | max messafe size in bytes to be sent trasnport engines, see ctor of SendTransportEngine for details |
- Returns
- a pointer to the Engine - don't delete it
SendTransportEngine* hmbdc::app::mcast::NetContext::createSendTransportEngineTuply |
( |
Config const & |
cfg, |
|
|
size_t |
maxMessageSize, |
|
|
tuple<> |
args |
|
) |
| |
|
inline |
same as above but provide a unified interface - not preferred
- Returns
- a pointer to the Engine - don't delete it
Sender* hmbdc::app::mcast::NetContext::getSender |
( |
Topic const & |
t | ) |
|
|
inline |
get (or create for the first time) a Sender - whose function is to send messages on its associated Topic
this operation typically might be slow, so caching the return value is recommended.
- Parameters
-
t | - the Topic that the Sender is for |
void hmbdc::app::mcast::NetContext::listenTo |
( |
Topic const & |
t | ) |
|
|
inline |
This process is interested in a Topic.
Normally the receiving transport covering this topic needs to be created - not necessarily running - before calling this
- Parameters
-
void hmbdc::app::mcast::NetContext::stopListenTo |
( |
Topic const & |
t | ) |
|
|
inline |
undo the subscription
- Parameters
-
The documentation for this struct was generated from the following file: