lassert.hh File Reference

#include <lestes/package.hh>
#include <lestes/std/data_types.hh>
#include <lestes/std/event_macros.hh>
#include <lestes/std/messages.hh>
#include <lestes/std/source_location.hh>

Include dependency graph for lassert.hh:

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

Go to the source code of this file.

Namespaces

namespace  lestes
namespace  lestes::std

Defines

#define LESTES__func__   __func__
#define lassert3(e, msg, loc)   ((e) ? (void)0 : ::lestes::std::lassert_fail( #e, __FILE__, __LINE__, LESTES__func__, (msg), (loc) ))
 When given expression evaluates to false, the program is aborted.
#define lassert2(e, msg)   lassert3( e, (msg), NULL )
 a shortcut to lestes3 without a location
#define lassert2loc(e, loc)   lassert3( e, "", (loc) )
 a shortcut to lassert3 without a message
#define lassert(e)   lassert2( e, "" )
 a shortcut to lassert2 without a message

Functions

 lestes::std::declare_event (lassert_event)
 lassert_event is trigerred when a lassertion fails (including ignored lassertions)
void lestes::std::lassert_fail (lstring assertion, lstring filename, ulint line, lstring function, lstring message, ptr< source_location >)
 Called when an assertion fails.


Detailed Description

Assertion checking macros.
Author:
Rudo, the new lassert2 macro

Rudo, added lassert_event

Rudo, the new lassert3 and lassert2l macros

JAZ, include file messages.hh with standard assertation messages.


Define Documentation

#define lassert (  )     lassert2( e, "" )

a shortcut to lassert2 without a message

#define lassert2 ( e,
msg   )     lassert3( e, (msg), NULL )

a shortcut to lestes3 without a location

#define lassert2loc ( e,
loc   )     lassert3( e, "", (loc) )

a shortcut to lassert3 without a message

#define lassert3 ( e,
msg,
loc   )     ((e) ? (void)0 : ::lestes::std::lassert_fail( #e, __FILE__, __LINE__, LESTES__func__, (msg), (loc) ))

When given expression evaluates to false, the program is aborted.

Should be used instead of the standard assert macro.

Parameters:
e The expression to evaluate, it is evaluated only once.
msg If not empty, it is printed after the "assertion failed" info.
loc source_location; if not NULL, it is printed before the "assertion failed" info.

#define LESTES__func__   __func__


Generated on Mon Feb 12 18:39:03 2007 for lestes by doxygen 1.5.1-20070107