#include <Pt/Cosmo/IActivator.h>
Dependency resolver.
More...
|
|
| IActivator () |
| | Constructor.
|
| |
|
virtual | ~IActivator () |
| | Destructor.
|
| |
| Component * | get (const std::string &featureId) const |
| | Returns the component by feature ID or throws. More...
|
| |
| template<typename I > |
| I * | get (const std::string &id) const |
| | Returns the interface from a component or throws. More...
|
| |
| Component * | query (const std::string &featureId) const |
| | Returns the component by feature ID or null. More...
|
| |
| template<typename I > |
| I * | query (const std::string &id) const |
| | Returns the interface from a component or null. More...
|
| |
|
|
virtual Component * | onQuery (const std::string &featureId) const =0 |
| | Gets the component by feature ID or null if not available.
|
| |
Passed to IActivate::onActivate() to resolve required dependencies by feature ID. Use get() when the dependency is mandatory (throws on failure) or query() when it may legitimately be absent.
◆ get() [1/2]
| Component * get |
( |
const std::string & |
featureId | ) |
const |
- Parameters
-
| featureId | Feature ID of the required component. |
◆ get() [2/2]
| I * get |
( |
const std::string & |
id | ) |
const |
- Parameters
-
| id | Feature ID of the required component. |
◆ query() [1/2]
| Component * query |
( |
const std::string & |
featureId | ) |
const |
- Parameters
-
| featureId | Feature ID of the component. |
◆ query() [2/2]
| I * query |
( |
const std::string & |
id | ) |
const |
- Parameters
-
| id | Feature ID of the component. |