![]() |
Lumiera 0.pre.04~rc.1
»edit your freedom«
|
#include "common/query/defs-registry.hpp"
Helper for organising preconfigured default objects. Maintains a collection of objects known or encountered as "default" for a given type. This collection is ordered by "degree of constriction", which is implemented by counting the number of predicates in the query used to define or identify each object. Accessing an object identified by a query causes the query to be resolved (executed in prolog), which may result in some additional properties of the object being bound or specified.
Definition at line 186 of file defs-registry.hpp.
Classes | |
| class | Iter |
| used for enumerating solutions More... | |
Public Member Functions | |
| template<class TAR > | |
| Iter< TAR > | candidates (Query< TAR > const &query) |
| find a sequence of "default" objects possibly matching the query. | |
| template<class TAR > | |
| bool | put (P< TAR > const &obj, Query< TAR > const &query) |
| register the object as being "default" when searching something similar as designated by the given query. | |
| template<class TAR > | |
| bool | forget (P< TAR > const &obj) |
| if this object is registered as "default" in some way, drop the registration. | |
| template<class TAR > | |
| string | dump () |
| helper for diagnostics. | |
Private Attributes | |
| Table | table_ |
Additional Inherited Members | |
Private Member Functions inherited from NonCopyable | |
| ~NonCopyable ()=default | |
| NonCopyable ()=default | |
| NonCopyable (NonCopyable const &)=delete | |
| NonCopyable & | operator= (NonCopyable const &)=delete |
find a sequence of "default" objects possibly matching the query.
If there was a registration for some object of the given kind with the same query, this one will be first in the sequence. Besides, the sequence will yield all still existing registered "default" objects of this kind, ordered ascending by "degree of constriction", i.e. starting with the object registered together with the shortest query.
Definition at line 250 of file defs-registry.hpp.
References Slot< TAR >::access(), and DefsRegistry::table_.
Here is the call graph for this function:register the object as being "default" when searching something similar as designated by the given query.
Only a weak ref is stored.
| obj | to be recorded as "default". Only a weak pointer will be stored |
| true | if object has actually been stored |
| false | if another object is registered for exactly the same query Nothing is changed in this case |
Definition at line 277 of file defs-registry.hpp.
References Slot< TAR >::access(), and DefsRegistry::table_.
Here is the call graph for this function:
|
inline |
if this object is registered as "default" in some way, drop the registration.
Definition at line 307 of file defs-registry.hpp.
References Slot< TAR >::access(), util::remove_if(), and DefsRegistry::table_.
Here is the call graph for this function:
|
inline |
helper for diagnostics.
Definition at line 322 of file defs-registry.hpp.
References util::for_each(), and DefsRegistry::table_.
Here is the call graph for this function:
|
private |
Definition at line 189 of file defs-registry.hpp.
Referenced by DefsRegistry::candidates(), DefsRegistry::dump(), DefsRegistry::forget(), and DefsRegistry::put().
Inheritance diagram for DefsRegistry:
Collaboration diagram for DefsRegistry: