67 _Fmt pattern (
"dummy_%s_%i");
73 return pattern % prefix %
rani(10
'000); 80 /********************************************************************//** 81 * @test verify some general assumptions regarding implementation details 82 * of the the defaults manager. 83 * @see DefsManager_test for the "big picture" 85 class DefsManagerImpl_test : public Test 93 string pipeID = create(); 103 string sID = newID ("stream"); 104 StreamType::ID stID (sID); 106 // create Pipes explicitly 107 // (without utilising default queries) 108 PPipe pipe1 = Struct::retrieve.newPipe (newID("pipe"), newID("stream")); 109 PPipe pipe2 = Struct::retrieve.newPipe (newID("pipe"), sID ); 111 CHECK (pipe1 != pipe2); 112 CHECK (stID == pipe2->getStreamID()); 114 CHECK (!find (pipe1->getPipeID()), "accidental clash of random test-IDs"); 115 CHECK (!find (pipe2->getPipeID()), "accidental clash of random test-IDs"); 117 // now declare that these objects should be considered "default" 118 Query<Pipe> justAnyPipe (""); 119 lumiera::query::setFakeBypass(justAnyPipe); /////////////////////////////////////////////////TODO mock resolution 120 CHECK (Session::current->defaults.define (pipe1, justAnyPipe)); // unrestricted default 122 Query<Pipe> pipeWithSpecificStream("stream("+sID+")"); 123 lumiera::query::setFakeBypass(pipeWithSpecificStream); ///////////////////////////////////TODO mock resolution 124 CHECK (Session::current->defaults.define (pipe2, pipeWithSpecificStream)); 126 CHECK ( find (pipe1->getPipeID()), "failure declaring object as default"); 127 CHECK ( find (pipe2->getPipeID()), "failure declaring object as default"); 129 CHECK (stID != pipe1->getStreamID(), "accidental clash"); 130 CHECK (!Session::current->defaults.define (pipe1, Query<Pipe> ("stream("+sID+")"))); 131 // can't be registered with
this query, due to failure caused by wrong stream-
ID 138 string sID =
newID (
"stream");
139 Query<Pipe> query_for_streamID (
"stream("+sID+
")");
144 typeHandler.
resolve (pipe1, query_for_streamID);
147 CHECK (!
find (pipe1->getPipeID()));
150 CHECK (pipe2 == pipe1);
151 CHECK (
find (pipe1->getPipeID()));
153 return pipe1->getPipeID();
161 REQUIRE (
find (pipe->getPipeID()),
"test assumes pre-registered default pipe");
162 long cnt = pipe.use_count();
166 CHECK (!
find (pipe->getPipeID()));
167 CHECK (cnt == pipe.use_count());
Utilities to support working with predicate queries.
Steam-Layer Interface: Asset Lookup and Organisation.
A "processing pipe" represented as Asset.
Framework for classification of media streams.
the "front side" interface: the Steam-Layer code can use this QueryHandler to retrieve instances of t...
void normaliseID(string &id)
ensure standard format for a given id string.
int rani(uint bound=_iBOUND())
virtual bool resolve(P< TY > &solution, Query< TY > const &q)=0
try to find or create an object of type TY fulfilling the given query.
lib::P< TAR > create(Query< TAR > const &)
retrieve an object fulfilling the query and register it as default.
Facade for the Asset subsystem.
static session::SessManager & current
access point to the current Session
Steam-Layer implementation namespace root.
A front-end for using printf-style formatting.
DefaultsAccess defaults
manages default configured objects
Definition of the concrete frontend for rule based configuration within the session.
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...
Token or Atom with distinct identity.
static lib::Depend< ConfigResolver > instance
Singleton factory instance, configured with the actual implementation type.
Simplistic test class runner.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
Superinterface describing especially bookkeeping properties.
Steam-Layer Interface: Assets.
static PPipe query(string const &properties)
convenience shortcut for retrieving default configured pipes
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 ...
Primary Interface to the current Session.
user-visible Interface to the ConfigRules subsystem.
Asset representation of structural elements within the model.
Generic interface to express a query for specifically typed result elements exposing some capabilitie...
string newID(Symbol prefix)
create a random new ID
bool find(const string &pID)
shortcut: query for given Pipe-ID
thin wrapper around a size_t hash ID used as primary key for all Asset objects.
Implementation of the core defaults-management operations.