OpenDDS  Snapshot(2023/04/28-20:55)
ShmemLoader.cpp
Go to the documentation of this file.
1 /*
2  *
3  *
4  * Distributed under the OpenDDS License.
5  * See: http://www.opendds.org/license.html
6  */
7 
8 #include "ShmemLoader.h"
9 #include "ShmemInst.h"
10 
13 
14 namespace {
15  const char SHMEM_NAME[] = "shmem";
16 }
17 
19 
20 namespace OpenDDS {
21 namespace DCPS {
22 
23 class ShmemType : public TransportType {
24 public:
25  const char* name() { return SHMEM_NAME; }
26 
27  TransportInst_rch new_inst(const std::string& name)
28  {
29  return make_rch<ShmemInst>(name);
30  }
31 };
32 
33 int
34 ShmemLoader::init(int /*argc*/, ACE_TCHAR* /*argv*/[])
35 {
36  static bool initialized(false);
37 
38  if (initialized) return 0; // already initialized
39 
41  if (!registry->register_type(make_rch<ShmemType>())) {
42  return 0;
43  }
44 
45  //FUTURE: when we're ready, add a ShmemInst to the default config, like so:
46  /*
47  TransportInst_rch default_inst =
48  registry->create_inst(TransportRegistry::DEFAULT_INST_PREFIX + "0200_SHMEM",
49  SHMEM_NAME, false);
50  registry->get_config(TransportRegistry::DEFAULT_CONFIG_NAME)
51  ->sorted_insert(default_inst);
52  */
53  initialized = true;
54 
55  return 0;
56 }
57 
58 ACE_FACTORY_DEFINE(OpenDDS_Shmem, ShmemLoader);
61  ACE_TEXT("OpenDDS_Shmem"),
65  0)
66 
67 } // namespace DCPS
68 } // namespace OpenDDS
69 
#define TheTransportRegistry
& ACE_SVC_NAME(TAO_AV_TCP_Factory)
TransportInst_rch new_inst(const std::string &name)
Definition: ShmemLoader.cpp:27
ACE_STATIC_SVC_DEFINE(ACE_Logging_Strategy, ACE_TEXT("Logging_Strategy"), ACE_Service_Type::SERVICE_OBJECT, &ACE_SVC_NAME(ACE_Logging_Strategy), ACE_Service_Type::DELETE_THIS|ACE_Service_Type::DELETE_OBJ, 0) extern "C" int _get_dll_unload_policy()
ACE_SVC_OBJ_T
char ACE_TCHAR
const char *const name
Definition: debug.cpp:60
ACE_TEXT("TCP_Factory")
Base class for concrete transports to provide new objects.
Definition: TransportType.h:37
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
ACE_FACTORY_DEFINE(OpenDDS_Shmem, ShmemLoader)
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28
bool register_type(const TransportType_rch &type)