Lumiera
0.pre.03
»edit your freedom«
|
#include "stage/model/element-access.hpp"
helper to perform conversion to the desired result type. This is a bit of tricky metaprogramming to deal with the problem that we can not assume a single base interface for all the UI elements or widgets accessible through UI-Coordinates. Rather we have to deal with a small set of possible base interfaces, and thus the actual access function returns a variant record holding a pointer, and internally tagged with the base interface type to apply. Now the public API functions are templated to the result type as expected by the invoking clinent and thus we get a matrix of possible cases; when the expected result type is reachable by dynamic downcast from the actual base interface type returned by the internal access function, we can perform this dynamic_cast
. Otherwise the returned result proxy object is marked as empty.
Definition at line 110 of file element-access.hpp.
Public Types | |
using | Base = typename RawResult::FirstMatching< canUpcast >::Type |
template<typename X > | |
using | canUpcast = std::is_convertible< TAR *, X > |
Public Member Functions | |
virtual void | handle (Base &pb) override |
Public Member Functions inherited from Variant< TYPES >::Visitor | |
virtual | ~Visitor () |
this is an interface | |
Public Attributes | |
lib::Result< TAR & > | result {error::Invalid{"not convertible to desired target widget"}} |