37 #ifndef MOBJECT_SESSION_QUERY_FAKECONFIGRULES_H 38 #define MOBJECT_SESSION_QUERY_FAKECONFIGRULES_H 47 #include <boost/any.hpp> 69 using lumiera::query::isFakeBypass;
75 using boost::any_cast;
98 return querySpec.usesPredicate (
"default");
101 template<
typename WRA>
103 exists(WRA
const& solution)
105 return bool(solution);
124 typedef std::map<QueryKey,any> Tab;
131 virtual void reset();
132 any
const& fetch_from_table_for (
QueryKey const& query);
136 bool detect_case (
typename WrapReturn<TY>::Wrapper&,
Query<TY> const&);
137 bool fabricate_matching_new_Pipe (
Query<Pipe> const& q,
string const& pipeID,
string const& streamID);
138 bool fabricate_just_new_Pipe (
Query<Pipe> const& q);
144 bool set_new_mock_solution (
Query<TY> const& q,
typename WrapReturn<TY>::Wrapper& candidate);
148 void fill_mock_table ();
165 template<
class TY,
class BASE>
168 typedef typename WrapReturn<TY>::Wrapper Ret;
175 any
const&
entry = this->fetch_from_table_for(q);
178 Ret
const& candidate (any_cast<Ret const&> (entry));
180 ||(solution && solution == candidate)
182 return exists (solution = candidate);
184 return try_special_case(solution, q);
189 try_special_case (Ret& solution,
Query<TY> const& q)
191 if (solution && isFakeBypass(q))
192 return exists (solution);
196 Query<TY> defaultsQuery = q.rebuild().removeTerm(
"default");
200 if (this->detect_case (solution, q))
203 return exists (solution = Ret());
219 if (q.usesPredicate (
"make"))
221 return fabricate_just_new_Pipe (q);
223 const string pipeID = q.
extractID(
"pipe");
224 const string streamID = q.
extractID(
"stream");
226 if (candidate && pipeID == candidate->getPipeID())
227 return set_new_mock_solution (q, candidate);
229 if (!isnil(pipeID) && !isnil(streamID))
230 return fabricate_matching_new_Pipe (q, pipeID, streamID);
232 if (!candidate && (!isnil(streamID) || !isnil(pipeID)))
233 return fabricate_just_new_Pipe (q);
242 const string streamID = q.
extractID(
"stream");
244 if (!candidate && !isnil(streamID))
245 return fabricate_ProcPatt_on_demand (q);
254 return fabricate_Timeline_on_demand (q);
255 return bool(candidate);
263 return fabricate_Sequence_on_demand (q);
264 return bool(candidate);
279 , LookupPreconfigured
288 virtual ~MockConfigRules() {}
Utilities to support working with predicate queries.
"Processing Pattern" is a structural Asset representing information how to build some part of the ren...
AnyPair entry(Query< TY > const &query, typename WrapReturn< TY >::Wrapper &obj)
helper to simplify creating mock table entries, wrapped correctly
Per type specific configuration of instances created as service dependencies.
Customised refcounting smart pointer.
static session::SessManager & current
access point to the current Session
Steam-Layer implementation namespace root.
Definition of the concrete frontend for rule based configuration within the session.
Namespace of Session and user visible high-level objects.
bool is_defaults_query(Query< TY > const &querySpec)
helper detecting if a query actually intended to retrieve a "default" object.
structural asset corresponding to the part of the model forming a processing pipe for generating medi...
Facade: Dummy Implementation of the query interface.
The (current) Session holds all the user visible content to be edited and manipulated within the Lumi...
This framework allows to (re)configure the lib::Depend front-end for dependency-injection.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
a traits-class to define the smart-ptr to wrap the result
Wrapper for indexing and ordering.
bool detect_case(typename WrapReturn< TY >::Wrapper &, Query< TY > const &)
Hook for treating very special cases for individual types only.
Helper to abstract creation and lifecycle of a dependency.
Primary Interface to the current Session.
any & item(string const &querySpec)
shortcut for simply accessing a table entry
the actual table holding preconfigured answers packaged as boost::any objects.
user-visible Interface to the ConfigRules subsystem.
The asset subsystem of the Steam-Layer.
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.
bool contains(SEQ const &cont, typename SEQ::const_reference val)
shortcut for brute-force containment test in any sequential container
string resolve(fsys::path iniSpec)
use the general mechanism for resolving a search path to get the absolute path of the setup...