46 #ifndef MOBJECT_SESSION_QUERY_FAKECONFIGRULES_H 47 #define MOBJECT_SESSION_QUERY_FAKECONFIGRULES_H 56 #include <boost/any.hpp> 78 using lumiera::query::isFakeBypass;
84 using boost::any_cast;
103 template<
typename TY>
107 return querySpec.usesPredicate (
"default");
110 template<
typename WRA>
112 exists(WRA
const& solution)
114 return bool(solution);
133 typedef std::map<QueryKey,any> Tab;
140 virtual void reset();
141 any
const& fetch_from_table_for (
QueryKey const& query);
145 bool detect_case (
typename WrapReturn<TY>::Wrapper&,
Query<TY> const&);
146 bool fabricate_matching_new_Pipe (
Query<Pipe> const& q,
string const& pipeID,
string const& streamID);
147 bool fabricate_just_new_Pipe (
Query<Pipe> const& q);
153 bool set_new_mock_solution (
Query<TY> const& q,
typename WrapReturn<TY>::Wrapper& candidate);
157 void fill_mock_table ();
174 template<
class TY,
class BASE>
177 typedef typename WrapReturn<TY>::Wrapper Ret;
184 any
const&
entry = this->fetch_from_table_for(q);
187 Ret
const& candidate (any_cast<Ret const&> (entry));
189 ||(solution && solution == candidate)
191 return exists (solution = candidate);
193 return try_special_case(solution, q);
198 try_special_case (Ret& solution,
Query<TY> const& q)
200 if (solution && isFakeBypass(q))
201 return exists (solution);
205 Query<TY> defaultsQuery = q.rebuild().removeTerm(
"default");
209 if (this->detect_case (solution, q))
212 return exists (solution = Ret());
228 if (q.usesPredicate (
"make"))
230 return fabricate_just_new_Pipe (q);
232 const string pipeID = q.
extractID(
"pipe");
233 const string streamID = q.
extractID(
"stream");
235 if (candidate && pipeID == candidate->getPipeID())
236 return set_new_mock_solution (q, candidate);
238 if (!isnil(pipeID) && !isnil(streamID))
239 return fabricate_matching_new_Pipe (q, pipeID, streamID);
241 if (!candidate && (!isnil(streamID) || !isnil(pipeID)))
242 return fabricate_just_new_Pipe (q);
251 const string streamID = q.
extractID(
"stream");
253 if (!candidate && !isnil(streamID))
254 return fabricate_ProcPatt_on_demand (q);
263 return fabricate_Timeline_on_demand (q);
264 return bool(candidate);
272 return fabricate_Sequence_on_demand (q);
273 return bool(candidate);
288 , LookupPreconfigured
297 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...