Lumiera  0.pre.03
»edit your freedom«
config-rules.hpp File Reference

Go to the source code of this file.

Description

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 will be hidden behind a instance (Singleton factory). As of 1/2008, it is planned to use an embedded YAP Prolog system at some point in the future, for now we use a mock implementation based on lookup in a hard-wired, 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...

relation to Query and QueryResolver
The ConfigRules resolver is just a special kind of QueryResolver, able to handle specific kinds of queries. Clients using the ConfigRules directly get a more easy to use point-and-shot style interface, allowing just to retrieve some suitable solution, instead of having to iterate through a result set.
Todo:

right now (12/2012) the above paragraph is a lie. ConfigQuery is way older than QueryResolver and will be retrofitted step by step. Not much of a problem, since the currently utilised mock implementation isn't able to deal with a real query anyway.

as of 11/2016 the situation is basically the same: this is placeholder code and just implemented enough to keep us going without violating the architecture vision

Note
this is rather a concept draft and left as such for now... don't take this code too literal!
Todo:
clarify the relation of config query and query-for-defaults ///////////////TICKET #705
See also
lumiera::Query
mobject::session::DefsManager
asset::StructFactory
config-resolver.hpp specialised setup for the Steam-Layer
fake-configrules.hpp currently used dummy-implementation

Definition in file config-rules.hpp.

#include "lib/p.hpp"
#include "lib/symbol.hpp"
#include "lib/meta/generator.hpp"
#include "common/query.hpp"
#include <string>

Classes

class  ConfigRules< TYPES >
 Generic query interface for retrieving objects matching some capability query. More...
 
class  Pred< SYM, SIG >
 
class  QueryHandler< TY >
 the "front side" interface: the Steam-Layer code can use this QueryHandler to retrieve instances of the type TY fulfilling the given Query. More...
 
class  Resolver
 
class  TypeHandler< TY >
 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). More...
 

Macros

#define SYMBOL   uint
 placeholder definition for later. More...
 

Functions

bool isFakeBypass (lumiera::QueryKey const &q)
 
 LUMIERA_ERROR_DECLARE (CAPABILITY_QUERY)
 unresolvable capability query.
 
void setFakeBypass (lumiera::QueryKey const &q)
 backdoor for tests: the next config query with this query string will magically succeed with every candidate object provided. More...
 

Namespaces

 lumiera
 Lumiera public interface.
 

Macro Definition Documentation

◆ SYMBOL

#define SYMBOL   uint

placeholder definition for later.

Todo:
intention is to integrate with lib::Symbol

Definition at line 116 of file config-rules.hpp.

Function Documentation

◆ setFakeBypass()

void setFakeBypass ( lumiera::QueryKey const &  q)

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

Definition at line 57 of file config-rules.cpp.

References lumiera::query::setFakeBypass().

Referenced by lumiera::query::setFakeBypass().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: