/home/martin/workspace/OpenStreetNav/src/elements/Relation.h
Go to the documentation of this file.
00001 /*
00002  * Relation.h
00003  *
00004  *  Created on: Nov 5, 2011
00005  *      Author: martin
00006  */
00007 
00008 #ifndef RELATION_H_
00009 #define RELATION_H_
00010 
00011 #include <memory>
00012 #include <map>
00013 #include <set>
00014 #include "Element.h"
00015 
00016 namespace osm
00017 {
00018 
00019 class Node;
00020 class Way;
00021 
00026 class Relation : public Element
00027 {
00028 public:
00029     Relation();
00034     Relation(int64_t id);
00035     virtual ~Relation();
00036     int64_t id;
00040     std::multimap<std::string, std::shared_ptr<osm::Element> > members;
00044     std::set<osm::Tag> tags;
00045     boost::property_tree::ptree get_description();
00046     osm::ObjectType get_type() const;
00047     bool operator==(Relation const& r) const;
00048     bool operator!=(Relation const& r) const;
00049     void fill(osmdb::PropertiesSelection& db);
00050     void add_to_relation(osmdb::ElementImporter& db, int64_t relation, std::string const& role);
00051     virtual int64_t get_id() const;
00052     void add_node(std::string const& role, osm::Node const& nd);
00053     void add_way(std::string const& role, osm::Way const& w);
00054     void add_rel(std::string const& role, osm::Relation const& r);
00055 private:
00056     void add_member_ptr(std::string const& role, osm::Element* ptr);
00057 };
00058 
00059 }
00060 #endif /* RELATION_H_ */
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines