hmbdc
simplify-high-performance-messaging-programming
Public Types | Public Member Functions | Friends | List of all members
hmbdc::app::netmap::NetContext Struct Reference
Inheritance diagram for hmbdc::app::netmap::NetContext:
hmbdc::pattern::GuardedSingleton< NetContext >

Public Types

using Sender = hmbdc::app::netmap::Sender
 

Public Member Functions

SendTransportEnginecreateSendTransportEngine (Config const &cfgIn, size_t maxMessageSize)
 construct a send transport and remember it More...
 
SendTransportEnginecreateSendTransportEngineTuply (Config const &cfg, size_t maxMessageSize, 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...
 
SendergetSender (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 (Topic const &t)
 This process is interested in a Topic. More...
 
void stopListenTo (Topic const &t)
 undo the subscription More...
 

Friends

class hmbdc::pattern::SingletonGuardian< NetContext >
 

Additional Inherited Members

- Static Public Member Functions inherited from hmbdc::pattern::GuardedSingleton< NetContext >
static NetContext & instance ()
 
static bool initialized ()
 

Member Function Documentation

template<typename Buffer , typename MsgArbitrator = RecvTransport::NoOpArb>
auto hmbdc::app::netmap::NetContext::createRecvTransportEngine ( Config const &  cfgIn,
Buffer &  buffer,
MsgArbitrator &&  arb = RecvTransport::NoOpArb() 
)
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

Parameters
cfgInjason specifing the transport - see example, perf-netmap.cpp and DefaultUserConfig.hpp
bufferbuffer that recv messages go in, normally the one returned by app::Context::buffer()
arboptonally 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
Returns
a pointer to the Engine
template<typename Buffer , typename ArgsTuple >
auto hmbdc::app::netmap::NetContext::createRecvTransportEngineTuply ( Config const &  cfg,
Buffer &  buffer,
ArgsTuple &&  args 
)
inline

same as above but to provide a unified interface - not preferred

Returns
a pointer to the Engine
SendTransportEngine* hmbdc::app::netmap::NetContext::createSendTransportEngine ( Config const &  cfgIn,
size_t  maxMessageSize 
)
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

Parameters
cfgInjason specifing the transport - see example, perf-netmap.cpp and DefaultUserConfig.hpp
maxMessageSizemax messafe size in bytes to be sent
Returns
a pointer to the Engine
SendTransportEngine* hmbdc::app::netmap::NetContext::createSendTransportEngineTuply ( Config const &  cfg,
size_t  maxMessageSize,
tuple<>  args 
)
inline

same as above but provide an unified interface - not preferred

Returns
a pointer to the Engine - don't delete it
Sender* hmbdc::app::netmap::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::netmap::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
tTopic interested
void hmbdc::app::netmap::NetContext::stopListenTo ( Topic const &  t)
inline

undo the subscription

Parameters
tTopic

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