mf
Media Framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
node_job.h
Go to the documentation of this file.
1 #ifndef MF_FLOW_NODE_JOB_H_
2 #define MF_FLOW_NODE_JOB_H_
3 
4 #include "node.h"
5 #include <vector>
6 #include <utility>
7 
8 namespace mf { namespace flow {
9 
11 
13 class node_job {
14 private:
15  using input_view_handle_type = std::pair<node_input*, timed_frame_array_view>;
16  using output_view_handle_type = std::pair<node_output*, frame_view>;
17 
18  node& node_;
19  time_unit time_ = -1;
20  bool end_marked_ = false;
21 
22  std::vector<input_view_handle_type> inputs_stack_;
23  std::vector<input_view_handle_type*> inputs_map_;
24 
25  std::vector<output_view_handle_type> outputs_stack_;
26  std::vector<output_view_handle_type*> outputs_map_;
27 
28 public:
29  node_job(node&);
30  ~node_job();
31 
34  void define_time(time_unit t);
36  void push_output(node_output&, const frame_view&);
39  bool end_was_marked() const noexcept { return end_marked_; }
41 
42  time_unit time() const noexcept { return time_; }
43  void mark_end() { end_marked_ = true; }
44 
45  template<typename Input> decltype(auto) in_full(Input&);
46  template<typename Input> decltype(auto) in(Input&);
47  template<typename Output> decltype(auto) out(Output&);
48  template<typename Param> decltype(auto) param(const Param&);
49 };
50 
51 }}
52 
53 #include "node_job.tcc"
54 
55 #endif
Input port of node in flow graph.
Definition: node.h:166
Generic ndarray_view where lower dimension(s) are type-erased.
Definition: ndarray_view_generic.h:25
Output port of node in flow graph.
Definition: node.h:108
std::ptrdiff_t time_unit
Discrete time unit type.
Definition: common.h:52
decltype(auto) out(Output &)
Node in flow graph, base class.
Definition: node.h:19
void define_time(time_unit t)
Definition: node_job.cc:51
void push_output(node_output &, const frame_view &)
Definition: node_job.cc:28
decltype(auto) param(const Param &)
~node_job()
Definition: node_job.cc:15
bool end_was_marked() const noexcept
Definition: node_job.h:39
node_output * pop_output()
Definition: node_job.cc:43
void push_input(node_input &, const timed_frame_array_view &)
Definition: node_job.cc:21
time_unit time() const noexcept
Definition: node_job.h:42
Work unit of flow graph node.
Definition: node_job.h:13
void mark_end()
Definition: node_job.h:43
node_job(node &)
Definition: node_job.cc:5
decltype(auto) in_full(Input &)
node_input * pop_input()
Definition: node_job.cc:35
decltype(auto) in(Input &)
Generic ndarray_timed_view where lower dimension(s) are type-erased.
Definition: ndarray_timed_view_generic.h:12