Locator is an utility class based on the Locator design-patter.
More...
#include <service_locator.h>
|
| static T & | get () |
| | get is a method that gets you the reference to the T class. If a pointer was not provided, it returns a pointer to the TNull nullService_ attribute. More...
|
| |
| static void | provide (T *service) |
| | provide is a method that allows to provide a pointer to a class T object. More...
|
| |
|
|
static T * | service_ = &Locator<T, TNull>::nullService_ |
| |
|
static TNull | nullService_ |
| |
template<class T, class TNull>
class core::Locator< T, TNull >
Locator is an utility class based on the Locator design-patter.
- Template Parameters
-
| T | is the type of the wanted class |
| TNull | is the type of the wanted class, but when it's empty |
◆ get()
template<class T , class TNull >
get is a method that gets you the reference to the T class. If a pointer was not provided, it returns a pointer to the TNull nullService_ attribute.
- Returns
- a reference to the T class service.
◆ provide()
template<class T , class TNull >
provide is a method that allows to provide a pointer to a class T object.
- Parameters
-
| service | is the given pointer. If null, it is replaced by the nullService_ pointer. |
The documentation for this class was generated from the following file: