hmbdc
simplify-high-performance-messaging-programming
Protocol.hpp
1 #include "hmbdc/Copyright.hpp"
2 #pragma once
3 #include "hmbdc/tips/rnetmap/SendTransportEngine.hpp"
4 #include "hmbdc/tips/rnetmap/RecvTransportEngine.hpp"
5 #include "hmbdc/tips/rnetmap/DefaultUserConfig.hpp"
6 #include "hmbdc/app/utils/NetContextUtil.hpp"
7 #include "hmbdc/app/Config.hpp"
8 
9 #include "hmbdc/pattern/GuardedSingleton.hpp"
10 
11 namespace hmbdc { namespace tips { namespace rnetmap {
12 struct Protocol
15  static constexpr char const* name() { return "rnetmap"; }
16  static constexpr auto dftConfig() { return DefaultUserConfig; }
17 
19  template <typename Buffer, typename AttachmentAllocator>
21  std::string getTipsDomainName(app::Config cfg) {
22  cfg.resetSection("tx", false);
23  cfg.setAdditionalFallbackConfig(app::Config(DefaultUserConfig));
24  return cfg.getExt<std::string>("ifaceAddr") + '-' + cfg.getExt<std::string>("netmapPort");
25  }
26 
27  private:
29  Protocol(){
30  checkEpollTaskInitialization();
31  }
32 };
33 }}}
34 
T getExt(const path_type &param, bool throwIfMissing=true) const
get a value from the config
Definition: Config.hpp:238
class to hold an hmbdc configuration
Definition: Config.hpp:45
void setAdditionalFallbackConfig(Config const &c)
set additional defaults
Definition: Config.hpp:154
Definition: Protocol.hpp:12
Config & resetSection(char const *section, bool sectionExists=true)
change section name
Definition: Config.hpp:177
Definition: NetContextUtil.hpp:10
base for the Singleton that works with SingletonGuardian
Definition: GuardedSingleton.hpp:53
RAII representing the lifespan of the underlying Singleton which also ganrantees the singularity of u...
Definition: GuardedSingleton.hpp:20
Definition: Base.hpp:12