CoDiPack  3.0.0
A Code Differentiation Package
SciComp TU Kaiserslautern
Loading...
Searching...
No Matches
macros.hpp File Reference
#include "../config.h"
Include dependency graph for macros.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  codi::CODI_UNION< First >
 Creates a union of interface definitions. More...
 

Namespaces

namespace  codi
 CoDiPack - Code Differentiation Package.
 

Macros

#define CODI_ENABLE_CHECK(option, condition)
 
#define CODI_TO_STRING(expression)
 Conversion macro.
 
#define CODI_TO_STRING2(expression)
 Conversion macro.
 
#define CODI_UNUSED_ARG(arg)
 Used in a constexpr context, where using CODI_UNUSED spoils the constexpr.
 
#define CODI_WRAP_FUNCTION(NAME, FUNC)
 Wrap a function in a function object. Used for performance optimizations.
 
#define CODI_WRAP_FUNCTION_TEMPLATE(NAME, FUNC)
 Wrap a function in a function object. Used for performance optimizations.
 
Default template type declarations

These templates are used to employ the design guideline for the default definitions of template arguments. See Template declarations for Details.

#define CODI_ANY   int
 Used in default declarations of expression templates.
 
#define CODI_ANY_T(Type)
 Like CODI_ANY but with a specific type.
 
#define CODI_DD(Type, Default)
 Abbreviation for CODI_DECLARE_DEFAULT.
 
#define CODI_DECLARE_DEFAULT(Type, Default)
 
#define CODI_IMPLEMENTATION   ImplProxy
 Used in interface declarations to indicate the type of the implementing class.
 
#define CODI_STATIC_ASSERT(cond, message)
 Static assert definition for CoDiPack. Not evaluated in IDE mode.
 
#define CODI_T(...)
 Abbreviation for CODI_TEMPLATE.
 
#define CODI_TEMPLATE(...)
 Expand template types in preprocessor macros.
 
#define CODI_UNDEFINED   char
 Used in interface declarations for types that have to be defined in the specializations.
 
#define CODI_UNDEFINED_VALUE   false
 Used in interface declarations for variables that have to be defined in the specializations.
 

Functions

template<typename... Args>
inlinevoid codi::CODI_UNUSED (Args const &...)
 Disable unused warnings for an arbitrary number of arguments.
 

Macro Definition Documentation

◆ CODI_ANY_T

#define CODI_ANY_T ( Type)
Value:
Type

Like CODI_ANY but with a specific type.

◆ CODI_DD

#define CODI_DD ( Type,
Default )
Value:
Type

Abbreviation for CODI_DECLARE_DEFAULT.

◆ CODI_DECLARE_DEFAULT

#define CODI_DECLARE_DEFAULT ( Type,
Default )
Value:
Type

CODI_IDE can be defined to use the default declaration of type names. This enables auto completion in the IDEs.

Every using declaration in all CoDiPack classes should declare its variables as: using TYPE = CODI_DECLARE_DEFAULT(T_TYPE, Default);

◆ CODI_ENABLE_CHECK

#define CODI_ENABLE_CHECK ( option,
condition )
Value:
(!(option) || (condition))

Check the condition only if the option is true, otherwise the result is always true. Used like if(CODI_ENABLE_CHECK(option, condition)) {...}, option == false means that the if body is always executed.

◆ CODI_STATIC_ASSERT

#define CODI_STATIC_ASSERT ( cond,
message )
Value:
static_assert(cond, message)

Static assert definition for CoDiPack. Not evaluated in IDE mode.

Static assert in CoDiPack.

◆ CODI_T

#define CODI_T ( ...)
Value:
CODI_TEMPLATE(__VA_ARGS__)
#define CODI_TEMPLATE(...)
Expand template types in preprocessor macros.
Definition macros.hpp:113

Abbreviation for CODI_TEMPLATE.

◆ CODI_TEMPLATE

#define CODI_TEMPLATE ( ...)
Value:
__VA_ARGS__

Expand template types in preprocessor macros.

◆ CODI_TO_STRING

#define CODI_TO_STRING ( expression)
Value:
CODI_TO_STRING2(expression)
#define CODI_TO_STRING2(expression)
Conversion macro.
Definition macros.hpp:64

Conversion macro.

◆ CODI_TO_STRING2

#define CODI_TO_STRING2 ( expression)
Value:
#expression

Conversion macro.

◆ CODI_UNUSED_ARG

#define CODI_UNUSED_ARG ( arg)
Value:
/* arg */

Used in a constexpr context, where using CODI_UNUSED spoils the constexpr.

◆ CODI_WRAP_FUNCTION

#define CODI_WRAP_FUNCTION ( NAME,
FUNC )
Value:
struct NAME { \
public: \ \
template<typename... Args> \
void operator()(Args&&... args) const { \
FUNC(std::forward<Args>(args)...); \
} \
}

Wrap a function in a function object. Used for performance optimizations.

◆ CODI_WRAP_FUNCTION_TEMPLATE

#define CODI_WRAP_FUNCTION_TEMPLATE ( NAME,
FUNC )
Value:
template<typename... TT> \
struct NAME { \
public: \ \
template<typename... Args> \
void operator()(Args&&... args) const { \
FUNC<TT...>(std::forward<Args>(args)...); \
} \
}

Wrap a function in a function object. Used for performance optimizations.