OpenWalker Project
Documentation of the ROS Packages
class_creator.h
Go to the documentation of this file.
1 
34 #ifndef OPEN_WALKER_PLUGIN_LOADER_CLASS_CREATOR_H
35 #define OPEN_WALKER_PLUGIN_LOADER_CLASS_CREATOR_H
36 
37 #include <string>
38 #include <memory>
39 
41 
42 namespace ow_plugin_loader
43 {
44 
54 {
55 public:
57 
58 protected:
60  IGenericClass* c_ptr_;
61 
62 public:
73  ClassCreator(const std::string& libFilePath, bool* ok = 0);
74 
78  virtual ~ClassCreator();
79 
89  IGenericClass* genericClassPtr();
90 
91 
101  template<class IClass>
102  IClass* classPtr()
103  {
104  return static_cast<IClass*>(genericClassPtr());
105  }
106 
107 
108 private:
112  ClassCreator(const ClassCreator& other);
113 
117  ClassCreator& operator=(const ClassCreator& other);
118 };
119 
120 } // namespace ow_plugin_loader
121 
122 #endif // OPEN_WALKER_PLUGIN_LOADER_CLASS_CREATOR_H
Definition: class_creator.h:42
ClassCreator(const std::string &libFilePath, bool *ok=0)
Default constructor.
ClassLoader loader_
class loader
Definition: class_creator.h:59
The ClassCreator class.
Definition: class_creator.h:53
The IGenericClass class.
Definition: i_generic_class.h:54
The ClassLoader class.
Definition: class_loader.h:51
IGenericClass * c_ptr_
the pointer to the created class
Definition: class_creator.h:60
virtual ~ClassCreator()
Deconstructor.
IGenericClass * genericClassPtr()
Generic pointer to the created class.
IClass * classPtr()
Interface class pointer to the created class.
Definition: class_creator.h:102