Classes | Namespaces | Macros
src/macros.hpp File Reference
#include <exception>
#include <stdexcept>
Include dependency graph for src/macros.hpp:

Go to the source code of this file.

Classes

struct  pinocchio::helper::argument_type< T >
 
struct  pinocchio::helper::argument_type< T(U)>
 
struct  pinocchio::helper::handle_return_type_without_typename< D, TypeAccess >
 

Namespaces

 pinocchio
 Main pinocchio namespace.
 
 pinocchio::helper
 

Macros

#define _PINOCCHIO_CHECK_ARGUMENT_SIZE_1
 
#define _PINOCCHIO_CHECK_ARGUMENT_SIZE_2(size, expected_size)   _PINOCCHIO_CHECK_ARGUMENT_SIZE_3(size, expected_size, PINOCCHIO_STRING_LITERAL(size) " is different from " PINOCCHIO_STRING_LITERAL(expected_size))
 
#define _PINOCCHIO_CHECK_ARGUMENT_SIZE_3(size, expected_size, message)
 
#define _PINOCCHIO_CHECK_INPUT_ARGUMENT_0
 
#define _PINOCCHIO_CHECK_INPUT_ARGUMENT_1(condition)
 
#define _PINOCCHIO_CHECK_INPUT_ARGUMENT_2(condition, message)   PINOCCHIO_THROW(condition,std::invalid_argument,message)
 
#define _PINOCCHIO_EXPAND(x)   x
 
#define _PINOCCHIO_GET_OVERRIDE_FOR_CHECK_ARGUMENT_SIZE(_1, _2, _3, MACRO_NAME, ...)   MACRO_NAME
 
#define _PINOCCHIO_GET_OVERRIDE_FOR_CHECK_INPUT_ARGUMENT(_1, _2, MACRO_NAME, ...)   MACRO_NAME
 
#define PINOCCHIO_ASSERT_MATRIX_SPECIFIC_SIZE(type, M, nrows, ncols)
 Ensure that a matrix (or vector) is of correct size (compile-time and run-time assertion) More...
 
#define PINOCCHIO_CHECK_ARGUMENT_SIZE(...)
 Macro to check if the size of an element is equal to the expected size. More...
 
#define PINOCCHIO_CHECK_INPUT_ARGUMENT(...)
 Macro to check an assert-like condition and throw a std::invalid_argument exception (with a message) if violated. More...
 
#define PINOCCHIO_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS
 
#define PINOCCHIO_COMPILER_DIAGNOSTIC_POP
 
#define PINOCCHIO_COMPILER_DIAGNOSTIC_PUSH
 macros for pragma push/pop/ignore deprecated warnings More...
 
#define PINOCCHIO_MACRO_EMPTY_ARG
 Empty macro argument. More...
 
#define PINOCCHIO_NOT_A_MACRO
 
#define PINOCCHIO_STATIC_ASSERT(condition, msg)   { int msg[(condition) ? 1 : -1]; /*avoid unused-variable warning*/ (void) msg; }
 
#define PINOCCHIO_STRING_LITERAL(string)   #string
 
#define PINOCCHIO_THROW(condition, exception_type, message)   if (!(condition)) { throw exception_type(message); }
 Generic macro to throw an exception in Pinocchio if the condition is not met with a given input message. More...
 
#define PINOCCHIO_UNUSED_VARIABLE(var)   (void)(var)
 Helper to declare that a parameter is unused. More...
 

Macro Definition Documentation

#define _PINOCCHIO_CHECK_ARGUMENT_SIZE_1

Definition at line 144 of file src/macros.hpp.

#define _PINOCCHIO_CHECK_ARGUMENT_SIZE_2 (   size,
  expected_size 
)    _PINOCCHIO_CHECK_ARGUMENT_SIZE_3(size, expected_size, PINOCCHIO_STRING_LITERAL(size) " is different from " PINOCCHIO_STRING_LITERAL(expected_size))

Definition at line 141 of file src/macros.hpp.

#define _PINOCCHIO_CHECK_ARGUMENT_SIZE_3 (   size,
  expected_size,
  message 
)
Value:
if (size != expected_size) { \
std::ostringstream oss; \
oss << "wrong argument size: expected " << expected_size << ", got " << size << std::endl; \
oss << "hint: " << message << std::endl; \
PINOCCHIO_THROW(false, std::invalid_argument, oss.str()); \
}
std::size_t size(custom_string const &s)
#define PINOCCHIO_THROW(condition, exception_type, message)
Generic macro to throw an exception in Pinocchio if the condition is not met with a given input messa...
Definition: src/macros.hpp:108

Definition at line 133 of file src/macros.hpp.

#define _PINOCCHIO_CHECK_INPUT_ARGUMENT_0

Definition at line 124 of file src/macros.hpp.

#define _PINOCCHIO_CHECK_INPUT_ARGUMENT_1 (   condition)
Value:
"The following check on the input argument has failed: "#condition)
#define _PINOCCHIO_CHECK_INPUT_ARGUMENT_2(condition, message)
Definition: src/macros.hpp:117

