Pothos  0.1.1
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 
41  Topology(void);
42 
47  ~Topology(void);
48 
50  void setThreadPool(const ThreadPool &threadPool);
51 
53  const ThreadPool &getThreadPool(void) const;
54 
58  std::vector<PortInfo> inputPortInfo(void);
59 
63  std::vector<PortInfo> outputPortInfo(void);
64 
73  void commit(void);
74 
84  bool waitInactive(const double idleDuration = 0.1, const double timeout = 1.0);
85 
93  template <
94  typename SrcType, typename SrcPortType,
95  typename DstType, typename DstPortType>
96  void connect(
97  SrcType &&src, const SrcPortType &srcPort,
98  DstType &&dst, const DstPortType &dstPort);
99 
107  template <
108  typename SrcType, typename SrcPortType,
109  typename DstType, typename DstPortType>
110  void disconnect(
111  SrcType &&src, const SrcPortType &srcPort,
112  DstType &&dst, const DstPortType &dstPort);
113 
121  void disconnectAll(const bool recursive = false);
122 
124  void _connect(
125  const Object &src, const std::string &srcPort,
126  const Object &dst, const std::string &dstPort);
127 
129  void _disconnect(
130  const Object &src, const std::string &srcPort,
131  const Object &dst, const std::string &dstPort);
132 
139  void registerCallable(const std::string &name, const Callable &call);
140 
161  std::string toDotMarkup(const std::string &config = "");
162 
170  Object opaqueCallMethod(const std::string &name, const Object *inputArgs, const size_t numArgs) const;
171 
172 protected:
183  virtual Object opaqueCallHandler(const std::string &name, const Object *inputArgs, const size_t numArgs);
184 
185 private:
186  Topology(const Topology &){} // non construction-copyable
187  Topology &operator=(const Topology &){return *this;} // non copyable
188 public:
189  struct Impl;
190  std::shared_ptr<Impl> _impl;
191 };
192 
193 } //namespace Pothos
Definition: Connectable.hpp:39
#define POTHOS_API
Definition: Config.hpp:41
Definition: Callable.tmpl.hpp:30
Definition: ThreadPool.hpp:83
Definition: Object.hpp:55
Definition: Topology.hpp:30
std::shared_ptr< Impl > _impl
Definition: Topology.hpp:189