Pothos  0.3.0-ga8f2d4e2
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::null());
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  // This module owns the plugin, so its just a pointer.
57  const PluginModule *_module;
58  PluginPath _path;
59  Object _object;
60 };
61 
62 } //namespace Pothos
63 
64 #include <utility> //std::forward
65 
66 template <typename ValueType>
67 Pothos::Plugin::Plugin(const PluginPath &path, ValueType &&value):
68  _path(path),
69  _object(Object(std::forward<ValueType>(value)))
70 {
71  return;
72 }
static const PluginModule & null(void)
A reference to a permanent empty module.
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