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

Description

Test:
build a bunch of PolymorphicValue objects.

Handle them like copyable value objects, without knowing the exact implementation type; moreover execute implementation internals only disclosed to the concrete subtype. Verify correctness through checksums.

Definition at line 165 of file polymorphic-value-test.cpp.

Private Member Functions

TestList createOpaqueValues ()
 
virtual void run (Arg)
 
void verifyBasics ()
 
void verifyCopySupportDetectionMetafunctions ()
 
template<class PV , class IMP >
void verifyCreation_and_Copy ()
 
void verifyOverrunProtection ()
 

Static Private Member Functions

static void operate (PolyVal &elm)
 

Member Function Documentation

◆ verifyCopySupportDetectionMetafunctions()

void verifyCopySupportDetectionMetafunctions ( )
inlineprivate
Test:
internally, PolymorphicValue uses some metafunctions to pick a suitable code path, based on the presence of helper functions on the API of the embedded objects.

Default is no support by these objects, which then requires to use a more expensive implementation. Sometimes it's desirable to support cloning only (copy ctor), but no assignment after the fact. In this special case, a support API with only a cloneInto() member can be implemented, causing the PolymorphicValue container to raise an exception in case the copy operator is invoked.

Definition at line 291 of file polymorphic-value-test.cpp.

+ Inheritance diagram for PolymorphicValue_test:
+ Collaboration diagram for PolymorphicValue_test:

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