OscProb
exceptions.h File Reference
#include <sstream>
#include <stdexcept>
#include <string>
#include <vector>

Go to the source code of this file.

Namespaces

namespace  OscProb
 Some useful general definitions.
 

Macros

#define FUNCTION_NAME   __func__
 
#define THROW_ON_INVALID_ARG(condition, ...)
 

Functions

std::vector< std::string > OscProb::split (const std::string &s, char delimiter)
 Helper function to split a string by a delimiter. More...
 
template<typename... Args>
std::string OscProb::format_args (const std::string &names, const Args &... args)
 The main variadic template function to log the arguments. More...
 

Macro Definition Documentation

◆ FUNCTION_NAME

#define FUNCTION_NAME   __func__

Definition at line 83 of file exceptions.h.

◆ THROW_ON_INVALID_ARG

#define THROW_ON_INVALID_ARG (   condition,
  ... 
)
Value:
do { \
if (!(condition)) { \
std::stringstream ss; \
ss << "\n Condition '" << #condition << "' failed." \
<< "\n With: " << OscProb::format_args(#__VA_ARGS__, __VA_ARGS__) \
<< "\n In function: " << FUNCTION_NAME \
<< "\n At file: " << __FILE__ << "\n At line: " << __LINE__; \
throw std::invalid_argument(ss.str()); \
} \
} \
while (0)
#define FUNCTION_NAME
Definition: exceptions.h:83
std::string format_args(const std::string &names, const Args &... args)
The main variadic template function to log the arguments.
Definition: exceptions.h:55

Definition at line 87 of file exceptions.h.