13 #ifndef included_utilities_h
14 #define included_utilities_h
16 #include "CAROM_config.h"
27 #define CAROM_NULL_USE(variable) \
29 if (0) { char* temp = (char *)&variable; temp++; } \
37 #define CAROM_ERROR(X) \
39 std::ostringstream os; \
40 os << X << std::ends; \
41 CAROM::Utilities::abort(os.str(), __FILE__, __LINE__); \
49 #define CAROM_VERIFY(EXP) \
52 std::ostringstream os; \
53 os << "Failed verify: " << # EXP << std::ends; \
54 CAROM::Utilities::abort(os.str(), __FILE__, __LINE__); \
63 #ifdef DEBUG_CHECK_ASSERTIONS
65 #define CAROM_ASSERT(EXP) \
68 std::ostringstream os; \
69 os << "Failed assertion: " << # EXP << std::ends; \
70 CAROM::Utilities::abort(os.str(), __FILE__, __LINE__); \
78 #define CAROM_ASSERT(EXP)
99 const std::string& message,
100 const std::string& filename,
125 const std::string& filename);
static std::string processorToString(int processorID)
Converts a processor ID to a string. Use this to ensure same width is used when converting a processo...
static bool file_exist(const std::string &filename)
Verifies if a file exists.
static void abort(const std::string &message, const std::string &filename, int line)
Cleanly ends the program when something horrible happened and prints a message about what took place....