dynamic_addon_factory.cpp
Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 #include "dynamic_library.h"
00012 
00013 #include <opc/common/addons_core/errors.h>
00014 #include <opc/common/addons_core/dynamic_addon.h>
00015 #include <opc/common/addons_core/dynamic_addon_factory.h>
00016 #include <opc/common/class_pointers.h>
00017 
00018 
00019 namespace
00020 {
00021   using namespace Common;
00022 
00023   class DynamicAddonFactory : public AddonFactory
00024   {
00025   public:
00026     DEFINE_CLASS_POINTERS(DynamicAddonFactory);
00027 
00028   public:
00029     DynamicAddonFactory(const std::string& modulePath);
00030 
00031     virtual Addon::UniquePtr CreateAddon();
00032 
00033   private:
00034     DynamicLibrary Library;
00035   };
00036 
00037   DynamicAddonFactory::DynamicAddonFactory(const std::string& modulePath)
00038     : Library(modulePath)
00039   {
00040   }
00041 
00042   Addon::UniquePtr DynamicAddonFactory::CreateAddon()
00043   {
00044     return Addon::UniquePtr(Library.Find<CreateAddonFunc>("CreateAddon")());
00045   }
00046 }
00047 
00048 Common::AddonFactory::UniquePtr Common::CreateDynamicAddonFactory(const char* modulePath)
00049 {
00050   return Common::AddonFactory::UniquePtr(new DynamicAddonFactory(modulePath));
00051 }


ros_opcua_impl_freeopcua
Author(s): Denis Štogl
autogenerated on Sat Jun 8 2019 18:24:40