GEOS
3.3.5
|
00001 /********************************************************************** 00002 * $Id: Assert.h 2556 2009-06-06 22:22:28Z strk $ 00003 * 00004 * GEOS - Geometry Engine Open Source 00005 * http://geos.refractions.net 00006 * 00007 * Copyright (C) 2001-2002 Vivid Solutions Inc. 00008 * Copyright (C) 2006 Refractions Research Inc. 00009 * 00010 * This is free software; you can redistribute and/or modify it under 00011 * the terms of the GNU Lesser General Public Licence as published 00012 * by the Free Software Foundation. 00013 * See the COPYING file for more information. 00014 * 00015 **********************************************************************/ 00016 00017 #ifndef GEOS_UTIL_ASSERT_H 00018 #define GEOS_UTIL_ASSERT_H 00019 00020 #include <geos/export.h> 00021 #include <string> 00022 00023 // Forward declarations 00024 namespace geos { 00025 namespace geom { 00026 class Coordinate; 00027 } 00028 } 00029 00030 namespace geos { 00031 namespace util { // geos.util 00032 00033 class GEOS_DLL Assert { 00034 public: 00035 00036 static void isTrue(bool assertion, const std::string& message); 00037 00038 static void isTrue(bool assertion) { 00039 isTrue(assertion, std::string()); 00040 } 00041 00042 00043 static void equals(const geom::Coordinate& expectedValue, 00044 const geom::Coordinate& actualValue, 00045 const std::string& message); 00046 00047 static void equals(const geom::Coordinate& expectedValue, 00048 const geom::Coordinate& actualValue) 00049 { 00050 equals(expectedValue, actualValue, std::string()); 00051 } 00052 00053 00054 static void shouldNeverReachHere(const std::string& message); 00055 00056 static void shouldNeverReachHere() { shouldNeverReachHere(std::string()); } 00057 }; 00058 00059 } // namespace geos.util 00060 } // namespace geos 00061 00062 00063 #endif // GEOS_UTIL_ASSERT_H 00064 00065 /********************************************************************** 00066 * $Log$ 00067 * Revision 1.2 2006/03/14 17:46:26 strk 00068 * Removed unrequired include 00069 * 00070 * Revision 1.1 2006/03/09 16:46:49 strk 00071 * geos::geom namespace definition, first pass at headers split 00072 * 00073 **********************************************************************/