Osmium  0.1
include/osmium/geometry/null.hpp
Go to the documentation of this file.
00001 #ifndef OSMIUM_GEOMETRY_NULL_HPP
00002 #define OSMIUM_GEOMETRY_NULL_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 
00025 #include <osmium/geometry.hpp>
00026 
00027 namespace Osmium {
00028 
00029     namespace Geometry {
00030 
00035         class Null : public Geometry {
00036 
00037         public:
00038 
00039             Null() : Geometry() {
00040             }
00041 
00042             std::ostream& write_to_stream(std::ostream& out, AsWKT, bool /*with_srid=false*/) const {
00043                 return out;
00044             }
00045 
00046             std::ostream& write_to_stream(std::ostream& out, AsWKB, bool /*with_srid=false*/) const {
00047                 return out;
00048             }
00049 
00050             std::ostream& write_to_stream(std::ostream& out, AsHexWKB, bool /*with_srid=false*/) const {
00051                 return out;
00052             }
00053 
00054 #ifdef OSMIUM_WITH_JAVASCRIPT
00055             struct JavascriptTemplate : public Osmium::Javascript::Template {
00056 
00057                 JavascriptTemplate() : Osmium::Javascript::Template() {
00058                     js_template->Set("toWKT",    v8::FunctionTemplate::New(function_template<Osmium::Javascript::Template, &Osmium::Javascript::Template::js_undefined>));
00059                     js_template->Set("toWKB",    v8::FunctionTemplate::New(function_template<Osmium::Javascript::Template, &Osmium::Javascript::Template::js_undefined>));
00060                     js_template->Set("toHexWKB", v8::FunctionTemplate::New(function_template<Osmium::Javascript::Template, &Osmium::Javascript::Template::js_undefined>));
00061                     js_template->Set("toArray",  v8::FunctionTemplate::New(function_template<Osmium::Javascript::Template, &Osmium::Javascript::Template::js_undefined>));
00062                 }
00063 
00064             };
00065 #endif // OSMIUM_WITH_JAVASCRIPT
00066 
00067         }; // class Null
00068 
00069     } // namespace Geometry
00070 
00071 } // namespace Osmium
00072 
00073 #endif // OSMIUM_GEOMETRY_HPP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines