Error Struct Reference

#include <error.h>

Inheritance diagram for Error:

Inheritance graph
[legend]

List of all members.


Detailed Description

Error class with a syntax similar to printf:

        if(error)
          throw Error("my message %d %f", 2, 2.5f);

or:

        catch(const Error &e) {
          e.tag("my message %d %f", 2, 2.5f);
          throw e;
        }

To embed the message with __FILE__,__LINE__ use the "LOCATE" macro

        throw LOCATE(Error("my error"));

When catching and printing the error message it will output a message similar to:

 *	error.h:27
 *		my error
 * 

Also check for OpenGL error with glCheckError(); Bare error class You could use an error message "a la" printf

Public Member Functions

 Error (const char *msg,...)
void tag (const char *msg,...)
void print () const

Public Attributes

char msg [1024]
 error message


Constructor & Destructor Documentation

Error::Error ( const char *  msg,
  ... 
) [inline]

Creates an Error with a message Use a printf-like syntax


Member Function Documentation

void Error::tag ( const char *  msg,
  ... 
) [inline]

Sets an Error message "a la" printf() Adds a line to the error description with a filename/code line

Referenced by LocateError::LocateError().

void Error::print (  )  const [inline]

Print the error message on stdout

References msg.


Member Data Documentation

char Error::msg[1024]

error message

Referenced by print().


The documentation for this struct was generated from the following file:

Generated on Tue Aug 4 17:57:42 2009 for libvd by  doxygen 1.5.5