Lumiera  0.pre.03
»edit your freedom«
OutputMapping< DEF > Class Template Reference

#include "steam/mobject/output-mapping.hpp"

Description

template<class DEF>
class steam::mobject::OutputMapping< DEF >

OutputMapping is a facility to resolve output designations.

The session/model uses preliminary or partial output specifications, which are to be resolved to an actual system output while building and preparing a render network for operation (playback/rendering). For a given specification, resolution to the desired target spec may be derived by querying the OutputMapping. Here, the kind of the target specification is defined through the type parameter.

definition of specific mapping behaviour

This is an generic map-like container, acting as Interface to be used in the signature of API functions either providing or requiring a Mapping. For each distinct usage situation, an instantiation of this template should be created, providing a definition context as template parameter. Instances of this concrete mapping type may then be default constructed and copied freely. The definition context is supposed to provide

  • a functor DEF::output usable as function pipe-ID –> Target
  • the concrete output-functor also defines the concrete Target type, which will be returned when accessing the OutputMapping
  • a function DEF::buildQuery (sourcePipeID,seqNr) yielding a (defaults) query to be issued in case of accessing a non existent mapping
    Template Parameters
    DEFstatic (compile-time) definition/configuration context

Definition at line 121 of file output-mapping.hpp.

Public Types

using Target = typename Setup::Target
 

Public Member Functions

void clear ()
 
bool contains (PId mapping4sourcePipeID)
 
bool contains (PPipe sourcePipe)
 
bool empty () const
 
Resolver operator[] (PId sourcePipeID)
 standard map-style access to an OutputMapping. More...
 
Resolver operator[] (PPipe const &pipe)
 similar to the standard map-style access, but accepts a source pipe object instead of just a pipe-ID
 
Resolver operator[] (Query< asset::Pipe > query4pipe)
 determine an OutputMapping by resolving a complex query, instead of just picking a mapped pipe (which is the default usage). More...
 
size_t size () const
 

Classes

class  Resolver
 

Private Types

using PId = asset::ID< asset::Pipe >
 
using PPipe = asset::PPipe
 
typedef _def< DEF > Setup
 

Private Member Functions

Resolver buildResolutionWrapper (HashVal tableSlot)
 
Target resolveTarget (PId mappedPipeID)
 

Private Attributes

std::map< HashVal, HashVal > table_
 

Member Function Documentation

◆ operator[]() [1/2]

OutputMapping< DEF >::Resolver operator[] ( PId  sourcePipeID)
inline

standard map-style access to an OutputMapping.

For the given source pipe-ID the mapped target pipe-ID is fetched and then handed over to the configured DEF::output functor, which is assumed to calculate or retrieve the actual result object.

default mappings
whenever accessing an yet non-existent mapping, a query is issued behind the scenes to establish a suitable default mapping. The actual query is built from a query template by the DEF::buildQuery function and thus can be configured for the concrete usage situation of the mapping.
Warning
depending on the actually configured defaults query, there might be no solution, in which case an unconnected marker is retrieved and stored. Thus the yielded Resolver should be checked, if in doubt.

Definition at line 320 of file output-mapping.hpp.

◆ operator[]() [2/2]

OutputMapping< DEF >::Resolver operator[] ( Query< asset::Pipe query4pipe)
inline

determine an OutputMapping by resolving a complex query, instead of just picking a mapped pipe (which is the default usage).

Accessing the OutputMapping this way by query enables all kinds of extended usages: It suffices that the given query somehow yields a Pipe, which then is considered the mapped result and handed over to the DEF::output functor for resolution to a result object to be returned.

Query for the Nth default instance
OutputMapping provides a special behaviour for retrieving "the Nth default pipe". The rationale being the request for connection to the Nth bus of a given kind, like e.g. the 3rd audio subgroup or the 2nd video master. This special behaviour is triggered by the predicate "ord(##)" in the query. The remainder of the query is supposed to designate a default in this case, rather then querying directly for the result of the mapping. Thus this remainder of the query is used to retrieve a source pipe, which then is treated as if accessing a non-existent mapping: a suitable default solution for this mapping is retrieved, but in this special case, we append the given sequence number to the ID of the retrieved pipe, i.e. we get the Nth (identical) solution to the aforementioned query for a default pipe.
Note
the mapped result is remembered within this mapping. Further invocations with the same query will just fetch this stored pipe-ID and hand it to the functor, without resolving the query again. You might want to remove this specific mapping in order to force re-evaluation of the query.
Parameters
Queryfor a pipe, which is handed over as-is to the rules engine.
Warning
depending on the actual query, there might be no solution, in which case an unconnected marker is retrieved and stored. Thus the yielded Resolver should be checked, if in doubt.

Definition at line 375 of file output-mapping.hpp.

References Struct::retrieve.

+ Inheritance diagram for OutputMapping< DEF >:
+ Collaboration diagram for OutputMapping< DEF >:

The documentation for this class was generated from the following file: