# Assert.h

    00001 /**********************************************************************
    00002  * $Id: Assert.h 1820 2006-09-06 16:54:23Z mloskot $
    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 <string>
    00021
    00022 // Forward declarations
    00023 namespace geos {
    00024         namespace geom {
    00025                 class Coordinate;
    00026         }
    00027 }
    00028
    00029 namespace geos {
    00030 namespace util { // geos.util
    00031
    00032 class Assert {
    00033 public:
    00034
    00035         static void isTrue(bool assertion, const std::string& message);
    00036
    00037         static void isTrue(bool assertion) {
    00038                 isTrue(assertion, std::string());
    00039         }
    00040
    00041
    00042         static void equals(const geom::Coordinate& expectedValue,
    00043                         const geom::Coordinate& actualValue,
    00044                         const std::string& message);
    00045
    00046         static void equals(const geom::Coordinate& expectedValue,
    00047                         const geom::Coordinate& actualValue)
    00048         {
    00049                 equals(expectedValue, actualValue, std::string());
    00050         }
    00051
    00052
    00053         static void shouldNeverReachHere(const std::string& message);
    00054
    00055         static void shouldNeverReachHere() { shouldNeverReachHere(std::string()); }
    00056 };
    00057
    00058 } // namespace geos.util
    00059 } // namespace geos
    00060
    00061
    00062 #endif // GEOS_UTIL_ASSERT_H
    00063
    00064 /**********************************************************************
    00065  * $Log$
    00066  * Revision 1.2  2006/03/14 17:46:26  strk
    00067  * Removed unrequired include
    00068  *
    00069  * Revision 1.1  2006/03/09 16:46:49  strk
    00070  * geos::geom namespace definition, first pass at headers split
    00071  *
    00072  **********************************************************************/