Loading...
Searching...
No Matches
Macros
Macros
Collaboration diagram for Macros:

Macros

#define BITPIT_COMMA   ,
 
#define BITPIT_CREATE_WORKSPACE(workspace, item_type, size, stack_size)
 
#define BITPIT_DEPRECATED(func)   func
 
#define BITPIT_UNREACHABLE(str)   assert(!str)
 
#define BITPIT_UNUSED(variable)
 

Detailed Description

Macro Definition Documentation

◆ BITPIT_COMMA

#define BITPIT_COMMA   ,

Comma.

Definition at line 97 of file compiler.hpp.

◆ BITPIT_CREATE_WORKSPACE

#define BITPIT_CREATE_WORKSPACE ( workspace,
item_type,
size,
stack_size )
Value:
item_type *workspace; \
std::array<item_type, stack_size> workspace##_stack; \
std::unique_ptr<std::vector<item_type>> workspace##_heap; \
if (size <= stack_size) { \
workspace = workspace##_stack.data(); \
} else { \
workspace##_heap = std::unique_ptr<std::vector<item_type>>(new std::vector<item_type>(size)); \
workspace = workspace##_heap->data(); \
}

Create a workspace with the specified size.

If the size is less than the specified stack size, the workspace will make use of an array created on the stack, otherwise a container with the specified size will be created on the heap and that container will be used for the workspace.

NOTE: this macro will always create an array on the stack, whether it will be used as workspace or not depend on the requested workspace size.

Parameters
workspaceis the name of the workspace
item_typeis the type of items the workspace will contain
sizeis the size of the workspace
stack_sizeis the maximum size the workspace can have to be allocated on the stack
Examples
RBF_example_00001.cpp.

Definition at line 76 of file commonUtils.hpp.

◆ BITPIT_DEPRECATED

#define BITPIT_DEPRECATED ( func)    func

Deprecated macro.

Parameters
funcid the function/method to be marked as deprecated

Definition at line 87 of file compiler.hpp.

◆ BITPIT_UNREACHABLE

#define BITPIT_UNREACHABLE ( str)    assert(!str)

Unreachable macro.

Useful for suppressing "control reaches end of non-void function" warnings.

Parameters
stris the error message that will be displayed it the unreachable code is reached

Definition at line 53 of file compiler.hpp.

◆ BITPIT_UNUSED

#define BITPIT_UNUSED ( variable)
--- layout: doxygen_footer ---