Helper class used to cast given view instance to one over the provided base container instance. More...
Static Public Member Functions | |
template<typename View > | |
static CastView | create (View const &v, component_type *c) |
template<typename View > | |
static CastView * | create_new_or_get_component (View const &v, component_type *c) |
Helper class used to cast given view instance to one over the provided base container instance.
This primary template is used when the view is derived from a Segmented. It constructs the cast view instance by re-creating the underlying view (hierarchy) on heap, using reference to the base container at the bottom-most level, and passing the pointer to the result alongside the reference to the original segmented_view to the segmented_view constructor that takes ownership of the reconstructed view (hierarchy).
CastView | Type of the cast view to be instantiated. |
|
static |
Creates the cast view by recursively heap-allocating the underlying views until the bottom-most container is hit, in which case the reference to the provided component (base container) is used.