|
CPN
Computational Process Networks
|
Include dependency graph for ThrowingAssert.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Classes | |
| class | AssertException |
| The exception thrown by the ASSERT macro. More... | |
Macros | |
| #define | ASSERT(exp,...) (exp ? true : __ASSERT(#exp, __FILE__, __LINE__, __PRETTY_FUNCTION__, false, ## __VA_ARGS__)) |
| #define | ASSERT_ABORT(exp,...) (exp ? true : __ASSERT(#exp, __FILE__, __LINE__, __PRETTY_FUNCTION__, true, ## __VA_ARGS__)) |
| #define | ENSURE(exp,...) (exp ? true : __ASSERT(#exp, __FILE__, __LINE__, __PRETTY_FUNCTION__, false, ## __VA_ARGS__)) |
| #define | ENSURE_ABORT(exp,...) (exp ? true : __ASSERT(#exp, __FILE__, __LINE__, __PRETTY_FUNCTION__, true, ## __VA_ARGS__)) |
Functions | |
| bool | __ASSERT (const char *exp, const char *file, int line, const char *func, bool die) __attribute__((noreturn)) |
| bool | __ASSERT (const char *exp, const char *file, int line, const char *func, bool die, const std::string &msg) __attribute__((noreturn)) |
| bool | __ASSERT (const char *exp, const char *file, int line, const char *func, bool die, const char *fmt,...) __attribute__((noreturn)) |
An implementation of an assert like micro that throws an exception. This is usefull when using a unit test as the test will then fail and the application will continue.
Note that this file uses some GCC only features like exp ?: see http://gcc.gnu.org/onlinedocs/gcc-4.4.1/gcc/Conditionals.html
Use ASSERT when you want the test to be compiled out when NDEBUG is defined and use ENSURE when you want the expression to remain when NDEBUG is defined.
Also these macros evaluate there arguments only ONCE.
Definition in file ThrowingAssert.h.
| #define ASSERT | ( | exp, | |
| ... | |||
| ) | (exp ? true : __ASSERT(#exp, __FILE__, __LINE__, __PRETTY_FUNCTION__, false, ## __VA_ARGS__)) |
Definition at line 62 of file ThrowingAssert.h.
Referenced by SocketHandle::Connect(), SocketHandle::CreatePair(), CPN::Kernel::CreateQueue(), CPN::PseudoNode::CreateReader(), CPN::Kernel::CreateReaderEndpoint(), CPN::PseudoNode::CreateWriter(), CPN::Kernel::CreateWriterEndpoint(), CPN::RemoteQueue::D4RTagPacket(), CPN::RemoteQueue::DequeuePacket(), CPN::RemoteContextClient::DispatchMessage(), CPN::RemoteContextServer::DispatchMessage(), CPN::RemoteQueue::EndOfReadPacket(), CPN::RemoteQueue::EndOfWritePacket(), CPN::RemoteQueue::EnqueuePacket(), CPN::PacketHandler::FirePacket(), CPN::RemoteContextServer::GetCreateEndpointKey(), CPN::PacketDecoder::GetDecoderBytes(), CPN::RemoteContextClient::GetEndpointInfo(), CPN::RemoteContextServer::GetEndpointInfo(), CPN::NodeLoader::GetFactory(), CPN::LocalContext::GetKernelConnectionInfo(), CPN::RemoteContextServer::GetKernelInfo(), CPN::RemoteContextServer::GetNodeInfo(), CPN::QueueBase::GetRawDequeuePtr(), CPN::QueueBase::GetRawEnqueuePtr(), SocketAddress::GetType(), CPN::ThresholdQueue::TQImpl::Grow(), CPN::RemoteQueue::IDReaderPacket(), CPN::RemoteQueue::IDWriterPacket(), CPN::RemoteQueue::InternalCheckStatus(), CPN::Kernel::InternalCreateNode(), CPN::RemoteQueue::InternalDequeue(), CPN::ThresholdQueue::InternalEnqueue(), CPN::RemoteQueue::InternalEnqueue(), CPN::RemoteQueue::InternalFlush(), CPN::ThresholdQueue::InternalGetRawDequeuePtr(), CPN::ThresholdQueue::InternalGetRawEnqueuePtr(), CPN::RemoteQueue::InternalReset(), CPN::QueueBase::InternalReset(), Loader(), Logger::Logger(), CPN::Kernel::NodeTerminated(), CPN::KernelBase::NotifyTerminate(), CPN::QueueBase::RawDequeue(), CPN::RemoteQueue::ReadBlockPacket(), CPN::PacketDecoder::ReleaseDecoderBytes(), CPN::KernelBase::RemoteCreateNode(), CPN::Kernel::RemoteCreateNode(), CPN::KernelBase::RemoteCreateQueue(), CPN::Kernel::RemoteCreateQueue(), CPN::KernelBase::RemoteCreateReader(), CPN::Kernel::RemoteCreateReader(), CPN::KernelBase::RemoteCreateWriter(), CPN::Kernel::RemoteCreateWriter(), CPN::LocalContext::SendCreateNode(), CPN::LocalContext::SendCreateQueue(), CPN::LocalContext::SendCreateReader(), CPN::LocalContext::SendCreateWriter(), CPN::RemoteQueue::SendEndOfReadPacket(), CPN::RemoteQueue::SendEndOfWritePacket(), CPN::PacketEncoder::SendEnqueue(), CPN::RemoteQueue::SendEnqueuePacket(), CPN::RemoteContextDaemon::SendMessage(), CPN::PacketEncoder::SendPacket(), CPN::ConnectionServer::PendingConnection::Set(), CPN::RemoteContextClient::SetupKernel(), CPN::RemoteContextServer::SignalKernelEnd(), CPN::RemoteContextServer::SignalKernelStart(), CPN::RemoteContextServer::SignalNodeEnd(), CPN::RemoteContextServer::SignalNodeStart(), CPN::ThresholdQueue::UnlockedGrow(), CPN::RemoteQueue::UnlockedSignalReaderTagChanged(), CPN::RemoteQueue::UnlockedSignalWriterTagChanged(), CPN::RemoteContextClient::WaitForAllNodeEnd(), CPN::RemoteQueue::WaitForData(), CPN::RemoteQueue::WaitForFreespace(), CPN::LocalContext::WaitForNodeEnd(), CPN::RemoteQueue::WriteBlockPacket(), and CPN::RemoteQueue::WriteBytes().
| #define ASSERT_ABORT | ( | exp, | |
| ... | |||
| ) | (exp ? true : __ASSERT(#exp, __FILE__, __LINE__, __PRETTY_FUNCTION__, true, ## __VA_ARGS__)) |
Definition at line 63 of file ThrowingAssert.h.
Referenced by CPN::RemoteQueue::~RemoteQueue().
| #define ENSURE | ( | exp, | |
| ... | |||
| ) | (exp ? true : __ASSERT(#exp, __FILE__, __LINE__, __PRETTY_FUNCTION__, false, ## __VA_ARGS__)) |
Definition at line 64 of file ThrowingAssert.h.
Referenced by Sync::ReentrantCondition::ReentrantCondition(), Sync::ReentrantLock::ReentrantLock(), and Sync::StatusHandler< KernelStatus_t >::StatusHandler().
| #define ENSURE_ABORT | ( | exp, | |
| ... | |||
| ) | (exp ? true : __ASSERT(#exp, __FILE__, __LINE__, __PRETTY_FUNCTION__, true, ## __VA_ARGS__)) |
Definition at line 65 of file ThrowingAssert.h.
Referenced by Sync::ReentrantLock::Lock(), Sync::Internal::ScopeMutex::ScopeMutex(), Sync::ReentrantLock::Unlock(), Sync::ReentrantCondition::~ReentrantCondition(), Sync::ReentrantLock::~ReentrantLock(), Sync::Internal::ScopeMutex::~ScopeMutex(), and Sync::StatusHandler< KernelStatus_t >::~StatusHandler().
Definition at line 59 of file ThrowingAssert.cc.
References CreateMessage(), and GetStack().
Here is the call graph for this function:| bool __ASSERT | ( | const char * | exp, |
| const char * | file, | ||
| int | line, | ||
| const char * | func, | ||
| bool | die, | ||
| const std::string & | msg | ||
| ) |
Definition at line 69 of file ThrowingAssert.cc.
References CreateMessage(), and GetStack().
Here is the call graph for this function:| bool __ASSERT | ( | const char * | exp, |
| const char * | file, | ||
| int | line, | ||
| const char * | func, | ||
| bool | die, | ||
| const char * | fmt, | ||
| ... | |||
| ) |
Definition at line 79 of file ThrowingAssert.cc.
References CreateMessage(), and GetStack().
Here is the call graph for this function:
1.8.5