Pothos  0.2.1-g9f04573d
The Pothos dataflow programming software suite
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros
Topology.hpp
Go to the documentation of this file.
1 
11 #pragma once
12 #include <Pothos/Config.hpp>
15 #include <Pothos/Object/Object.hpp>
16 #include <string>
17 #include <memory>
18 #include <iosfwd>
19 
20 namespace Pothos {
21 
31 {
32 public:
33 
38  static std::shared_ptr<Topology> make(void);
39 
87  static std::shared_ptr<Topology> make(const std::string &json);
88 
90  Topology(void);
91 
96  ~Topology(void);
97 
99  void setThreadPool(const ThreadPool &threadPool);
100 
102  const ThreadPool &getThreadPool(void) const;
103 
107  std::vector<PortInfo> inputPortInfo(void);
108 
112  std::vector<PortInfo> outputPortInfo(void);
113 
122  void commit(void);
123 
134  bool waitInactive(const double idleDuration = 0.1, const double timeout = 1.0);
135 
143  template <
144  typename SrcType, typename SrcPortType,
145  typename DstType, typename DstPortType>
146  void connect(
147  SrcType &&src, const SrcPortType &srcPort,
148  DstType &&dst, const DstPortType &dstPort);
149 
157  template <
158  typename SrcType, typename SrcPortType,
159  typename DstType, typename DstPortType>
160  void disconnect(
161  SrcType &&src, const SrcPortType &srcPort,
162  DstType &&dst, const DstPortType &dstPort);
163 
171  void disconnectAll(const bool recursive = false);
172 
174  void _connect(
175  const Object &src, const std::string &srcPort,
176  const Object &dst, const std::string &dstPort);
177 
179  void _disconnect(
180  const Object &src, const std::string &srcPort,
181  const Object &dst, const std::string &dstPort);
182 
189  void registerCallable(const std::string &name, const Callable &call);
190 
218  std::string queryJSONStats(void);
219 
271  std::string dumpJSON(const std::string &request = "{}");
272 
294  std::string toDotMarkup(const std::string &request = "{}");
295 
303  Object opaqueCallMethod(const std::string &name, const Object *inputArgs, const size_t numArgs) const;
304 
305 protected:
316  virtual Object opaqueCallHandler(const std::string &name, const Object *inputArgs, const size_t numArgs);
317 
318 private:
319  Topology(const Topology &){} // non construction-copyable
320  Topology &operator=(const Topology &){return *this;} // non copyable
321 public:
322  struct Impl;
323  std::shared_ptr<Impl> _impl;
324 };
325 
326 } //namespace Pothos
Definition: Connectable.hpp:39
#define POTHOS_API
Definition: Config.hpp:41
Definition: Callable.tmpl.hpp:30
Definition: ThreadPool.hpp:113
Definition: Object.hpp:55
Definition: Topology.hpp:30
std::shared_ptr< Impl > _impl
Definition: Topology.hpp:322