BeeeOn Gateway
v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
|
#include <DIWrapper.h>
Public Member Functions | |
virtual std::string | id () const =0 |
Static Public Member Functions | |
template<typename T , typename B > | |
static B & | extractInstance (DIWrapper &w) |
Common class to be inherited by all setters helpers. The purpose is to be able to have all setters in a single map.
|
static |
Get instance of the given wrapper.
Extract instance of the given wrapper. We expect that the underlying wrapper holds an instance of T which is derived from B or T == B. If the wrapper is not AbstractDIWrapper<T>, then std::bad_cast is thrown.
Usually, the method is called with *this as the DIWrapper argument and thus we are sure it really is AbstractDIWrapper<T>. Also, the B must be castable from T. This should be assured by compile-time check during setter registration.