Pothos  0.2.1-g9f04573d
The Pothos dataflow programming software suite
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros
Proxy.hpp
Go to the documentation of this file.
1 
11 #pragma once
12 #include <Pothos/Config.hpp>
13 #include <memory>
14 #include <string>
15 
16 namespace Pothos {
17 
18 class ProxyEnvironment;
19 class ProxyHandle;
20 
28 {
29 public:
30 
34  Proxy(void);
35 
41  Proxy(const std::shared_ptr<ProxyHandle> &handle);
42 
49  Proxy(ProxyHandle *handle);
50 
55  pothos_explicit operator bool(void) const;
56 
58  std::shared_ptr<ProxyHandle> getHandle(void) const;
59 
63  std::shared_ptr<ProxyEnvironment> getEnvironment(void) const;
64 
70  template <typename ValueType>
71  ValueType convert(void) const;
72 
74  template <typename ReturnType>
75  ReturnType call(const std::string &name) const;
76 
78  inline
79  Proxy callProxy(const std::string &name) const;
80 
82  inline
83  void callVoid(const std::string &name) const;
85  template <typename ReturnType, typename A0>
86  ReturnType call(const std::string &name, const A0 &a0) const;
87 
89  template <typename A0>
90  Proxy callProxy(const std::string &name, const A0 &a0) const;
91 
93  template <typename A0>
94  void callVoid(const std::string &name, const A0 &a0) const;
96  template <typename ReturnType, typename A0, typename A1>
97  ReturnType call(const std::string &name, const A0 &a0, const A1 &a1) const;
98 
100  template <typename A0, typename A1>
101  Proxy callProxy(const std::string &name, const A0 &a0, const A1 &a1) const;
102 
104  template <typename A0, typename A1>
105  void callVoid(const std::string &name, const A0 &a0, const A1 &a1) const;
107  template <typename ReturnType, typename A0, typename A1, typename A2>
108  ReturnType call(const std::string &name, const A0 &a0, const A1 &a1, const A2 &a2) const;
109 
111  template <typename A0, typename A1, typename A2>
112  Proxy callProxy(const std::string &name, const A0 &a0, const A1 &a1, const A2 &a2) const;
113 
115  template <typename A0, typename A1, typename A2>
116  void callVoid(const std::string &name, const A0 &a0, const A1 &a1, const A2 &a2) const;
118  template <typename ReturnType, typename A0, typename A1, typename A2, typename A3>
119  ReturnType call(const std::string &name, const A0 &a0, const A1 &a1, const A2 &a2, const A3 &a3) const;
120 
122  template <typename A0, typename A1, typename A2, typename A3>
123  Proxy callProxy(const std::string &name, const A0 &a0, const A1 &a1, const A2 &a2, const A3 &a3) const;
124 
126  template <typename A0, typename A1, typename A2, typename A3>
127  void callVoid(const std::string &name, const A0 &a0, const A1 &a1, const A2 &a2, const A3 &a3) const;
129  template <typename ReturnType, typename A0, typename A1, typename A2, typename A3, typename A4>
130  ReturnType call(const std::string &name, const A0 &a0, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4) const;
131 
133  template <typename A0, typename A1, typename A2, typename A3, typename A4>
134  Proxy callProxy(const std::string &name, const A0 &a0, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4) const;
135 
137  template <typename A0, typename A1, typename A2, typename A3, typename A4>
138  void callVoid(const std::string &name, const A0 &a0, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4) const;
140  template <typename ReturnType, typename A0, typename A1, typename A2, typename A3, typename A4, typename A5>
141  ReturnType call(const std::string &name, const A0 &a0, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5) const;
142 
144  template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5>
145  Proxy callProxy(const std::string &name, const A0 &a0, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5) const;
146 
148  template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5>
149  void callVoid(const std::string &name, const A0 &a0, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5) const;
151  template <typename ReturnType, typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6>
152  ReturnType call(const std::string &name, const A0 &a0, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6) const;
153 
155  template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6>
156  Proxy callProxy(const std::string &name, const A0 &a0, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6) const;
157 
159  template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6>
160  void callVoid(const std::string &name, const A0 &a0, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6) const;
162  template <typename ReturnType, typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7>
163  ReturnType call(const std::string &name, const A0 &a0, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7) const;
164 
166  template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7>
167  Proxy callProxy(const std::string &name, const A0 &a0, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7) const;
168 
170  template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7>
171  void callVoid(const std::string &name, const A0 &a0, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7) const;
173  template <typename ReturnType, typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8>
174  ReturnType call(const std::string &name, const A0 &a0, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8) const;
175 
177  template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8>
178  Proxy callProxy(const std::string &name, const A0 &a0, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8) const;
179 
181  template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8>
182  void callVoid(const std::string &name, const A0 &a0, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8) const;
183 
191  int compareTo(const Proxy &other) const;
192 
197  size_t hashCode(void) const;
198 
204  std::string toString(void) const;
205 
212  std::string getClassName(void) const;
213 
215  bool operator<(const Proxy &obj) const;
216 
218  bool operator>(const Proxy &obj) const;
219 
220 private:
221  std::shared_ptr<ProxyHandle> _handle;
222 };
223 
231 POTHOS_API bool operator==(const Proxy &lhs, const Proxy &rhs);
232 
233 } //namespace Pothos
234 
235 inline Pothos::Proxy Pothos::Proxy::callProxy(const std::string &name) const
236 {
237  return this->call<Proxy>(name);
238 }
239 
240 inline void Pothos::Proxy::callVoid(const std::string &name) const
241 {
242  this->call<Proxy>(name);
243 }
#define pothos_explicit
Definition: Config.hpp:85
#define POTHOS_API
Definition: Config.hpp:41
POTHOS_API bool operator==(const Callable &lhs, const Callable &rhs)
void callVoid(const std::string &name) const
Call a method with a void return and 0 args.
Definition: Proxy.hpp:240
Proxy callProxy(const std::string &name) const
Call a method with a Proxy return and 0 args.
Definition: Proxy.hpp:235
Definition: Handle.hpp:29
int compareTo(const T0 &v0, const T1 &v1)
Definition: CompareTo.hpp:27
Definition: Proxy.hpp:27