IActivator Class Referenceabstract

#include <Pt/Cosmo/IActivator.h>

Dependency resolver. More...

Public Member Functions

 IActivator ()
 Constructor.
virtual ~IActivator ()
 Destructor.
Componentget (const std::string &featureId) const
 Returns the component by feature ID or throws.
template<typename I>
I * get (const std::string &id) const
 Returns the interface from a component or throws.
Componentquery (const std::string &featureId) const
 Returns the component by feature ID or null.
template<typename I>
I * query (const std::string &id) const
 Returns the interface from a component or null.

Protected Member Functions

virtual ComponentonQuery (const std::string &featureId) const =0
 Gets the component by feature ID or null if not available.

Detailed Description

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.

Member Function Documentation

◆ get() [1/2]

Component * get ( const std::string & featureId) const
Parameters
featureIdFeature ID of the required component.

◆ get() [2/2]

template<typename I>
I * get ( const std::string & id) const
Parameters
idFeature ID of the required component.

◆ query() [1/2]

Component * query ( const std::string & featureId) const
Parameters
featureIdFeature ID of the component.

◆ query() [2/2]

template<typename I>
I * query ( const std::string & id) const
Parameters
idFeature ID of the component.