From dd8a88d095f88eeca6e5daa36bae1f4fa0455f4f Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Mon, 26 Nov 2012 01:22:01 +0100 Subject: [PATCH] adjustments and stubbing to get it past the compiler --- src/common/configrules.cpp | 4 +- src/common/configrules.hpp | 2 + src/lib/advice/binding.hpp | 2 +- src/lib/query-resolver.cpp | 12 +- src/lib/query-resolver.hpp | 208 +------------ src/lib/query.cpp | 10 +- src/lib/query.hpp | 276 +++++++++++++++--- src/proc/asset/pipe.cpp | 5 +- src/proc/asset/pipe.hpp | 4 +- src/proc/asset/struct-factory-impl.hpp | 20 +- src/proc/asset/struct.cpp | 2 +- src/proc/asset/struct.hpp | 2 +- src/proc/mobject/output-designation.cpp | 10 +- src/proc/mobject/output-mapping.hpp | 2 +- src/proc/mobject/session/defs-manager.cpp | 5 +- src/proc/mobject/session/defs-manager.hpp | 9 +- src/proc/mobject/session/defs-registry.hpp | 11 +- src/proc/mobject/session/locatingpin.cpp | 2 +- .../placement-index-query-resolver.cpp | 6 +- .../placement-index-query-resolver.hpp | 4 +- .../session}/query/fake-configrules.cpp | 45 +-- .../session}/query/fake-configrules.hpp | 43 +-- src/proc/mobject/session/scope-locator.hpp | 2 +- src/proc/mobject/session/scope-query.hpp | 3 + src/proc/mobject/session/scope.cpp | 2 +- .../mobject/session/sess-manager-impl.cpp | 2 +- .../session/session-service-explore-scope.hpp | 2 +- .../session/specific-contents-query.hpp | 2 + src/proc/play/dummy-play-connection.hpp | 4 +- tests/components/proc/asset/basicpipetest.cpp | 20 +- .../proc/engine/engine-interface-test.cpp | 2 +- .../builder/fixture-change-detector-test.cpp | 4 +- .../builder/model-port-registry-test.cpp | 4 +- .../segmentation-datastructure-test.cpp | 4 +- .../proc/mobject/output-mapping-test.cpp | 16 +- .../session/defs-manager-impl-test.cpp | 6 +- .../mobject/session/defs-manager-test.cpp | 16 +- .../session/defs-registry-impl-test.cpp | 16 +- .../session/placement-index-query-test.cpp | 1 + .../mobject/session/query-resolver-test.cpp | 8 +- .../session/session-element-tracker-test.cpp | 2 +- .../session/session-modify-parts-test.cpp | 2 +- .../timeline-sequence-handling-test.cpp | 2 +- tests/lib/query/query-utils-test.cpp | 9 +- tests/lib/query/querydiagnostics.hpp | 93 +++--- tests/lib/subsystem-runner-test.cpp | 4 +- 46 files changed, 483 insertions(+), 427 deletions(-) rename src/{common => proc/mobject/session}/query/fake-configrules.cpp (77%) rename src/{common => proc/mobject/session}/query/fake-configrules.hpp (78%) diff --git a/src/common/configrules.cpp b/src/common/configrules.cpp index b42e5591a..eb8ddda25 100644 --- a/src/common/configrules.cpp +++ b/src/common/configrules.cpp @@ -24,7 +24,7 @@ #include "lib/error.hpp" #include "common/configrules.hpp" -#include "common/query/fake-configrules.hpp" +#include "proc/mobject/session/query/fake-configrules.hpp" @@ -39,7 +39,7 @@ namespace lumiera { namespace { /** type of the actual ConfigRules implementation to use */ - lib::singleton::UseSubclass typeinfo; + lib::singleton::UseSubclass typeinfo; } diff --git a/src/common/configrules.hpp b/src/common/configrules.hpp index 28b535d02..71823ee3b 100644 --- a/src/common/configrules.hpp +++ b/src/common/configrules.hpp @@ -41,6 +41,7 @@ ** @see mobject::session::DefsManager ** @see asset::StructFactory ** @see fake-configrules.hpp currently used dummy-implementation + ** @see ** */ @@ -98,6 +99,7 @@ namespace lumiera { ///////TODO: shouldn't that be namespace lib? or proc? using lib::Symbol; using lib::Literal; + using lib::Query; /** placeholder definition for later. * @todo intention is to integrate with lib::Symbol diff --git a/src/lib/advice/binding.hpp b/src/lib/advice/binding.hpp index df9715907..90dc4be78 100644 --- a/src/lib/advice/binding.hpp +++ b/src/lib/advice/binding.hpp @@ -228,7 +228,7 @@ namespace advice { inline Binding const& Binding::addTypeGuard() { - atoms_.insert (Atom ("advice.type."+lumiera::query::buildTypeID())); + atoms_.insert (Atom ("advice.type."+lib::query::buildTypeID())); return *this; } diff --git a/src/lib/query-resolver.cpp b/src/lib/query-resolver.cpp index a8bac0e25..64f38d3b7 100644 --- a/src/lib/query-resolver.cpp +++ b/src/lib/query-resolver.cpp @@ -30,8 +30,6 @@ namespace lib { /* generate vtables here... */ - Goal::~Goal() { } - Resolution::~Resolution() { } QueryResolver::~QueryResolver() { } @@ -57,12 +55,14 @@ namespace lib { /* == dispatch to resolve typed queries == */ + using factory::BuildRefcountPtr; + /** factory used as dispatcher table * for resolving typed queries */ - typedef MultiFact< Resolution(Goal const&) // nominal signature of fabrication - , Goal::QueryID // select resolution function by kind-of-Query - , BuildRefcountPtr // wrapper: manage result set by smart-ptr - > DispatcherTable; // + typedef factory::MultiFact< Resolution(Goal const&) // nominal signature of fabrication + , Goal::QueryID // select resolution function by kind-of-Query + , BuildRefcountPtr // wrapper: manage result set by smart-ptr + > DispatcherTable; // struct QueryDispatcher : DispatcherTable diff --git a/src/lib/query-resolver.hpp b/src/lib/query-resolver.hpp index bb6ec737e..849e8c1e1 100644 --- a/src/lib/query-resolver.hpp +++ b/src/lib/query-resolver.hpp @@ -1,5 +1,5 @@ /* - QUERY-RESOLVER.hpp - interface for discovering contents of a scope + QUERY-RESOLVER.hpp - framework for resolving generic queries Copyright (C) Lumiera.org 2009, Hermann Vosseler @@ -21,235 +21,41 @@ */ -#ifndef PROC_MOBJECT_SESSION_QUERY_RESOLVER_H -#define PROC_MOBJECT_SESSION_QUERY_RESOLVER_H +#ifndef LIB_QUERY_RESOLVER_H +#define LIB_QUERY_RESOLVER_H -//#include "proc/mobject/mobject.hpp" -//#include "proc/mobject/placement.hpp" -#include "lib/bool-checkable.hpp" -#include "lib/typed-counter.hpp" +#include "lib/query.hpp" #include "lib/iter-adapter.hpp" -#include "lib/nocopy.hpp" -#include "lib/util.hpp" -#include #include #include #include #include -//#include #include -//using std::vector; -//using std::string; +using std::tr1::function; namespace lib { - using lib::IxID; - using util::unConst; using boost::noncopyable; - using boost::lexical_cast; using boost::scoped_ptr; - using std::tr1::function; using std::string; - class Goal; class Resolution; class QueryResolver; class QueryDispatcher; /** Allow for taking ownership of a result set */ typedef std::tr1::shared_ptr PReso; - - - /** - * TODO type comment - * Query ABC - */ - class Goal - : util::no_copy_by_client - { - public: - virtual ~Goal() ; - - enum Kind - { GENERIC = 0 - , DISCOVERY - }; - - struct QueryID - { - Kind kind; - IxID type; - }; - - QueryID const& - getQID() const - { - return id_; - } - - - /** - * Single Solution, possibly part of a result set. - * A pointer-like object, usually to be down-casted - * to a specifically typed Query::Cursor - * @see Resolution - */ - class Result - : public lib::BoolCheckable - { - void* cur_; - - protected: - void point_at(void* p) { cur_ = p; } - - template - RES& - access() - { - REQUIRE (cur_); - return *reinterpret_cast (cur_); - } - - public: - bool isValid() const { return bool(cur_); } - - Result() : cur_(0) { } ///< create an NIL result - }; - - - - protected: - QueryID id_; - - Goal (QueryID qid) - : id_(qid) - { } - - }; - - - inline bool - operator== (Goal::QueryID const& id1, Goal::QueryID const& id2) - { - return id1.kind == id2.kind - && id1.type == id2.type; - } - - inline bool - operator!= (Goal::QueryID const& id1, Goal::QueryID const& id2) - { - return ! (id1 == id2); - } - - - - /** Context used for generating type-IDs to denote - * the specific result types of issued queries */ - typedef lib::TypedContext ResultType; - - template - inline IxID - getResultTypeID() ///< @return unique ID denoting result type RES - { - return ResultType::ID::get(); - } - - - - - /** - * TODO type comment - * Concrete query to yield specifically typed result elements - */ - template - class Query - : public Goal - { - protected: - static QueryID - defineQueryTypeID (Kind queryType = Goal::GENERIC) - { - QueryID id = {queryType, getResultTypeID() }; - return id; - } - - class Builder; - - public: - Query() - : Goal (defineQueryTypeID()) - { } - - static Builder - build (Kind queryType = Goal::GENERIC); - - - /* results retrieval */ - class Cursor - : public Goal::Result - { - public: - typedef RES value_type; - typedef RES& reference; - typedef RES* pointer; - - RES& operator* () { return access(); } - RES* operator->() { return & access(); } - - void point_at(RES* r){ Goal::Result::point_at(r);} - void point_at(RES& r){ Goal::Result::point_at(&r);} - }; - - - typedef lib::IterAdapter iterator; - - iterator operator() (QueryResolver const& resolver) const; - iterator resolveBy (QueryResolver const& resolver) const; - - - protected: - Query (QueryID qID) - : Goal (qID) - { } - - friend class Builder; - - }; - - - - - /** - * Helper for establishing, - * reworking and remolding queries. - */ - template - class Query::Builder - { - string predicateForm_; - - public: - - const string - asKey() const - { - return "type(" - + lexical_cast (getResultTypeID()) - + "), "+predicateForm_; - } - - }; /** - * ABC denoting the result set + * ABC representing the result set * of an individual query resolution */ class Resolution - : noncopyable + : boost::noncopyable { public: typedef Goal::Result Result; diff --git a/src/lib/query.cpp b/src/lib/query.cpp index 5683a0ac7..a9541e079 100644 --- a/src/lib/query.cpp +++ b/src/lib/query.cpp @@ -1,5 +1,5 @@ /* - Query - interface for capability queries + Query - interface for generic queries Copyright (C) Lumiera.org 2008, Hermann Vosseler @@ -40,7 +40,7 @@ using util::contains; using util::isnil; -namespace lumiera { +namespace lib { namespace query { namespace { // local definitions @@ -142,7 +142,9 @@ namespace lumiera { } // namespace query - /** */ + + Goal::~Goal() { } + -} // namespace lumiera +} // namespace lib diff --git a/src/lib/query.hpp b/src/lib/query.hpp index c397050f6..277bdc019 100644 --- a/src/lib/query.hpp +++ b/src/lib/query.hpp @@ -1,5 +1,5 @@ /* - QUERY.hpp - interface for capability queries + QUERY.hpp - interface for generic queries Copyright (C) Lumiera.org 2008, Hermann Vosseler @@ -21,63 +21,271 @@ */ -#ifndef LUMIERA_QUERY_H -#define LUMIERA_QUERY_H +#ifndef LIB_QUERY_H +#define LIB_QUERY_H -#include -#include -#include - +#include "lib/bool-checkable.hpp" +#include "lib/typed-counter.hpp" +#include "lib/iter-adapter.hpp" +#include "lib/nocopy.hpp" #include "lib/symbol.hpp" +#include "lib/util.hpp" + +#include +#include +#include +#include +#include -namespace lumiera { +namespace lib { + using lib::IxID; using lib::Symbol; using lib::Literal; + using util::unConst; + using boost::lexical_cast; using std::string; + /* ==== common definitions for rule based queries ==== */ + class Goal; + class Resolution; + class QueryResolver; + + /** Allow for taking ownership of a result set */ + typedef std::tr1::shared_ptr PReso; + + + + /** + * Query ABC: unspecific goal for resolution or retrieval. + * Goal elements are used within the backbone of a generic query system + * to access individual resolution mechanisms based on an internal classification + * of the type of query. + */ + class Goal + : util::no_copy_by_client + { + public: + virtual ~Goal() ; + + enum Kind + { GENERIC = 0 + , DISCOVERY + }; + + struct QueryID + { + Kind kind; + IxID type; + }; + + QueryID const& + getQID() const + { + return id_; + } + + + /** + * Single Solution, possibly part of a result set. + * A pointer-like object, usually to be down-casted + * to a specifically typed Query::Cursor + * @see Resolution + */ + class Result + : public lib::BoolCheckable + { + void* cur_; + + protected: + void point_at(void* p) { cur_ = p; } + + template + RES& + access() + { + REQUIRE (cur_); + return *reinterpret_cast (cur_); + } + + public: + bool isValid() const { return bool(cur_); } + + Result() : cur_(0) { } ///< create an NIL result + }; + + + + protected: + QueryID id_; + + Goal (QueryID qid) + : id_(qid) + { } + + }; + + + inline bool + operator== (Goal::QueryID const& id1, Goal::QueryID const& id2) + { + return id1.kind == id2.kind + && id1.type == id2.type; + } + + inline bool + operator!= (Goal::QueryID const& id1, Goal::QueryID const& id2) + { + return ! (id1 == id2); + } + + + + /** Context used for generating type-IDs to denote + * the specific result types of issued queries */ + typedef lib::TypedContext ResultType; + + template + inline IxID + getResultTypeID() ///< @return unique ID denoting result type RES + { + return ResultType::ID::get(); + } + + /** - * Generic query interface for retrieving objects - * matching the given capability query + * Generic interface to express a query + * for specifically typed result elements + * providing some capabilities or fulfilling + * some properties. This is a generic umbrella + * for several kinds of queries and provides a + * mechanism for uniform usage of various + * resolution mechanisms. + * + * Any query bears an internal type classification and can be + * represented in a common syntactical form based on predicate logic. + * Query instances are created by some facilities allowing to query for objects. + * These query providers \em do know the specific kind (type) of query to expose. + * While client code uses these queries only by reference, there is the possibility + * to involve a generic QueryResolver, which -- behind the scenes -- manages a registry + * of specific resolution mechanisms. This way, clients may retrieve a set of results, + * each representing a possible solution to the posed query. + * * @note until really integrating a rules based system - * this is a dummy placeholder implementation - * based on a dressed-up std::string - * @warning in this preliminary implementation, the - * given query-string is used as-is, without any - * normalisation. Moreover, as espeically the - * fake-configrules match by string comparision, + * this is largely dummy placeholder implementation. + * Some more specific query resolvers are available already, + * so, depending on the circumstances the actual resolution might be + * substantial or just a fake. + * @warning especially the classical resolution-type queries are just + * faked and use the given query-string as-is, without any normalisation. + * Moreover, as especially the fake-configrules match by string comparison, * this may led to unexpected mis-matches. - * @todo the »real thing« should be based on a - * normalised syntax tree representation - * of the atoms in the query. */ - template + template class Query + : public Goal { - std::string predicateForm_; - - public: - explicit Query (string const& predicate="") - : predicateForm_(predicate) - { } - - - void - clear() + protected: + static QueryID + defineQueryTypeID (Kind queryType = Goal::GENERIC) { - predicateForm_.clear(); + QueryID id = {queryType, getResultTypeID() }; + return id; } - operator string() const { return predicateForm_; } + class Builder; -// operator string& () { return predicateForm_; } //TICKET #710 : needed temporarily by fake-configrules - }; // for calling removeTerm on the string-ref.... + public: + Query() + : Goal (defineQueryTypeID()) + { } + + explicit + Query (string querySpec) + : Goal (defineQueryTypeID(Goal::GENERIC)) + { + UNIMPLEMENTED("how to issue generic queries");////////////////////////////////////////////////////////////////////////////////////////////TODO + } + + static Builder + build (Kind queryType = Goal::GENERIC); + + + /* results retrieval */ + class Cursor + : public Goal::Result + { + public: + typedef RES value_type; + typedef RES& reference; + typedef RES* pointer; + + RES& operator* () { return access(); } + RES* operator->() { return & access(); } + + void point_at(RES* r){ Goal::Result::point_at(r);} + void point_at(RES& r){ Goal::Result::point_at(&r);} + }; + + + typedef lib::IterAdapter iterator; + + iterator operator() (QueryResolver const& resolver) const; + iterator resolveBy (QueryResolver const& resolver) const; + + friend size_t + hash_value (Query const& q) + { + UNIMPLEMENTED("generic standard representation");////////////////////////////////////////////////////////////////////////////////////////////TODO + } + + friend bool + operator== (Query const& q1, Query const& q2) + { + UNIMPLEMENTED("how to define equality on queries");////////////////////////////////////////////////////////////////////////////////////////////TODO + } + + protected: + Query (QueryID qID) + : Goal (qID) + { } + + friend class Builder; + + }; + + + + + /** + * Helper for establishing, + * reworking and remolding queries. + */ + template + class Query::Builder + { + string predicateForm_; + + public: + + const string + asKey() const + { + return "type(" + + lexical_cast (getResultTypeID()) + + "), "+predicateForm_; + } + + }; + + + namespace query { diff --git a/src/proc/asset/pipe.cpp b/src/proc/asset/pipe.cpp index 5104b0415..d1e49c2c1 100644 --- a/src/proc/asset/pipe.cpp +++ b/src/proc/asset/pipe.cpp @@ -58,9 +58,10 @@ namespace asset { PPipe - Pipe::query (string properties) + Pipe::query (Query const& properties) { - return Struct::retrieve (Query (properties)); + UNIMPLEMENTED ("maybe provide a direct way to query, based on a predicate string?");//////////////////////////////////TODO + return Struct::retrieve (properties); } diff --git a/src/proc/asset/pipe.hpp b/src/proc/asset/pipe.hpp index 1e91e1965..60903c62a 100644 --- a/src/proc/asset/pipe.hpp +++ b/src/proc/asset/pipe.hpp @@ -27,6 +27,7 @@ #include "proc/asset/struct.hpp" #include "proc/asset/procpatt.hpp" #include "proc/streamtype.hpp" +#include "lib/query.hpp" #include @@ -35,6 +36,7 @@ namespace proc { namespace asset { + using lib::Query; using std::string; class Pipe; @@ -96,7 +98,7 @@ namespace asset { void switchProcPatt (PProcPatt& another); /** convenience shortcut for retrieving default configured pipes */ - static PPipe query (string properties); + static PPipe query (Query const& properties); /** convenience shortcut for lookup by id */ static PPipe lookup (ID id); diff --git a/src/proc/asset/struct-factory-impl.hpp b/src/proc/asset/struct-factory-impl.hpp index b25a94ef1..cf3658ef4 100644 --- a/src/proc/asset/struct-factory-impl.hpp +++ b/src/proc/asset/struct-factory-impl.hpp @@ -69,7 +69,7 @@ namespace asset { using util::isnil; using util::contains; using lumiera::query::LUMIERA_ERROR_CAPABILITY_QUERY; - using lumiera::query::extractID; + using lib::query::extractID; using proc::mobject::Session; using proc::mobject::MObject; @@ -113,9 +113,11 @@ namespace asset { createIdent (Query const& query) { // does the query somehow specify the desired name-ID? - string nameID = extractID (genericIdSymbol, query); + string nameID = "TODO";//extractID (genericIdSymbol, query);////////////////////////////////////////////////////////////////////////////////////////////TODO + UNIMPLEMENTED("Query rebuilding");////////////////////////////////////////////////////////////////////////////////////////////TODO if (isnil (nameID)) - nameID = extractID (StructTraits::idSymbol(), query); + nameID = "TODO";//extractID (StructTraits::idSymbol(), query);////////////////////////////////////////////////////////////////////////////////////////////TODO + UNIMPLEMENTED("Query rebuilding");////////////////////////////////////////////////////////////////////////////////////////////TODO if (isnil (nameID)) { // no name-ID contained in the query... @@ -127,7 +129,8 @@ namespace asset { ENSURE (!isnil (nameID)); // does the query actually demand the Nth instance/element? - string seqID = extractID (seqNrPredicate, query); + string seqID = "TODO";//extractID (seqNrPredicate, query);////////////////////////////////////////////////////////////////////////////////////////////TODO + UNIMPLEMENTED("Query rebuilding");////////////////////////////////////////////////////////////////////////////////////////////TODO) if (!isnil (seqID) && 1 < asNumber(seqID)) nameID += "."+seqID; @@ -200,7 +203,8 @@ namespace asset { StructFactoryImpl::fabricate (Query const& caps) { const Asset::Ident idi (createIdent (caps)); - string streamID = extractID ("stream", caps); + string streamID = "TODO";//extractID ("stream", caps);////////////////////////////////////////////////////////////////////////////////////////////TODO + UNIMPLEMENTED("fabricate a Pipe by query");////////////////////////////////////////////////////////////////////////////////////////////TODO if (isnil (streamID)) streamID = "default"; PProcPatt processingPattern = Session::current->defaults (Query("stream("+streamID+")")); return new Pipe( idi @@ -215,7 +219,8 @@ namespace asset { { TODO ("extract additional properties/capabilities from the query..."); const Asset::Ident idi (createIdent (caps)); - string sequenceID = extractID ("sequence", caps); + string sequenceID = "TODO";//extractID ("sequence", caps);////////////////////////////////////////////////////////////////////////////////////////////TODO + UNIMPLEMENTED("fabricate a Timeline by query");////////////////////////////////////////////////////////////////////////////////////////////TODO Query desiredSequence (isnil (sequenceID)? "" : "id("+sequenceID+")"); PSequence sequence = recursive_create_(desiredSequence); ASSERT (sequence); @@ -232,7 +237,8 @@ namespace asset { { // when we reach this point it is clear a suitable sequence doesn't yet exist in the model TODO ("actually extract properties/capabilities from the query..."); - string trackID = extractID ("track", caps); + string trackID = "TODO";//extractID ("track", caps);////////////////////////////////////////////////////////////////////////////////////////////TODO + UNIMPLEMENTED("fabricate a Sequence by query");////////////////////////////////////////////////////////////////////////////////////////////TODO Query desiredTrack (isnil (trackID)? "" : "id("+trackID+")"); // PTrack track = Session::current->query (desiredTrack); ///////////////////////////////////TICKET #639 // TODO: handle the following cases diff --git a/src/proc/asset/struct.cpp b/src/proc/asset/struct.cpp index 032920ec8..9f5ede87b 100644 --- a/src/proc/asset/struct.cpp +++ b/src/proc/asset/struct.cpp @@ -36,7 +36,7 @@ using boost::format; using lib::Symbol; -using lumiera::query::normaliseID; +using lib::query::normaliseID; using lumiera::query::QueryHandler; using lumiera::ConfigRules; diff --git a/src/proc/asset/struct.hpp b/src/proc/asset/struct.hpp index d9954526a..87e07d392 100644 --- a/src/proc/asset/struct.hpp +++ b/src/proc/asset/struct.hpp @@ -72,7 +72,7 @@ namespace asset { using std::string; using boost::scoped_ptr; - using lumiera::Query; + using lib::Query; using lib::Symbol; class Struct; diff --git a/src/proc/mobject/output-designation.cpp b/src/proc/mobject/output-designation.cpp index aecd3c1fb..92fcccd62 100644 --- a/src/proc/mobject/output-designation.cpp +++ b/src/proc/mobject/output-designation.cpp @@ -49,10 +49,10 @@ #include using lumiera::query::QueryHandler; -using lumiera::query::removeTerm; -using lumiera::query::extractID; using lumiera::ConfigRules; using lumiera::Symbol; +using lib::query::removeTerm; +using lib::query::extractID; namespace proc { namespace mobject { @@ -179,7 +179,8 @@ namespace mobject { uint is_defaults_query_with_channel (Query const& query4pipe) { - string seqNr = extractID (SEQNR_PREDICATE, query4pipe); + string seqNr = "TODO";//extractID (SEQNR_PREDICATE, query4pipe);////////////////////////////////////////////////////////////////////////////////////////////TODO + UNIMPLEMENTED ("Query remolding");////////////////////////////////////////////////////////////////////////////////////////////TODO return abs(std::atoi (seqNr.c_str())); // also 0 in case of an invalid number } @@ -187,7 +188,8 @@ namespace mobject { build_corresponding_sourceQuery (Query const& query4pipe) { Query srcQuery = query4pipe; - removeTerm (SEQNR_PREDICATE, srcQuery); +// removeTerm (SEQNR_PREDICATE, srcQuery);////////////////////////////////////////////////////////////////////////////////////////////TODO + UNIMPLEMENTED ("Query remolding");////////////////////////////////////////////////////////////////////////////////////////////TODO return srcQuery; } } diff --git a/src/proc/mobject/output-mapping.hpp b/src/proc/mobject/output-mapping.hpp index 807ab5f50..ae57ef93e 100644 --- a/src/proc/mobject/output-mapping.hpp +++ b/src/proc/mobject/output-mapping.hpp @@ -96,7 +96,7 @@ namespace mobject { }//(End) type rebinding helper namespace error = lumiera::error; - using lumiera::Query; + using lib::Query; using asset::HashVal; diff --git a/src/proc/mobject/session/defs-manager.cpp b/src/proc/mobject/session/defs-manager.cpp index aaae140f7..4da7e4845 100644 --- a/src/proc/mobject/session/defs-manager.cpp +++ b/src/proc/mobject/session/defs-manager.cpp @@ -118,10 +118,11 @@ namespace session { return res; else res = create (capabilities); // not yet known as default, create new - + + UNIMPLEMENTED("String representation of queries, here just for diagnostics"); if (!res) throw lumiera::error::Config (_Fmt("The following Query could not be resolved: %s.") - % capabilities.asKey() + % "TODO"//capabilities.asKey()////////////////////////////////////////////////////////////////////////////////////////////TODO , LUMIERA_ERROR_CAPABILITY_QUERY ); else return res; diff --git a/src/proc/mobject/session/defs-manager.hpp b/src/proc/mobject/session/defs-manager.hpp index f37c624be..f514db858 100644 --- a/src/proc/mobject/session/defs-manager.hpp +++ b/src/proc/mobject/session/defs-manager.hpp @@ -39,6 +39,7 @@ namespace session { using lib::P; + using lib::Query; using boost::scoped_ptr; namespace impl { class DefsRegistry; } @@ -73,14 +74,14 @@ namespace session { * is considered \e misconfiguration. */ template - P operator() (lumiera::Query const&); + P operator() (Query const&); /** search through the registered defaults, never create anything. * @return object fulfilling the query, \c empty ptr if not found. */ template - P search (lumiera::Query const&); + P search (Query const&); /** retrieve an object fulfilling the query and register it as default. * The resolution is delegated to the ConfigQuery system (which may cause @@ -88,7 +89,7 @@ namespace session { * @return object fulfilling the query, \c empty ptr if no solution. */ template - P create (lumiera::Query const&); + P create (Query const&); /** register the given object as default, after ensuring it fulfils the * query. The latter may cause some properties of the object to be set, @@ -97,7 +98,7 @@ namespace session { * @note only a weak ref to the object is stored */ template - bool define (P const&, lumiera::Query const& =lumiera::Query()); + bool define (P const&, Query const& =Query()); /** remove the defaults registration of the given object, if there was such * @return false if nothing has been changed because the object wasn't registered diff --git a/src/proc/mobject/session/defs-registry.hpp b/src/proc/mobject/session/defs-registry.hpp index d72c92014..d4f6b5f77 100644 --- a/src/proc/mobject/session/defs-registry.hpp +++ b/src/proc/mobject/session/defs-registry.hpp @@ -59,7 +59,7 @@ namespace mobject { namespace session { using lib::P; - using lumiera::Query; + using lib::Query; using lib::ClassLock; using std::tr1::weak_ptr; @@ -97,10 +97,12 @@ namespace session { weak_ptr objRef; Record (const Query& q, const P& obj) - : degree (lumiera::query::countPred (q)), + : degree (lib::query::countPred ("TODO")),//q)),////////////////////////////////////////////////////////////////////////////////////////////TODO query (q), objRef (obj) - { } + { + UNIMPLEMENTED("Query remolding");////////////////////////////////////////////////////////////////////////////////////////////TODO + } struct Search ///< Functor searching for a specific object @@ -123,8 +125,9 @@ namespace session { inline bool operator() (Record one, Record two) ///< @note doesn't touch the objRef { + UNIMPLEMENTED ("arbitrary total ordering of queries"); return ( one.degree < two.degree - ||(one.degree == two.degree && one.query < two.query) + ||(one.degree == two.degree && false)//one.query < two.query)////////////////////////////////////////////////////////////////////////////////////////////TODO ); } }; diff --git a/src/proc/mobject/session/locatingpin.cpp b/src/proc/mobject/session/locatingpin.cpp index 93f6437e5..ac24622a5 100644 --- a/src/proc/mobject/session/locatingpin.cpp +++ b/src/proc/mobject/session/locatingpin.cpp @@ -148,7 +148,7 @@ namespace session { LocatingPin::LocatingSolution::getPipe() { TODO ("implement Placement LocatingSolution"); - return asset::Pipe::query ("pipe(master)"); // yet another idiotic dummy + return asset::Pipe::query (lib::Query("pipe(master)")); // yet another idiotic dummy } diff --git a/src/proc/mobject/session/placement-index-query-resolver.cpp b/src/proc/mobject/session/placement-index-query-resolver.cpp index 4eda27cf0..59242cea5 100644 --- a/src/proc/mobject/session/placement-index-query-resolver.cpp +++ b/src/proc/mobject/session/placement-index-query-resolver.cpp @@ -39,6 +39,10 @@ namespace session { using boost::scoped_ptr; + using lib::Goal; + using lib::Query; + using lib::Resolution; + using lib::getResultTypeID; typedef PlacementIndex::ID PID; @@ -190,7 +194,7 @@ namespace session { * there is a smart-ptr managing this ResultSet. */ class ResultSet - : public Resolution + : public lib::Resolution { ContentFilter acceptable_; ExplorerBuilder buildExploartion_; diff --git a/src/proc/mobject/session/placement-index-query-resolver.hpp b/src/proc/mobject/session/placement-index-query-resolver.hpp index 426815f3f..1d459f820 100644 --- a/src/proc/mobject/session/placement-index-query-resolver.hpp +++ b/src/proc/mobject/session/placement-index-query-resolver.hpp @@ -87,7 +87,7 @@ namespace session { * * more generally, any ScopeQuery with these properties, in some variations */ class PlacementIndexQueryResolver - : public session::QueryResolver + : public lib::QueryResolver { function _getIndex; @@ -106,7 +106,7 @@ namespace session { void defineHandling(); template - Resolution* resolutionFunction (Goal const& goal); + lib::Resolution* resolutionFunction (Goal const& goal); public: diff --git a/src/common/query/fake-configrules.cpp b/src/proc/mobject/session/query/fake-configrules.cpp similarity index 77% rename from src/common/query/fake-configrules.cpp rename to src/proc/mobject/session/query/fake-configrules.cpp index a095a4acf..f90543aa6 100644 --- a/src/common/query/fake-configrules.cpp +++ b/src/proc/mobject/session/query/fake-configrules.cpp @@ -21,7 +21,7 @@ * *****************************************************/ -#include "common/query/fake-configrules.hpp" +#include "proc/mobject/session/query/fake-configrules.hpp" #include "proc/mobject/session.hpp" #include "proc/mobject/session/track.hpp" @@ -31,13 +31,17 @@ #include "include/logging.h" +#include "lib/symbol.hpp" #include "lib/util.hpp" +using lib::Literal; using util::isnil; //////////////////////////////////////////////////////////////////TICKET #710 : to be removed entirely in Alpha -namespace lumiera { +namespace proc { +namespace mobject { +namespace session { namespace query { @@ -49,7 +53,7 @@ namespace lumiera { using asset::PProcPatt; // using lumiera::query::extractID; - using lumiera::query::removeTerm; + using lib::query::removeTerm; namespace { @@ -58,9 +62,10 @@ namespace lumiera { /** helper to simplify creating mock table entries, wrapped correctly */ template - AnyPair entry (const string& query, typename WrapReturn::Wrapper& obj) + AnyPair entry (Query const& query, typename WrapReturn::Wrapper& obj) { - return AnyPair ( Query (query).asKey() + UNIMPLEMENTED ("generic query-key");////////////////////////////////////////////////////////////////////////////////////////////TODO + return AnyPair ( "TODO"//Query (query).asKey()////////////////////////////////////////////////////////////////////////////////////////////TODO , any(obj)); } @@ -73,7 +78,8 @@ namespace lumiera { string capabilities (caps); Query query (capabilities); Ptr obj = Struct::retrieve (query); - return AnyPair(query.asKey(), obj); + UNIMPLEMENTED("generic query-key"); +// return AnyPair(query.asKey(), obj);////////////////////////////////////////////////////////////////////////////////////////////TODO } /** shortcut for simply accessing a table entry */ @@ -81,7 +87,8 @@ namespace lumiera { any& item (PTAB& table, const string& query) { - return (*table)[Query(query).asKey()]; + UNIMPLEMENTED ("generic Query-key");////////////////////////////////////////////////////////////////////////////////////////////TODO + //return (*table)[Query(query).asKey()];////////////////////////////////////////////////////////////////////////////////////////////TODO } } @@ -162,13 +169,14 @@ namespace lumiera { { typedef asset::Timeline aTl; typedef WrapReturn::Wrapper Ptr; - - string nameID = removeTerm ("id", query); + + UNIMPLEMENTED ("generic query remolding");////////////////////////////////////////////////////////////////////////////////////////////TODO + string nameID = "TODO";//removeTerm ("id", query);////////////////////////////////////////////////////////////////////////////////////////////TODO if (isnil (nameID)) - nameID = removeTerm ("timeline", query); + nameID = "TODO";//removeTerm ("timeline", query);////////////////////////////////////////////////////////////////////////////////////////////TODO if (isnil (nameID)) nameID = "prime"; - query.insert (0, "id("+nameID+"), "); +// query.insert (0, "id("+nameID+"), "); // try to find an existing one with the desired id Ptr newTimeline; @@ -193,13 +201,14 @@ namespace lumiera { { typedef asset::Sequence aSq; typedef WrapReturn::Wrapper Ptr; - - string nameID = removeTerm ("id", query); + + UNIMPLEMENTED ("generic Query remolding");////////////////////////////////////////////////////////////////////////////////////////////TODO + string nameID = "TODO";//removeTerm ("id", query);////////////////////////////////////////////////////////////////////////////////////////////TODO if (isnil (nameID)) - nameID = removeTerm ("sequence", query); + nameID = "TODO";//removeTerm ("sequence", query);////////////////////////////////////////////////////////////////////////////////////////////TODO if (isnil (nameID)) nameID = "first"; - query.insert (0, "id("+nameID+"), "); +// query.insert (0, "id("+nameID+"), "); // try to find an existing sequence with the desired id Ptr newSequence; @@ -224,7 +233,8 @@ namespace lumiera { bool MockTable::set_new_mock_solution (Query& q, typename WrapReturn::Wrapper& obj) { - answer_->erase (q.asKey()); + UNIMPLEMENTED ("generic query-key");////////////////////////////////////////////////////////////////////////////////////////////TODO +// answer_->erase (q.asKey());////////////////////////////////////////////////////////////////////////////////////////////TODO answer_->insert (entry (q, obj)); return true; } @@ -275,5 +285,4 @@ namespace lumiera { } // namespace query - -} // namespace lumiera +}}} // namespace proc::mobject::session diff --git a/src/common/query/fake-configrules.hpp b/src/proc/mobject/session/query/fake-configrules.hpp similarity index 78% rename from src/common/query/fake-configrules.hpp rename to src/proc/mobject/session/query/fake-configrules.hpp index 5086fc4e3..cb3bf899f 100644 --- a/src/common/query/fake-configrules.hpp +++ b/src/proc/mobject/session/query/fake-configrules.hpp @@ -37,8 +37,8 @@ */ -#ifndef LUMIERA_FAKECONFIGRULES_H -#define LUMIERA_FAKECONFIGRULES_H +#ifndef MOBJECT_SESSION_QUERY_FAKECONFIGRULES_H +#define MOBJECT_SESSION_QUERY_FAKECONFIGRULES_H #include "proc/mobject/session.hpp" #include "common/configrules.hpp" @@ -51,7 +51,9 @@ -namespace lumiera { +namespace proc { +namespace mobject { +namespace session { namespace query { namespace asset = proc::asset; @@ -62,6 +64,11 @@ namespace lumiera { using proc::mobject::Session; using lib::meta::InstantiateChained; + using lib::Query; + using lib::query::removeTerm; //////////////TODO better use Query::Builder + using lib::query::extractID; ///////////////TODO dto + using lumiera::query::isFakeBypass; /////////TODO placeholder until there is a real resolution engine + using util::contains; using util::isnil; @@ -144,7 +151,7 @@ namespace lumiera { virtual bool resolve (Ret& solution, Query const& q) { - const any& entry = this->fetch_from_table_for (q.asKey()); + const any& entry = this->fetch_from_table_for ("TODO");//q.asKey());////////////////////////////////////////////////////////////////////////////////////////////TODO if (!isnil (entry)) { Ret const& candidate (any_cast (entry)); @@ -160,10 +167,10 @@ namespace lumiera { bool try_special_case (Ret& solution, Query const& q) { - if (solution && isFakeBypass(q)) // backdoor for tests + if (true)//solution && isFakeBypass(q)) // backdoor for tests////////////////////////////////////////////////////////////////////////////////////////////TODO return solution; - string querySpec (q); + string querySpec ;//(q);////////////////////////////////////////////////////////////////////////////////////////////TODO if (treat_as_defaults_query (querySpec)) { Query defaultsQuery(querySpec); @@ -184,19 +191,19 @@ namespace lumiera { inline bool MockTable::detect_case (typename WrapReturn::Wrapper&, Query& q) { - q.clear(); // end recursion +// q.clear(); // end recursion////////////////////////////////////////////////////////////////////////////////////////////TODO return false; } template<> inline bool MockTable::detect_case (WrapReturn::Wrapper& candidate, Query& q) { - if (!isnil (extractID("make", q))) + if (true)//!isnil (extractID("make", q)))////////////////////////////////////////////////////////////////////////////////////////////TODO // used by tests to force fabrication of a new "solution" return fabricate_just_new_Pipe (q); - const string pipeID = extractID("pipe", q); - const string streamID = extractID("stream", q); + const string pipeID = "TODO";//extractID("pipe", q);////////////////////////////////////////////////////////////////////////////////////////////TODO + const string streamID = "TODO";//extractID("stream", q);////////////////////////////////////////////////////////////////////////////////////////////TODO if (candidate && pipeID == candidate->getPipeID()) return set_new_mock_solution (q, candidate); // "learn" this solution to be "valid" @@ -207,19 +214,19 @@ namespace lumiera { if (!candidate && (!isnil(streamID) || !isnil(pipeID))) return fabricate_just_new_Pipe (q); - q.clear(); +// q.clear();////////////////////////////////////////////////////////////////////////////////////////////TODO return false; } template<> inline bool MockTable::detect_case (WrapReturn::Wrapper& candidate, Query& q) { - const string streamID = extractID("stream", q); + const string streamID = "TODO";//extractID("stream", q);////////////////////////////////////////////////////////////////////////////////////////////TODO if (!candidate && !isnil(streamID)) return fabricate_ProcPatt_on_demand (q); - q.clear(); +// q.clear();////////////////////////////////////////////////////////////////////////////////////////////TODO return false; } template<> @@ -229,7 +236,7 @@ namespace lumiera { if (!candidate) return fabricate_Timeline_on_demand (q); - q.clear(); +// q.clear();////////////////////////////////////////////////////////////////////////////////////////////TODO return bool(candidate); } template<> @@ -239,7 +246,7 @@ namespace lumiera { if (!candidate) return fabricate_Sequence_on_demand (q); - q.clear(); +// q.clear();////////////////////////////////////////////////////////////////////////////////////////////TODO return bool(candidate); } @@ -254,7 +261,7 @@ namespace lumiera { * values for some types of interest for testing and debugging. */ class MockConfigRules - : public InstantiateChained < InterfaceTypes + : public InstantiateChained < lumiera::InterfaceTypes , LookupPreconfigured // building block used for each of the types , MockTable // for implementing the base class (interface) > @@ -272,6 +279,6 @@ namespace lumiera { - -}} // namespace lumiera::query + } // namespace query +}}} // namespace proc::mobject::session #endif diff --git a/src/proc/mobject/session/scope-locator.hpp b/src/proc/mobject/session/scope-locator.hpp index 183b8ebd4..fd0dbb80d 100644 --- a/src/proc/mobject/session/scope-locator.hpp +++ b/src/proc/mobject/session/scope-locator.hpp @@ -97,7 +97,7 @@ namespace session { friend class lib::singleton::StaticCreate; private: - QueryResolver const& theResolver(); + lib::QueryResolver const& theResolver(); }; diff --git a/src/proc/mobject/session/scope-query.hpp b/src/proc/mobject/session/scope-query.hpp index 1369ce21e..7f74d24ab 100644 --- a/src/proc/mobject/session/scope-query.hpp +++ b/src/proc/mobject/session/scope-query.hpp @@ -56,6 +56,9 @@ namespace session { using std::tr1::function; using std::tr1::placeholders::_1; + using lib::Goal; + using lib::Query; + /** diff --git a/src/proc/mobject/session/scope.cpp b/src/proc/mobject/session/scope.cpp index 6b27c9a86..7abbfc9a2 100644 --- a/src/proc/mobject/session/scope.cpp +++ b/src/proc/mobject/session/scope.cpp @@ -119,7 +119,7 @@ namespace session { * of contents discovery queries to the PlacementIndex * managed within the session */ - QueryResolver const& + lib::QueryResolver const& ScopeLocator::theResolver() { return SessionServiceExploreScope::getResolver(); diff --git a/src/proc/mobject/session/sess-manager-impl.cpp b/src/proc/mobject/session/sess-manager-impl.cpp index 6999a2cb5..b840cb204 100644 --- a/src/proc/mobject/session/sess-manager-impl.cpp +++ b/src/proc/mobject/session/sess-manager-impl.cpp @@ -126,7 +126,7 @@ namespace session { REQUIRE (0 == session_->timelines.size(), "injecting default timeline, but session isn't pristine"); // issue a default query to retrieve or create a Timeline and a default Sequence - asset::PTimeline initialTimeline = session_->defaults (lumiera::Query ()); + asset::PTimeline initialTimeline = session_->defaults (lib::Query ()); // these got registered automatically ENSURE (1 == session_->timelines.size()); diff --git a/src/proc/mobject/session/session-service-explore-scope.hpp b/src/proc/mobject/session/session-service-explore-scope.hpp index 302a69458..3a249f6b0 100644 --- a/src/proc/mobject/session/session-service-explore-scope.hpp +++ b/src/proc/mobject/session/session-service-explore-scope.hpp @@ -68,7 +68,7 @@ namespace session { */ struct SessionServiceExploreScope { - static QueryResolver const& getResolver(); + static lib::QueryResolver const& getResolver(); static PlacementMO& getScope (PlacementMO const&); static PlacementMO& getScope (PlacementMO::ID const&); diff --git a/src/proc/mobject/session/specific-contents-query.hpp b/src/proc/mobject/session/specific-contents-query.hpp index 84503c6b8..e104ef7f3 100644 --- a/src/proc/mobject/session/specific-contents-query.hpp +++ b/src/proc/mobject/session/specific-contents-query.hpp @@ -37,6 +37,8 @@ namespace session { using std::tr1::function; + using lib::QueryResolver; + /** * Specialised version of the ContentsQuery to pick some objects diff --git a/src/proc/play/dummy-play-connection.hpp b/src/proc/play/dummy-play-connection.hpp index 37681ce0f..651af57ca 100644 --- a/src/proc/play/dummy-play-connection.hpp +++ b/src/proc/play/dummy-play-connection.hpp @@ -124,8 +124,8 @@ namespace play { using asset::PTimeline; using mobject::ModelPort; using mobject::builder::ModelPortRegistry; - using lumiera::Query; using util::contains; + using lib::Query; // using lib::ScopedCollection; // using lib::Literal; using lib::eachEntry; @@ -139,7 +139,7 @@ namespace play { inline PID getPipe (string id) { - return Pipe::query("id("+id+")"); + return Pipe::query (Query ("id("+id+")")); } inline TID diff --git a/tests/components/proc/asset/basicpipetest.cpp b/tests/components/proc/asset/basicpipetest.cpp index 316c24fde..7542e1c2e 100644 --- a/tests/components/proc/asset/basicpipetest.cpp +++ b/tests/components/proc/asset/basicpipetest.cpp @@ -47,8 +47,8 @@ namespace asset { namespace test { using mobject::Session; - using lumiera::Query; - using lumiera::query::normaliseID; + using lib::Query; + using lib::query::normaliseID; @@ -107,19 +107,19 @@ namespace test { { normaliseID (pID); - PPipe pipe1 = Pipe::query ("pipe("+pID+")"); + PPipe pipe1 = Pipe::query (Query ("pipe("+pID+")")); CHECK (pipe1); CHECK (pipe1->getPipeID() == pID); string pID2 = "another-" + pID; - PPipe pipe2 = Pipe::query ("pipe("+pID2+")"); + PPipe pipe2 = Pipe::query (Query ("pipe("+pID2+")")); CHECK (pipe2); CHECK (pipe2 != pipe1); Category c1 = pipe1->ident.category; Category c2 = pipe2->ident.category; CHECK (c1 == c2); - PPipe pipe3 = Pipe::query ("pipe("+pID2+")"); + PPipe pipe3 = Pipe::query (Query ("pipe("+pID2+")")); //////////////////////////////////////////////////////////////TODO: that's broken; creating a new one instead to find the existing one, as it should be CHECK (pipe3 == pipe2); } @@ -127,7 +127,7 @@ namespace test { void create_using_default() { - PPipe pipe1 = Pipe::query (""); // "the default pipe" + PPipe pipe1 = Pipe::query (Query("")); // "the default pipe" PPipe pipe2; CHECK (pipe1); CHECK (pipe1 == Session::current->defaults (Query())); @@ -145,7 +145,7 @@ namespace test { CHECK (pipe2 == pipe1); string sID = pipe1->getStreamID(); // sort of a "default stream type" - PPipe pipe3 = Pipe::query ("stream("+sID+")"); + PPipe pipe3 = Pipe::query (Query ("stream("+sID+")")); CHECK (pipe3); CHECK (pipe3->getStreamID() == StreamType::ID(sID)); CHECK (pipe3->getProcPatt() == Session::current->defaults (Query("stream("+sID+")"))); @@ -157,7 +157,7 @@ namespace test { typedef P PPipe; /////TODO: transition to P<> typedef P PProcPatt; - PPipe thePipe = Pipe::query ("pipe("+pID+")"); + PPipe thePipe = Pipe::query (Query ("pipe("+pID+")")); CHECK (thePipe); PProcPatt thePatt = thePipe->getProcPatt(); CHECK (thePatt); @@ -171,7 +171,7 @@ namespace test { // now querying for a pipe using this pattern (created on-the-fly) // note: because the pattern is new, this new pipe will be used as // default pipe for this pattern automatically - PPipe pipe2x = Pipe::query ("pattern(another)"); + PPipe pipe2x = Pipe::query (Query ("pattern(another)")); CHECK (pattern2 == pipe2x->getProcPatt()); CHECK (pipe2x == Session::current->defaults (Query("pattern(another)"))); @@ -193,7 +193,7 @@ namespace test { CHECK (thePipe->getProcPatt()); CHECK ( pattern3 == pattern2); // but is still valid, as long as the ref is alive.... - PPipe pipe3x = Pipe::query ("pattern(another)"); + PPipe pipe3x = Pipe::query (Query ("pattern(another)")); pattern3 = pipe3x->getProcPatt(); /////TODO: transition to P<> CHECK (pattern3 != pattern2); // because pattern2 is already unlinked... CHECK (pipe3x == Session::current->defaults (Query("pattern(another)"))); diff --git a/tests/components/proc/engine/engine-interface-test.cpp b/tests/components/proc/engine/engine-interface-test.cpp index 7f7b6ea59..609df6ec7 100644 --- a/tests/components/proc/engine/engine-interface-test.cpp +++ b/tests/components/proc/engine/engine-interface-test.cpp @@ -91,7 +91,7 @@ namespace test { EngineService& engine = EngineService::instance(); EngineDiagnostics monitor(engine); - PID pipe = Pipe::query("id(dummy)"); + PID pipe = Pipe::query(lib::Query ("id(dummy)")); ModelPort port(pipe); OutputSlot& oSlot = DiagnosticOutputSlot::build(); diff --git a/tests/components/proc/mobject/builder/fixture-change-detector-test.cpp b/tests/components/proc/mobject/builder/fixture-change-detector-test.cpp index c7910c21a..f0c7d50ba 100644 --- a/tests/components/proc/mobject/builder/fixture-change-detector-test.cpp +++ b/tests/components/proc/mobject/builder/fixture-change-detector-test.cpp @@ -43,7 +43,7 @@ namespace test { using asset::Struct; using asset::Timeline; using asset::PTimeline; - using lumiera::Query; + using lib::Query; // typedef asset::ID PID; typedef asset::ID TID; @@ -56,7 +56,7 @@ namespace test { inline PID getPipe (string id) { - return Pipe::query("id("+id+")"); + return Pipe::query (Query ("id("+id+")")); } inline TID diff --git a/tests/components/proc/mobject/builder/model-port-registry-test.cpp b/tests/components/proc/mobject/builder/model-port-registry-test.cpp index d37ae5653..5eb46b70b 100644 --- a/tests/components/proc/mobject/builder/model-port-registry-test.cpp +++ b/tests/components/proc/mobject/builder/model-port-registry-test.cpp @@ -43,7 +43,7 @@ namespace test { using asset::Struct; using asset::Timeline; using asset::PTimeline; - using lumiera::Query; + using lib::Query; typedef asset::ID PID; typedef asset::ID TID; @@ -56,7 +56,7 @@ namespace test { inline PID getPipe (string id) { - return Pipe::query("id("+id+")"); + return Pipe::query (Query ("id("+id+")")); } inline TID diff --git a/tests/components/proc/mobject/builder/segmentation-datastructure-test.cpp b/tests/components/proc/mobject/builder/segmentation-datastructure-test.cpp index a39af76f2..bdaa00a90 100644 --- a/tests/components/proc/mobject/builder/segmentation-datastructure-test.cpp +++ b/tests/components/proc/mobject/builder/segmentation-datastructure-test.cpp @@ -43,7 +43,7 @@ namespace test { using asset::Struct; using asset::Timeline; using asset::PTimeline; - using lumiera::Query; + using lib::Query; // typedef asset::ID PID; typedef asset::ID TID; @@ -56,7 +56,7 @@ namespace test { inline PID getPipe (string id) { - return Pipe::query("id("+id+")"); + return Pipe::query (Query ("id("+id+")")); } inline TID diff --git a/tests/components/proc/mobject/output-mapping-test.cpp b/tests/components/proc/mobject/output-mapping-test.cpp index 5bd75c464..a36e87807 100644 --- a/tests/components/proc/mobject/output-mapping-test.cpp +++ b/tests/components/proc/mobject/output-mapping-test.cpp @@ -98,9 +98,9 @@ namespace test { Mapping map; CHECK (isnil (map)); - PPipe p1 = Pipe::query("id(hairy)"); - PPipe p2 = Pipe::query("id(furry)"); - PPipe pX = Pipe::query("id(curly)"); + PPipe p1 = Pipe::query(Query ("id(hairy)")); + PPipe p2 = Pipe::query(Query ("id(furry)")); + PPipe pX = Pipe::query(Query ("id(curly)")); map[p1] = p2; CHECK (!isnil (map)); @@ -125,9 +125,9 @@ namespace test { { Mapping m1; - PPipe p1 = Pipe::query("id(hairy)"); - PPipe p2 = Pipe::query("id(furry)"); - PPipe pi = Pipe::query("id(nappy)"); + PPipe p1 = Pipe::query(Query ("id(hairy)")); + PPipe p2 = Pipe::query(Query ("id(furry)")); + PPipe pi = Pipe::query(Query ("id(nappy)")); m1[pi] = p1; Mapping m2(m1); @@ -158,8 +158,8 @@ namespace test { Mapping map; CHECK (isnil (map)); - PPipe p1 = Pipe::query("stream(hairy)"); - PPipe p2 = Pipe::query("stream(furry)"); + PPipe p1 = Pipe::query(Query ("stream(hairy)")); + PPipe p2 = Pipe::query(Query ("stream(furry)")); CHECK (map[p1] == "master_hairy"); CHECK (map[p2] == "master_furry"); diff --git a/tests/components/proc/mobject/session/defs-manager-impl-test.cpp b/tests/components/proc/mobject/session/defs-manager-impl-test.cpp index 9df802a31..a8794ecff 100644 --- a/tests/components/proc/mobject/session/defs-manager-impl-test.cpp +++ b/tests/components/proc/mobject/session/defs-manager-impl-test.cpp @@ -45,13 +45,13 @@ namespace session { namespace test { using lib::Symbol; + using lib::Query; + using lib::query::normaliseID; using asset::Asset; using asset::AssetManager; using asset::Pipe; using asset::PPipe; using asset::Struct; - using lumiera::Query; - using lumiera::query::normaliseID; using lumiera::ConfigRules; using lumiera::query::QueryHandler; @@ -154,7 +154,7 @@ lumiera::query::setFakeBypass("stream("+sID+")"); ////////////////////////////// void forget (string pID) { - PPipe pipe = Pipe::query ("pipe("+pID+")"); + PPipe pipe = Pipe::query (Query ("pipe("+pID+")")); REQUIRE (find (pipe->getPipeID()), "test assumes pre-registered default pipe"); long cnt = pipe.use_count(); diff --git a/tests/components/proc/mobject/session/defs-manager-test.cpp b/tests/components/proc/mobject/session/defs-manager-test.cpp index 720c12b6c..20ea97b1f 100644 --- a/tests/components/proc/mobject/session/defs-manager-test.cpp +++ b/tests/components/proc/mobject/session/defs-manager-test.cpp @@ -54,8 +54,8 @@ namespace test { using asset::Pipe; using asset::PPipe; using asset::Struct; - using lumiera::Query; - using lumiera::query::normaliseID; + using lib::Query; + using lib::query::normaliseID; /** shortcut: run just a query @@ -103,13 +103,13 @@ namespace test { void retrieveSimpleDefault (string) { - PPipe pipe1 = Pipe::query (""); // "the default pipe" + PPipe pipe1 = Pipe::query (Query ("")); // "the default pipe" PPipe pipe2; // several variants to query for "the default pipe" - pipe2 = Pipe::query (""); + pipe2 = Pipe::query (Query ("")); CHECK (pipe2 == pipe1); - pipe2 = Pipe::query ("default(X)"); + pipe2 = Pipe::query (Query ("default(X)")); CHECK (pipe2 == pipe1); pipe2 = Session::current->defaults(Query ()); CHECK (pipe2 == pipe1); @@ -123,7 +123,7 @@ namespace test { void retrieveConstrainedDefault (string pID, string sID) { - PPipe pipe1 = Pipe::query (""); // "the default pipe" + PPipe pipe1 = Pipe::query (Query ("")); // "the default pipe" CHECK ( pipe1->getStreamID() != StreamType::ID(sID), "stream-ID \"%s\" not suitable for test, because " "the default-pipe \"%s\" happens to have the same " @@ -132,10 +132,10 @@ namespace test { ); string query_for_sID ("stream("+sID+")"); - PPipe pipe2 = Pipe::query (query_for_sID); + PPipe pipe2 = Pipe::query (Query (query_for_sID)); CHECK (pipe2->getStreamID() == StreamType::ID(sID)); CHECK (pipe2 != pipe1); - CHECK (pipe2 == Pipe::query (query_for_sID)); // reproducible + CHECK (pipe2 == Pipe::query (Query (query_for_sID))); // reproducible } diff --git a/tests/components/proc/mobject/session/defs-registry-impl-test.cpp b/tests/components/proc/mobject/session/defs-registry-impl-test.cpp index 05c2e5b1a..71eb343ed 100644 --- a/tests/components/proc/mobject/session/defs-registry-impl-test.cpp +++ b/tests/components/proc/mobject/session/defs-registry-impl-test.cpp @@ -34,8 +34,8 @@ #include #include -using lumiera::Query; -using lumiera::query::test::garbage_query; +using lib::Query; +using lib::query::test::garbage_query; using util::isnil; using lib::P; @@ -165,9 +165,11 @@ namespace test { { Prd px (fabricate<23>()); Q23 qx (garbage_query()); - ps[qx] = px; + UNIMPLEMENTED ("generic query key and ordering for map access");////////////////////////////////////////////////////////////////////////////////////////////TODO +// ps[qx] = px; reg_->put (px, qx); - px->instanceID = qx; + UNIMPLEMENTED ("Query building from predicate string");////////////////////////////////////////////////////////////////////////////////////////////TODO +// px->instanceID = qx;////////////////////////////////////////////////////////////////////////////////////////////TODO } } @@ -213,8 +215,10 @@ namespace test { { CHECK ( *j ); Q23 qx ((*j)->instanceID); - CHECK ( ps[qx] == (*j)); - d = lumiera::query::countPred (qx); + UNIMPLEMENTED ("generic query key and ordering for map access");////////////////////////////////////////////////////////////////////////////////////////////TODO +// CHECK ( ps[qx] == (*j));////////////////////////////////////////////////////////////////////////////////////////////TODO + UNIMPLEMENTED ("Query remolding");////////////////////////////////////////////////////////////////////////////////////////////TODO +// d = lib::query::countPred (qx);////////////////////////////////////////////////////////////////////////////////////////////TODO CHECK ( d_prev <= d ); d_prev = d; } diff --git a/tests/components/proc/mobject/session/placement-index-query-test.cpp b/tests/components/proc/mobject/session/placement-index-query-test.cpp index 17f6b2a34..29f0f1dde 100644 --- a/tests/components/proc/mobject/session/placement-index-query-test.cpp +++ b/tests/components/proc/mobject/session/placement-index-query-test.cpp @@ -39,6 +39,7 @@ namespace mobject { namespace session { namespace test { + using lib::QueryResolver; using session::PathQuery; using session::ContentsQuery; using util::isSameObject; diff --git a/tests/components/proc/mobject/session/query-resolver-test.cpp b/tests/components/proc/mobject/session/query-resolver-test.cpp index 2a57f8980..69bb07208 100644 --- a/tests/components/proc/mobject/session/query-resolver-test.cpp +++ b/tests/components/proc/mobject/session/query-resolver-test.cpp @@ -31,10 +31,8 @@ -namespace proc { -namespace mobject { -namespace session { -namespace test { +namespace lib { +namespace test{ using lib::test::showSizeof; using std::string; @@ -223,4 +221,4 @@ namespace test { LAUNCHER (QueryResolver_test, "unit session"); -}}}} // namespace proc::mobject::session::test +}} // namespace lib::test diff --git a/tests/components/proc/mobject/session/session-element-tracker-test.cpp b/tests/components/proc/mobject/session/session-element-tracker-test.cpp index 96370928c..1bed847ec 100644 --- a/tests/components/proc/mobject/session/session-element-tracker-test.cpp +++ b/tests/components/proc/mobject/session/session-element-tracker-test.cpp @@ -84,7 +84,7 @@ namespace test { - using lumiera::Query; + using lib::Query; using asset::Timeline; using asset::PTimeline; using asset::AssetManager; diff --git a/tests/components/proc/mobject/session/session-modify-parts-test.cpp b/tests/components/proc/mobject/session/session-modify-parts-test.cpp index 42ea5329e..089c49ec4 100644 --- a/tests/components/proc/mobject/session/session-modify-parts-test.cpp +++ b/tests/components/proc/mobject/session/session-modify-parts-test.cpp @@ -58,7 +58,7 @@ namespace test { using asset::PSequence; using asset::Sequence; - using lumiera::Query; + using lib::Query; typedef MORef RClip; typedef PlacementMO::ID PID; diff --git a/tests/components/proc/mobject/session/timeline-sequence-handling-test.cpp b/tests/components/proc/mobject/session/timeline-sequence-handling-test.cpp index 72ba5b60f..9d633cc9e 100644 --- a/tests/components/proc/mobject/session/timeline-sequence-handling-test.cpp +++ b/tests/components/proc/mobject/session/timeline-sequence-handling-test.cpp @@ -55,7 +55,7 @@ namespace test { using asset::PSequence; using asset::Pipe; - using lumiera::Query; + using lib::Query; /******************************************************************************** diff --git a/tests/lib/query/query-utils-test.cpp b/tests/lib/query/query-utils-test.cpp index b0af6b950..2e07842ef 100644 --- a/tests/lib/query/query-utils-test.cpp +++ b/tests/lib/query/query-utils-test.cpp @@ -32,7 +32,7 @@ #include #include -using lumiera::Query; +using lib::Query; using lib::Cmdline; using util::isnil; using util::contains; @@ -46,7 +46,7 @@ using std::endl; -namespace lumiera { +namespace lib { namespace query { namespace test{ @@ -83,7 +83,8 @@ namespace test{ void check_Query () { - cout << Query ("I am writing a test sentence.").asKey() << endl; + UNIMPLEMENTED ("generate a generic query key");////////////////////////////////////////////////////////////////////////////////////////////TODO +// cout << Query ("I am writing a test sentence.").asKey() << endl;////////////////////////////////////////////////////////////////////////////////////////////TODO } @@ -166,4 +167,4 @@ namespace test{ -}}} // namespace lumiera::query::test +}}} // namespace lib::query::test diff --git a/tests/lib/query/querydiagnostics.hpp b/tests/lib/query/querydiagnostics.hpp index 69214d32d..ddcad83ef 100644 --- a/tests/lib/query/querydiagnostics.hpp +++ b/tests/lib/query/querydiagnostics.hpp @@ -21,65 +21,56 @@ */ -#ifndef LUMIERA_TEST_QUERY_QUERYDIAGNOSTICS_H -#define LUMIERA_TEST_QUERY_QUERYDIAGNOSTICS_H +#ifndef LIB_QUERY_TEST_QUERYDIAGNOSTICS_H +#define LIB_QUERY_TEST_QUERYDIAGNOSTICS_H -#include +#include "lib/format-string.hpp" -using boost::format; +using util::_Fmt; using std::string; using std::rand; -namespace lumiera - { - namespace query - { - namespace test - { - - namespace // implementation constants - { - - format predicatePatt ("%s_%2i( %s )"); - const string garbage ("asdfghjklqwertzuiop"); +namespace lib { +namespace query{ +namespace test { - const uint MAX_DEGREE_RAND = 9; - - } - - - - inline string - garbage_term () ///< yields a random string of 3 letters - { - return str (predicatePatt - % char ('a'+ rand() % 26) - % (rand() % 100) - % garbage.substr(rand() % 17 , 3) - ); - } - - inline string - garbage_query (int degree=0) ///< fabricating (random) query strings - { - string fake; - if (!degree) - degree = 1 + rand() % MAX_DEGREE_RAND; - while (0 < --degree) - fake += garbage_term() + ", "; - fake += garbage_term() + "."; - return fake; - } - - - - - } // namespace test + namespace {// implementation constants - } // namespace query - -} // namespace lumiera + _Fmt predicatePattern ("%s_%2i( %s )"); + const string garbage ("asanisimasabibeddiboom"); + + const uint MAX_DEGREE_RAND = 9; + + } + + + + inline string + garbage_term () ///< yields a random string of 3 letters + { + return predicatePattern + % char ('a'+ rand() % 26) + % (rand() % 100) + % garbage.substr(rand() % 19 , 3); + } + + inline string + garbage_query (int degree=0) ///< fabricating (random) query strings + { + string fake; + if (!degree) + degree = 1 + rand() % MAX_DEGREE_RAND; + while (0 < --degree) + fake += garbage_term() + ", "; + fake += garbage_term() + "."; + return fake; + } + + + + +}}} // namespace lib::query::test #endif diff --git a/tests/lib/subsystem-runner-test.cpp b/tests/lib/subsystem-runner-test.cpp index f15fe9fe2..20c3ec599 100644 --- a/tests/lib/subsystem-runner-test.cpp +++ b/tests/lib/subsystem-runner-test.cpp @@ -42,6 +42,8 @@ using std::tr1::bind; using util::isnil; using util::cStr; using test::Test; +using lib::Literal; +using lib::query::extractID; using backend::Thread; @@ -50,7 +52,7 @@ namespace test { namespace { // private test classes and data... - using query::extractID; + using lib::query::extractID; /** limit for the randomly selected duration of * subsystem's running phase (milliseconds) */