GPR5100 - Rollback
Loading...
Searching...
No Matches
Static Public Member Functions | Static Protected Attributes | List of all members
core::Locator< T, TNull > Class Template Reference

Locator is an utility class based on the Locator design-patter. More...

#include <service_locator.h>

Static Public Member Functions

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 Protected Attributes

static T * service_ = &Locator<T, TNull>::nullService_
 
static TNull nullService_
 

Detailed Description

template<class T, class TNull>
class core::Locator< T, TNull >

Locator is an utility class based on the Locator design-patter.

Template Parameters
Tis the type of the wanted class
TNullis the type of the wanted class, but when it's empty

Member Function Documentation

◆ get()

template<class T , class TNull >
static T & core::Locator< T, TNull >::get ( )
inlinestatic

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 >
static void core::Locator< T, TNull >::provide ( T *  service)
inlinestatic

provide is a method that allows to provide a pointer to a class T object.

Parameters
serviceis the given pointer. If null, it is replaced by the nullService_ pointer.

The documentation for this class was generated from the following file: