Pothos  0.4.0-gd11861cd
The Pothos dataflow programming software suite
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros Pages
BlockRegistry.hpp
Go to the documentation of this file.
1 
11 #pragma once
12 #include <Pothos/Config.hpp>
14 #include <Pothos/Proxy/Proxy.hpp>
17 #include <utility> //std::forward
18 #include <string>
19 
20 namespace Pothos {
21 
31 {
32 public:
33 
48  BlockRegistry(const std::string &path, const Callable &factory);
49 
56  template <typename... ArgsType>
57  static Proxy make(const std::string &path, ArgsType&&... args);
58 };
59 
60 } //namespace Pothos
61 
62 template <typename... ArgsType>
63 Pothos::Proxy Pothos::BlockRegistry::make(const std::string &path, ArgsType&&... args)
64 {
65  auto env = Pothos::ProxyEnvironment::make("managed");
66  auto registry = env->findProxy("Pothos/BlockRegistry");
67  return registry.callProxy(path, std::forward<ArgsType>(args)...);
68 }
#define POTHOS_API
Definition: Config.hpp:41
Definition: Callable.hpp:30
Definition: BlockRegistry.hpp:30
static Proxy make(const std::string &path, ArgsType &&...args)
static Sptr make(const std::string &name, const ProxyEnvironmentArgs &args=ProxyEnvironmentArgs())
Definition: Proxy.hpp:28