exception.hh
#ifndef __SDR_EXCEPTION_HH__
#define __SDR_EXCEPTION_HH__
#include <exception>
#include <sstream>
namespace sdr {
class SDRError : public std::exception, public std::stringstream {
public:
SDRError(): std::exception(), std::stringstream() { }
SDRError(const SDRError &other)
: std::exception(), std::stringstream() { this->str(other.str()); }
virtual ~SDRError() throw() { }
virtual const char *what() const throw() { return this->str().c_str(); }
};
class ConfigError : public SDRError {
public:
ConfigError(): SDRError() {}
ConfigError(const ConfigError &other): SDRError(other) {}
virtual ~ConfigError() throw() { }
};
class RuntimeError: public SDRError {
public:
RuntimeError(): SDRError() {}
RuntimeError(const RuntimeError &other): SDRError(other) {}
virtual ~RuntimeError() throw() { }
};
}
#endif // __SDR_EXCEPTION_HH__
sdr::ConfigError::~ConfigError
virtual ~ConfigError()
Destructor.
Definition: exception.hh:31
sdr::SDRError::what
virtual const char * what() const
Implements the std::exception interface.
Definition: exception.hh:20
sdr::ConfigError::ConfigError
ConfigError(const ConfigError &other)
Copy constructor.
Definition: exception.hh:29
sdr
Definition: autocast.hh:8
std
Definition: operators.hh:9
sdr::SDRError
Base class of all SDR exceptions.
Definition: exception.hh:10
sdr::RuntimeError
The runtime error class.
Definition: exception.hh:36
sdr::RuntimeError::~RuntimeError
virtual ~RuntimeError()
Destructor.
Definition: exception.hh:43
sdr::SDRError::SDRError
SDRError(const SDRError &other)
Copy constructor.
Definition: exception.hh:15
sdr::RuntimeError::RuntimeError
RuntimeError()
Constructor.
Definition: exception.hh:39
sdr::RuntimeError::RuntimeError
RuntimeError(const RuntimeError &other)
Copy constructor.
Definition: exception.hh:41
sdr::ConfigError
The configuration error class.
Definition: exception.hh:24
sdr::ConfigError::ConfigError
ConfigError()
Constructor.
Definition: exception.hh:27
sdr::SDRError::~SDRError
virtual ~SDRError()
Destructor.
Definition: exception.hh:18
sdr::SDRError::SDRError
SDRError()
Constructor.
Definition: exception.hh:13