Definition at line 120 of file src/macros.hpp.

#define _PINOCCHIO_CHECK_INPUT_ARGUMENT_2 (   condition,
  message 
)    PINOCCHIO_THROW(condition,std::invalid_argument,message)

Definition at line 117 of file src/macros.hpp.

#define _PINOCCHIO_EXPAND (   x)    x

Definition at line 114 of file src/macros.hpp.

#define _PINOCCHIO_GET_OVERRIDE_FOR_CHECK_ARGUMENT_SIZE (   _1,
  _2,
  _3,
  MACRO_NAME,
  ... 
)    MACRO_NAME

Definition at line 131 of file src/macros.hpp.

#define _PINOCCHIO_GET_OVERRIDE_FOR_CHECK_INPUT_ARGUMENT (   _1,
  _2,
  MACRO_NAME,
  ... 
)    MACRO_NAME

Definition at line 115 of file src/macros.hpp.

#define PINOCCHIO_ASSERT_MATRIX_SPECIFIC_SIZE (   type,
  M,
  nrows,
  ncols 
)
Value:
EIGEN_STATIC_ASSERT( (type::RowsAtCompileTime == Eigen::Dynamic || type::RowsAtCompileTime == nrows) \
&& (type::ColsAtCompileTime == Eigen::Dynamic || type::ColsAtCompileTime == ncols),\
THIS_METHOD_IS_ONLY_FOR_MATRICES_OF_A_SPECIFIC_SIZE); \
assert(M.rows()==nrows && M.cols()==ncols);
M

Ensure that a matrix (or vector) is of correct size (compile-time and run-time assertion)

Definition at line 54 of file src/macros.hpp.

#define PINOCCHIO_CHECK_ARGUMENT_SIZE (   ...)
Value:
#define _PINOCCHIO_CHECK_ARGUMENT_SIZE_2(size, expected_size)
Definition: src/macros.hpp:141
#define _PINOCCHIO_CHECK_ARGUMENT_SIZE_3(size, expected_size, message)
Definition: src/macros.hpp:133
#define _PINOCCHIO_CHECK_ARGUMENT_SIZE_1
Definition: src/macros.hpp:144
#define _PINOCCHIO_EXPAND(x)
Definition: src/macros.hpp:114
#define _PINOCCHIO_GET_OVERRIDE_FOR_CHECK_ARGUMENT_SIZE(_1, _2, _3, MACRO_NAME,...)
Definition: src/macros.hpp:131

Macro to check if the size of an element is equal to the expected size.

Definition at line 147 of file src/macros.hpp.

#define PINOCCHIO_CHECK_INPUT_ARGUMENT (   ...)
Value:
#define _PINOCCHIO_CHECK_INPUT_ARGUMENT_1(condition)
Definition: src/macros.hpp:120
#define _PINOCCHIO_CHECK_INPUT_ARGUMENT_0
Definition: src/macros.hpp:124
#define _PINOCCHIO_GET_OVERRIDE_FOR_CHECK_INPUT_ARGUMENT(_1, _2, MACRO_NAME,...)
Definition: src/macros.hpp:115
#define _PINOCCHIO_CHECK_INPUT_ARGUMENT_2(condition, message)
Definition: src/macros.hpp:117
#define _PINOCCHIO_EXPAND(x)
Definition: src/macros.hpp:114

Macro to check an assert-like condition and throw a std::invalid_argument exception (with a message) if violated.

Definition at line 127 of file src/macros.hpp.

#define PINOCCHIO_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS

Definition at line 90 of file src/macros.hpp.

#define PINOCCHIO_COMPILER_DIAGNOSTIC_POP

Definition at line 89 of file src/macros.hpp.

#define PINOCCHIO_COMPILER_DIAGNOSTIC_PUSH

macros for pragma push/pop/ignore deprecated warnings

Definition at line 88 of file src/macros.hpp.

#define PINOCCHIO_MACRO_EMPTY_ARG

Empty macro argument.

Definition at line 48 of file src/macros.hpp.

#define PINOCCHIO_NOT_A_MACRO

Definition at line 36 of file src/macros.hpp.

#define PINOCCHIO_STATIC_ASSERT (   condition,
  msg 
)    { int msg[(condition) ? 1 : -1]; /*avoid unused-variable warning*/ (void) msg; }

Static assertion.

Parameters
conditiona boolean convertible expression
msga valid C++ variable name.

Definition at line 63 of file src/macros.hpp.

#define PINOCCHIO_STRING_LITERAL (   string)    #string

Definition at line 23 of file src/macros.hpp.

#define PINOCCHIO_THROW (   condition,
  exception_type,
  message 
)    if (!(condition)) { throw exception_type(message); }

Generic macro to throw an exception in Pinocchio if the condition is not met with a given input message.

Definition at line 108 of file src/macros.hpp.

#define PINOCCHIO_UNUSED_VARIABLE (   var)    (void)(var)

Helper to declare that a parameter is unused.

Definition at line 51 of file src/macros.hpp.



pinocchio
Author(s):
autogenerated on Tue Jun 1 2021 02:45:05