Lumiera
0.pre.03
»edit your freedom«
|
Go to the source code of this file.
Basic and generic representation of an internal query.
This header provides the foundation for issuing queries instead of using hard wired logic and defaults. This is a fundamental architecture pattern within Lumiera, and serves to decouple the parts of the application and allows for a rules based configuration and orchestration of the internal workings.
A Query is a request for just someone to come up with a solution, a preconfigured setup, some existing data object or contextual information. In order to be usable, actually a QueryResolver needs to be available to compute the solution and retrieve the results. As a common denominator, queries can be generic queries given in predicate logic syntax; in this case a generic query resolver (Planned feature as of 1/2013) will be able at least to determine a suitable facility for delegating the resolution. Besides, specific subsystems are using more specific kinds of queries and provide a specialised resolution mechanism, kind of a shortcut, which in these cases can be addressed directly.
To resolve the query, a lumiera::QueryResolver instance is necessary, and this query resolver needs the ability to deal with this specific kind of query. Typically this is achieved by installing a resolution function into the resolver on application start. The QueryResolver returns a result set, actually a Query::Cursor, which can be used to enumerate multiple solutions, if any.
Queries are immutable, but it is possible to re-build and remould a query using a Query<TY>::Builder, accessible via Query::build() and Query::rebuild().
Definition in file query.hpp.
#include "lib/typed-counter.hpp"
#include "lib/iter-adapter.hpp"
#include "lib/query-text.hpp"
#include "lib/query-util.hpp"
#include "lib/hash-value.h"
#include "lib/nocopy.hpp"
#include "lib/symbol.hpp"
#include "lib/util.hpp"
#include <boost/lexical_cast.hpp>
#include <boost/operators.hpp>
#include <memory>
#include <typeinfo>
#include <cctype>
#include <string>
Classes | |
class | Query< RES >::Builder |
Helper for establishing, reworking and remolding queries. More... | |
class | Query< RES >::Cursor |
class | Goal |
Query ABC: unspecific goal for resolution or retrieval. More... | |
class | Query< RES > |
Generic interface to express a query for specifically typed result elements exposing some capabilities or fulfilling some properties. More... | |
struct | Goal::QueryID |
class | QueryKey |
Wrapper for indexing and ordering. More... | |
class | Goal::Result |
Single Solution, possibly part of a result set. More... | |
Typedefs | |
typedef lib::TypedContext< Goal::Result > | ResultType |
Context used for generating type-IDs to denote the specific result types of issued queries. | |
Functions | |
template<typename RES > | |
IxID | getResultTypeID () |
bool | operator!= (Goal::QueryID const &id1, Goal::QueryID const &id2) |
bool | operator< (Goal::QueryID const &id1, Goal::QueryID const &id2) |
bool | operator== (Goal::QueryID const &id1, Goal::QueryID const &id2) |
size_t | taggedHash (size_t hash, Goal::QueryID typeID) |
includes the QueryID type distinction into the given hash value | |
Namespaces | |
lumiera | |
Lumiera public interface. | |