Decoupled.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 
5 #include <Ice/PropertiesF.h>
6 
8 
9 namespace armarx
10 {
11 
13  std::string const& configName,
14  std::string const& configDomain);
15 
16  struct Decoupled
17  {
18  template <typename ComponentT>
19  static bool
20  registerComponent(std::string const& name)
21  {
22  return setCreateComponentFunction(&armarx::Component::create<ComponentT>, name);
23  }
24 
26  std::string const& name);
27  };
28 
29 #define ARMARX_REGISTER_COMPONENT_EXECUTABLE(ComponentT, applicationName) \
30  const static bool global_register_##Component = \
31  ::armarx::Decoupled::registerComponent<ComponentT>(applicationName)
32 
33 
34 #define ARMARX_DECOUPLED_REGISTER_COMPONENT(ComponentT) \
35  ARMARX_REGISTER_COMPONENT_EXECUTABLE(ComponentT, (#ComponentT))
36 
37 } // namespace armarx
armarx::Decoupled::setCreateComponentFunction
static bool setCreateComponentFunction(CreateComponentFunction *function, std::string const &name)
Definition: Decoupled.cpp:13
armarx::CreateComponentFunction
armarx::ComponentPtr CreateComponentFunction(Ice::PropertiesPtr properties, std::string const &configName, std::string const &configDomain)
Definition: Decoupled.h:12
IceInternal::Handle
Definition: forward_declarations.h:8
Component.h
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27
armarx::Decoupled::registerComponent
static bool registerComponent(std::string const &name)
Definition: Decoupled.h:20
armarx::Decoupled
Definition: Decoupled.h:16