CppWAMP
C++11 client library for the WAMP protocol
wamp::error::Logic Struct Reference

Exception thrown when a pre-condition is not met. More...

#include <cppwamp/error.hpp>

Inherits std::logic_error.

Static Public Member Functions

static void raise (const char *file, int line, const std::string &msg)
 Throws an error::Logic exception with the given details. More...
 
static void check (bool condition, const char *file, int line, const std::string &msg)
 Conditionally throws an error::Logic exception with the given details. More...
 

Detailed Description

Exception thrown when a pre-condition is not met.

Member Function Documentation

◆ raise()

void wamp::error::Logic::raise ( const char *  file,
int  line,
const std::string &  msg 
)
static

Throws an error::Logic exception with the given details.

The CPPWAMP_LOGIC_ERROR macro should be used instead, which will conveniently fill in the file and line details.

Parameters
fileThe source file where the exception is raised
lineThe source line where the exception is raised
msgDescribes the cause of the exception

◆ check()

void wamp::error::Logic::check ( bool  condition,
const char *  file,
int  line,
const std::string &  msg 
)
static

Conditionally throws an error::Logic exception with the given details.

This function is intended for asserting preconditions. The CPPWAMP_LOGIC_CHECK macro should be used instead, which will conveniently fill in the file and line details.

Parameters
conditionIf `true`, then an exception will be thrown
fileThe source file where the exception is raised
lineThe source line where the exception is raised
msgDescribes the cause of the exception

The documentation for this struct was generated from the following files: