Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

rs_assert.h File Reference

#include <stdexcept>
#include <cassert>
#include "rsdef.h"

Include dependency graph for rs_assert.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Namespaces

namespace  rs

Defines

#define assert(bed)
 assertion (tested in DEBUG-Version). More...

#define hassert(bed)   do { if (!(bed)) throw std::runtime_error(rs::assertionText(#bed, __FILE__, __LINE__)); } while(0)
 assertion (tested in DEBUG and NDEBUG mode). More...

#define GUARDED   {
#define UNGUARDED   }

Functions

template<class T> const T & nonnull (const T &t)
 nonnull(x) -- hassert for expression x. More...

template<class T> T & nonnull (T &t)


Define Documentation

#define assert bed   
 

assertion (tested in DEBUG-Version).

Definition at line 120 of file rs_assert.h.

Referenced by Comment::append(), rs::user::ask_number(), BinaryFile::BinaryFile(), Bit(), Bmp::Bmp(), rs::file::canonicalize(), Pixel::color(), Counted::Counted(), Dword(), BinaryFile::eof(), InputFile::fillBuffer(), Inifile::findOrCreateSection(), Counted::free_reference(), BinaryFile::get_char(), InputFile::getLine(), ProgramInfo::infos(), ProgramInfo::init(), Section::insertEntry(), Inifile::insertSection(), FilePosition::LineNumber(), Lnk::Lnk(), matches(), SmartPtr::operator *(), SmartPtr::operator->(), RepeatedCmdLineArgumentOption::print(), BinaryFile::put_char(), BinaryFile::put_nat(), BinaryFile::read_bytes(), SmartPtr::sameObject(), Pixel::set_color(), store(), rs::str::vstrf(), Word(), BinaryFile::write_bytes(), XML_Document::XML_Document(), XML_Node::XML_Node(), Counted::~Counted(), and XML_Document::~XML_Document().

#define hassert bed       do { if (!(bed)) throw std::runtime_error(rs::assertionText(#bed, __FILE__, __LINE__)); } while(0)
 

assertion (tested in DEBUG and NDEBUG mode).

  • In DEBUG mode assert() is called (so you easily find the location with the debugger)
  • In NDEBUG mode a logic_error is thrown

Definition at line 127 of file rs_assert.h.

Referenced by Bmp::Bmp(), nonnull(), and Terminator::Terminator().

#define GUARDED   {
 

Definition at line 129 of file rs_assert.h.

#define UNGUARDED   }
 

Definition at line 130 of file rs_assert.h.


Function Documentation

const T& nonnull const T &    t
 

nonnull(x) -- hassert for expression x.

Definition at line 135 of file rs_assert.h.

T& nonnull T &    t
 

Definition at line 139 of file rs_assert.h.


Contact me in case of errors or questions.
This documentation is powered by Doxygen.
(C) 2000-2002 Doxygen