Pothos  0.4.3-gabce2ce6
The Pothos dataflow programming software suite
Environment.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 <Pothos/Proxy/Proxy.hpp>
17 #include <utility> //std::forward
18 #include <memory>
19 #include <string>
20 #include <vector>
21 #include <map>
22 #include <iosfwd>
23 
24 namespace Pothos {
25 
26 typedef std::map<std::string, std::string> ProxyEnvironmentArgs;
27 
31 typedef std::pair<std::string, Pothos::Callable> ProxyConvertPair;
32 
42  public Util::RefHolder,
43  public std::enable_shared_from_this<ProxyEnvironment>
44 {
45 public:
46  typedef std::shared_ptr<ProxyEnvironment> Sptr;
47 
57  static Sptr make(const std::string &name, const ProxyEnvironmentArgs &args = ProxyEnvironmentArgs());
58 
60  virtual ~ProxyEnvironment(void);
61 
66  virtual std::string getNodeId(void) const;
67 
72  virtual std::string getUniquePid(void) const;
73 
78  static std::string getLocalUniquePid(void);
79 
85  virtual std::string getPeeringAddress(void);
86 
91  virtual std::string getName(void) const = 0;
92 
101  virtual Proxy findProxy(const std::string &name) = 0;
102 
109  virtual Proxy convertObjectToProxy(const Object &local);
110 
115  template <typename ValueType>
116  Proxy makeProxy(ValueType &&local);
117 
124  virtual Object convertProxyToObject(const Proxy &proxy);
125 
132  virtual void serialize(const Proxy &proxy, std::ostream &os) = 0;
133 
140  virtual Proxy deserialize(std::istream &is) = 0;
141 };
142 
143 } //namespace Pothos
144 
145 template <typename ValueType>
147 {
148  return convertObjectToProxy(Pothos::Object(std::forward<ValueType>(local)));
149 }
#define POTHOS_API
Definition: Config.hpp:41
Definition: CallInterface.hpp:15
Proxy makeProxy(ValueType &&local)
std::shared_ptr< ProxyEnvironment > Sptr
Definition: Environment.hpp:46
Definition: RefHolder.hpp:24
Definition: Object.hpp:55
void serialize(Archive &, Pothos::Detail::ObjectContainer &, const unsigned int)
Definition: Serialize.hpp:46
std::map< std::string, std::string > ProxyEnvironmentArgs
Definition: Environment.hpp:26
std::pair< std::string, Pothos::Callable > ProxyConvertPair
Definition: Environment.hpp:31
Definition: Environment.hpp:41
Definition: Proxy.hpp:28