Lumiera  0.pre.03
»edit your freedom«
ViewHook_test Class Reference

Description

Test:
verify the mechanism to attach widgets to a canvas, while keeping the canvas implementation itself opaque.
  • manage the attachment and detach automatically
  • ability to adjust the location parameter of an existing attachment
  • ability to re-attach existing attachments in a new sequence order
    Remarks
    this test focuses on the concepts and the API, and thus uses a dummy implementation of the "Canvas", which just registers a list of widgets with a dedicated "position" for each.
    See also
    view-hook.hpp
    canvas-hook.hpp

Definition at line 164 of file view-hook-test.cpp.

Private Member Functions

void reOrderHooked ()
 
virtual void run (Arg)
 
void verify_multiplicity ()
 
void verify_standardUsage ()
 

Member Function Documentation

◆ verify_standardUsage()

void verify_standardUsage ( )
inlineprivate
Test:
the standard use case is to hook up a widget to a canvas for display.

Definition at line 179 of file view-hook-test.cpp.

◆ verify_multiplicity()

void verify_multiplicity ( )
inlineprivate
Test:
each hooking has a distinct identity and is managed on its own.

Definition at line 195 of file view-hook-test.cpp.

◆ reOrderHooked()

void reOrderHooked ( )
inlineprivate
Test:
a mechanism to re-attach elements in changed order.
Remarks
this test looks somewhat convoluted, because ViewHooked<W> is defined to be non-copyable (for good reason, since we can assume that the canvas somehow maintains a pointer to each widget added, so we can not allow the attached widgets to move in memory). However, in practice the "order sequence" is typically defined as a delegating iterator over some sequence of model elements, which themselves are managed as a STL container of std::unique_ptr; thus it is very much possible to alter the sequence of the model elements, without actually touching the memory location of the slave widgets used for presentation.

Definition at line 228 of file view-hook-test.cpp.

+ Inheritance diagram for ViewHook_test:
+ Collaboration diagram for ViewHook_test:

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