Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
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

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

Static Private Member Functions

static void operate (PolyVal &elm)
 

Member Function Documentation

◆ run()

virtual void run ( Arg  )
inlineprivatevirtual

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

References PolymorphicValue_test::createOpaqueValues(), PolymorphicValue_test::operate(), PolymorphicValue_test::verifyBasics(), PolymorphicValue_test::verifyCopySupportDetectionMetafunctions(), and PolymorphicValue_test::verifyOverrunProtection().

+ Here is the call graph for this function:

◆ createOpaqueValues()

TestList createOpaqueValues ( )
inlineprivate

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

Referenced by PolymorphicValue_test::run().

+ Here is the caller graph for this function:

◆ operate()

static void operate ( PolyVal elm)
inlinestaticprivate

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

Referenced by PolymorphicValue_test::run().

+ Here is the caller graph for this function:

◆ verifyBasics()

void verifyBasics ( )
inlineprivate

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

Referenced by PolymorphicValue_test::run().

+ Here is the caller graph for this function:

◆ verifyCreation_and_Copy()

template<class PV , class IMP >
void verifyCreation_and_Copy ( )
inlineprivate

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

References INSTANCEOF.

◆ verifyOverrunProtection()

void verifyOverrunProtection ( )
inlineprivate

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

References VERIFY_ERROR.

Referenced by PolymorphicValue_test::run().

+ Here is the caller graph for this function:

◆ 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.

Referenced by PolymorphicValue_test::run().

+ Here is the caller graph for this function:
+ Inheritance diagram for PolymorphicValue_test:
+ Collaboration diagram for PolymorphicValue_test:

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