Lumiera  0.pre.03
config-rules.hpp File Reference

Go to the source code of this file.


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.

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

this is rather a concept draft and left as such for now... don't take this code too literal!
clarify the relation of config query and query-for-defaults ///////////////TICKET #705
See also
config-resolver.hpp specialised setup for the Proc-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>


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 Proc-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...


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


bool isFakeBypass (lumiera::QueryKey const &q)
 unresolvable capability query. More...
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...


 Lumiera public interface.

Macro Definition Documentation


#define SYMBOL

placeholder definition for later.

intention is to integrate with lib::Symbol

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

Class Documentation

◆ lumiera::query::Pred

class lumiera::query::Pred
+ Collaboration diagram for Pred< SYM, SIG >:

◆ lumiera::query::Resolver

class lumiera::query::Resolver
+ Collaboration diagram for Resolver: