Pothos  0.7.0-gf7fbae99
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 
78  template <typename ValueType>
79  operator ValueType(void) const;
80 
82  template <typename ReturnType, typename... ArgsType>
83  ReturnType call(const std::string &name, ArgsType&&... args) const;
84 
86  template <typename... ArgsType>
87  Proxy call(const std::string &name, ArgsType&&... args) const;
88 
93  template <typename... ArgsType>
94  POTHOS_DEPRECATED("Replaced by call() overload without return type")
95  Proxy callProxy(const std::string &name, ArgsType&&... args) const;
96 
101  template <typename... ArgsType>
102  POTHOS_DEPRECATED("Replaced by call() overload without return type")
103  void callVoid(const std::string &name, ArgsType&&... args) const;
104 
106  template <typename ReturnType>
107  ReturnType get(const std::string &name) const;
108 
110  Proxy get(const std::string &name) const;
111 
113  template <typename ValueType>
114  void set(const std::string &name, ValueType&& value) const;
115 
117  template <typename... ArgsType>
118  Proxy operator()(ArgsType&&... args) const;
119 
127  int compareTo(const Proxy &other) const;
128 
133  size_t hashCode(void) const;
134 
140  Object toObject(void) const;
141 
147  std::string toString(void) const;
148 
155  std::string getClassName(void) const;
156 
158  bool operator<(const Proxy &obj) const;
159 
161  bool operator>(const Proxy &obj) const;
162 
163 private:
164  std::shared_ptr<ProxyHandle> _handle;
165 };
166 
174 POTHOS_API bool operator==(const Proxy &lhs, const Proxy &rhs);
175 
176 } //namespace Pothos
#define POTHOS_API
Definition: Config.hpp:41
POTHOS_API bool operator==(const Callable &lhs, const Callable &rhs)
Definition: ArchiveEntry.hpp:20
Definition: Object.hpp:47
#define POTHOS_DEPRECATED(msg)
Definition: Config.hpp:72
Definition: Handle.hpp:29
int compareTo(const T0 &v0, const T1 &v1)
Definition: CompareTo.hpp:27
Definition: Proxy.hpp:28