DefsManagerImpl_test now running

This commit is contained in:
Fischlurch 2008-04-08 03:21:24 +02:00
parent ed2799b76f
commit 0b5b9b593e
3 changed files with 25 additions and 8 deletions

View file

@ -97,11 +97,10 @@ namespace lumiera
// for baiscpipetest.cpp ---------
answer_->insert (entry_Struct<cPP> ("stream(video)"));
answer_->insert (entry_Struct<cPP> ("stream(teststream)"));
item<cPP> (answer_, "stream(default)") = item<cPP> (answer_,"stream(video)"); //TODO killme
item<cPP> (answer_, "stream(default)") = item<cPP> (answer_,"stream(video)"); // set up a default stream
answer_->insert (entry_Struct<Pipe> ("pipe(master), stream(video)"));
item<Pipe> (answer_, "pipe(default)") = item<Pipe>(answer_,"pipe(master), stream(video)"); //TODO killme
TODO ("remove the default entries!!! DefaultsManager should find them automatically");
item<Pipe> (answer_, "default(P)") = item<Pipe>(answer_,"pipe(master), stream(video)");
}
@ -121,6 +120,16 @@ namespace lumiera
answer_->insert (entry<Pipe> (q, newPipe));
return true; // denotes query will now succeed...
}
/** special case: create a new pipe for a specific stream ID */
bool
MockTable::fabricate_new_Pipe_for_stream (Query<Pipe>& q, string const& streamID)
{
typedef WrapReturn<Pipe>::Wrapper Ptr;
Ptr newPipe (Struct::create (Query<Pipe> ("make(PP), "+q)));
answer_->insert (entry<Pipe> (q, newPipe));
return true;
}
/** special case: create/retrieve new rocessing pattern for given stream ID... */
bool
MockTable::fabricate_ProcPatt_on_demand (Query<const ProcPatt>& q, string const& streamID)

View file

@ -111,6 +111,7 @@ namespace lumiera
template<class TY>
bool detect_case (typename WrapReturn<TY>::Wrapper&, Query<TY>& q);
bool fabricate_matching_new_Pipe (Query<Pipe>& q, string const& pipeID, string const& streamID);
bool fabricate_new_Pipe_for_stream (Query<Pipe>& q, string const& streamID);
bool fabricate_ProcPatt_on_demand (Query<const ProcPatt>& q, string const& streamID);
template<class TY>
@ -180,6 +181,11 @@ namespace lumiera
inline bool
MockTable::detect_case (WrapReturn<Pipe>::Wrapper& candidate, Query<Pipe>& q)
{
if (!isnil (extractID("make", q)))
return false; // let the query fail here,
// so the invoking factory will go ahead
// and create a new object.
const string pipeID = extractID("pipe", q);
const string streamID = extractID("stream", q);
@ -188,6 +194,9 @@ namespace lumiera
if (!isnil(pipeID) && !isnil(streamID))
return fabricate_matching_new_Pipe (q, pipeID, streamID);
if (!candidate && !isnil(streamID))
return fabricate_new_Pipe_for_stream (q, streamID);
q.clear();
return false;
@ -197,9 +206,7 @@ namespace lumiera
MockTable::detect_case (WrapReturn<const ProcPatt>::Wrapper& candidate, Query<const ProcPatt>& q)
{
if (!isnil (extractID("make", q)))
return false; // let the query fail here,
// so the invoking factory will go ahead
// and create a new object.
return false; // failure triggers creation...
const string streamID = extractID("stream", q);
if (!candidate && !isnil(streamID))

View file

@ -6,11 +6,12 @@ PLANNED "AddClip_test" AddClip_test <<END
END
PLANNED "DefsManagerImpl_test" DefsManagerImpl_test <<END
PLANNED "DefsManager_test" DefsManager_test <<END
END
PLANNED "DefsManager_test" DefsManager_test <<END
TEST "DefsManagerImpl_test" DefsManagerImpl_test <<END
return: 0
END