hmbdc
simplify-high-performance-messaging-programming
|
a singleton that holding netmap resources More...
#include <NetContext.hpp>
Public Types | |
using | Sender = hmbdc::app::netmap::Sender |
Public Member Functions | |
SendTransportEngine * | createSendTransportEngine (Config const &cfgIn, size_t maxMessageSize) |
construct a send transport and remember it More... | |
SendTransportEngine * | createSendTransportEngineTuply (Config const &cfg, size_t maxMessageSize, std::tuple<> args) |
same as above but provide an unified interface - not preferred More... | |
template<typename Buffer , typename MsgArbitrator = RecvTransport::NoOpArb> | |
auto | createRecvTransportEngine (Config const &cfgIn, Buffer &buffer, MsgArbitrator &&arb=RecvTransport::NoOpArb()) |
construct a send transport and remember it More... | |
template<typename Buffer , typename ArgsTuple > | |
auto | createRecvTransportEngineTuply (Config const &cfg, Buffer &buffer, ArgsTuple &&args) |
same as above but to provide a unified interface - not preferred More... | |
Sender * | getSender (comm::Topic const &t) |
get (or create for the first time) a Sender - whose function is to send messages on its associated Topic More... | |
void | listenTo (comm::Topic const &t) |
This process is interested in a Topic. More... | |
void | stopListenTo (comm::Topic const &t) |
undo the subscription More... | |
Friends | |
struct | hmbdc::pattern::SingletonGuardian< NetContext > |
Additional Inherited Members | |
![]() | |
static NetContext & | instance () |
static bool | initialized () |
a singleton that holding netmap resources
it manage transport engines see perf-netmap.cpp for usage
|
inline |
construct a send transport and remember it
After this, user is respoonsible to get it started within a hmbdc Context, otherwise the transport is not functioing/running. Don't create the same thing twice
cfgIn | jason specifing the transport - see perf-netmap.cpp and hmbdc/app/netmap/DefaultUserConfig.hpp |
buffer | buffer that recv messages go in, 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 also supports either netmap packet level (BEFORE topic filtering) or hmbdc message level (AFTER topic filtering) 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 |
|
inline |
same as above but to provide a unified interface - not preferred
|
inline |
construct a send transport and remember it
After this, user is responsible to get it started within a hmbdc Context, otherwise the transport is not functioing/running. Don't create the same thing twice. it might take several seconds (configured by nmResetWaitSec=2) to construct the engine to avoid message losses at the beginning - netmap seems to require that
cfgIn | jason specifing the transport - see hmbdc/app/netmap/DefaultUserConfig.hpp |
maxMessageSize | max messafe size in bytes to be sent |
|
inline |
same as above but provide an unified interface - not preferred
|
inline |
|
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
t | Topic interested |
|
inline |
undo the subscription
t | Topic |