Pothos  0.1.1
The Pothos dataflow programming software suite
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros
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 <memory>
18 #include <string>
19 #include <vector>
20 #include <map>
21 #include <iosfwd>
22 
23 namespace Pothos {
24 
25 typedef std::map<std::string, std::string> ProxyEnvironmentArgs;
26 
30 typedef std::pair<std::string, Pothos::Callable> ProxyConvertPair;
31 
41  public Util::RefHolder,
42  public std::enable_shared_from_this<ProxyEnvironment>
43 {
44 public:
45  typedef std::shared_ptr<ProxyEnvironment> Sptr;
46 
56  static Sptr make(const std::string &name, const ProxyEnvironmentArgs &args = ProxyEnvironmentArgs());
57 
59  virtual ~ProxyEnvironment(void);
60 
65  virtual std::string getNodeId(void) const;
66 
71  virtual std::string getUniquePid(void) const;
72 
77  static std::string getLocalUniquePid(void);
78 
84  virtual std::string getPeeringAddress(void);
85 
90  virtual std::string getName(void) const = 0;
91 
100  virtual Proxy findProxy(const std::string &name) = 0;
101 
108  virtual Proxy convertObjectToProxy(const Object &local);
109 
114  template <typename ValueType>
115  Proxy makeProxy(const ValueType &local)
116  {
117  return convertObjectToProxy(Pothos::Object::make(local));
118  }
119 
126  virtual Object convertProxyToObject(const Proxy &proxy);
127 
134  virtual void serialize(const Proxy &proxy, std::ostream &os) = 0;
135 
142  virtual Proxy deserialize(std::istream &is) = 0;
143 };
144 
145 } //namespace Pothos
#define POTHOS_API
Definition: Config.hpp:41
static Object make(ValueType &&value)
Definition: ObjectImpl.hpp:210
std::shared_ptr< ProxyEnvironment > Sptr
Definition: Environment.hpp:45
Definition: RefHolder.hpp:24
Proxy makeProxy(const ValueType &local)
Definition: Environment.hpp:115
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:25
std::pair< std::string, Pothos::Callable > ProxyConvertPair
Definition: Environment.hpp:30
Definition: Environment.hpp:40
Definition: Proxy.hpp:27