Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

mexception.h File Reference

More...

#include "magic/mobject.h"

Go to the source code of this file.

Namespaces

namespace  MagiC

Compounds

class  Exception
 Highest exception class. More...


Defines

#define EXCEPTIONCLASS(eclass)
#define failtrace_begin   try {
#define failtrace(expr)   failtrace_begin; expr; failtrace_end;
#define trywith(expr, err)

Enumerations

enum  assertmodes

Functions

 BEGIN_NAMESPACE (MagiC)
 EXCEPTIONCLASS (generic_exception)
 EXCEPTIONCLASS (invalid_format)
 EXCEPTIONCLASS (forwarded_failure)
 EXCEPTIONCLASS (system_failure)
 EXCEPTIONCLASS (open_failure)
 EXCEPTIONCLASS (device_not_open)
 EXCEPTIONCLASS (check_failed)
 EXCEPTIONCLASS (must_overload)
void assertwith (const char *filename, int lineno, const char *funcname, const char *condition=NULL, const char *message=NULL)


Detailed Description

Definition in file mexception.h.


Define Documentation

EXCEPTIONCLASS end_of_stream   
 

Value:

class eclass : public Exception {\
public:\
    eclass (const String& what_arg) : Exception (what_arg) { }\
    virtual ~eclass () {;}\
};
End of stream was reached.

Definition at line 81 of file mexception.h.

#define failtrace expr       failtrace_begin; expr; failtrace_end;
 

If the expr throws an exception, this macro rethrows it, but records the filename and line number in the Exception reason.

Definition at line 139 of file mexception.h.

#define failtrace_begin   try {
 

Failtrace and trywith.

Definition at line 126 of file mexception.h.

#define failtrace_end
 

Value:

} catch (Exception e) { \
        throw forwarded_failure (format ("%s\n%%ERR: Exception forwaded at %s[%d]:%s()", \
                                         (CONSTR) e.what(), __FILE__, __LINE__, __FUNCTION__)); \
    }

Definition at line 127 of file mexception.h.

#define trywith expr,
err   
 

Value:

try { \
        expr; \
    } catch (Exception e) { \
        throw forwarded_failure (format ("%s\n%%ERR: Exception forwaded at %s[%d]:%s()\n%%ERR: %s", \
                                         (CONSTR) e.what(), __FILE__, __LINE__, __FUNCTION__, (CONSTR) err)); \
    }
Much like failtrace(expr).

If the expr throws an exception, this macro rethrows it, but records the filename and line number in the Exception reason, as well as additional explanation.

Definition at line 147 of file mexception.h.


Enumeration Type Documentation

enum assertmodes
 

The Application and ASSERT framework supports many ways of handling assertion fails.

It is, for example, very useful to crash the program (ASSERT_CRASH) if you are running the program under debugger.

Just include in your Main line:

assertmode = ASSERT_CRASH;

Definition at line 166 of file mexception.h.


Function Documentation

void assertwith const char *    filename,
int    lineno,
const char *    funcname,
const char *    condition = NULL,
const char *    message = NULL
 

Internal for ASSERT and ASSERTWITH.

*

Definition at line 447 of file mobject.cc.

BEGIN_NAMESPACE MagiC   
 

This file is part of the MagiC++ library.

* * Copyright (C) 1998-2002 Marko Grönroos <magi@iki.fi> * *

* This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; see the file COPYING.LIB. If * not, write to the Free Software Foundation, Inc., 59 Temple Place *

  • Suite 330, Boston, MA 02111-1307, USA. * *

EXCEPTIONCLASS must_overload   
 

Special exceptions for unimplemented member functions.

EXCEPTIONCLASS check_failed   
 

Intergrity check operation for an object failed.

EXCEPTIONCLASS device_not_open   
 

An operation was attempted on a closed device.

EXCEPTIONCLASS out_of_bounds   
 

Opening a file or device failed for some reason.

EXCEPTIONCLASS stream_failure   
 

A failure in an I/O or other system call.

EXCEPTIONCLASS file_not_open   
 

A file was not found.

EXCEPTIONCLASS io_error   
 

Flag parameters given in a call were invalid.

EXCEPTIONCLASS generic_exception   
 

Common exceptions.


Generated on Thu Feb 10 20:06:42 2005 for LibMagiC by doxygen1.2.18