blocxx
|
#include "blocxx/BLOCXX_config.h"
#include "blocxx/AutoPtr.hpp"
#include <iosfwd>
#include <exception>
#include <new>
#include <cerrno>
Go to the source code of this file.
Classes | |
class | BLOCXX_NAMESPACE::Exception |
This class is the base of all exceptions thrown by BloCxx code. More... | |
class | BLOCXX_NAMESPACE::ExceptionDetail::FormatMsg |
struct | BLOCXX_NAMESPACE::ExceptionDetail::Errno< exType > |
Namespaces | |
namespace | BLOCXX_NAMESPACE |
Taken from RFC 1321. | |
namespace | BLOCXX_NAMESPACE::ExceptionDetail |
Macros | |
#define | BLOCXX_THROW(exType, msg) |
Throw an exception using FILE and LINE. | |
#define | BLOCXX_THROWL(exType, line, msg) |
This macro is deprecated in 3.1.0. | |
#define | BLOCXX_THROW_SUBEX(exType, msg, subex) |
Throw an exception using FILE and LINE. | |
#define | BLOCXX_THROW_ERR(exType, msg, err) |
Throw an exception using FILE and LINE. | |
#define | BLOCXX_THROW_ERRNO(exType) |
Throw an exception using FILE, LINE, errno and strerror(errno) | |
#define | BLOCXX_THROW_ERRNO1(exType, errnum) |
Throw an exception using FILE, LINE, errnum and strerror(errnum) | |
#define | BLOCXX_THROW_ERRNO_MSG(exType, msg) |
Throw an exception using FILE, LINE, errno and strerror(errno) | |
#define | BLOCXX_THROW_ERRNO_MSG1(exType, msg, errnum) |
Throw an exception using FILE, LINE, errnum and strerror(errnum) | |
#define | BLOCXX_THROW_ERR_SUBEX(exType, msg, err, subex) |
Throw an exception using FILE and LINE. | |
#define | BLOCXX_DECLARE_EXCEPTION2(NAME, BASE) |
Declare a new exception class named <NAME>Exception that derives from <BASE>. | |
#define | BLOCXX_DECLARE_APIEXCEPTION2(NAME, BASE, LINKAGE_SPEC) |
Declare a new exception class named <NAME>Exception that derives from <BASE>. | |
#define | BLOCXX_DECLARE_EXCEPTION(NAME) |
Declare a new exception class named <NAME>Exception that derives from Exception This macro is typically used in a header file. | |
#define | BLOCXX_DECLARE_APIEXCEPTION(NAME, LINKAGE_SPEC) |
Declare a new exception class named <NAME>Exception that derives from Exception This macro is typically used in a header file. | |
#define | BLOCXX_DEFINE_EXCEPTION2(NAME, BASE) |
Define a new exception class named <NAME>Exception that derives from <BASE>. | |
#define | BLOCXX_DEFINE_EXCEPTION_WITH_BASE_AND_ID_AUX(NAME, BASE, SUB_CLASS_ID) |
Define a new exception class named <NAME>Exception that derives from <BASE>. | |
#define | BLOCXX_DEFINE_EXCEPTION(NAME) |
Define a new exception class named <NAME>Exception that derives from Exception. | |
#define | BLOCXX_DEFINE_EXCEPTION_WITH_ID(NAME) |
Define a new exception class named <NAME>Exception that derives from Exception. | |
#define | BLOCXX_DEFINE_EXCEPTION_WITH_BASE_AND_ID(NAME, BASE) |
Define a new exception class named <NAME>Exception that derives from <BASE>. | |
Functions | |
void | BLOCXX_NAMESPACE::ExceptionDetail::portable_strerror_r (int errnum, char *buf, unsigned n) |
std::ostream & | BLOCXX_NAMESPACE::operator<< (std::ostream &os, const Exception &e) |
Writes the exception object to the stream in the form: <file>: <line> <type>: <message> | |
Variables | |
struct BLOCXX_COMMON_API | BLOCXX_NAMESPACE::ExceptionDetail::FormatMsgImpl |
unsigned const | BLOCXX_NAMESPACE::ExceptionDetail::BUFSZ = 1024 |
#define BLOCXX_DECLARE_APIEXCEPTION | ( | NAME, | |
LINKAGE_SPEC ) |
Declare a new exception class named <NAME>Exception that derives from Exception This macro is typically used in a header file.
NAME | The name of the new class (Exception will be postfixed) |
LINKAGE_SPEC | the linkage specifier. If the BLOCXX_DEFINE_EXCEPTION is part of libblocxx this would BLOCXX_COMMON_API... |
Definition at line 396 of file Exception.hpp.
#define BLOCXX_DECLARE_APIEXCEPTION2 | ( | NAME, | |
BASE, | |||
LINKAGE_SPEC ) |
Declare a new exception class named <NAME>Exception that derives from <BASE>.
This macro is typically used in a header file. The exception class declaration will be prefaced with the linkage_spec parm. This allows the use of BLOCXX_COMMON_API when declaring exceptions. Example: BLOCXX_DECLARE_APIEXCEPTION(Bogus, MYException, BLOCXX_COMMON_API)
NAME | The name of the new class (Exception will be postfixed) |
BASE | The base class. |
LINKAGE_SPEC | The linkage specifier for the exception class. |
Definition at line 366 of file Exception.hpp.
#define BLOCXX_DECLARE_EXCEPTION | ( | NAME | ) |
Declare a new exception class named <NAME>Exception that derives from Exception This macro is typically used in a header file.
NAME | The name of the new class (Exception will be postfixed) |
Definition at line 386 of file Exception.hpp.
#define BLOCXX_DECLARE_EXCEPTION2 | ( | NAME, | |
BASE ) |
Declare a new exception class named <NAME>Exception that derives from <BASE>.
This macro is typically used in a header file.
NAME | The name of the new class (Exception will be postfixed) |
BASE | The base class. |
Definition at line 344 of file Exception.hpp.
#define BLOCXX_DEFINE_EXCEPTION | ( | NAME | ) |
Define a new exception class named <NAME>Exception that derives from Exception.
The new class will use UNKNOWN_SUBCLASS_ID for the subclass id. Use this macro for internal implementation exceptions that don't have an id. This macro is typically used in a cpp file.
NAME | The name of the new class (Exception will be postfixed) |
Definition at line 439 of file Exception.hpp.
#define BLOCXX_DEFINE_EXCEPTION2 | ( | NAME, | |
BASE ) |
Define a new exception class named <NAME>Exception that derives from <BASE>.
The new class will use UNKNOWN_SUBCLASS_ID for the subclass id. This macro is typically used in a cpp file.
NAME | The name of the new class (Exception will be postfixed) |
BASE | The base class. |
Definition at line 406 of file Exception.hpp.
#define BLOCXX_DEFINE_EXCEPTION_WITH_BASE_AND_ID | ( | NAME, | |
BASE ) |
Define a new exception class named <NAME>Exception that derives from <BASE>.
The new class will use ExceptionIds::<NAME>ExceptionId for the subclass id. Use this macro to create public exceptions that have an id in the BLOCXX_NAMESPACE::ExceptionIds namespace that will derive from BASE This macro is typically used in a cpp file.
NAME | The name of the new class (Exception will be postfixed) |
BASE | The base class. |
Definition at line 460 of file Exception.hpp.
#define BLOCXX_DEFINE_EXCEPTION_WITH_BASE_AND_ID_AUX | ( | NAME, | |
BASE, | |||
SUB_CLASS_ID ) |
Define a new exception class named <NAME>Exception that derives from <BASE>.
The new class will use SUB_CLASS_ID for the subclass id. This macro is typically used in a cpp file.
NAME | The name of the new class (Exception will be postfixed) |
BASE | The base class. |
SUB_CLASS_ID | The subclass id. |
Definition at line 423 of file Exception.hpp.
#define BLOCXX_DEFINE_EXCEPTION_WITH_ID | ( | NAME | ) |
Define a new exception class named <NAME>Exception that derives from Exception.
The new class will use ExceptionIds::<NAME>ExceptionId for the subclass id. Use this macro to create public exceptions that have an id in the BLOCXX_NAMESPACE::ExceptionIds namespace that derive from Exception This macro is typically used in a cpp file.
NAME | The name of the new class (Exception will be postfixed) |
Definition at line 449 of file Exception.hpp.
#define BLOCXX_THROW | ( | exType, | |
msg ) |
Throw an exception using FILE and LINE.
If applicable, BLOCXX_THROW_ERR should be used instead of this macro.
exType | The type of the exception |
msg | The exception message. A string that will be copied. |
Definition at line 263 of file Exception.hpp.
Referenced by BLOCXX_NAMESPACE::ServerSocketImpl::accept(), BLOCXX_NAMESPACE::Mutex::acquire(), BLOCXX_NAMESPACE::NonRecursiveMutex::acquire(), BLOCXX_NAMESPACE::GenericRWLockImpl< IdT, CompareT >::acquireReadLock(), BLOCXX_NAMESPACE::GenericRWLockImpl< IdT, CompareT >::acquireWriteLock(), BLOCXX_NAMESPACE::SocketAddress::allocEmptyAddress(), BLOCXX_NAMESPACE::FileSystemMockObject::basename(), BLOCXX_NAMESPACE::TempFileBuffer::buffer_to_device(), BLOCXX_NAMESPACE::FileSystemMockObject::canRead(), BLOCXX_NAMESPACE::FileSystemMockObject::canWrite(), BLOCXX_NAMESPACE::FileSystemMockObject::changeDirectory(), BLOCXX_NAMESPACE::FileSystemMockObject::changeFileOwner(), BLOCXX_NAMESPACE::FileSystemMockObject::close(), BLOCXX_NAMESPACE::NonRecursiveMutex::conditionPostWait(), BLOCXX_NAMESPACE::NonRecursiveMutex::conditionPreWait(), BLOCXX_NAMESPACE::SocketBaseImpl::connect(), BLOCXX_NAMESPACE::FileSystemMockObject::createFile(), BLOCXX_NAMESPACE::FileSystemMockObject::createTempFile(), BLOCXX_NAMESPACE::FileSystemMockObject::createTempFile(), BLOCXX_NAMESPACE::FileSystemMockObject::dirname(), BLOCXX_NAMESPACE::ExecMockObject::executeProcessAndGatherOutput(), BLOCXX_NAMESPACE::ExecMockObject::executeProcessAndGatherOutput2(), BLOCXX_NAMESPACE::FileSystemMockObject::exists(), BLOCXX_NAMESPACE::SafeCString::fget_string(), BLOCXX_NAMESPACE::SafeCString::fgets_check(), BLOCXX_NAMESPACE::SafeCString::fgets_trunc(), BLOCXX_NAMESPACE::FileAppender::FileAppender(), BLOCXX_NAMESPACE::FileSystemMockObject::fileSize(), BLOCXX_NAMESPACE::FileSystemMockObject::flush(), BLOCXX_NAMESPACE::SocketAddress::getByName(), BLOCXX_NAMESPACE::FileSystemMockObject::getCurrentWorkingDirectory(), BLOCXX_NAMESPACE::FileSystemMockObject::getDirectoryContents(), BLOCXX_NAMESPACE::FileSystem::getFileContents(), BLOCXX_NAMESPACE::FileSystemMockObject::getFileContents(), BLOCXX_NAMESPACE::FileSystemMockObject::getFileLines(), BLOCXX_NAMESPACE::FileSystemMockObject::getFileSize(), BLOCXX_NAMESPACE::SocketUtils::getFullyQualifiedHostName(), BLOCXX_NAMESPACE::NwIface::getInterfaceName(), BLOCXX_NAMESPACE::SocketAddress::getUDS(), BLOCXX_NAMESPACE::SelectEngine::go(), BLOCXX_NAMESPACE::ThreadCounter::incThreadCount(), BLOCXX_NAMESPACE::FileSystemMockObject::isDirectory(), BLOCXX_NAMESPACE::FileSystemMockObject::isExecutable(), BLOCXX_NAMESPACE::FileSystemMockObject::isLink(), BLOCXX_NAMESPACE::Thread::join(), BLOCXX_NAMESPACE::DateTime::localTimeAndOffset(), BLOCXX_NAMESPACE::FileSystemMockObject::makeDirectory(), BLOCXX_NAMESPACE::MultiProcessFileAppender::MultiProcessFileAppender(), BLOCXX_NAMESPACE::Mutex::Mutex(), BLOCXX_NAMESPACE::NonRecursiveMutex::NonRecursiveMutex(), BLOCXX_NAMESPACE::NwIface::NwIface(), BLOCXX_NAMESPACE::FileSystemMockObject::openFile(), BLOCXX_NAMESPACE::FileSystemMockObject::openForAppendOrCreateFile(), BLOCXX_NAMESPACE::FileSystemMockObject::openOrCreateFile(), BLOCXX_NAMESPACE::PosixUnnamedPipe::passDescriptor(), BLOCXX_NAMESPACE::Exec::processInputOutput(), BLOCXX_NAMESPACE::BinarySerialization::read(), BLOCXX_NAMESPACE::FileSystem::read(), BLOCXX_NAMESPACE::FileSystemMockObject::read(), BLOCXX_NAMESPACE::PosixUnnamedPipe::read(), BLOCXX_NAMESPACE::BinarySerialization::readLen(), BLOCXX_NAMESPACE::TempFileEnumerationImplBase::readSize(), BLOCXX_NAMESPACE::FileSystemMockObject::readSymbolicLink(), BLOCXX_NAMESPACE::FileSystem::Path::realPath(), BLOCXX_NAMESPACE::FileSystemMockObject::realPath(), BLOCXX_NAMESPACE::PosixUnnamedPipe::receiveDescriptor(), BLOCXX_NAMESPACE::receiveDescriptor(), BLOCXX_NAMESPACE::Mutex::release(), BLOCXX_NAMESPACE::NonRecursiveMutex::release(), BLOCXX_NAMESPACE::GenericRWLockImpl< IdT, CompareT >::releaseReadLock(), BLOCXX_NAMESPACE::GenericRWLockImpl< IdT, CompareT >::releaseWriteLock(), BLOCXX_NAMESPACE::FileSystemMockObject::removeDirectory(), BLOCXX_NAMESPACE::FileSystemMockObject::removeFile(), BLOCXX_NAMESPACE::FileSystemMockObject::renameFile(), BLOCXX_NAMESPACE::FileSystemMockObject::rewind(), BLOCXX_NAMESPACE::FileSystemMockObject::security(), BLOCXX_NAMESPACE::FileSystemMockObject::security(), BLOCXX_NAMESPACE::FileSystemMockObject::security(), BLOCXX_NAMESPACE::FileSystemMockObject::security(), BLOCXX_NAMESPACE::FileSystem::seek(), BLOCXX_NAMESPACE::FileSystemMockObject::seek(), BLOCXX_NAMESPACE::DateTime::set(), BLOCXX_NAMESPACE::DateTime::setMicrosecond(), BLOCXX_NAMESPACE::DateTime::setMonth(), BLOCXX_NAMESPACE::DateTime::setTime(), BLOCXX_NAMESPACE::Socket::Socket(), BLOCXX_NAMESPACE::Socket::Socket(), BLOCXX_NAMESPACE::Socket::Socket(), BLOCXX_NAMESPACE::Socket::Socket(), BLOCXX_NAMESPACE::Socket::Socket(), BLOCXX_NAMESPACE::Thread::start(), BLOCXX_NAMESPACE::FileSystemMockObject::tell(), BLOCXX_NAMESPACE::TempFileEnumerationImplBase::throwIfEmpty(), BLOCXX_NAMESPACE::throwStringConversion(), BLOCXX_NAMESPACE::throwStringConversion(), BLOCXX_NAMESPACE::Condition::timedWait(), BLOCXX_NAMESPACE::MD5::update(), BLOCXX_NAMESPACE::UUID::UUID(), BLOCXX_NAMESPACE::BinarySerialization::verifySignature(), BLOCXX_NAMESPACE::Condition::wait(), BLOCXX_NAMESPACE::Process::waitCloseTerm(), BLOCXX_NAMESPACE::ThreadCounter::waitForAll(), BLOCXX_NAMESPACE::FileSystem::write(), BLOCXX_NAMESPACE::FileSystemMockObject::write(), and BLOCXX_NAMESPACE::PosixUnnamedPipe::write().
#define BLOCXX_THROW_ERR | ( | exType, | |
msg, | |||
err ) |
Throw an exception using FILE and LINE.
exType | The type of the exception |
msg | The exception message. A string that will be copied. |
err | The error code. |
Definition at line 287 of file Exception.hpp.
Referenced by BLOCXX_NAMESPACE::CmdLineParser::CmdLineParser(), BLOCXX_NAMESPACE::LogAppender::createLogAppender(), BLOCXX_NAMESPACE::SafeCString::fgets_check(), BLOCXX_NAMESPACE::CmdLineParser::mustGetOptionValue(), BLOCXX_NAMESPACE::CmdLineParser::mustGetOptionValueList(), BLOCXX_NAMESPACE::SafeCString::Impl::nchars_check(), and BLOCXX_NAMESPACE::SafeCString::strcpy_check().
#define BLOCXX_THROW_ERR_SUBEX | ( | exType, | |
msg, | |||
err, | |||
subex ) |
Throw an exception using FILE and LINE.
exType | The type of the exception |
msg | The exception message. A string that will be copied. |
err | The error code. |
subex | A sub-exception. A point to it will be passed to the exception constructor, which should clone() it. |
Definition at line 334 of file Exception.hpp.
Referenced by BLOCXX_NAMESPACE::LogAppender::createLogAppender().
#define BLOCXX_THROW_ERRNO | ( | exType | ) |
Throw an exception using FILE, LINE, errno and strerror(errno)
exType | The type of the exception; ctor must take file, line, message, and error code. |
Definition at line 295 of file Exception.hpp.
Referenced by BLOCXX_NAMESPACE::FileSystem::Path::getCurrentWorkingDirectory().
#define BLOCXX_THROW_ERRNO1 | ( | exType, | |
errnum ) |
Throw an exception using FILE, LINE, errnum and strerror(errnum)
exType | The type of the exception; ctor must take file, line, message, and error code. |
errnum | The errno value. |
Definition at line 303 of file Exception.hpp.
#define BLOCXX_THROW_ERRNO_MSG | ( | exType, | |
msg ) |
Throw an exception using FILE, LINE, errno and strerror(errno)
exType | The type of the exception; ctor must take file, line, message, and error code. |
msg | The exception message to use. |
Definition at line 312 of file Exception.hpp.
Referenced by BLOCXX_NAMESPACE::ServerSocketImpl::accept(), BLOCXX_NAMESPACE::FileBuf::buffer_from_device(), BLOCXX_NAMESPACE::ServerSocketImpl::close(), BLOCXX_NAMESPACE::SocketBaseImpl::connect(), BLOCXX_NAMESPACE::UnnamedPipe::createConnectedPipes(), BLOCXX_NAMESPACE::UnnamedPipe::createStderr(), BLOCXX_NAMESPACE::UnnamedPipe::createStdin(), BLOCXX_NAMESPACE::UnnamedPipe::createStdinStdout(), BLOCXX_NAMESPACE::UnnamedPipe::createStdout(), BLOCXX_NAMESPACE::UnnamedPipe::createUnnamedPipeFromDescriptor(), BLOCXX_NAMESPACE::SocketBaseImpl::disconnect(), BLOCXX_NAMESPACE::ServerSocketImpl::doListen(), BLOCXX_NAMESPACE::ServerSocketImpl::doListenIPv4(), BLOCXX_NAMESPACE::ServerSocketImpl::doListenUDS(), BLOCXX_NAMESPACE::FileSystem::fileSize(), BLOCXX_NAMESPACE::ServerSocketImpl::fillAddrParms(), BLOCXX_NAMESPACE::SocketBaseImpl::fillUnixAddrParms(), BLOCXX_NAMESPACE::SelectEngine::go(), BLOCXX_NAMESPACE::Process::killWait(), BLOCXX_NAMESPACE::PosixUnnamedPipe::open(), BLOCXX_NAMESPACE::PosixUnnamedPipe::passDescriptor(), BLOCXX_NAMESPACE::pollStatusImpl(), BLOCXX_NAMESPACE::Exec::processInputOutput(), BLOCXX_NAMESPACE::PosixUnnamedPipe::read(), BLOCXX_NAMESPACE::SocketBaseImpl::read(), BLOCXX_NAMESPACE::FileSystem::readSymbolicLink(), BLOCXX_NAMESPACE::PosixUnnamedPipe::receiveDescriptor(), BLOCXX_NAMESPACE::Socket::shutdownAllSockets(), BLOCXX_NAMESPACE::BinarySerialization::write(), BLOCXX_NAMESPACE::PosixUnnamedPipe::write(), and BLOCXX_NAMESPACE::SocketBaseImpl::write().
#define BLOCXX_THROW_ERRNO_MSG1 | ( | exType, | |
msg, | |||
errnum ) |
Throw an exception using FILE, LINE, errnum and strerror(errnum)
exType | The type of the exception; ctor must take file, line, message, and error code. |
msg | The exception message to use. |
errnum | The errno value. |
Definition at line 322 of file Exception.hpp.
Referenced by BLOCXX_NAMESPACE::Thread::start().
#define BLOCXX_THROW_SUBEX | ( | exType, | |
msg, | |||
subex ) |
Throw an exception using FILE and LINE.
exType | The type of the exception |
msg | The exception message. A string that will be copied. |
subex | A sub-exception. A pointer to it will be passed to the exception constructor, which should clone() it. |
Definition at line 277 of file Exception.hpp.
Referenced by BLOCXX_NAMESPACE::RWLocker::releaseReadLock(), and BLOCXX_NAMESPACE::RWLocker::releaseWriteLock().
#define BLOCXX_THROWL | ( | exType, | |
line, | |||
msg ) |
This macro is deprecated in 3.1.0.
Definition at line 268 of file Exception.hpp.