Pothos  0.7.0-gf7fbae99
The Pothos dataflow programming software suite
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::string moduleVersion;
30  std::vector<PluginRegistryInfoDump> subInfo;
31 };
32 
37 {
38 public:
43  static void add(const Plugin &plugin);
44 
48  template <typename ValueType>
49  static void add(const PluginPath &path, ValueType &&value);
50 
56  template <typename CallType>
57  static void addCall(const PluginPath &path, const CallType &call);
58 
65  static Plugin remove(const PluginPath &path);
66 
73  static Plugin get(const PluginPath &path);
74 
80  static bool empty(const PluginPath &path);
81 
86  static bool exists(const PluginPath &path);
87 
94  static std::vector<std::string> list(const PluginPath &path);
95 
99  static PluginRegistryInfoDump dump(void);
100 
101 private:
103  PluginRegistry(void){}
104 };
105 
106 } //namespace Pothos
107 
108 #include <utility> //std::forward
109 
110 template <typename ValueType>
111 void Pothos::PluginRegistry::add(const PluginPath &path, ValueType &&value)
112 {
113  Pothos::PluginRegistry::add(Pothos::Plugin(path, std::forward<ValueType>(value)));
114 }
115 
116 #include <Pothos/Callable/CallableImpl.hpp> //used in template definition below:
117 
118 template <typename CallType>
119 void Pothos::PluginRegistry::addCall(const PluginPath &path, const CallType &call)
120 {
122 }
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:36
Definition: Callable.hpp:30
Definition: ArchiveEntry.hpp:20
std::string moduleVersion
Definition: Registry.hpp:29
std::vector< PluginRegistryInfoDump > subInfo
Definition: Registry.hpp:30
std::string objectType
Definition: Registry.hpp:27
static void addCall(const PluginPath &path, const CallType &call)
Definition: Registry.hpp:119
Definition: Path.hpp:24
Definition: Plugin.hpp:23
std::string modulePath
Definition: Registry.hpp:28