src/util/Error.h File Reference

#include <string>
#include <iostream>

Go to the source code of this file.

Namespaces

namespace  green

Classes

class  green::Error

Defines

#define THROW_ERROR(msg)   throw Error(__LINE__, __FILE__, (msg));
#define ERROR_ASSERT(cond, msg)   if(!(cond)) throw Error(__LINE__, __FILE__, (msg));
#define CHECK_SHARED(x)   ERROR_ASSERT((x).get(), std::string(#x) + " is NULL")


Detailed Description

This file contains error checking facilities for the Green Engine. This includes an Error class meant to be thrown as an ecception, which contains information about the error's type, the line it was thrown at, the file it was thrown from, and custom message. This file also contains some macros to make it easy to check for and error, and throw one if there is one.

Author:
Jeremy Bell
Date:
02-26-07

Define Documentation

#define CHECK_SHARED (  )     ERROR_ASSERT((x).get(), std::string(#x) + " is NULL")

A convenient macro for checking if a shared_ptr is valid

#define ERROR_ASSERT ( cond,
msg   )     if(!(cond)) throw Error(__LINE__, __FILE__, (msg));

A convenient macro for throwing an Error if (cond) is false

#define THROW_ERROR ( msg   )     throw Error(__LINE__, __FILE__, (msg));

A convenient macro for throwing an Error


Generated on Fri Apr 27 10:27:38 2007 for Green Engine by  doxygen 1.5.1