1 #include "hmbdc/Copyright.hpp" 3 #include "hmbdc/app/utils/EpollTask.hpp" 4 #include "hmbdc/app/Base.hpp" 8 namespace hmbdc {
namespace app {
namespace utils {
12 template <
typename CcNetContext,
typename RunnerContext,
typename CcContext>
14 typename std::enable_if<RunnerContext::cpa::has_pool, void>::type
15 createMinimumNetContext(CcNetContext& netCtx
16 , RunnerContext& runnerCtx
18 , Config::Base
const& cfgIn
21 ,
size_t maxMessageSize
22 , uint8_t runningUsingThreadIndex
23 ,
char const* listenToTopic) {
25 runnerCtx.start(1, 1u << runningUsingThreadIndex);
26 if (sendSec ==
nullptr || sendSec[0]) {
27 auto eng = netCtx.createSendTransportEngine(
29 , maxMessageSize?maxMessageSize:ctx.maxMessageSize()
31 runnerCtx.addToPool(*eng);
33 if (recvSec ==
nullptr || recvSec[0]) {
34 auto eng = netCtx.createRecvTransportEngine(
38 runnerCtx.addToPool(*eng);
39 netCtx.listenTo(
Topic(listenToTopic));
43 void checkEpollTaskInitialization() {
44 auto& pg = utils::gEpollTaskGuard;
class to hold an hmbdc configuration
Definition: Config.hpp:46
topic as in the publish / subscribe communication paradigm
Definition: Topic.hpp:14
Definition: NetContextUtil.hpp:10
RAII representing the lifespan of the underlying Singleton which also ganrantees the singularity of u...
Definition: GuardedSingleton.hpp:20