Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
config-rules.hpp File Reference

Interface for accessing rule based configuration. More...

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

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

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>

Namespaces

namespace  lumiera
 Lumiera public interface.
 
namespace  lumiera::error
 
namespace  lumiera::query
 

Macros

#define SYMBOL   uint
 placeholder definition for later.
 

Classes

class  Resolver
 
class  Pred< SYM, SIG >
 
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...
 
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  ConfigRules< TYPES >
 Generic query interface for retrieving objects matching some capability query. More...
 

Functions

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

Macro Definition Documentation

◆ SYMBOL

#define SYMBOL   uint

placeholder definition for later.

Todo:
intention is to integrate with lib::Symbol

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


Class Documentation

◆ lumiera::query::Resolver

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

◆ lumiera::query::Pred

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