![]() |
Lumiera 0.pre.04~rc.1
»edit your freedom«
|
#include "common/query/defs-manager.hpp"
Organise a collection of preconfigured default objects.
For various kinds of objects we can tweak the default parametrisation as part of the general session configuration. A ref to an instance of this class is accessible through the current session and can be used to fill in parts of the configuration of new objects, if the user code didn't give more specific parameters. Necessary sub-objects will be created on demand, and any default configuration, once found, will be remembered and stored with the current session.
Definition at line 129 of file defs-manager.hpp.
Public Member Functions | |
| DefsManager () noexcept | |
| initialise the most basic internal defaults. | |
| ~DefsManager () | |
| template<class TAR > | |
| lib::P< TAR > | operator() (Query< TAR > const &) |
| common access point: retrieve the default object fulfilling some given conditions. | |
| template<class TAR > | |
| lib::P< TAR > | search (Query< TAR > const &) |
| search through the registered defaults, never create anything. | |
| template<class TAR > | |
| lib::P< TAR > | create (Query< TAR > const &) |
| retrieve an object fulfilling the query and register it as default. | |
| template<class TAR > | |
| bool | define (lib::P< TAR > const &, Query< TAR > const &=Query< TAR >()) |
| register the given object as default, after ensuring it fulfils the query. | |
| template<class TAR > | |
| bool | forget (lib::P< TAR > const &) |
| remove the defaults registration of the given object, if there was such | |
| void | clear () |
| template<class TAR > | |
| P< TAR > | search (const Query< TAR > &capabilities) |
| template<class TAR > | |
| P< TAR > | create (const Query< TAR > &capabilities) |
| template<class TAR > | |
| P< TAR > | operator() (const Query< TAR > &capabilities) |
Private Attributes | |
| unique_ptr< impl::DefsRegistry > | defsRegistry_ |
Additional Inherited Members | |
Private Member Functions inherited from NonCopyable | |
| ~NonCopyable ()=default | |
| NonCopyable ()=default | |
| NonCopyable (NonCopyable const &)=delete | |
| NonCopyable & | operator= (NonCopyable const &)=delete |
|
noexcept |
initialise the most basic internal defaults.
Definition at line 56 of file defs-manager-impl.hpp.
| ~DefsManager | ( | ) |
causes std::default_delete from unique_ptr<DefsRegistry> to be emitted here, where the declaration of DefsRegistry is available.
Definition at line 67 of file defs-manager-impl.hpp.
common access point: retrieve the default object fulfilling some given conditions.
May silently trigger object creation.
| error::Config | in case no solution is possible, which is considered misconfiguration. |
search through the registered defaults, never create anything.
empty ptr if not found. Referenced by DefsManager::operator()().
Here is the caller graph for this function:retrieve an object fulfilling the query and register it as default.
The resolution is delegated to the ConfigQuery system (which may cause creation of new object instances)
empty ptr if no solution. Referenced by DefsManagerImpl_test::create(), and DefsManager::operator()().
Here is the caller graph for this function:| template bool define | ( | lib::P< TAR > const & | , |
| Query< TAR > const & | = Query< TAR >() |
||
| ) |
register the given object as default, after ensuring it fulfils the query.
The latter may cause some properties of the object to be set, trigger creation of additional objects, and may fail altogether.
Definition at line 111 of file defs-manager-impl.hpp.
References DefsManager::defsRegistry_, and QueryHandler< TY >::resolve().
Referenced by DefsManager_test::verifyRemoval().
Here is the call graph for this function:
Here is the caller graph for this function:| template bool forget | ( | lib::P< TAR > const & | ) |
remove the defaults registration of the given object, if there was such
Definition at line 125 of file defs-manager-impl.hpp.
References DefsManager::defsRegistry_.
| void clear | ( | ) |
for session lifecycle
Definition at line 71 of file defs-manager-impl.hpp.
References DefsManager::defsRegistry_.
Definition at line 80 of file defs-manager-impl.hpp.
References DefsManager::defsRegistry_, and QueryHandler< TY >::resolve().
Here is the call graph for this function:Definition at line 98 of file defs-manager-impl.hpp.
References DefsManager::defsRegistry_, and QueryHandler< TY >::resolve().
Here is the call graph for this function:Definition at line 133 of file defs-manager-impl.hpp.
References Query< RES >::Builder::asKey(), DefsManager::create(), LERR_, Query< RES >::rebuild(), and DefsManager::search().
Here is the call graph for this function:
|
private |
Definition at line 132 of file defs-manager.hpp.
Referenced by DefsManager::clear(), DefsManager::create(), DefsManager::define(), DefsManager::forget(), and DefsManager::search().
Inheritance diagram for DefsManager:
Collaboration diagram for DefsManager: