dynamic_addon_factory.cpp
Go to the documentation of this file.
1 
11 #include "dynamic_library.h"
12 
17 
18 
19 namespace
20 {
21 using namespace Common;
22 
23 class DynamicAddonFactory : public AddonFactory
24 {
25 public:
26  DEFINE_CLASS_POINTERS(DynamicAddonFactory)
27 
28 public:
29  DynamicAddonFactory(const std::string & modulePath);
30 
31  virtual Addon::UniquePtr CreateAddon();
32 
33 private:
34  DynamicLibrary Library;
35 };
36 
37 DynamicAddonFactory::DynamicAddonFactory(const std::string & modulePath)
38  : Library(modulePath)
39 {
40 }
41 
42 Addon::UniquePtr DynamicAddonFactory::CreateAddon()
43 {
44  return Addon::UniquePtr(Library.Find<CreateAddonFunc>("CreateAddon")());
45 }
46 }
47 
48 Common::AddonFactory::UniquePtr Common::CreateDynamicAddonFactory(const char * modulePath)
49 {
50  return Common::AddonFactory::UniquePtr(new DynamicAddonFactory(modulePath));
51 }
Common::Addon * CreateAddon()
Addon interface definition GNU LGPL.
Addon interface definition GNU LGPL.
const char * modulePath
AddonFactory::UniquePtr CreateDynamicAddonFactory(const char *modulePath)
#define DEFINE_CLASS_POINTERS(ClassName)
Exception declarations GNU LGPL.
Common::Addon *(* CreateAddonFunc)()
Definition: dynamic_addon.h:18


ros_opcua_impl_freeopcua
Author(s): Denis Štogl
autogenerated on Tue Jan 19 2021 03:06:04