Lumiera  0.pre.03
»edit your freedom«
proc-id.hpp
Go to the documentation of this file.
1 /*
2  PROC-ID.hpp - symbolic and hash identification of processing steps
3 
4  Copyright (C)
5  2024, 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 
30 #ifndef ENGINE_PROC_ID_H
31 #define ENGINE_PROC_ID_H
32 
33 
34 #include "lib/error.hpp"
35 #include "lib/hash-standard.hpp"
36 #include "lib/several.hpp"
37 //#include "steam/streamtype.hpp"
38 
39 #include <string>
40 
41 
42 namespace steam {
43 namespace engine {
44  namespace err = lumiera::error;
45 
46  using lib::HashVal;
47  using std::string;
48  using StrView = std::string_view;
49 
50  class ProcNode;
51 
52  class ProcID
53  {
54  StrView nodeSymb_;
55  StrView portQual_;
56  StrView argLists_;
57 
58  ProcID (StrView nodeSymb, StrView portQual, StrView argLists);
59 
62 
63  public:
65  static ProcID& describe (StrView nodeSymb, StrView portSpec);
66 
67  /* === symbolic descriptors === */
68 
69  string genProcName();
70  string genProcSpec();
71  string genNodeName();
72  string genNodeSpec(Leads&);
73  string genSrcSpec (Leads&);
74 
75  friend bool
76  operator== (ProcID const& l, ProcID const& r)
77  {
78  return l.nodeSymb_ == r.nodeSymb_
79  and l.portQual_ == r.portQual_
80  and l.argLists_ == r.argLists_;
81  }
82 
83  friend bool
84  operator!= (ProcID const& l, ProcID const& r)
85  { return not (l == r); }
86 
87  friend HashVal hash_value (ProcID const&);
88  };
89 
90 
91 
92 
93 }} // namespace steam::engine
94 #endif /*ENGINE_PROC_ID_H*/
friend HashVal hash_value(ProcID const &)
generate registry hash value based on the distinct data in ProcID.
Definition: proc-node.cpp:105
Steam-Layer implementation namespace root.
Abstraction interface: array-like random access by subscript.
static ProcID & describe(StrView nodeSymb, StrView portSpec)
build and register a processing ID descriptor
Definition: proc-node.cpp:69
ProcID(StrView nodeSymb, StrView portQual, StrView argLists)
Definition: proc-node.cpp:93
Helper to use a single extension point for specialised hash functions.
Lumiera error handling (C++ interface).
size_t HashVal
a STL compatible hash value
Definition: hash-value.h:52
string genProcSpec()
render a descriptor for the operation (without predecessors)
Definition: proc-node.cpp:125
string genSrcSpec(Leads &)
transitively enumerate all unique source nodes
Definition: proc-node.cpp:169