joque
task orchestration library
run_result.hpp
Go to the documentation of this file.
1 #pragma once
23 
24 #include <concepts>
25 #include <cstdint>
26 #include <list>
27 #include <string>
28 #include <string_view>
29 #include <tuple>
30 
31 namespace joque
32 {
33 
35 {
36  enum type_e : uint8_t
37  {
39  STANDARD
40  };
41 
43  std::string data;
44 };
45 
46 void map( std::convertible_to< output_chunk > auto& rec, auto&& f )
47 {
48  f( "type", rec.type );
49  f( "data", rec.data );
50 }
51 
54 struct run_result
55 {
57  int retcode;
58 
59  std::list< output_chunk > output;
60 
61  std::string log;
62 };
63 
65 {
67 
68  std::string log;
69 };
70 
71 void insert( auto& res, output_chunk::type_e type, std::string data )
72 {
73  res.output.emplace_back( type, std::move( data ) );
74 }
75 
76 void insert_std( auto& res, std::string data )
77 {
78  insert( res, output_chunk::STANDARD, std::move( data ) );
79 }
80 
81 void insert_err( auto& res, std::string data )
82 {
83  insert( res, output_chunk::ERROR, std::move( data ) );
84 }
85 
86 } // namespace joque
MIT License.
Definition: dag.hpp:27
void insert_err(auto &res, std::string data)
Definition: run_result.hpp:81
bool invalidated
Definition: run_result.hpp:66
void insert(auto &res, output_chunk::type_e type, std::string data)
Definition: run_result.hpp:71
std::string log
Definition: run_result.hpp:68
int retcode
Return code of the run, 0 implies success.
Definition: run_result.hpp:57
void insert_std(auto &res, std::string data)
Definition: run_result.hpp:76
Fun && f
Definition: task.hpp:93
void map(std::convertible_to< run_record > auto &rec, auto &&f)
Definition: records.hpp:76
std::string log
Definition: run_result.hpp:61
std::list< output_chunk > output
Definition: run_result.hpp:59
Definition: run_result.hpp:65
TODO: hide this Result of single traits run call.
Definition: run_result.hpp:55
Definition: run_result.hpp:35
type_e
Definition: run_result.hpp:37
@ ERROR
Definition: run_result.hpp:38
@ STANDARD
Definition: run_result.hpp:39
std::string data
Definition: run_result.hpp:43
type_e type
Definition: run_result.hpp:42