delphyne
macros.h File Reference
#include <string>
#include <drake/common/drake_assert.h>
#include <drake/common/drake_copyable.h>
Include dependency graph for macros.h:
This graph shows which files directly or indirectly include this file:

Macros

#define DELPHYNE_DEPRECATED(version)   ()
 
#define DELPHYNE_FORCEINLINE
 
#define DELPHYNE_ASSERT(condition)   DRAKE_ASSERT(condition)
 
#define DELPHYNE_DEMAND(condition)   DRAKE_DEMAND(condition)
 
#define DELPHYNE_ABORT_MESSAGE(msg)   DRAKE_DEMAND(msg)
 
#define DELPHYNE_NO_COPY_NO_MOVE_NO_ASSIGN(class)   DRAKE_NO_COPY_NO_MOVE_NO_ASSIGN(class)
 
#define STR_SIMPLE(x)   #x
 
#define STR(x)   STR_SIMPLE(x)
 
#define DELPHYNE_VALIDATE(pred, exctype, message)
 

Macro Definition Documentation

◆ DELPHYNE_ABORT_MESSAGE

#define DELPHYNE_ABORT_MESSAGE (   msg)    DRAKE_DEMAND(msg)

◆ DELPHYNE_ASSERT

#define DELPHYNE_ASSERT (   condition)    DRAKE_ASSERT(condition)

Used to declare an assertion. Will quit execution otherwise.

◆ DELPHYNE_DEMAND

#define DELPHYNE_DEMAND (   condition)    DRAKE_DEMAND(condition)

Used to declare a demand. Will quit execution otherwise.

◆ DELPHYNE_DEPRECATED

#define DELPHYNE_DEPRECATED (   version)    ()

◆ DELPHYNE_FORCEINLINE

#define DELPHYNE_FORCEINLINE

◆ DELPHYNE_NO_COPY_NO_MOVE_NO_ASSIGN

#define DELPHYNE_NO_COPY_NO_MOVE_NO_ASSIGN (   class)    DRAKE_NO_COPY_NO_MOVE_NO_ASSIGN(class)

Deletes the special member functions for copy-construction, copy-assignment, move-construction, and move-assignment. Invoke this macro in the public section of the class declaration, e.g.:

class Foo {
 public:
  DELPHYNE_NO_COPY_NO_MOVE_NO_ASSIGN(Foo)
  // ...
};

*‍/

◆ DELPHYNE_VALIDATE

#define DELPHYNE_VALIDATE (   pred,
  exctype,
  message 
)
Value:
do { \
if (!(pred)) { \
std::string fullname = std::string(__FILE__); \
size_t found = fullname.find_last_of("/"); \
std::string fname = fullname; \
if (found != std::string::npos) { \
fname = fullname.substr(found + 1); \
} \
std::string errmsg(fname); \
errmsg.append(":").append(__func__).append(":").append(STR(__LINE__)); \
errmsg.append(": ").append(message); \
throw exctype(errmsg); \
} \
} while (0)

Used to validate that an argument passed into a function or method is true; if not, an exception of type exctype is thrown.

◆ STR

#define STR (   x)    STR_SIMPLE(x)

Stringify a token

◆ STR_SIMPLE

#define STR_SIMPLE (   x)    #x

Internal stringify a token

STR
#define STR(x)
Definition: macros.h:82