Dune Core Modules (2.6.0)

bartonnackmanifcheck.hh File Reference

Provides check for implementation of interface methods when using static polymorphism, i.e. the Barton-Nackman trick. This is purely for debugging purposes. To check the correct implementation of interface methods (and pick up possible infinite loops) NDEBUG must be undefined and DUNE_INTERFACECHECK has to be defined. More...

Go to the source code of this file.

Macros

#define CHECK_AND_CALL_INTERFACE_IMPLEMENTATION(__interface_method_to_call__)    (__interface_method_to_call__)
 

Detailed Description

Provides check for implementation of interface methods when using static polymorphism, i.e. the Barton-Nackman trick. This is purely for debugging purposes. To check the correct implementation of interface methods (and pick up possible infinite loops) NDEBUG must be undefined and DUNE_INTERFACECHECK has to be defined.

Author
Robert Kloefkorn

Use by invoking CHECK_INTERFACE_IMPLEMENTATION(asImp().methodToCheck()) and for template methods double (CHECK_INTERFACE_IMPLEMENTATION((asImp().template methodToCheck<param> ())). If either NDEBUG is defined or DUNE_INTERFACECHECK is undefined the CHECK_INTERFACE_IMPLEMENTATION macro is empty.

Note: adding the interface check to a method will cause the implementation of the method to be called twice, so before use make sure that this will not cause problems e.g. if internal counters are updated.

Macro Definition Documentation

◆ CHECK_AND_CALL_INTERFACE_IMPLEMENTATION

#define CHECK_AND_CALL_INTERFACE_IMPLEMENTATION (   __interface_method_to_call__)     (__interface_method_to_call__)

The macro CHECK_AND_CALL_INTERFACE_IMPLEMENTATION throws an exception, if the interface method ist not implemented and just calls the method otherwise. If NDEBUG is defined no checking is done and the method is just called.

Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.80.0 (Mar 28, 23:30, 2024)