Pothos  0.4.3-gabce2ce6
The Pothos dataflow programming software suite
Proxy.hpp
Go to the documentation of this file.
1 
11 #pragma once
12 #include <Pothos/Config.hpp>
13 #include <Pothos/Object/Object.hpp>
14 #include <memory>
15 #include <string>
16 
17 namespace Pothos {
18 
19 class ProxyEnvironment;
20 class ProxyHandle;
21 
29 {
30 public:
31 
35  Proxy(void);
36 
42  Proxy(const std::shared_ptr<ProxyHandle> &handle);
43 
50  Proxy(ProxyHandle *handle);
51 
56  explicit operator bool(void) const;
57 
59  std::shared_ptr<ProxyHandle> getHandle(void) const;
60 
64  std::shared_ptr<ProxyEnvironment> getEnvironment(void) const;
65 
71  template <typename ValueType>
72  ValueType convert(void) const;
73 
75  template <typename ReturnType, typename... ArgsType>
76  ReturnType call(const std::string &name, ArgsType&&... args) const;
77 
79  template <typename... ArgsType>
80  Proxy callProxy(const std::string &name, ArgsType&&... args) const;
81 
83  template <typename... ArgsType>
84  void callVoid(const std::string &name, ArgsType&&... args) const;
85 
87  template <typename ReturnType>
88  ReturnType get(const std::string &name) const;
89 
91  Proxy get(const std::string &name) const;
92 
94  template <typename ValueType>
95  void set(const std::string &name, ValueType&& value) const;
96 
98  template <typename... ArgsType>
99  Proxy operator()(ArgsType&&... args) const;
100 
108  int compareTo(const Proxy &other) const;
109 
114  size_t hashCode(void) const;
115 
121  Object toObject(void) const;
122 
128  std::string toString(void) const;
129 
136  std::string getClassName(void) const;
137 
139  bool operator<(const Proxy &obj) const;
140 
142  bool operator>(const Proxy &obj) const;
143 
144 private:
145  std::shared_ptr<ProxyHandle> _handle;
146 };
147 
155 POTHOS_API bool operator==(const Proxy &lhs, const Proxy &rhs);
156 
157 } //namespace Pothos
#define POTHOS_API
Definition: Config.hpp:41
POTHOS_API bool operator==(const Callable &lhs, const Callable &rhs)
Definition: CallInterface.hpp:15
Definition: Object.hpp:55
Definition: Handle.hpp:29
int compareTo(const T0 &v0, const T1 &v1)
Definition: CompareTo.hpp:27
Definition: Proxy.hpp:28