68 typedef std::pair<const QueryKey, any> AnyPair;
72 AnyPair
entry (
Query<TY> const& query,
typename WrapReturn<TY>::Wrapper& obj)
74 return AnyPair(query, any(obj));
81 typedef typename WrapReturn<STRU>::Wrapper Ptr;
83 string capabilities (caps);
86 return AnyPair(query, obj);
99 INFO (config,
"creating mock answers for some hard wired config queries...");
106 answer_.insert (entry_Struct<cPP> (
"stream(video)"));
107 answer_.insert (entry_Struct<cPP> (
"stream(teststream)"));
108 item<cPP> (
"stream(default)") = item<cPP> (
"stream(video)");
110 answer_.insert (entry_Struct<Pipe> (
"pipe(master), stream(video)"));
111 item<Pipe> (
"") = item<Pipe>(
"pipe(master), stream(video)");
113 answer_.insert (entry_Struct<Pipe> (
"pipe(ambiance)"));
125 INFO (config,
"discarded all config query mock answers.");
140 typedef WrapReturn<Pipe>::Wrapper Ptr;
143 answer_.insert (entry<Pipe> (q, newPipe));
151 typedef WrapReturn<Pipe>::Wrapper Ptr;
154 answer_.insert (entry<Pipe> (q, newPipe));
163 typedef WrapReturn<cPP>::Wrapper Ptr;
166 answer_.insert (entry<cPP> (q, newPP));
178 typedef WrapReturn<aTL>::Wrapper Ptr;
189 .removeTerm(
"timeline")
190 .prependConditions(
"id("+nameID+
")");
195 for ( ; i < cnt; ++i)
204 answer_.insert (entry<aTL> (normalisedQuery, newTimeline));
205 answer_.insert (entry<aTL> (query, newTimeline));
214 typedef WrapReturn<aSeq>::Wrapper Ptr;
225 .removeTerm(
"sequence")
226 .prependConditions(
"id("+nameID+
")");
231 for ( ; i < cnt; ++i)
240 answer_.insert (entry<aSeq> (normalisedQuery, newSequence));
241 answer_.insert (entry<aSeq> (query, newSequence));
252 answer_.insert (entry<TY> (q, obj));
264 WARN (config,
"using a mock implementation of the ConfigQuery interface");
268 MockTable::MockTable ()
289 static const any NOTFOUND;
292 Tab::iterator i = answer_.find (query);
293 if (i == answer_.end())
AnyPair entry_Struct(Literal caps)
helper especially for creating structural assets from a capability query
Utilities to support working with predicate queries.
Definition of a structural asset to express patterns of wiring or processing Processing patterns can ...
A "processing pipe" represented as Asset.
bool fabricate_just_new_Pipe(Query< Pipe > const &q)
special case: create a new pipe for a specific stream ID
"Processing Pattern" is a structural Asset representing information how to build some part of the ren...
void fill_mock_table()
hard coded answers to configuration queries.
Basic and generic representation of an internal query.
bool set_new_mock_solution(Query< TY > const &q, typename WrapReturn< TY >::Wrapper &candidate)
for entering "valid" solutions on-the-fly from tests
AnyPair entry(Query< TY > const &query, typename WrapReturn< TY >::Wrapper &obj)
helper to simplify creating mock table entries, wrapped correctly
Mock/Test/Debugging Implementation of the config rules system.
inline string literal This is a marker type to indicate that
This header is for including and configuring NoBug.
static session::SessManager & current
access point to the current Session
Organisational grouping device within the Session model ("Track" / "Media Bin").
Steam-Layer implementation namespace root.
Namespace of Session and user visible high-level objects.
structural asset corresponding to the part of the model forming a processing pipe for generating medi...
bool fabricate_Timeline_on_demand(Query< asset::Timeline > const &q)
special case: fabricate new Timeline, maybe using specific sub-objects as hinted by the IDs given wit...
static StructFactory retrieve
storage for the static StructFactory instance
string extractID(Symbol sym, const string &termString)
(preliminary) helper: instead of really parsing and evaluating the terms, just do a regular expressio...
bool fabricate_matching_new_Pipe(Query< Pipe > const &q, string const &pipeID, string const &streamID)
special case: create a new pipe with matching pipe and stream IDs on the fly when referred...
Marker types to indicate a literal string and a Symbol.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
bool fabricate_Sequence_on_demand(Query< asset::Sequence > const &q)
special case: fabricate new Timeline, maybe using ID specs from the query...
any const & fetch_from_table_for(QueryKey const &query)
this is the (preliminary/mock) implementation handling queries for objects of a specific type and wit...
string removeTerm(Symbol sym, string &queryString)
(preliminary) helper: cut a term with the given symbol.
bool fabricate_ProcPatt_on_demand(Query< const ProcPatt > const &q)
special case: create/retrieve new processing pattern for given stream ID...
Wrapper for indexing and ordering.
SequenceAccess sequences
collection of sequences
virtual void reset()
clear the contents of the mock solution table.
lib::P< STRU > made4fake(Query< STRU > const &query)
special backdoor for fake-configrules.hpp This allows to simulate creation of objects triggered by ru...
Customised refcounting smart pointer template, built upon std::shared_ptr, but forwarding type relati...
key abstraction: structural asset Created automatically as a sideeffect of building the structure of ...
MockConfigRules()
to be used only by the singleton factory
Primary Interface to the current Session.
Generic interface to express a query for specifically typed result elements exposing some capabilitie...
string extractID(Symbol predicate) const
convenience shortcut to extract a desired name-ID.
TimelineAccess timelines
collection of timelines (top level)