GEOS  3.3.3
Assert.h
1 /**********************************************************************
2  * $Id: Assert.h 2556 2009-06-06 22:22:28Z strk $
3  *
4  * GEOS - Geometry Engine Open Source
5  * http://geos.refractions.net
6  *
7  * Copyright (C) 2001-2002 Vivid Solutions Inc.
8  * Copyright (C) 2006 Refractions Research Inc.
9  *
10  * This is free software; you can redistribute and/or modify it under
11  * the terms of the GNU Lesser General Public Licence as published
12  * by the Free Software Foundation.
13  * See the COPYING file for more information.
14  *
15  **********************************************************************/
16 
17 #ifndef GEOS_UTIL_ASSERT_H
18 #define GEOS_UTIL_ASSERT_H
19 
20 #include <geos/export.h>
21 #include <string>
22 
23 // Forward declarations
24 namespace geos {
25  namespace geom {
26  class Coordinate;
27  }
28 }
29 
30 namespace geos {
31 namespace util { // geos.util
32 
33 class GEOS_DLL Assert {
34 public:
35 
36  static void isTrue(bool assertion, const std::string& message);
37 
38  static void isTrue(bool assertion) {
39  isTrue(assertion, std::string());
40  }
41 
42 
43  static void equals(const geom::Coordinate& expectedValue,
44  const geom::Coordinate& actualValue,
45  const std::string& message);
46 
47  static void equals(const geom::Coordinate& expectedValue,
48  const geom::Coordinate& actualValue)
49  {
50  equals(expectedValue, actualValue, std::string());
51  }
52 
53 
54  static void shouldNeverReachHere(const std::string& message);
55 
56  static void shouldNeverReachHere() { shouldNeverReachHere(std::string()); }
57 };
58 
59 } // namespace geos.util
60 } // namespace geos
61 
62 
63 #endif // GEOS_UTIL_ASSERT_H
64 
65 /**********************************************************************
66  * $Log$
67  * Revision 1.2 2006/03/14 17:46:26 strk
68  * Removed unrequired include
69  *
70  * Revision 1.1 2006/03/09 16:46:49 strk
71  * geos::geom namespace definition, first pass at headers split
72  *
73  **********************************************************************/