diff --git a/src/common/advice.hpp b/src/common/advice.hpp index d83c33aa4..46014d1fe 100644 --- a/src/common/advice.hpp +++ b/src/common/advice.hpp @@ -90,20 +90,21 @@ */ -#ifndef LIB_ADVICE_H -#define LIB_ADVICE_H +#ifndef LUMIERA_ADVICE_H +#define LUMIERA_ADVICE_H #include "lib/error.hpp" #include "lib/null-value.hpp" -#include "lib/advice/binding.hpp" #include "lib/symbol.hpp" #include "lib/util.hpp" +#include "common/advice/binding.hpp" + #include -namespace lib { +namespace lumiera{ namespace advice { using lib::Symbol; @@ -227,7 +228,7 @@ namespace advice { * piece of advice they're looking for. * * Any advice::Provision remains inactive and thus invisible, until - * \link #setAdvice setting the concrete advice data \endlink. After that, + * \link #setAdvice setting the concrete advice data.\endlink After that, * the provided data is \em copied into the AdviceSystem and remains available * even after the original Provision goes out of scope. Consequently, it isn't * possible to \em modify advice data once set. But client code may retract @@ -271,6 +272,7 @@ namespace advice { AdviceLink::operator= (o); setSolution ( NULL ); } + return *this; } @@ -433,7 +435,7 @@ namespace advice { AD const& handleMissingSolution() const ///< @warning might segfault when used during shutdown { - return NullValue::get(); + return lib::NullValue::get(); } @@ -477,5 +479,5 @@ namespace advice { -}} // namespace lib::advice +}} // namespace lumiera::advice #endif diff --git a/src/common/advice/advice.cpp b/src/common/advice/advice.cpp index 2255de2b6..ffd8a1547 100644 --- a/src/common/advice/advice.cpp +++ b/src/common/advice/advice.cpp @@ -90,25 +90,26 @@ #include "lib/error.hpp" -#include "lib/advice.hpp" -#include "lib/advice/index.hpp" #include "lib/del-stash.hpp" #include "lib/singleton.hpp" #include "lib/symbol.hpp" #include "lib/sync.hpp" #include "lib/util.hpp" #include "include/logging.h" +#include "common/advice.hpp" +#include "common/advice/index.hpp" #include using lib::Symbol; using lib::Singleton; +using lib::DelStash; using util::unConst; typedef void (DeleterFunc)(void*); -namespace lib { +namespace lumiera{ namespace advice { namespace { // ======= implementation of the AdviceSystem ============ @@ -159,6 +160,8 @@ namespace advice { { throw error::Fatal("Unable to store Advice due to memory exhaustion"); } + ERROR_LOG_AND_IGNORE (memory, "Storing a piece of Advice") + throw error::Fatal("Unable to store Advice data"); } void diff --git a/src/common/advice/binding.cpp b/src/common/advice/binding.cpp index 82bcc491b..69bb45e77 100644 --- a/src/common/advice/binding.cpp +++ b/src/common/advice/binding.cpp @@ -21,9 +21,9 @@ * *****************************************************/ -#include "lib/advice/binding.hpp" -#include "lib/symbol.hpp" #include "lib/util.hpp" +#include "lib/symbol.hpp" +#include "common/advice/binding.hpp" #include #include @@ -41,7 +41,7 @@ using boost::hash_combine; using boost::lexical_cast; -namespace lib { +namespace lumiera{ namespace advice { LUMIERA_ERROR_DEFINE (BINDING_PATTERN_SYNTAX, "Unable to parse the given binding pattern definition"); @@ -191,4 +191,4 @@ namespace advice { -}} // namespace lib::advice +}} // namespace lumiera::advice diff --git a/src/common/advice/binding.hpp b/src/common/advice/binding.hpp index 90dc4be78..cc74d54bf 100644 --- a/src/common/advice/binding.hpp +++ b/src/common/advice/binding.hpp @@ -55,6 +55,8 @@ ** the symbolic definition is parsed, then normalised and finally, after creating the matcher ** functor, the full pattern definition can be discarded. ** + ** @remarks while binding is defined in the context of the advice system for now, + ** obviously this is the foundation of a more generic system to deal with predicate terms. ** @note as of 4/2010 this is an experimental setup and implemented just enough to work out ** the interfaces. Ichthyo expects this collaboration service to play a central role ** at various places within proc-layer. @@ -69,21 +71,22 @@ */ -#ifndef LIB_ADVICE_BINDING_H -#define LIB_ADVICE_BINDING_H +#ifndef LUMIERA_ADVICE_BINDING_H +#define LUMIERA_ADVICE_BINDING_H #include "lib/error.hpp" #include "lib/symbol.hpp" -#include "lib/query.hpp" +#include "common/query.hpp" #include #include #include -namespace lib { +namespace lumiera{ namespace advice { + using lib::Literal; using std::string; typedef size_t HashVal; @@ -228,7 +231,7 @@ namespace advice { inline Binding const& Binding::addTypeGuard() { - atoms_.insert (Atom ("advice.type."+lib::query::buildTypeID())); + atoms_.insert (Atom ("advice.type."+lumiera::query::buildTypeID())); return *this; } @@ -297,5 +300,5 @@ namespace advice { -}} // namespace lib::advice +}} // namespace lumiera::advice #endif diff --git a/src/common/advice/index.hpp b/src/common/advice/index.hpp index a98c6fc54..f9593ef42 100644 --- a/src/common/advice/index.hpp +++ b/src/common/advice/index.hpp @@ -83,24 +83,24 @@ */ -#ifndef LIB_ADVICE_INDEX_H -#define LIB_ADVICE_INDEX_H +#ifndef LUMIERA_ADVICE_INDEX_H +#define LUMIERA_ADVICE_INDEX_H #include "lib/error.hpp" -#include "lib/advice/binding.hpp" #include "lib/symbol.hpp" #include "include/logging.h" #include "lib/iter-adapter-stl.hpp" #include "lib/util-foreach.hpp" #include "lib/util.hpp" +#include "common/advice/binding.hpp" #include #include #include #include -namespace lib { +namespace lumiera{ namespace advice { namespace error = lumiera::error; @@ -249,7 +249,7 @@ namespace advice { cout << "E...:"<< (*i) << endl; } - RangeIter + lib::RangeIter allElms () { return eachElm (elms_); @@ -591,5 +591,5 @@ namespace advice { #undef VERIFY -}} // namespace lib::advice +}} // namespace lumiera::advice #endif diff --git a/src/common/config-rules.hpp b/src/common/config-rules.hpp index 71823ee3b..837e0acaa 100644 --- a/src/common/config-rules.hpp +++ b/src/common/config-rules.hpp @@ -1,5 +1,5 @@ /* - CONFIGRULES.hpp - interface for rule based configuration + CONFIG-RULES.hpp - interface for rule based configuration Copyright (C) Lumiera.org 2008, Hermann Vosseler @@ -21,7 +21,7 @@ */ -/** @file configrules.hpp +/** @file config-rules.hpp ** Interface for accessing rule based configuration. ** By using the Query template, you can pose a query in prolog syntax and get some ** existing or newly created object fulfilling the requested predicates. The actual @@ -46,33 +46,25 @@ */ -#ifndef LUMIERA_CONFIGRULES_H -#define LUMIERA_CONFIGRULES_H +#ifndef LUMIERA_CONFIG_RULES_H +#define LUMIERA_CONFIG_RULES_H #include "lib/p.hpp" -#include "lib/query.hpp" #include "lib/symbol.hpp" #include "lib/meta/generator.hpp" -#include "lib/singleton-subclass.hpp" - -//TODO: is it sensible to bring in the types explicitly here? (it's not necessary, but may be convenient...) -#include "proc/mobject/session/track.hpp" -#include "proc/asset/procpatt.hpp" -#include "proc/asset/pipe.hpp" -#include "proc/asset/timeline.hpp" -#include "proc/asset/sequence.hpp" +#include "common/query.hpp" #include -namespace lumiera { ///////TODO: shouldn't that be namespace lib? or proc? +namespace lumiera { using std::string; using lib::P; - + /////////////////////////////////////////////////////////////////////TICKET #705 this is draft/preview code; a real resolution system needs to be integrated namespace query { @@ -93,13 +85,13 @@ namespace lumiera { ///////TODO: shouldn't that be namespace lib? or proc? class Resolver { - + ///////////////////////////////////////////////////////////////TICKET #705 a real resolution system needs to be integrated }; using lib::Symbol; using lib::Literal; - using lib::Query; + using lumiera::Query; /** placeholder definition for later. * @todo intention is to integrate with lib::Symbol @@ -208,34 +200,6 @@ namespace lumiera { ///////TODO: shouldn't that be namespace lib? or proc? - /* ============= global configuration ==================== */ - - /** - * the list of all concrete types participating in the - * rule based config query system - */ - typedef lib::meta::Types < proc::mobject::session::Track - , proc::asset::Pipe - , const proc::asset::ProcPatt - , proc::asset::Timeline - , proc::asset::Sequence - > ::List - InterfaceTypes; - - /** - * user-visible Interface to the ConfigRules subsystem. - * Configured as Singleton (with hidden Implementation class) - */ - class ConfigRules - : public query::ConfigRules - { - - public: - static lib::SingletonSub instance; - - }; - - namespace query { diff --git a/src/common/query.hpp b/src/common/query.hpp index 277bdc019..0b4065d82 100644 --- a/src/common/query.hpp +++ b/src/common/query.hpp @@ -39,7 +39,7 @@ #include -namespace lib { +namespace lumiera { using lib::IxID; using lib::Symbol; diff --git a/src/common/query/config-rules.cpp b/src/common/query/config-rules.cpp index eb8ddda25..f18b7b1c3 100644 --- a/src/common/query/config-rules.cpp +++ b/src/common/query/config-rules.cpp @@ -23,7 +23,7 @@ #include "lib/error.hpp" -#include "common/configrules.hpp" +#include "common/config-rules.hpp" #include "proc/mobject/session/query/fake-configrules.hpp" @@ -36,16 +36,6 @@ namespace lumiera { } // namespace query - namespace { - - /** type of the actual ConfigRules implementation to use */ - lib::singleton::UseSubclass typeinfo; - } - - - /** Singleton factory instance, parametrised to actual impl. type. */ - lib::SingletonSub ConfigRules::instance (typeinfo); - @@ -59,8 +49,5 @@ namespace lumiera { bool isFakeBypass (string const& q) { return q == fakeBypass; } /////////////////////////////////////////////////////////////////////////////TICKET 710 - } // namespace query - - - + }// namespace query } // namespace lumiera diff --git a/src/common/query/defs-manager.cpp b/src/common/query/defs-manager-impl.hpp similarity index 63% rename from src/common/query/defs-manager.cpp rename to src/common/query/defs-manager-impl.hpp index 4da7e4845..ae277adf4 100644 --- a/src/common/query/defs-manager.cpp +++ b/src/common/query/defs-manager-impl.hpp @@ -1,5 +1,5 @@ /* - DefsManager - access to preconfigured default objects and definitions + DEFS-MANAGER-IMPL.h - access to preconfigured default objects and definitions Copyright (C) Lumiera.org 2008, Hermann Vosseler @@ -18,25 +18,46 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -* *****************************************************/ +*/ -#include "proc/mobject/session/defs-manager.hpp" -#include "proc/mobject/session/defs-registry.hpp" -#include "common/configrules.hpp" +/** @file defs-manager-impl.hpp + ** Implementation of the core defaults-management operations. + ** These generic implementations are factored out into a separate header (include) + ** to improve readability. To actually generate code, it is necessary to pull in this + ** include to create explicit template instantiations with the concrete types to be used + ** for definition and retrieval of default-configured objects. + ** + ** For the standard use-case within the session / Proc-Layer, this is performed for the + ** core MObject types, alongside with the definition of the generic config-query-resolver. + ** + ** @see config-resolver.cpp definition of the explicit specialisiations for the session + ** @see proc::ConfigResolver + ** + */ + + + + +#ifndef LUMIERA_QUERY_DEFS_MANAGER_IMPL_H +#define LUMIERA_QUERY_DEFS_MANAGER_IMPL_H + + +#include "common/query/defs-manager.hpp" +#include "common/query/defs-registry.hpp" +#include "common/config-rules.hpp" #include "lib/format-string.hpp" #include "lib/error.hpp" using util::_Fmt; -using lumiera::ConfigRules; +using proc::ConfigResolver; using lumiera::query::QueryHandler; using lumiera::query::LUMIERA_ERROR_CAPABILITY_QUERY; -namespace proc { -namespace mobject { -namespace session { +namespace lumiera{ +namespace query { @@ -61,7 +82,7 @@ namespace session { DefsManager::search (const Query& capabilities) { P res; - QueryHandler& typeHandler = ConfigRules::instance(); + QueryHandler& typeHandler = ConfigResolver::instance(); for (DefsRegistry::Iter i = defsRegistry->candidates(capabilities); bool(*i) ; ++i ) { @@ -79,7 +100,7 @@ namespace session { DefsManager::create (const Query& capabilities) { P res; - QueryHandler& typeHandler = ConfigRules::instance(); + QueryHandler& typeHandler = ConfigResolver::instance(); typeHandler.resolve (res, capabilities); if (res) defsRegistry->put (res, capabilities); @@ -92,7 +113,7 @@ namespace session { DefsManager::define (const P& defaultObj, const Query& capabilities) { P candidate (defaultObj); - QueryHandler& typeHandler = ConfigRules::instance(); + QueryHandler& typeHandler = ConfigResolver::instance(); typeHandler.resolve (candidate, capabilities); if (!candidate) return false; @@ -128,48 +149,5 @@ namespace session { return res; } -}}} // namespace mobject::session - - - - - - - /***************************************************************/ - /* explicit template instantiations for querying various Types */ - /***************************************************************/ - -#include "proc/asset/procpatt.hpp" -#include "proc/asset/pipe.hpp" -#include "proc/asset/timeline.hpp" -#include "proc/asset/sequence.hpp" -#include "proc/mobject/session/track.hpp" - -namespace proc { -namespace mobject { -namespace session { - - - using asset::Pipe; - using asset::PPipe; - using asset::ProcPatt; - using asset::PProcPatt; - using asset::Timeline; - using asset::PTimeline; - using asset::Sequence; - using asset::PSequence; - - using mobject::session::Track; - using mobject::session::PTrack; - - template PPipe DefsManager::operator() (Query const&); - template PProcPatt DefsManager::operator() (Query const&); - template PTrack DefsManager::operator() (Query const&); - template PTimeline DefsManager::operator() (Query const&); - template PSequence DefsManager::operator() (Query const&); - - template bool DefsManager::define (PPipe const&, Query const&); - template bool DefsManager::forget (PPipe const&); - - -}}} // namespace proc::mobject::session +}} // namespace lumiera::query +#endif /* LUMIERA_QUERY_DEFS_MANAGER_IMPL_H */ diff --git a/src/common/query/defs-manager.hpp b/src/common/query/defs-manager.hpp index f514db858..41f2b4abc 100644 --- a/src/common/query/defs-manager.hpp +++ b/src/common/query/defs-manager.hpp @@ -21,25 +21,24 @@ */ -#ifndef PROC_MOBJECT_SESSION_DEFS_MANAGER_H -#define PROC_MOBJECT_SESSION_DEFS_MANAGER_H +#ifndef LUMIERA_QUERY_DEFS_MANAGER_H +#define LUMIERA_QUERY_DEFS_MANAGER_H #include "lib/p.hpp" -#include "lib/query.hpp" +#include "common/query.hpp" #include #include -namespace proc { -namespace mobject { -namespace session { +namespace lumiera{ +namespace query { using lib::P; - using lib::Query; + using lumiera::Query; using boost::scoped_ptr; namespace impl { class DefsRegistry; } @@ -126,5 +125,5 @@ namespace session { -}}} // namespace proc::mobject::session +}} // namespace lumiera::query #endif diff --git a/src/common/query/defs-registry.hpp b/src/common/query/defs-registry.hpp index d4f6b5f77..6f849f0c4 100644 --- a/src/common/query/defs-registry.hpp +++ b/src/common/query/defs-registry.hpp @@ -36,15 +36,15 @@ -#ifndef PROC_MOBJECT_SESSION_DEFS_REGISTRY_H -#define PROC_MOBJECT_SESSION_DEFS_REGISTRY_H +#ifndef LUMIERA_QUERY_DEFS_REGISTRY_H +#define LUMIERA_QUERY_DEFS_REGISTRY_H -#include "lib/sync-classlock.hpp" -#include "lib/query.hpp" +#include "lib/p.hpp" #include "lib/util.hpp" #include "lib/util-foreach.hpp" -#include "lib/p.hpp" +#include "lib/sync-classlock.hpp" +#include "common/query.hpp" #include #include @@ -54,12 +54,10 @@ #include -namespace proc { -namespace mobject { -namespace session { +namespace lumiera{ +namespace query { using lib::P; - using lib::Query; using lib::ClassLock; using std::tr1::weak_ptr; @@ -97,7 +95,7 @@ namespace session { weak_ptr objRef; Record (const Query& q, const P& obj) - : degree (lib::query::countPred ("TODO")),//q)),////////////////////////////////////////////////////////////////////////////////////////////TODO + : degree (lumiera::query::countPred ("TODO")),//q)),////////////////////////////////////////////////////////////////////////////////////////////TODO query (q), objRef (obj) { @@ -343,5 +341,5 @@ namespace session { using impl::DefsRegistry; -}}} // namespace proc::mobject::session +}} // namespace lumiera::query #endif diff --git a/src/common/query/query-resolver.cpp b/src/common/query/query-resolver.cpp index 64f38d3b7..60b7a6a45 100644 --- a/src/common/query/query-resolver.cpp +++ b/src/common/query/query-resolver.cpp @@ -21,10 +21,10 @@ * *****************************************************/ -#include "lib/query-resolver.hpp" #include "lib/multifact-arg.hpp" +#include "common/query/query-resolver.hpp" -namespace lib { +namespace lumiera { @@ -55,14 +55,16 @@ namespace lib { /* == dispatch to resolve typed queries == */ - using factory::BuildRefcountPtr; + using lib::factory::BuildRefcountPtr; + using lib::factory::MultiFact; + /** factory used as dispatcher table * for resolving typed queries */ - 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; // + 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; // struct QueryDispatcher : DispatcherTable @@ -119,4 +121,4 @@ namespace lib { -} // namespace lib +} // namespace lumiera diff --git a/src/common/query/query-resolver.hpp b/src/common/query/query-resolver.hpp index 849e8c1e1..ece3f42cc 100644 --- a/src/common/query/query-resolver.hpp +++ b/src/common/query/query-resolver.hpp @@ -21,11 +21,11 @@ */ -#ifndef LIB_QUERY_RESOLVER_H -#define LIB_QUERY_RESOLVER_H +#ifndef LUMIERA_QUERY_RESOLVER_H +#define LUMIERA_QUERY_RESOLVER_H -#include "lib/query.hpp" #include "lib/iter-adapter.hpp" +#include "common/query.hpp" #include #include @@ -35,7 +35,7 @@ using std::tr1::function; -namespace lib { +namespace lumiera { using boost::noncopyable; using boost::scoped_ptr; @@ -162,5 +162,5 @@ namespace lib { } -} // namespace lib +} // namespace lumiera #endif diff --git a/src/common/query/query.cpp b/src/common/query/query.cpp index a9541e079..0712c8479 100644 --- a/src/common/query/query.cpp +++ b/src/common/query/query.cpp @@ -21,10 +21,10 @@ * *****************************************************/ -#include "lib/query.hpp" #include "lib/util.hpp" #include "lib/symbol.hpp" #include "include/logging.h" +#include "common/query.hpp" #include #include @@ -40,7 +40,7 @@ using util::contains; using util::isnil; -namespace lib { +namespace lumiera { namespace query { namespace { // local definitions @@ -147,4 +147,4 @@ namespace lib { -} // namespace lib +} // namespace lumiera diff --git a/src/lib/time/mutation.cpp b/src/lib/time/mutation.cpp index 718af5244..182d5a7bd 100644 --- a/src/lib/time/mutation.cpp +++ b/src/lib/time/mutation.cpp @@ -205,7 +205,7 @@ namespace time { materialiseGridPoint (Symbol gridID, int steps) { REQUIRE (!isnil (gridID)); - PQuant grid = Quantiser::retrieve(gridID); + PQuant grid;//////////TODO = Quantiser::retrieve(gridID); return Offset(grid->timeOf(0), grid->timeOf(steps)); } diff --git a/src/proc/asset/meta/time-grid.cpp b/src/proc/asset/meta/time-grid.cpp index d72878f03..4ef8cdfe0 100644 --- a/src/proc/asset/meta/time-grid.cpp +++ b/src/proc/asset/meta/time-grid.cpp @@ -27,9 +27,8 @@ #include "lib/time/quantiser.hpp" #include "lib/time/timevalue.hpp" #include "lib/time/display.hpp" -#include "lib/advice.hpp" +#include "common/advice.hpp" #include "lib/util.hpp" -//#include "include/logging.h" #include #include @@ -67,7 +66,7 @@ namespace meta { using lib::time::FixedFrameQuantiser; using std::tr1::dynamic_pointer_cast; - namespace advice = lib::advice; + namespace advice = lumiera::advice; namespace { diff --git a/src/proc/asset/pipe.hpp b/src/proc/asset/pipe.hpp index 60903c62a..aa731b61f 100644 --- a/src/proc/asset/pipe.hpp +++ b/src/proc/asset/pipe.hpp @@ -27,7 +27,7 @@ #include "proc/asset/struct.hpp" #include "proc/asset/procpatt.hpp" #include "proc/streamtype.hpp" -#include "lib/query.hpp" +#include "common/query.hpp" #include @@ -36,7 +36,7 @@ namespace proc { namespace asset { - using lib::Query; + using lumiera::Query; using std::string; class Pipe; diff --git a/src/proc/asset/struct-factory-impl.hpp b/src/proc/asset/struct-factory-impl.hpp index cf3658ef4..e6fa6308b 100644 --- a/src/proc/asset/struct-factory-impl.hpp +++ b/src/proc/asset/struct-factory-impl.hpp @@ -42,12 +42,12 @@ #include "proc/mobject/session/element-query.hpp" #include "proc/mobject/session/session-query.hpp" #include "proc/mobject/session/scope.hpp" -#include "common/configrules.hpp" +#include "common/config-rules.hpp" +#include "common/query.hpp" #include "proc/asset/timeline.hpp" #include "proc/asset/sequence.hpp" #include "proc/asset/procpatt.hpp" #include "proc/asset/pipe.hpp" -#include "lib/query.hpp" #include "proc/asset/struct-scheme.hpp" @@ -68,8 +68,9 @@ namespace asset { using lib::Symbol; using util::isnil; using util::contains; + using lumiera::Query; using lumiera::query::LUMIERA_ERROR_CAPABILITY_QUERY; - using lib::query::extractID; + using lumiera::query::extractID; using proc::mobject::Session; using proc::mobject::MObject; diff --git a/src/proc/asset/struct.cpp b/src/proc/asset/struct.cpp index 9f5ede87b..cebb9a344 100644 --- a/src/proc/asset/struct.cpp +++ b/src/proc/asset/struct.cpp @@ -23,22 +23,23 @@ #include "proc/asset/struct.hpp" #include "proc/assetmanager.hpp" -#include "common/configrules.hpp" +#include "proc/config-resolver.hpp" #include "proc/asset/struct-factory-impl.hpp" #include "lib/util.hpp" #include "lib/symbol.hpp" #include "include/logging.h" +#include "common/query.hpp" #include using boost::format; using lib::Symbol; -using lib::query::normaliseID; +using lumiera::query::normaliseID; using lumiera::query::QueryHandler; -using lumiera::ConfigRules; +using proc::ConfigResolver; using util::contains; @@ -101,7 +102,7 @@ namespace asset { StructFactory::operator() (Query const& capabilities) { P res; - QueryHandler& typeHandler = ConfigRules::instance(); + QueryHandler& typeHandler = ConfigResolver::instance(); typeHandler.resolve (res, capabilities); if (res) diff --git a/src/proc/asset/struct.hpp b/src/proc/asset/struct.hpp index 87e07d392..ebd9fbb5b 100644 --- a/src/proc/asset/struct.hpp +++ b/src/proc/asset/struct.hpp @@ -57,9 +57,9 @@ #ifndef ASSET_STRUCT_H #define ASSET_STRUCT_H -#include "proc/asset.hpp" -#include "lib/query.hpp" #include "lib/symbol.hpp" +#include "proc/asset.hpp" +#include "common/query.hpp" #include #include @@ -72,7 +72,7 @@ namespace asset { using std::string; using boost::scoped_ptr; - using lib::Query; + using lumiera::Query; using lib::Symbol; class Struct; diff --git a/src/proc/config-resolver.cpp b/src/proc/config-resolver.cpp index eb8ddda25..d8dab278a 100644 --- a/src/proc/config-resolver.cpp +++ b/src/proc/config-resolver.cpp @@ -1,6 +1,6 @@ /* - ConfigRules - interface for rule based configuration + ConfigResolver - concrete setup for rule based configuration Copyright (C) Lumiera.org 2008, Hermann Vosseler @@ -23,18 +23,12 @@ #include "lib/error.hpp" -#include "common/configrules.hpp" +#include "proc/config-resolver.hpp" #include "proc/mobject/session/query/fake-configrules.hpp" -namespace lumiera { - namespace query { - - LUMIERA_ERROR_DEFINE (CAPABILITY_QUERY, "unresolvable capability query"); - - - } // namespace query +namespace proc { namespace { @@ -44,23 +38,55 @@ namespace lumiera { /** Singleton factory instance, parametrised to actual impl. type. */ - lib::SingletonSub ConfigRules::instance (typeinfo); + lib::SingletonSub ConfigResolver::instance (typeinfo); +} // namespace proc + + + + + + + + +#include "common/query/defs-manager-impl.hpp" + + + + /***************************************************************/ + /* explicit template instantiations for querying various Types */ + /***************************************************************/ + +#include "proc/asset/procpatt.hpp" +#include "proc/asset/pipe.hpp" +#include "proc/asset/timeline.hpp" +#include "proc/asset/sequence.hpp" +#include "proc/mobject/session/track.hpp" + +namespace lumiera{ +namespace query { + + using proc::asset::Pipe; + using proc::asset::PPipe; + using proc::asset::ProcPatt; + using proc::asset::PProcPatt; + using proc::asset::Timeline; + using proc::asset::PTimeline; + using proc::asset::Sequence; + using proc::asset::PSequence; + + using proc::mobject::session::Track; + using proc::mobject::session::PTrack; + + template PPipe DefsManager::operator() (Query const&); + template PProcPatt DefsManager::operator() (Query const&); + template PTrack DefsManager::operator() (Query const&); + template PTimeline DefsManager::operator() (Query const&); + template PSequence DefsManager::operator() (Query const&); + + template bool DefsManager::define (PPipe const&, Query const&); + template bool DefsManager::forget (PPipe const&); - - namespace query { - namespace { // local definitions: implementing a backdoor for tests - string fakeBypass; - } - - void setFakeBypass(string const& q) { fakeBypass = q; } - bool isFakeBypass (string const& q) { return q == fakeBypass; } - /////////////////////////////////////////////////////////////////////////////TICKET 710 - - } // namespace query - - - -} // namespace lumiera +}} // namespace lumiera::query diff --git a/src/proc/config-resolver.hpp b/src/proc/config-resolver.hpp index 71823ee3b..b353b8c13 100644 --- a/src/proc/config-resolver.hpp +++ b/src/proc/config-resolver.hpp @@ -1,8 +1,9 @@ /* - CONFIGRULES.hpp - interface for rule based configuration + CONFIG-RESOLVER.hpp - concrete setup for rule based configuration Copyright (C) Lumiera.org 2008, Hermann Vosseler + 2012 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -21,22 +22,12 @@ */ -/** @file configrules.hpp - ** Interface for accessing rule based configuration. - ** By using the Query template, you can pose a query in prolog syntax and get some - ** existing or newly created object fulfilling the requested predicates. The actual - ** implementation is hidden behind the #instance (Singleton factory). As of 1/2008, - ** it is \e planned to use an embedded YAP Prolog system at some point in the future, - ** for now we use a \link MockConfigRules mock implementation \endlink employing a - ** preconfigured Map. - ** - ** Fully implementing this facility would require the participating objects to register capabilities - ** they want to provide, together with functors carrying out the necessary configuration steps. - ** All details and consequences of this approach still have to be worked out... - ** - ** @note this is rather a scrapbook and in flux... don't take this code too literal! +/** @file config-resolver.hpp + ** Definition of the concrete frontend for rule based configuration within the session. + ** + ** @note this is placeholder code using a preliminary/mock implementation... don't take this code too literal! ** @todo clarify the relation of config query and query-for-defaults ///////////////TICKET #705 - ** + ** ** @see lumiera::Query ** @see mobject::session::DefsManager ** @see asset::StructFactory @@ -46,164 +37,23 @@ */ -#ifndef LUMIERA_CONFIGRULES_H -#define LUMIERA_CONFIGRULES_H +#ifndef PROC_CONFIG_RESOLVER +#define PROC_CONFIG_RESOLVER -#include "lib/p.hpp" -#include "lib/query.hpp" -#include "lib/symbol.hpp" -#include "lib/meta/generator.hpp" +#include "common/query.hpp" +#include "common/config-rules.hpp" #include "lib/singleton-subclass.hpp" -//TODO: is it sensible to bring in the types explicitly here? (it's not necessary, but may be convenient...) +// types for explicit specialisations.... #include "proc/mobject/session/track.hpp" #include "proc/asset/procpatt.hpp" #include "proc/asset/pipe.hpp" #include "proc/asset/timeline.hpp" #include "proc/asset/sequence.hpp" -#include - -namespace lumiera { ///////TODO: shouldn't that be namespace lib? or proc? - - using std::string; - using lib::P; - - - - - namespace query { - - // The intention is to support the following style of Prolog code - // - // resolve(O, Cap) :- find(O), capabilities(Cap). - // resolve(O, Cap) :- make(O), capabilities(Cap). - // capabilities(Q) :- call(Q). - // - // stream(T, mpeg) :- type(T, track), type(P, pipe), resolve(P, stream(P,mpeg)), placed_to(P, T). - // - // The type guard is inserted automatically, while the predicate implementations for - // find/1, make/1, stream/2, and placed_to/2 are to be provided by the target types. - // - // As a example, the goal ":-retrieve(T, stream(T,mpeg))." would search a Track object, try to - // retrieve a pipe object with stream-type=mpeg and associate the track with this Pipe. The - // predicate "stream(P,mpeg)" needs to be implemented (natively) for the pipe object. - - class Resolver - { - - }; - - - using lib::Symbol; - using lib::Literal; - using lib::Query; - -/** placeholder definition for later. - * @todo intention is to integrate with lib::Symbol - */ -#define SYMBOL uint - - - template - < SYMBOL SYM, // Predicate symbol - typename SIG = bool(string) // Signature - > - class Pred - { }; - - /** - * the "back side" interface towards the classes participating - * in the configuration system (the config system will be - * delivering instances of these classes for a given query). - * This one currently is just brainstorming. The idea is that - * a participating class would provide such and TypeHandler - * implementing the predicates which make sense for this special - * type of object. Registering such a TypeHandler should create - * the necessary handler functions to be installed into - * the Prolog system. - * @todo it can't be done exactly this way, but I leave it in - * as a reminder for later, to show the intention - */ - template - class TypeHandler - { - static const TY NIL; - - template - TY find (Pred capability); - - template - TY make (Pred capability, TY& refObj =NIL); - }; - - /** - * the "front side" interface: the Proc-Layer code can - * use this QueryHandler to retrieve instances of the - * type TY fulfilling the given Query. To start with, - * we use a mock implementation. - * (this code works and is already used 2/2008) - * @see lumiera::query::LookupPreconfigured - * @see lumiera::query::MockTable - */ - template - class QueryHandler - { - protected: - virtual ~QueryHandler() { } - public: - /** try to find or create an object of type TY - * fulfilling the given query. - * @param solution object fulfilling the query. Will be bound or - * unified (in case it's already bound) with the first solution. - * @query any goals to be fulfilled by the solution. - * @return false if resolution failed. In this case, solution ptr is empty. - */ - virtual bool resolve (P& solution, const Query& q) = 0; - }; - - // TODO: the Idea is to provide specialisations for the concrete types - // we want to participate in the ConfigRules system.... - // Thus we get the possibility to create a specific return type, - // e.g. return a P but a Placement, using the appropriate factory. - // Of course then the definitions need to be split up in separate headers. - - - - - - /** - * Generic query interface for retrieving objects matching - * some capability query. To be instantiated using a typelist, - * thus inheriting from the Handler classes for each type. In - * the (future) version using YAP Prolog, this will drive the - * generation and registration of the necessary predicate - * implementations for each concrete type, using the specialisations - * given alongside with the types. For now it just serves to generate - * the necessary resolve(Query) virtual functions (implemented - * by MockConfigRules) - */ - template - class ConfigRules - : public lib::meta::InstantiateForEach - { - protected: - ConfigRules () {} - virtual ~ConfigRules() {} - - public: - // TODO: find out what operations we need to support here for the »real solution« (using Prolog) - }; - - - - - LUMIERA_ERROR_DECLARE (CAPABILITY_QUERY); ///< unresolvable capability query. - - } // namespace query - +namespace proc { @@ -226,29 +76,15 @@ namespace lumiera { ///////TODO: shouldn't that be namespace lib? or proc? * user-visible Interface to the ConfigRules subsystem. * Configured as Singleton (with hidden Implementation class) */ - class ConfigRules - : public query::ConfigRules + class ConfigResolver + : public lumiera::query::ConfigRules { public: - static lib::SingletonSub instance; + static lib::SingletonSub instance; }; - - - namespace query { - - /** backdoor for tests: the next config query with this query string - * will magically succeed with every candidate object provided. This - * is currently necessary to get objects into the defaults manager, - * as the query system is not able to do real query resolution */ - void setFakeBypass(string const& q); - bool isFakeBypass (string const& q); - /////////////////////////////////////////////////////////////////////////////TICKET 710 - - } // namespace query - -} // namespace lumiera +} // namespace proc #endif diff --git a/src/proc/control/styperegistry.hpp b/src/proc/control/styperegistry.hpp index ed77eb43a..26ca7f3b6 100644 --- a/src/proc/control/styperegistry.hpp +++ b/src/proc/control/styperegistry.hpp @@ -38,7 +38,7 @@ #include "proc/control/stypemanager.hpp" -//#include "lib/query.hpp" +//#include "common/query.hpp" //#include "lib/util.hpp" //#include "lib/p.hpp" diff --git a/src/proc/mobject/builder/operationpoint.hpp b/src/proc/mobject/builder/operationpoint.hpp index fc534ffc1..981d7a75e 100644 --- a/src/proc/mobject/builder/operationpoint.hpp +++ b/src/proc/mobject/builder/operationpoint.hpp @@ -25,7 +25,7 @@ #define MOBJECT_BUILDER_OPERATIONPOINT_H //#include "proc/engine/procnode.hpp" /////TODO can we get rid of this header here? -#include "lib/query.hpp" +//#include "common/query.hpp" #include #include diff --git a/src/proc/mobject/output-designation.cpp b/src/proc/mobject/output-designation.cpp index 92fcccd62..adbc33171 100644 --- a/src/proc/mobject/output-designation.cpp +++ b/src/proc/mobject/output-designation.cpp @@ -43,16 +43,16 @@ #include "proc/mobject/placement-ref.hpp" #include "proc/mobject/output-designation.hpp" #include "proc/mobject/output-mapping.hpp" -#include "common/configrules.hpp" +#include "proc/config-resolver.hpp" #include #include -using lumiera::query::QueryHandler; -using lumiera::ConfigRules; using lumiera::Symbol; -using lib::query::removeTerm; -using lib::query::extractID; +using lumiera::query::QueryHandler; +using lumiera::query::removeTerm; +using lumiera::query::extractID; +using proc::ConfigResolver; namespace proc { namespace mobject { @@ -168,7 +168,7 @@ namespace mobject { resolveQuery (Query const& query4pipe) { PPipe res; - QueryHandler& typeHandler = ConfigRules::instance(); + QueryHandler& typeHandler = ConfigResolver::instance(); typeHandler.resolve (res, query4pipe); HashVal resulting_targetPipeID (res? (HashVal)res->getID() : 0 ); return resulting_targetPipeID; diff --git a/src/proc/mobject/output-mapping.hpp b/src/proc/mobject/output-mapping.hpp index ae57ef93e..0138a2321 100644 --- a/src/proc/mobject/output-mapping.hpp +++ b/src/proc/mobject/output-mapping.hpp @@ -52,11 +52,11 @@ #ifndef PROC_MOBJECT_OUTPUT_MAPPING_H #define PROC_MOBJECT_OUTPUT_MAPPING_H +#include "lib/error.hpp" +#include "lib/util.hpp" #include "proc/asset/pipe.hpp" #include "lib/bool-checkable.hpp" -#include "lib/error.hpp" -#include "lib/query.hpp" -#include "lib/util.hpp" +#include "common/query.hpp" #include #include @@ -96,7 +96,7 @@ namespace mobject { }//(End) type rebinding helper namespace error = lumiera::error; - using lib::Query; + using lumiera::Query; using asset::HashVal; @@ -213,7 +213,7 @@ namespace mobject { * This operation is invoked when client code accesses * the result of an OutputMapping query. * @return result of invoking the configured \c DEF::output functor - * @throw error::Logic when resoving an \em unconnected mapping + * @throw error::Logic when resolving an \em unconnected mapping */ operator Target() { diff --git a/src/proc/mobject/session.hpp b/src/proc/mobject/session.hpp index 5b5c90d70..b60ef247a 100644 --- a/src/proc/mobject/session.hpp +++ b/src/proc/mobject/session.hpp @@ -51,7 +51,7 @@ #include "proc/mobject/placement.hpp" #include "proc/mobject/mobject-ref.hpp" -#include "proc/mobject/session/defs-manager.hpp" ////////////////////////////TICKET #643 forward declare this? +#include "common/query/defs-manager.hpp" ////////////////////////////TICKET #643 forward declare this? #include "lib/ref-array.hpp" #include "lib/singleton.hpp" #include "lib/symbol.hpp" @@ -107,7 +107,7 @@ namespace mobject { : boost::noncopyable { protected: - typedef session::DefsManager& DefaultsAccess; + typedef lumiera::query::DefsManager& DefaultsAccess; typedef session::ElementQuery& ElementsAccess; typedef lib::RefArray& TimelineAccess; typedef lib::RefArray& SequenceAccess; diff --git a/src/proc/mobject/session/locatingpin.cpp b/src/proc/mobject/session/locatingpin.cpp index ac24622a5..126edd1ef 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 (lib::Query("pipe(master)")); // yet another idiotic dummy + return asset::Pipe::query (lumiera::Query("pipe(master)")); // yet another idiotic dummy } diff --git a/src/proc/mobject/session/mobjectfactory.cpp b/src/proc/mobject/session/mobjectfactory.cpp index 4890e3c3a..62c9ce9d6 100644 --- a/src/proc/mobject/session/mobjectfactory.cpp +++ b/src/proc/mobject/session/mobjectfactory.cpp @@ -30,6 +30,9 @@ #include "proc/mobject/session/binding.hpp" #include "proc/asset/clip.hpp" #include "proc/asset/effect.hpp" +#include "common/query/defs-manager.hpp" + +using lumiera::query::DefsManager; namespace proc { namespace mobject { diff --git a/src/proc/mobject/session/mobjectfactory.hpp b/src/proc/mobject/session/mobjectfactory.hpp index 217ddd33d..7eb55dc91 100644 --- a/src/proc/mobject/session/mobjectfactory.hpp +++ b/src/proc/mobject/session/mobjectfactory.hpp @@ -29,6 +29,10 @@ #include "lib/symbol.hpp" +namespace lumiera { +namespace query { + class DefsManager; +}} namespace proc { namespace asset { @@ -52,7 +56,6 @@ namespace session { class Label; class Binding; - class DefsManager; class MObjectFactory @@ -64,7 +67,7 @@ namespace session { public: - Placement operator() (DefsManager&); + Placement operator() (lumiera::query::DefsManager&); Placement operator() (asset::Clip const&, asset::Media const&); Placement operator() (asset::Clip const&, vector); Placement operator() (asset::EntryID const&); diff --git a/src/proc/mobject/session/placement-index-query-resolver.cpp b/src/proc/mobject/session/placement-index-query-resolver.cpp index 59242cea5..4b4b9bb93 100644 --- a/src/proc/mobject/session/placement-index-query-resolver.cpp +++ b/src/proc/mobject/session/placement-index-query-resolver.cpp @@ -39,10 +39,10 @@ namespace session { using boost::scoped_ptr; - using lib::Goal; - using lib::Query; - using lib::Resolution; - using lib::getResultTypeID; + using lumiera::Goal; + using lumiera::Query; + using lumiera::Resolution; + using lumiera::getResultTypeID; typedef PlacementIndex::ID PID; @@ -194,7 +194,7 @@ namespace session { * there is a smart-ptr managing this ResultSet. */ class ResultSet - : public lib::Resolution + : public lumiera::Resolution { ContentFilter acceptable_; ExplorerBuilder buildExploartion_; @@ -325,7 +325,7 @@ namespace session { bool PlacementIndexQueryResolver::canHandleQuery(QID qID) const { - return qID.kind == Goal::DISCOVERY + return qID.kind == Goal::DISCOVERY &&( qID.type == getResultTypeID >() ||qID.type == getResultTypeID >() ||qID.type == getResultTypeID >() diff --git a/src/proc/mobject/session/placement-index-query-resolver.hpp b/src/proc/mobject/session/placement-index-query-resolver.hpp index 1d459f820..984ef9e62 100644 --- a/src/proc/mobject/session/placement-index-query-resolver.hpp +++ b/src/proc/mobject/session/placement-index-query-resolver.hpp @@ -59,7 +59,7 @@ #include "proc/mobject/session/placement-index.hpp" #include "proc/mobject/session/scope-query.hpp" -#include "lib/query.hpp" +#include "common/query.hpp" #include @@ -69,6 +69,7 @@ namespace mobject { namespace session { using std::tr1::function; + using lumiera::Goal; typedef PlacementIndex& IndexLink(void); @@ -87,7 +88,7 @@ namespace session { * * more generally, any ScopeQuery with these properties, in some variations */ class PlacementIndexQueryResolver - : public lib::QueryResolver + : public lumiera::QueryResolver { function _getIndex; @@ -106,7 +107,7 @@ namespace session { void defineHandling(); template - lib::Resolution* resolutionFunction (Goal const& goal); + lumiera::Resolution* resolutionFunction (Goal const& goal); public: diff --git a/src/proc/mobject/session/query/fake-configrules.cpp b/src/proc/mobject/session/query/fake-configrules.cpp index f90543aa6..7f7bfc274 100644 --- a/src/proc/mobject/session/query/fake-configrules.cpp +++ b/src/proc/mobject/session/query/fake-configrules.cpp @@ -27,7 +27,7 @@ #include "proc/mobject/session/track.hpp" #include "proc/asset/procpatt.hpp" #include "proc/asset/pipe.hpp" -#include "lib/query.hpp" +#include "common/query.hpp" #include "include/logging.h" @@ -53,7 +53,7 @@ namespace session { using asset::PProcPatt; // using lumiera::query::extractID; - using lib::query::removeTerm; + using lumiera::query::removeTerm; namespace { diff --git a/src/proc/mobject/session/query/fake-configrules.hpp b/src/proc/mobject/session/query/fake-configrules.hpp index cb3bf899f..48f582a49 100644 --- a/src/proc/mobject/session/query/fake-configrules.hpp +++ b/src/proc/mobject/session/query/fake-configrules.hpp @@ -41,8 +41,9 @@ #define MOBJECT_SESSION_QUERY_FAKECONFIGRULES_H #include "proc/mobject/session.hpp" -#include "common/configrules.hpp" +#include "proc/config-resolver.hpp" #include "lib/util.hpp" +#include "lib/p.hpp" #include #include @@ -63,11 +64,12 @@ namespace session { using asset::PProcPatt; using proc::mobject::Session; using lib::meta::InstantiateChained; + using lib::P; - 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 lumiera::Query; + using lumiera::query::removeTerm; //////////////TODO better use Query::Builder + using lumiera::query::extractID; ///////////////TODO dto + using lumiera::query::isFakeBypass; /////////TODO placeholder until there is a real resolution engine using util::contains; using util::isnil; @@ -106,7 +108,8 @@ namespace session { * the actual table holding preconfigured answers * packaged as boost::any objects. */ - class MockTable : public lumiera::ConfigRules + class MockTable + : public proc::ConfigResolver { typedef std::map Tab; typedef boost::scoped_ptr PTab; @@ -261,7 +264,7 @@ namespace session { * values for some types of interest for testing and debugging. */ class MockConfigRules - : public InstantiateChained < lumiera::InterfaceTypes + : public InstantiateChained < proc::InterfaceTypes , LookupPreconfigured // building block used for each of the types , MockTable // for implementing the base class (interface) > diff --git a/src/proc/mobject/session/root.cpp b/src/proc/mobject/session/root.cpp index 32ac83494..1696b6e85 100644 --- a/src/proc/mobject/session/root.cpp +++ b/src/proc/mobject/session/root.cpp @@ -22,8 +22,9 @@ #include "proc/mobject/session/root.hpp" -#include "proc/mobject/session/defs-manager.hpp" +#include "common/query/defs-manager.hpp" +using lumiera::query::DefsManager; namespace proc { namespace mobject { diff --git a/src/proc/mobject/session/root.hpp b/src/proc/mobject/session/root.hpp index 2169b9334..871bad337 100644 --- a/src/proc/mobject/session/root.hpp +++ b/src/proc/mobject/session/root.hpp @@ -28,11 +28,15 @@ #include "proc/mobject/builder/buildertool.hpp" +namespace lumiera { +namespace query { + class DefsManager; +}} + namespace proc { namespace mobject { namespace session { - class DefsManager; /** @@ -50,7 +54,7 @@ namespace session { */ class Root : public Meta { - DefsManager& defaults_; + lumiera::query::DefsManager& defaults_; ///////////TODO: timespan fields here or already in class Meta?? ///////////TODO: any idea about the purpose of root's "timespan"?? ///////TICKET #448 @@ -64,7 +68,7 @@ namespace session { virtual bool isValid() const; public: - Root (DefsManager&); + Root (lumiera::query::DefsManager&); DEFINE_PROCESSABLE_BY (builder::BuilderTool); diff --git a/src/proc/mobject/session/scope-locator.hpp b/src/proc/mobject/session/scope-locator.hpp index fd0dbb80d..cf6c083d3 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: - lib::QueryResolver const& theResolver(); + lumiera::QueryResolver const& theResolver(); }; diff --git a/src/proc/mobject/session/scope-query.hpp b/src/proc/mobject/session/scope-query.hpp index 7f74d24ab..0e1f2ade2 100644 --- a/src/proc/mobject/session/scope-query.hpp +++ b/src/proc/mobject/session/scope-query.hpp @@ -43,7 +43,7 @@ #include "proc/mobject/placement.hpp" -#include "lib/query-resolver.hpp" +#include "common/query/query-resolver.hpp" #include @@ -56,8 +56,8 @@ namespace session { using std::tr1::function; using std::tr1::placeholders::_1; - using lib::Goal; - using lib::Query; + using lumiera::Goal; + using lumiera::Query; diff --git a/src/proc/mobject/session/scope.cpp b/src/proc/mobject/session/scope.cpp index 7abbfc9a2..ba5e8424d 100644 --- a/src/proc/mobject/session/scope.cpp +++ b/src/proc/mobject/session/scope.cpp @@ -44,6 +44,7 @@ #include "proc/mobject/session/session-service-explore-scope.hpp" #include "proc/mobject/mobject.hpp" #include "lib/iter-source.hpp" ////////////////////TICKET #493 : using the IterSource adapters here +#include "common/query/query-resolver.hpp" #include @@ -119,7 +120,7 @@ namespace session { * of contents discovery queries to the PlacementIndex * managed within the session */ - lib::QueryResolver const& + lumiera::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 b840cb204..b1bd0df1c 100644 --- a/src/proc/mobject/session/sess-manager-impl.cpp +++ b/src/proc/mobject/session/sess-manager-impl.cpp @@ -38,13 +38,13 @@ */ +#include "lib/error.hpp" #include "proc/mobject/session.hpp" #include "proc/mobject/session/sess-manager-impl.hpp" -#include "proc/mobject/session/defs-manager.hpp" #include "proc/mobject/session/lifecycle-advisor.hpp" #include "proc/asset/timeline.hpp" -#include "lib/error.hpp" -#include "lib/query.hpp" +#include "common/query/defs-manager.hpp" +#include "common/query.hpp" using boost::scoped_ptr; @@ -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 (lib::Query ()); + asset::PTimeline initialTimeline = session_->defaults (lumiera::Query ()); // these got registered automatically ENSURE (1 == session_->timelines.size()); diff --git a/src/proc/mobject/session/session-interface-modules.hpp b/src/proc/mobject/session/session-interface-modules.hpp index 598095f71..05e0d2f5b 100644 --- a/src/proc/mobject/session/session-interface-modules.hpp +++ b/src/proc/mobject/session/session-interface-modules.hpp @@ -73,8 +73,8 @@ #include "lib/element-tracker.hpp" #include "proc/asset/timeline.hpp" #include "proc/asset/sequence.hpp" -#include "proc/mobject/session/defs-manager.hpp" #include "proc/mobject/session/element-query.hpp" +#include "common/query/defs-manager.hpp" @@ -96,8 +96,8 @@ namespace session { struct SessionInterfaceModules : boost::noncopyable { - DefsManager defaultsManager_; - ElementQuery elementQueryAPI_; + lumiera::query::DefsManager defaultsManager_; + mobject::session::ElementQuery elementQueryAPI_; TimelineTracker timelineRegistry_; SequenceTracker sequenceRegistry_; diff --git a/src/proc/mobject/session/session-service-explore-scope.hpp b/src/proc/mobject/session/session-service-explore-scope.hpp index 3a249f6b0..b92283b96 100644 --- a/src/proc/mobject/session/session-service-explore-scope.hpp +++ b/src/proc/mobject/session/session-service-explore-scope.hpp @@ -47,7 +47,7 @@ #define MOBJECT_SESSION_SESSION_SERVICE_EXPLORE_SCOPE_H #include "proc/mobject/placement.hpp" -#include "lib/query-resolver.hpp" +#include "common/query/query-resolver.hpp" @@ -68,7 +68,7 @@ namespace session { */ struct SessionServiceExploreScope { - static lib::QueryResolver const& getResolver(); + static lumiera::QueryResolver const& getResolver(); static PlacementMO& getScope (PlacementMO const&); static PlacementMO& getScope (PlacementMO::ID const&); diff --git a/src/proc/mobject/session/session.cpp b/src/proc/mobject/session/session.cpp index 583f7f3e9..28e447013 100644 --- a/src/proc/mobject/session/session.cpp +++ b/src/proc/mobject/session/session.cpp @@ -32,9 +32,9 @@ #include "proc/mobject/session.hpp" -#include "proc/mobject/session/defs-manager.hpp" #include "proc/mobject/session/session-impl.hpp" #include "proc/mobject/session/sess-manager-impl.hpp" +//#include "common/query/defs-manager.hpp" #include "lib/symbol.hpp" #include "lib/singleton.hpp" diff --git a/src/proc/mobject/session/specific-contents-query.hpp b/src/proc/mobject/session/specific-contents-query.hpp index e104ef7f3..f534bd816 100644 --- a/src/proc/mobject/session/specific-contents-query.hpp +++ b/src/proc/mobject/session/specific-contents-query.hpp @@ -27,6 +27,7 @@ #include "proc/mobject/session/scope-query.hpp" #include "proc/mobject/placement.hpp" +#include "common/query/query-resolver.hpp" #include @@ -37,7 +38,7 @@ namespace session { using std::tr1::function; - using lib::QueryResolver; + using lumiera::QueryResolver; /** diff --git a/src/proc/play/dummy-play-connection.hpp b/src/proc/play/dummy-play-connection.hpp index 651af57ca..8e2e9fc3e 100644 --- a/src/proc/play/dummy-play-connection.hpp +++ b/src/proc/play/dummy-play-connection.hpp @@ -85,7 +85,7 @@ #include "proc/mobject/builder/model-port-registry.hpp" #include "proc/asset/timeline.hpp" #include "proc/asset/pipe.hpp" -#include "lib/query.hpp" +#include "common/query.hpp" #include "lib/util.hpp" //#include "lib/symbol.hpp" @@ -125,7 +125,7 @@ namespace play { using mobject::ModelPort; using mobject::builder::ModelPortRegistry; using util::contains; - using lib::Query; + using lumiera::Query; // using lib::ScopedCollection; // using lib::Literal; using lib::eachEntry; diff --git a/src/proc/streamtype.hpp b/src/proc/streamtype.hpp index 29dcffa5d..d42fbf6cd 100644 --- a/src/proc/streamtype.hpp +++ b/src/proc/streamtype.hpp @@ -36,7 +36,7 @@ #include "lib/symbol.hpp" -#include "lib/query.hpp" +//#include "common/query.hpp" #include "proc/asset/entry-id.hpp" #include diff --git a/tests/components/proc/asset/basicpipetest.cpp b/tests/components/proc/asset/basicpipetest.cpp index 7542e1c2e..7ce280d0b 100644 --- a/tests/components/proc/asset/basicpipetest.cpp +++ b/tests/components/proc/asset/basicpipetest.cpp @@ -27,10 +27,10 @@ #include "proc/asset/category.hpp" #include "proc/asset/pipe.hpp" -#include "lib/query.hpp" #include "proc/assetmanager.hpp" #include "proc/mobject/session.hpp" #include "proc/asset/asset-diagnostics.hpp" +#include "common/query.hpp" #include #include @@ -47,8 +47,8 @@ namespace asset { namespace test { using mobject::Session; - using lib::Query; - using lib::query::normaliseID; + using lumiera::Query; + using lumiera::query::normaliseID; diff --git a/tests/components/proc/engine/engine-interface-test.cpp b/tests/components/proc/engine/engine-interface-test.cpp index 609df6ec7..614c4d135 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(lib::Query ("id(dummy)")); + PID pipe = Pipe::query(lumiera::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 f0c7d50ba..61eb5cb50 100644 --- a/tests/components/proc/mobject/builder/fixture-change-detector-test.cpp +++ b/tests/components/proc/mobject/builder/fixture-change-detector-test.cpp @@ -26,7 +26,7 @@ #include "proc/mobject/builder/fixture-change-detector.hpp" #include "proc/asset/timeline.hpp" #include "proc/asset/pipe.hpp" -#include "lib/query.hpp" +#include "common/query.hpp" #include "lib/util.hpp" @@ -43,7 +43,7 @@ namespace test { using asset::Struct; using asset::Timeline; using asset::PTimeline; - using lib::Query; + using lumiera::Query; // typedef asset::ID PID; typedef asset::ID 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 5eb46b70b..9b3487502 100644 --- a/tests/components/proc/mobject/builder/model-port-registry-test.cpp +++ b/tests/components/proc/mobject/builder/model-port-registry-test.cpp @@ -26,7 +26,7 @@ #include "proc/mobject/builder/model-port-registry.hpp" #include "proc/asset/timeline.hpp" #include "proc/asset/pipe.hpp" -#include "lib/query.hpp" +#include "common/query.hpp" #include "lib/util.hpp" @@ -43,7 +43,7 @@ namespace test { using asset::Struct; using asset::Timeline; using asset::PTimeline; - using lib::Query; + using lumiera::Query; typedef asset::ID PID; typedef asset::ID TID; diff --git a/tests/components/proc/mobject/builder/segmentation-datastructure-test.cpp b/tests/components/proc/mobject/builder/segmentation-datastructure-test.cpp index bdaa00a90..431cbb84b 100644 --- a/tests/components/proc/mobject/builder/segmentation-datastructure-test.cpp +++ b/tests/components/proc/mobject/builder/segmentation-datastructure-test.cpp @@ -26,7 +26,7 @@ #include "proc/mobject/builder/fixture-change-detector.hpp" #include "proc/asset/timeline.hpp" #include "proc/asset/pipe.hpp" -#include "lib/query.hpp" +#include "common/query.hpp" #include "lib/util.hpp" @@ -43,7 +43,7 @@ namespace test { using asset::Struct; using asset::Timeline; using asset::PTimeline; - using lib::Query; + using lumiera::Query; // typedef asset::ID PID; typedef asset::ID TID; 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 a8794ecff..3c598cc84 100644 --- a/tests/components/proc/mobject/session/defs-manager-impl-test.cpp +++ b/tests/components/proc/mobject/session/defs-manager-impl-test.cpp @@ -27,10 +27,11 @@ #include "proc/asset.hpp" #include "proc/asset/pipe.hpp" #include "proc/asset/struct.hpp" -#include "common/configrules.hpp" +#include "proc/config-resolver.hpp" #include "proc/assetmanager.hpp" #include "proc/mobject/session.hpp" #include "proc/streamtype.hpp" +#include "common/query.hpp" #include @@ -45,16 +46,17 @@ 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::ConfigRules; + using lumiera::Query; using lumiera::query::QueryHandler; + using lumiera::query::normaliseID; + + using proc::ConfigResolver; @@ -136,7 +138,7 @@ lumiera::query::setFakeBypass("stream("+sID+")"); ////////////////////////////// Query query_for_streamID ("stream("+sID+")"); // issue a ConfigQuery directly, without involving the DefaultsManager - QueryHandler& typeHandler = ConfigRules::instance(); + QueryHandler& typeHandler = ConfigResolver::instance(); PPipe pipe1; typeHandler.resolve (pipe1, query_for_streamID); CHECK (pipe1); diff --git a/tests/components/proc/mobject/session/defs-manager-test.cpp b/tests/components/proc/mobject/session/defs-manager-test.cpp index 20ea97b1f..a3b260f02 100644 --- a/tests/components/proc/mobject/session/defs-manager-test.cpp +++ b/tests/components/proc/mobject/session/defs-manager-test.cpp @@ -23,8 +23,8 @@ #include "lib/test/run.hpp" #include "lib/symbol.hpp" -#include "lib/query.hpp" #include "lib/util.hpp" +#include "common/query.hpp" #include "proc/asset.hpp" #include "proc/asset/pipe.hpp" @@ -54,8 +54,8 @@ namespace test { using asset::Pipe; using asset::PPipe; using asset::Struct; - using lib::Query; - using lib::query::normaliseID; + using lumiera::Query; + using lumiera::query::normaliseID; /** shortcut: run just a query 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 71eb343ed..e54024d83 100644 --- a/tests/components/proc/mobject/session/defs-registry-impl-test.cpp +++ b/tests/components/proc/mobject/session/defs-registry-impl-test.cpp @@ -24,8 +24,8 @@ #include "lib/test/run.hpp" #include "lib/util.hpp" -#include "proc/mobject/session/defs-registry.hpp" -#include "lib/query.hpp" +#include "common/query.hpp" +#include "common/query/defs-registry.hpp" #include "lib/p.hpp" #include "../lib/query/querydiagnostics.hpp" @@ -34,8 +34,6 @@ #include #include -using lib::Query; -using lib::query::test::garbage_query; using util::isnil; using lib::P; @@ -47,9 +45,8 @@ using std::map; -namespace proc { -namespace mobject { -namespace session { +namespace lumiera { +namespace query { namespace test { format typePatt ("Dummy<%2i>"); @@ -299,4 +296,4 @@ namespace test { -}}}} // namespace proc::mobject::session::test +}}} // namespace lumiera::query::test 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 29f0f1dde..dff06b1b9 100644 --- a/tests/components/proc/mobject/session/placement-index-query-test.cpp +++ b/tests/components/proc/mobject/session/placement-index-query-test.cpp @@ -26,7 +26,7 @@ #include "proc/mobject/session/session-service-explore-scope.hpp" #include "proc/mobject/session/placement-index-query-resolver.hpp" #include "proc/mobject/session/test-scopes.hpp" -#include "lib/query-resolver.hpp" +#include "common/query/query-resolver.hpp" #include "lib/util.hpp" #include @@ -39,7 +39,7 @@ namespace mobject { namespace session { namespace test { - using lib::QueryResolver; + using lumiera::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 69bb07208..be943f35f 100644 --- a/tests/components/proc/mobject/session/query-resolver-test.cpp +++ b/tests/components/proc/mobject/session/query-resolver-test.cpp @@ -23,15 +23,16 @@ #include "lib/test/run.hpp" #include "lib/test/test-helper.hpp" -#include "lib/query-resolver.hpp" #include "lib/singleton.hpp" +#include "common/query/query-resolver.hpp" + #include #include -namespace lib { +namespace lumiera { namespace test{ using lib::test::showSizeof; @@ -221,4 +222,4 @@ namespace test{ LAUNCHER (QueryResolver_test, "unit session"); -}} // namespace lib::test +}} // namespace lumiera::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 1bed847ec..d907a4418 100644 --- a/tests/components/proc/mobject/session/session-element-tracker-test.cpp +++ b/tests/components/proc/mobject/session/session-element-tracker-test.cpp @@ -29,7 +29,8 @@ #include "proc/mobject/session.hpp" #include "proc/asset/timeline.hpp" #include "proc/asset/sequence.hpp" -#include "lib/query.hpp" +#include "common/query.hpp" +#include "lib/p.hpp" @@ -84,7 +85,8 @@ namespace test { - using lib::Query; + using lib::P; + using lumiera::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 089c49ec4..f3dd290ff 100644 --- a/tests/components/proc/mobject/session/session-modify-parts-test.cpp +++ b/tests/components/proc/mobject/session/session-modify-parts-test.cpp @@ -31,7 +31,7 @@ #include "proc/mobject/session/testclip.hpp" #include "proc/mobject/mobject-ref.hpp" #include "proc/mobject/placement.hpp" -#include "lib/query.hpp" +#include "common/query.hpp" #include #include @@ -58,7 +58,7 @@ namespace test { using asset::PSequence; using asset::Sequence; - using lib::Query; + using lumiera::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 9d633cc9e..943ec415c 100644 --- a/tests/components/proc/mobject/session/timeline-sequence-handling-test.cpp +++ b/tests/components/proc/mobject/session/timeline-sequence-handling-test.cpp @@ -30,7 +30,7 @@ #include "proc/asset/timeline.hpp" #include "proc/asset/sequence.hpp" #include "proc/asset/pipe.hpp" -#include "lib/query.hpp" +#include "common/query.hpp" #include "lib/util.hpp" #include @@ -55,7 +55,7 @@ namespace test { using asset::PSequence; using asset::Pipe; - using lib::Query; + using lumiera::Query; /******************************************************************************** diff --git a/tests/components/proc/play/diagnostic-output-slot.hpp b/tests/components/proc/play/diagnostic-output-slot.hpp index e78062589..38fb9fbce 100644 --- a/tests/components/proc/play/diagnostic-output-slot.hpp +++ b/tests/components/proc/play/diagnostic-output-slot.hpp @@ -41,9 +41,9 @@ #include "lib/time/timevalue.hpp" #include "lib/scoped-ptrvect.hpp" #include "lib/iter-source.hpp" -#include "lib/advice.hpp" #include "lib/symbol.hpp" #include "lib/util.hpp" +#include "common/advice.hpp" #include "proc/engine/testframe.hpp" //#include "lib/sync.hpp" @@ -80,7 +80,7 @@ namespace play { getTestTimeGrid() { Symbol gridID("DiagnosticOutputSlot-buffer-grid"); - lib::advice::Request query4grid(gridID) ; + lumiera::advice::Request query4grid(gridID) ; PGrid testGrid25 = query4grid.getAdvice(); if (!testGrid25) diff --git a/tests/lib/advice/advice-basics-test.cpp b/tests/lib/advice/advice-basics-test.cpp index 809f53814..0a3bbece4 100644 --- a/tests/lib/advice/advice-basics-test.cpp +++ b/tests/lib/advice/advice-basics-test.cpp @@ -22,7 +22,7 @@ #include "lib/test/run.hpp" -#include "lib/advice.hpp" +#include "common/advice.hpp" #include @@ -30,7 +30,7 @@ using std::rand; -namespace lib { +namespace lumiera { namespace advice { namespace test { @@ -264,4 +264,4 @@ namespace test { LAUNCHER (AdviceBasics_test, "unit common"); -}}} // namespace lib::advice::test +}}} // namespace lumiera::advice::test diff --git a/tests/lib/advice/advice-binding-pattern-test.cpp b/tests/lib/advice/advice-binding-pattern-test.cpp index dc649cb46..dadbc33bf 100644 --- a/tests/lib/advice/advice-binding-pattern-test.cpp +++ b/tests/lib/advice/advice-binding-pattern-test.cpp @@ -24,18 +24,19 @@ #include "lib/test/run.hpp" #include "lib/test/test-helper.hpp" -#include "lib/advice.hpp" #include "lib/time/timevalue.hpp" +#include "common/advice.hpp" #include +using lib::time::Time; using std::cout; using std::endl; -namespace lib { -namespace advice{ +namespace lumiera { +namespace advice { namespace test { namespace { @@ -127,11 +128,11 @@ namespace test { b2.addPredicate("cat3(zzz)"); CHECK (b1 != b2); - b1.addTypeGuard(); + b1.addTypeGuard