Loading...
Searching...
No Matches
bartonnackmanifcheck.hh
Go to the documentation of this file.
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root
// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
//- Dune includes
#include <dune/common/exceptions.hh>
#ifdef CHECK_INTERFACE_IMPLEMENTATION
#undef CHECK_INTERFACE_IMPLEMENTATION
#endif
#ifdef CHECK_AND_CALL_INTERFACE_IMPLEMENTATION
#undef CHECK_AND_CALL_INTERFACE_IMPLEMENTATION
#endif
#if defined NDEBUG || !defined DUNE_INTERFACECHECK
#define CHECK_INTERFACE_IMPLEMENTATION(dummy)
#else
#define CHECK_INTERFACE_IMPLEMENTATION(__interface_method_to_call__) \
{\
static bool call = false; \
if( call == true ) \
DUNE_THROW(NotImplemented,"Interface method not implemented!");\
call = true; \
try { \
(__interface_method_to_call__); \
call = false; \
} \
catch ( ... ) \
{ \
call = false; \
throw; \
} \
}
#endif
#if defined NDEBUG || !defined DUNE_INTERFACECHECK
#define CHECK_AND_CALL_INTERFACE_IMPLEMENTATION(__interface_method_to_call__) \
(__interface_method_to_call__)
#else
#define CHECK_AND_CALL_INTERFACE_IMPLEMENTATION(__interface_method_to_call__) \
CHECK_INTERFACE_IMPLEMENTATION(__interface_method_to_call__)
#endif
exceptions.hh
A few common exception classes.