77 typedef std::pair<const QueryKey, any> AnyPair;
81 AnyPair
entry (
Query<TY> const& query,
typename WrapReturn<TY>::Wrapper& obj)
83 return AnyPair(query, any(obj));
90 typedef typename WrapReturn<STRU>::Wrapper Ptr;
92 string capabilities (caps);
95 return AnyPair(query, obj);
108 INFO (config,
"creating mock answers for some hard wired config queries...");
115 answer_.insert (entry_Struct<cPP> (
"stream(video)"));
116 answer_.insert (entry_Struct<cPP> (
"stream(teststream)"));
117 item<cPP> (
"stream(default)") = item<cPP> (
"stream(video)");
119 answer_.insert (entry_Struct<Pipe> (
"pipe(master), stream(video)"));
120 item<Pipe> (
"") = item<Pipe>(
"pipe(master), stream(video)");
122 answer_.insert (entry_Struct<Pipe> (
"pipe(ambiance)"));
134 INFO (config,
"discarded all config query mock answers.");
149 typedef WrapReturn<Pipe>::Wrapper Ptr;
152 answer_.insert (entry<Pipe> (q, newPipe));
160 typedef WrapReturn<Pipe>::Wrapper Ptr;
163 answer_.insert (entry<Pipe> (q, newPipe));
172 typedef WrapReturn<cPP>::Wrapper Ptr;
175 answer_.insert (entry<cPP> (q, newPP));
187 typedef WrapReturn<aTL>::Wrapper Ptr;
198 .removeTerm(
"timeline")
199 .prependConditions(
"id("+nameID+
")");
204 for ( ; i < cnt; ++i)
213 answer_.insert (entry<aTL> (normalisedQuery, newTimeline));
214 answer_.insert (entry<aTL> (query, newTimeline));
223 typedef WrapReturn<aSeq>::Wrapper Ptr;
234 .removeTerm(
"sequence")
235 .prependConditions(
"id("+nameID+
")");
240 for ( ; i < cnt; ++i)
249 answer_.insert (entry<aSeq> (normalisedQuery, newSequence));
250 answer_.insert (entry<aSeq> (query, newSequence));
261 answer_.insert (entry<TY> (q, obj));
273 WARN (config,
"using a mock implementation of the ConfigQuery interface");
277 MockTable::MockTable ()
298 static const any NOTFOUND;
301 Tab::iterator i = answer_.find (query);
302 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)