Pothos  0.1.0
The Pothos dataflow programming software suite
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros
Plugin.hpp
Go to the documentation of this file.
1 
11 #pragma once
12 #include <Pothos/Config.hpp>
13 #include <Pothos/Plugin/Path.hpp>
14 #include <Pothos/Plugin/Module.hpp>
15 #include <Pothos/Object/Object.hpp>
16 #include <string>
17 
18 namespace Pothos {
19 
24 {
25 public:
27  Plugin(void);
28 
32  Plugin(const PluginPath &path,
33  const Object &object = Object(),
34  const PluginModule &module = PluginModule());
35 
40  template <typename ValueType>
41  Plugin(const PluginPath &path, ValueType &&value);
42 
44  const PluginPath &getPath(void) const;
45 
47  const Object &getObject(void) const;
48 
50  const PluginModule &getModule(void) const;
51 
53  std::string toString(void) const;
54 
55 private:
56  PluginModule _module; //declared first, destroyed last
57  //-- since we must delete the Object before its containing module
58 
59  PluginPath _path;
60  Object _object;
61 };
62 
63 } //namespace Pothos
64 
65 #include <utility> //std::forward
66 
67 template <typename ValueType>
68 Pothos::Plugin::Plugin(const PluginPath &path, ValueType &&value):
69  _path(path),
70  _object(Object(std::forward<ValueType>(value)))
71 {
72  return;
73 }
Definition: Module.hpp:22
#define POTHOS_API
Definition: Config.hpp:41
Plugin(void)
Create a null plugin.
Definition: Object.hpp:55
Definition: Path.hpp:24
Definition: Plugin.hpp:23