GEOS  3.9.1dev
Assert.h
Go to the documentation of this file.
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 
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
60  {
61  shouldNeverReachHere(std::string());
62  }
63 };
64 
65 } // namespace geos.util
66 } // namespace geos
67 
68 
69 #endif // GEOS_UTIL_ASSERT_H
#define GEOS_DLL
Definition: export.h:28
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:60
static void isTrue(bool assertion)
Definition: Assert.h:38
static void equals(const geom::Coordinate &expectedValue, const geom::Coordinate &actualValue)
Definition: Assert.h:49
static void shouldNeverReachHere()
Definition: Assert.h:59
Basic namespace for all GEOS functionalities.