DynaMix  1.3.7
A new take on polymorphism in C++
exception.hpp File Reference
#include "global.hpp"
#include "assert.hpp"
#include "preprocessor.hpp"

Classes

class  dynamix::exception
 Parent class of all DynaMix exceptions. More...
 
class  dynamix::bad_mutation
 
class  dynamix::bad_mutation_source
 
class  dynamix::bad_message_call
 Thrown when a message is called on a object that doesn't implement it. More...
 
class  dynamix::unicast_clash
 
class  dynamix::bad_copy_construction
 
class  dynamix::bad_copy_assignment
 
class  dynamix::bad_next_bidder_call
 Thrown by DYNAMIX_CALL_NEXT_BIDDER if no next bidder is available. More...
 
class  dynamix::bad_mixin_move
 

Macros

#define DYNAMIX_THROW_UNLESS(test, exception)   do { if(!(test)) { throw exception(); } } while(false)
 
#define DYNAMIX_MSG_THROW_UNLESS(test, exception)   DYNAMIX_THROW_UNLESS(test, exception)
 
#define DYNAMIX_MULTICAST_MSG_THROW_UNLESS   DYNAMIX_MSG_THROW_UNLESS
 

Detailed Description

The library's exceptions.

Macro Definition Documentation

#define DYNAMIX_THROW_UNLESS (   test,
  exception 
)    do { if(!(test)) { throw exception(); } } while(false)

A macro that throws an exception if DYNAMIX_USE_EXCEPTIONS is defined. If it's not, it falls back to an assert.

#define DYNAMIX_MSG_THROW_UNLESS (   test,
  exception 
)    DYNAMIX_THROW_UNLESS(test, exception)

This macro is used internally to throw exceptions within the functions generated for the mixin messages.

Note
You can disable the throwing of exceptions in the message functions by defining DYNAMIX_NO_MSG_THROW before including DynaMix's headers. If you do this, the messages will fall back to having assert calls in them