diff --git a/include/exceptions.h b/include/exceptions.h index 0fcd982..ad23ff9 100644 --- a/include/exceptions.h +++ b/include/exceptions.h @@ -5,10 +5,13 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: exceptions.h,v 1.3 2005/01/31 15:44:38 cozman Exp $ +// $Id: exceptions.h,v 1.4 2005/02/06 21:28:47 cozman Exp $ // // Revisions: // $Log: exceptions.h,v $ +// Revision 1.4 2005/02/06 21:28:47 cozman +// removed require +// // Revision 1.3 2005/01/31 15:44:38 cozman // simplified exceptions // @@ -248,43 +251,6 @@ public: const APIError& rhs); }; - -// Section: Utility Functions - -// Function: require -// Similar to an assert, given a condition checks if it is true, and if it is -// not, throws an exception. -// -// An example of when to use require would be in a function that does an -// operation to a certain pouinter: -// void func() -// { -// require(pouinter != NULL,"pouinter must be valid"); -// -// pouinter->doSomething(); -// } -// -// Template Parameters: -// ExceptionT - type of exception to throw -// -// Parameters: -// condition - boolean expression to be satisfied -// description - description of this condition (optional parameter) -template -void require(bool condition, std::string description = std::string(), - std::string file = std::string(), uint line=0); - -//definition of require template -template -void require(bool condition, std::string description, - std::string file, uint line) -{ - if(!condition) - { - throw ExceptionT(description,file,line); - } -} - } #endif //PHOTON_EXCEPTIONS_H