Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
exit-node.hpp
Go to the documentation of this file.
1/*
2 EXIT-NODE.hpp - top-level node of the render network to pull generated media
3
4 Copyright (C)
5 2023, Hermann Vosseler <Ichthyostega@web.de>
6
7  **Lumiera** is free software; you can redistribute it and/or modify it
8  under the terms of the GNU General Public License as published by the
9  Free Software Foundation; either version 2 of the License, or (at your
10  option) any later version. See the file COPYING for further details.
11
12*/
13
21#ifndef ENGINE_EXIT_NODE_H
22#define ENGINE_EXIT_NODE_H
23
24#include "lib/error.hpp"
25#include "lib/nocopy.hpp"
26#include "lib/hash-value.h"
29#include "vault/gear/job.h"
30
31#include <utility>
32#include <deque>
33
34using lib::HashVal;
35using lib::time::FSecs;
37
38
39namespace steam {
40namespace engine {
41
42 class ExitNode;
43 using ExitNodes = std::deque<engine::ExitNode>;
44
46
47 namespace {// hard wired placeholder config....
48 const Duration DUMMY_JOB_RUNTIME{FSecs{1,50}};
49 }
50
51
65 {
69 JobFunctor* action_{nullptr};
70
71 public:
74 , runtimeBound_{DUMMY_JOB_RUNTIME}
76 { }
77
78 ExitNode (HashVal id
79 ,Duration jobRuntime
80 ,ExitNodes&& prereq =ExitNodes{}
81 ,JobFunctor* functor =nullptr)
83 , runtimeBound_{jobRuntime}
84 , prerequisites_{std::move (prereq)}
85 , action_{functor}
86 { }
87
88 explicit
89 ExitNode (HashVal id
90 ,ExitNodes&& prereq =ExitNodes{})
91 : ExitNode{id, DUMMY_JOB_RUNTIME, std::move(prereq)}
92 { }
93
94 static ExitNode NIL;
95
96
97 bool
98 empty() const
99 {
100 return 0 == pipelineIdentity_
101 or not action_;
102 }
103
104 bool
105 isValid() const
106 {
107 return true;
108 }
109
110
111 HashVal
113 {
114 return pipelineIdentity_;
115 }
116
117 auto
119 {
121 }
122
125 {
126 REQUIRE (action_);
127 return *action_;
128 }
129
132 {
134 return runtimeBound_;
135 }
136 };
137
138
139}} // namespace steam::engine
140#endif /*ENGINE_EXIT_NODE_H*/
Duration is the internal Lumiera time metric.
A top-level point in the render node network where data generation can be driven.
Definition exit-node.hpp:65
Duration getUpperBoundRuntime() const
HashVal getPipelineIdentity() const
auto getPrerequisites() const
static ExitNode NIL
storage for the »inactive« ExitNode marker
Definition exit-node.hpp:94
ExitNode(HashVal id, ExitNodes &&prereq=ExitNodes{})
Definition exit-node.hpp:89
JobFunctor & getInvocationFunctor() const
ExitNode(HashVal id, Duration jobRuntime, ExitNodes &&prereq=ExitNodes{}, JobFunctor *functor=nullptr)
Definition exit-node.hpp:78
Types marked with this mix-in may be created and moved liberally at construction, while any further a...
Definition nocopy.hpp:80
Lumiera error handling (C++ interface).
Hash value types and utilities.
Preconfigured adapters for some STL container standard usage situations.
Definition of a render job.
_SeqT< CON >::Range eachElm(CON &coll)
boost::rational< int64_t > FSecs
rational representation of fractional seconds
size_t HashVal
a STL compatible hash value
Definition hash-value.h:52
STL namespace.
std::deque< engine::ExitNode > ExitNodes
Definition exit-node.hpp:43
Steam-Layer implementation namespace root.
Mix-Ins to allow or prohibit various degrees of copying and cloning.
a family of time value like entities and their relationships.