Osmium  0.1
include/osmium/output.hpp
Go to the documentation of this file.
00001 #ifndef OSMIUM_OUTPUT_HPP
00002 #define OSMIUM_OUTPUT_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/osmfile.hpp>
00026 #include <osmium/handler.hpp>
00027 
00028 namespace Osmium {
00029 
00033     namespace Output {
00034 
00035         class Base : public Osmium::Handler::Base {
00036 
00037         protected:
00038 
00039             Osmium::OSMFile m_file;
00040 
00041             int get_fd() {
00042                 return m_file.get_fd();
00043             }
00044 
00045         public:
00046 
00047             Base(Osmium::OSMFile& file) : m_file(file) {
00048                 m_file.open_for_output();
00049             }
00050 
00051             virtual ~Base() {
00052             }
00053 
00054             virtual void init(Osmium::OSM::Meta&) = 0;
00055             virtual void node(const shared_ptr<Osmium::OSM::Node const>&) = 0;
00056             virtual void way(const shared_ptr<Osmium::OSM::Way const>&) = 0;
00057             virtual void relation(const shared_ptr<Osmium::OSM::Relation const>&) = 0;
00058             virtual void final() = 0;
00059 
00060         }; // class Base
00061 
00062     } // namespace Output
00063 
00064 } // namespace Osmium
00065 
00066 #include <osmium/output/pbf.hpp>
00067 #ifdef OSMIUM_WITH_OUTPUT_OSM_XML
00068 # include <osmium/output/xml.hpp>
00069 #endif
00070 
00071 #endif // OSMIUM_OUTPUT_HPP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines