Skyward boardcore
|
Main DependencyManager class. More...
#include <DependencyManager.h>
Public Member Functions | |
DependencyManager () | |
template<typename T , typename = std::enable_if_t< std::is_base_of<Injectable, T>::value>> | |
bool | insert (T *dependency) |
Insert a new dependency. | |
void | graphviz (std::ostream &os) |
Generate a gaphviz compatible output showing dependencies. Needs to be called after inject. | |
bool | inject () |
Inject all dependencies into all inserted . | |
Friends | |
class | DependencyInjector |
Main DependencyManager class.
This utility is meant to be used as a dependency injector for Skyward OBSW.
Dependencies and dependents should inherit from Injectable
. Normally though you should extend from InjectableWithDeps
in case of dependencies.
Here's a quick example (for more examples look at src/tests/catch/test-dependencymanager.cpp):
Definition at line 114 of file DependencyManager.h.
|
inline |
Definition at line 131 of file DependencyManager.h.
void DependencyManager::graphviz | ( | std::ostream & | os | ) |
Generate a gaphviz compatible output showing dependencies. Needs to be called after inject.
os | Output stream to write to. |
Definition at line 53 of file DependencyManager.cpp.
bool DependencyManager::inject | ( | ) |
Inject all dependencies into all inserted .
Definition at line 75 of file DependencyManager.cpp.
|
inline |
Insert a new dependency.
dependency | Injectable to insert in the DependencyManager. |
Definition at line 143 of file DependencyManager.h.
|
friend |
Definition at line 116 of file DependencyManager.h.