CANdevStudio
Development tool for CAN bus simulation
Loading...
Searching...
No Matches
Context< Args > Struct Template Reference

#include <context.h>

Public Member Functions

 Context (Args *... args)
 
template<typename T >
T & get () const
 

Detailed Description

template<typename... Args>
struct Context< Args >

The class provides wrapper that enables to inject multiple dependencies to one class.

NOTE: Interfaces provided as template arguments must be unique

Constructor & Destructor Documentation

◆ Context()

template<typename... Args>
Context< Args >::Context ( Args *...  args)
inline

Used to construct the context and and initialize it with implementations. Class takes ownership over implementations

Parameters
argspointers to implementation of Args interfaces

Member Function Documentation

◆ get()

template<typename... Args>
template<typename T >
T & Context< Args >::get ( ) const
inline

Get implementation of interfaces passed as template parameter

Returns
implementation of an interface

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