![]() |
Lumiera 0.pre.04
»edit your freedom«
|
#include "common/query.hpp"
Generic interface to express a query for specifically typed result elements exposing 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 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 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, where each result represents a possible solution to the original query.
Classes | |
| class | Builder |
| Helper for establishing, reworking and remolding queries. More... | |
| class | Cursor |
Public Types | |
| typedef lib::IterAdapter< Cursor, PReso > | iterator |
Public Types inherited from Goal | |
| enum | Kind { EMPTY = 0 , GENERIC = 1 , DISCOVERY , PLACEMENT } |
Static Public Member Functions | |
| static Builder | build (Kind queryType=Goal::GENERIC) |
Public Member Functions | |
| Query () | |
| Query (string querySpec) | |
| operator QueryKey () const | |
| automatic conversion from Query to QueryKey for indexing and ordering. | |
| Builder | rebuild () const |
| string | extractID (Symbol predicate) const |
| convenience shortcut to extract a desired name-ID. | |
| bool | usesPredicate (Symbol predicate) const |
| iterator | operator() (QueryResolver const &resolver) const |
| notational convenience shortcut, synonymous to Query<RES>::resolveBy() | |
| iterator | resolveBy (QueryResolver const &resolver) const |
Public Member Functions inherited from Goal | |
| virtual | ~Goal () |
| this is a marker baseclass | |
| QueryID const & | getQID () const |
Friends | |
| class | Builder |
| size_t | hash_value (Query const &q) |
Protected Member Functions | |
| virtual lib::QueryText | buildSyntacticRepresentation () const |
| Extension point to generate a generic query definition on demand. | |
| lib::QueryText | getQueryDefinition () const |
| access the complete syntactical representation of this query. | |
| Query (QueryID typeID, lib::QueryText const &genericQuerySpec) | |
| Query (QueryID typeID, string querySpec) | |
Protected Member Functions inherited from Goal | |
| Goal (QueryID qid) | |
Static Protected Member Functions | |
| static QueryID | defineQueryTypeID (Kind queryType=Goal::GENERIC) |
Private Attributes | |
| lib::QueryText | def_ |
| generic syntactical definition | |
Additional Inherited Members | |
Protected Attributes inherited from Goal | |
| QueryID | id_ |
|
inlineprotected |
Definition at line 301 of file query.hpp.
References Goal::getQID(), and Goal::QueryID::type.
Here is the call graph for this function:
|
inlineexplicit |
| typedef lib::IterAdapter<Cursor,PReso> iterator |
|
inlinestaticprotected |
|
inlineprotectedvirtual |
Extension point to generate a generic query definition on demand.
Some specialised kinds of queries, intended to be treated by a specific resolver, may choose skip constructing a generic query representation, but are then bound to supplement such a generic definition through this function when required. The generated query definition must be sufficient to reconstruct the query in all respects.
| bottom | token to indicate failure to comply to this requirement. |
Reimplemented in ScopeQuery< MO >.
Definition at line 277 of file query.hpp.
Referenced by Query< RES >::getQueryDefinition().
Here is the caller graph for this function:
|
inlineprotected |
access the complete syntactical representation of this query.
May trigger on-demand initialisation
Definition at line 286 of file query.hpp.
References Query< RES >::buildSyntacticRepresentation(), and Query< RES >::def_.
Here is the call graph for this function:
|
inline |
|
inlinestatic |
Definition at line 542 of file query.hpp.
Referenced by QueryKey::operator Query< RES >().
Here is the caller graph for this function:
|
inline |
Definition at line 550 of file query.hpp.
Referenced by steam::mobject::_mapping::build_corresponding_sourceQuery(), MockTable::fabricate_Sequence_on_demand(), MockTable::fabricate_Timeline_on_demand(), DefsManager::operator()(), and LookupPreconfigured::try_special_case().
Here is the caller graph for this function:
|
inline |
convenience shortcut to extract a desired name-ID.
Definition at line 564 of file query.hpp.
Referenced by StructFactoryImpl::createIdent(), MockTable::detect_case(), MockTable::detect_case(), StructFactoryImpl::fabricate(), StructFactoryImpl::fabricate(), StructFactoryImpl::fabricate(), MockTable::fabricate_Sequence_on_demand(), MockTable::fabricate_Timeline_on_demand(), and steam::mobject::_mapping::is_defaults_query_with_channel().
Here is the caller graph for this function:
|
inline |
Definition at line 572 of file query.hpp.
References lib::query::hasTerm().
Referenced by MockTable::detect_case(), and steam::mobject::session::query::anonymous_namespace{fake-configrules.hpp}::is_defaults_query().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
notational convenience shortcut, synonymous to Query<RES>::resolveBy()
Definition at line 154 of file query-resolver.hpp.
|
inline |
Definition at line 141 of file query-resolver.hpp.
References QueryResolver::issue().
Referenced by PlacementIndexQuery_test::checkQueryOperations(), PlacementIndexQuery_test::checkQueryResolver(), ScopeLocator::explore(), steam::mobject::session::test::explore_testScope(), ScopeLocator::getRawPath(), ScopeQuery_test::issue(), steam::mobject::session::pickAllSuitable(), ScopeLocator::query(), steam::mobject::session::test::anonymous_namespace{test-scopes.cpp}::retrieve_firstElmOfType(), and QueryResolver_test::run().
Here is the call graph for this function:
Here is the caller graph for this function:
|
mutableprivate |
generic syntactical definition
Definition at line 256 of file query.hpp.
Referenced by Query< RES >::getQueryDefinition().
|
friend |
Definition at line 356 of file query.hpp.
Referenced by ScopeQuery< MO >::buildSyntacticRepresentation().
Inheritance diagram for Query< RES >:
Collaboration diagram for Query< RES >: