Utilities.h

Go to the documentation of this file.
00001 /***************************************************************
00002 
00003  Intelligent Ground Vehicle Competition 2010
00004  Pennsylvania State University - Robotics Club
00005  Learn more at www.psurobotics.org
00006  Protected by the GNU General Public License
00007 
00008  This source file is developed and maintained by:
00009  + Jeremy Bridon jbridon@psu.edu
00010 
00011  File: Utilities.h
00012  Desc: Provides the custom Assert function-like macro for run-
00013        time error supports.
00014 
00015 ***************************************************************/
00016 
00017 // Inclusion guard
00018 #ifndef __ERRORCODE_H_
00019 #define __ERRORCODE_H_
00020 
00021 // Includes
00022 #include <stdio.h>
00023 #include <stdlib.h>
00024 
00025 // Say we are using the standard namespace; because we can!
00026 using namespace std;
00027 
00028 // Define PI
00029 #define PI 3.14159265358979323846
00030 
00033 void __Assert(bool Assertion, char *ErrorMessage = NULL, int Line = -1, const char *FileName = NULL);
00034 
00037 #define Assert(Assertion, ErrorMessage) __Assert((bool)(Assertion), (char*)(ErrorMessage), __LINE__, __FILE__)
00038 
00041 void itoa(char *dest, int val);
00042 
00044 int max(int a, int b);
00045 
00047 inline void swap(int& a, int& b)
00048 {
00049         int temp = a;
00050         a = b;
00051         b = temp;
00052 }
00053 
00054 // Inclusion guard
00055 #endif

Generated on Sun Feb 21 00:00:05 2010 for Penn State Robotics Club: AUVSI IGVC 2010 by  doxygen 1.5.5