Skyward boardcore
Loading...
Searching...
No Matches
Boardcore::InjectableWithDeps< Types > Class Template Reference

Base class for an Injectable with dependencies. More...

#include <DependencyManager.h>

Inheritance diagram for Boardcore::InjectableWithDeps< Types >:
Collaboration diagram for Boardcore::InjectableWithDeps< Types >:

Public Member Functions

virtual void inject (DependencyInjector &injector) override
 Invoked by the DependencyManager to inject dependencies. Override this method to retrieve dependencies from the injector via DependencyInjector::get().
 
template<typename T , typename = std::enable_if_t< DependencyManagerDetails::Contains<T, Types...>::value>>
T * getModule ()
 Get one of the modules in Types.
 
- Public Member Functions inherited from Boardcore::Injectable
virtual ~Injectable ()=default
 

Protected Types

using Super = InjectableWithDeps<Types...>
 

Detailed Description

template<typename... Types>
class Boardcore::InjectableWithDeps< Types >

Base class for an Injectable with dependencies.

Definition at line 286 of file DependencyManager.h.

Member Typedef Documentation

◆ Super

template<typename... Types>
using Boardcore::InjectableWithDeps< Types >::Super = InjectableWithDeps<Types...>
protected

Alias of the super class, to be used in derived classes in the constructor or when overriding methods

Definition at line 293 of file DependencyManager.h.

Member Function Documentation

◆ getModule()

template<typename... Types>
template<typename T , typename = std::enable_if_t< DependencyManagerDetails::Contains<T, Types...>::value>>
T * Boardcore::InjectableWithDeps< Types >::getModule ( )
inline

Get one of the modules in Types.

Note
If T is not inside Types... the compiler will fail to find this method!

Definition at line 310 of file DependencyManager.h.

◆ inject()

template<typename... Types>
virtual void Boardcore::InjectableWithDeps< Types >::inject ( DependencyInjector & injector)
inlineoverridevirtual

Invoked by the DependencyManager to inject dependencies. Override this method to retrieve dependencies from the injector via DependencyInjector::get().

Parameters
injectorProxy class used to obtain dependencies.

Reimplemented from Boardcore::Injectable.

Definition at line 296 of file DependencyManager.h.


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