29 #include <boost/functional/hash.hpp> 30 #include <unordered_set> 42 using boost::hash_combine;
46 std::unordered_set<ProcID> procRegistry;
47 std::unordered_set<string> symbRegistry;
53 auto res = symbRegistry.emplace (symbol);
71 REQUIRE (not isnil (nodeSymb));
72 REQUIRE (not isnil (portSpec));
73 REQUIRE (not contains (nodeSymb,
' '));
74 auto p = portSpec.find(
'(');
75 if (p == string::npos)
76 throw err::Invalid{
_Fmt{
"Spec for processing operation must contain at least one argument list. " 80 auto res = procRegistry.insert (
ProcID{nodeSymb, portSpec.substr(0,p), portSpec.substr(p)});
86 if (not isnil(
entry.portQual_))
108 if (not isnil(procID.portQual_))
109 hash_combine (hash, procID.portQual_);
110 hash_combine (hash, procID.argLists_);
115 ProcID::genProcName()
117 std::ostringstream buffer;
119 if (not isnil(portQual_))
120 buffer <<
'.' << portQual_;
127 std::ostringstream buffer;
129 if (not isnil(portQual_))
130 buffer <<
'.' << portQual_;
136 ProcID::genNodeName()
138 return string{nodeSymb_};
146 REQUIRE (not isnil(watch(node).ports()));
147 return watch(node).ports().front().procID;
152 ProcID::genNodeSpec (
Leads& leads)
154 std::ostringstream buffer;
156 if (1 != leads.size())
162 << procID(p).genNodeName()
171 return isnil(leads)?
string{
"-◎"}
177 .transform([](
ProcNode& n){
return procID(n).nodeSymb_;})
192 REQUIRE (not isnil(ports()));
193 return ports().front().procID.genNodeSpec (leads());
199 UNIMPLEMENTED (
"calculate an unique hash-key to designate this node");
209 auto& p{n_.wiring_.ports};
210 return portIdx < p.size()? p[portIdx].procID.genProcSpec()
211 : util::FAILURE_INDICATOR;
217 UNIMPLEMENTED (
"calculate an unique, stable and reproducible hash-key to identify the Turnout");
virtual ~Port()
this is an interface
HashVal getNodeHash()
calculate an unique hash-key to designate this node
friend HashVal hash_value(ProcID const &)
generate registry hash value based on the distinct data in ProcID.
auto explore(IT &&srcSeq)
start building a IterExplorer by suitably wrapping the given iterable source.
string getNodeSpec()
generate a descriptive Spec of this ProcNode for diagnostics
bool filter(Placement< DummyMO > const &candidate)
a filter predicate to pick some objects from a resultset.
AnyPair entry(Query< TY > const &query, typename WrapReturn< TY >::Wrapper &obj)
helper to simplify creating mock table entries, wrapped correctly
HashVal getPortHash(uint portIdx)
calculate an unique, stable and reproducible hash-key to identify the Turnout
Steam-Layer implementation namespace root.
A front-end for using printf-style formatting.
Metadata interface to generate symbolic and hash ID tags for media processing steps.
static ProcID & describe(StrView nodeSymb, StrView portSpec)
build and register a processing ID descriptor
Derived specific exceptions within Lumiera's exception hierarchy.
ProcID(StrView nodeSymb, StrView portQual, StrView argLists)
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
string getPortSpec(uint portIdx)
generate a descriptive diagnostic Spec for the designated Turnout
Interface to the processing nodes and the render nodes network.
void dedupSymbol(StrView &symbol)
deduplicate and re-link to the entry in the symbol table
size_t HashVal
a STL compatible hash value
Key abstraction of the Render Engine: A Data processing Node.
Building tree expanding and backtracking evaluations within hierarchical scopes.
string genProcSpec()
render a descriptor for the operation (without predecessors)
HashVal hash_value(ProcID const &procID)
generate registry hash value based on the distinct data in ProcID.
bool contains(SEQ const &cont, typename SEQ::const_reference val)
shortcut for brute-force containment test in any sequential container
string genSrcSpec(Leads &)
transitively enumerate all unique source nodes