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