Osmium  0.1
include/osmium.hpp
Go to the documentation of this file.
00001 #ifndef OSMIUM_OSMIUM_HPP
00002 #define OSMIUM_OSMIUM_HPP
00003 
00004 /*
00005 
00006 Copyright 2011 Jochen Topf <jochen@topf.org> and others (see README).
00007 
00008 This file is part of Osmium (https://github.com/joto/osmium).
00009 
00010 Osmium is free software: you can redistribute it and/or modify it under the
00011 terms of the GNU Lesser General Public License or (at your option) the GNU
00012 General Public License as published by the Free Software Foundation, either
00013 version 3 of the Licenses, or (at your option) any later version.
00014 
00015 Osmium is distributed in the hope that it will be useful, but WITHOUT ANY
00016 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
00017 PARTICULAR PURPOSE. See the GNU Lesser General Public License and the GNU
00018 General Public License for more details.
00019 
00020 You should have received a copy of the Licenses along with Osmium. If not, see
00021 <http://www.gnu.org/licenses/>.
00022 
00023 */
00024 
00039 #ifdef OSMIUM_WITH_JAVASCRIPT
00040 # include <v8.h>
00041 # include <unicode/ustring.h>
00042 # include <osmium/utils/unicode.hpp>
00043 #endif // OSMIUM_WITH_JAVASCRIPT
00044 
00045 #include <osmpbf/osmpbf.h>
00046 
00050 namespace Osmium {
00051 
00055     class Framework {
00056 
00057         Framework(bool d) : debug(d) {
00058         }
00059 
00060         ~Framework() {
00061             // this is needed even if the protobuf lib was never used so that valgrind doesn't report any errors
00062             google::protobuf::ShutdownProtobufLibrary();
00063         }
00064 
00065         bool debug;
00066 
00067         friend Framework& init(bool debug);
00068         friend void set_debug(bool d);
00069         friend bool debug();
00070 
00071     }; // class Framework
00072 
00079     Framework& init(bool debug=false) {
00080         static Framework f(debug);
00081         return f;
00082     }
00083 
00087     void set_debug(bool d) {
00088         init().debug = d;
00089     }
00090 
00094     bool debug() {
00095         return init().debug;
00096     }
00097 
00098 } // namespace Osmium
00099 
00100 // check way geometry before making a shplib object from it
00101 // normally this should be defined, otherwise you will generate invalid linestring geometries
00102 #define OSMIUM_CHECK_WAY_GEOMETRY
00103 
00104 #ifdef OSMIUM_WITH_JAVASCRIPT
00105 # include <osmium/javascript/template.hpp>
00106 #endif // OSMIUM_WITH_JAVASCRIPT
00107 
00108 #include <osmium/exceptions.hpp>
00109 #include <osmium/osm.hpp>
00110 #include <osmium/geometry/null.hpp>
00111 #include <osmium/geometry/point.hpp>
00112 #include <osmium/geometry/linestring.hpp>
00113 #include <osmium/geometry/polygon.hpp>
00114 #include <osmium/geometry/multipolygon.hpp>
00115 #include <osmium/osmfile.hpp>
00116 #include <osmium/input.hpp>
00117 #include <osmium/output.hpp>
00118 #include <osmium/export.hpp>
00119 #include <osmium/osmfile_impl.hpp>
00120 
00121 #ifdef OSMIUM_WITH_JAVASCRIPT
00122 # include <osmium/HandlerJavascript.hpp>
00123 #endif // OSMIUM_WITH_JAVASCRIPT
00124 
00125 #endif // OSMIUM_OSMIUM_HPP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines