43 #ifndef STEAM_MOBJECT_OUTPUT_MAPPING_H 44 #define STEAM_MOBJECT_OUTPUT_MAPPING_H 52 #include <boost/operators.hpp> 71 template<
typename FUN>
74 template<
typename RET>
80 using OutputMappingMemberFunc = decltype(&DEF::output) ;
84 using Target =
typename Rebinder::Res;
124 typedef _def<DEF>
Setup;
130 std::map<HashVal,HashVal> table_;
133 using Target =
typename Setup::Target;
137 size_t size()
const {
return table_.size(); }
138 bool empty()
const {
return 0 == size(); }
139 void clear() { table_.clear(); }
153 :
public boost::equality_comparable<Resolver, Target
154 , boost::equality_comparable<Resolver>>
160 : thisMapping_(container)
174 PId targetPipeID (pID_);
175 return thisMapping_.resolveTarget (targetPipeID);
190 operator= (
PPipe newPipe2map)
192 REQUIRE (newPipe2map);
193 pID_ = newPipe2map->getID();
211 throw error::Logic{
"attempt to resolve an unconnected output mapping" 212 , LERR_(UNCONNECTED)};
223 operator bool()
const 234 return a.pID_ == b.pID_;
238 operator== (
Resolver const& rr, Target
const& tval)
240 return rr.resolve() == tval;
253 contains (
PId mapping4sourcePipeID)
255 return util::contains (table_, mapping4sourcePipeID);
259 contains (
PPipe sourcePipe)
262 or this->contains (sourcePipe->getID());
269 resolveTarget (
PId mappedPipeID)
271 return DEF::output (mappedPipeID);
275 buildResolutionWrapper (
HashVal tableSlot)
277 ASSERT (this->contains (tableSlot));
278 return Resolver (*
this, table_[tableSlot]);
322 if (not contains (sourcePipeID))
326 table_[sourcePipeID] = _mapping::resolveQuery (query4pipe);
328 return buildResolutionWrapper (sourcePipeID);
339 return (*
this) [pipe->getID()];
377 HashVal hash4query = _mapping::slot (query4pipe);
378 if (not contains (hash4query))
381 auto addEntry = [&](
auto query)
383 table_[hash4query] = _mapping::resolveQuery (query);
386 if (uint seqNr = _mapping::is_defaults_query_with_channel (query4pipe))
390 PPipe corresponding_sourcePipe
392 _mapping::build_corresponding_sourceQuery (query4pipe));
393 ENSURE (corresponding_sourcePipe);
395 PId sourcePipeID = corresponding_sourcePipe->getID();
396 addEntry (DEF::buildQuery (sourcePipeID, seqNr));
399 addEntry (query4pipe);
402 ENSURE (this->contains (hash4query));
403 return buildResolutionWrapper (hash4query);
A "processing pipe" represented as Asset.
Basic and generic representation of an internal query.
bool isValid() const
< is this a valid connected mapping?
Steam-Layer implementation namespace root.
static StructFactory retrieve
storage for the static StructFactory instance
Derived specific exceptions within Lumiera's exception hierarchy.
Resolver operator[](PId sourcePipeID)
standard map-style access to an OutputMapping.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
Lumiera error handling (C++ interface).
Hash value types and utilities.
size_t HashVal
a STL compatible hash value
OutputMapping is a facility to resolve output designations.
Customised refcounting smart pointer template, built upon std::shared_ptr, but forwarding type relati...
Generic interface to express a query for specifically typed result elements exposing some capabilitie...
string resolve(fsys::path iniSpec)
use the general mechanism for resolving a search path to get the absolute path of the setup...
thin wrapper around a size_t hash ID used as primary key for all Asset objects.