Pothos  0.4.0-gd11861cd
The Pothos dataflow programming software suite
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros Pages
Registry.hpp
Go to the documentation of this file.
1 
11 #pragma once
12 #include <Pothos/Config.hpp>
13 #include <Pothos/Plugin/Plugin.hpp>
14 #include <Pothos/Plugin/Path.hpp>
15 #include <string>
16 #include <vector>
17 
18 namespace Pothos {
19 
24 {
26  std::string pluginPath;
27  std::string objectType;
28  std::string modulePath;
29  std::vector<PluginRegistryInfoDump> subInfo;
30 };
31 
36 {
37 public:
42  static void add(const Plugin &plugin);
43 
47  template <typename ValueType>
48  static void add(const PluginPath &path, ValueType &&value);
49 
55  template <typename CallType>
56  static void addCall(const PluginPath &path, const CallType &call);
57 
64  static Plugin remove(const PluginPath &path);
65 
72  static Plugin get(const PluginPath &path);
73 
79  static bool empty(const PluginPath &path);
80 
85  static bool exists(const PluginPath &path);
86 
93  static std::vector<std::string> list(const PluginPath &path);
94 
98  static PluginRegistryInfoDump dump(void);
99 
100 private:
102  PluginRegistry(void){}
103 };
104 
105 } //namespace Pothos
106 
107 #include <utility> //std::forward
108 
109 template <typename ValueType>
110 void Pothos::PluginRegistry::add(const PluginPath &path, ValueType &&value)
111 {
112  Pothos::PluginRegistry::add(Pothos::Plugin(path, std::forward<ValueType>(value)));
113 }
114 
115 #include <Pothos/Callable/CallableImpl.hpp> //used in template definition below:
116 
117 template <typename CallType>
118 void Pothos::PluginRegistry::addCall(const PluginPath &path, const CallType &call)
119 {
121 }
Definition: Registry.hpp:23
#define POTHOS_API
Definition: Config.hpp:41
std::string pluginPath
Definition: Registry.hpp:26
static void add(const Plugin &plugin)
Definition: Registry.hpp:35
Definition: Callable.hpp:30
std::vector< PluginRegistryInfoDump > subInfo
Definition: Registry.hpp:29
std::string objectType
Definition: Registry.hpp:27
static void addCall(const PluginPath &path, const CallType &call)
Definition: Registry.hpp:118
Definition: Path.hpp:24
Definition: Plugin.hpp:23
std::string modulePath
Definition: Registry.hpp:28