Osmium  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Classes | Public Member Functions | Private Types | Private Attributes
Osmium::Storage::ObjectStore Class Reference

#include <objectstore.hpp>

Inheritance diagram for Osmium::Storage::ObjectStore:
Inheritance graph
[legend]
Collaboration diagram for Osmium::Storage::ObjectStore:
Collaboration graph
[legend]

List of all members.

Classes

class  ApplyHandler

Public Member Functions

 ObjectStore ()
void node (const shared_ptr< Osmium::OSM::Node const > &node)
void way (const shared_ptr< Osmium::OSM::Way const > &way)
void relation (const shared_ptr< Osmium::OSM::Relation const > &relation)
void clear_nodes ()
void clear_ways ()
void clear_relations ()
void clear ()
template<class THandler >
void feed_to (THandler *handler, Osmium::OSM::Meta &meta, bool clear=true)

Private Types

typedef std::set< shared_ptr
< Osmium::OSM::Node const > > 
nodeset
typedef std::set< shared_ptr
< Osmium::OSM::Way const > > 
wayset
typedef std::set< shared_ptr
< Osmium::OSM::Relation const > > 
relationset

Private Attributes

nodeset m_nodes
wayset m_ways
relationset m_relations

Detailed Description

Stores Nodes, Ways, and Relations in main memory. Can store multiple versions of the same object. Storage is ordered by id and version.

The object store uses the handler interface, so storage is simply by calling the node(), way(), and relation() methods like in any other handler.

Note that Osmium OSM objects are rather larger, so this store can use a lot of memory. In many cases you don't need the whole object but only parts of it, so using a more space efficient storage might be possible.


Member Typedef Documentation

typedef std::set<shared_ptr<Osmium::OSM::Node const> > Osmium::Storage::ObjectStore::nodeset [private]
typedef std::set<shared_ptr<Osmium::OSM::Relation const> > Osmium::Storage::ObjectStore::relationset [private]
typedef std::set<shared_ptr<Osmium::OSM::Way const> > Osmium::Storage::ObjectStore::wayset [private]

Constructor & Destructor Documentation


Member Function Documentation

Remove all objects from object store.

Remove all nodes from object store.

Remove all relations from object store.

Remove all ways from object store.

template<class THandler >
void Osmium::Storage::ObjectStore::feed_to ( THandler *  handler,
Osmium::OSM::Meta meta,
bool  clear = true 
) [inline]

Feed contents of object store to the given handler. Because objects are stored ordered by id and version, they will be fed to the handler in order.

If clear is set, all nodes/ways/relations are removed from the object store after the after_nodes/ways/relations() call to the handler.

Template Parameters:
THandlerHandler class.
Parameters:
handlerPointer to handler.
metaReference to Osmium::OSM::Meta object which will be given to init() method of handler.
clearShould objects be cleared from the object store? Default is true.
void Osmium::Storage::ObjectStore::node ( const shared_ptr< Osmium::OSM::Node const > &  node) [inline]

Insert shared_ptr of Node into object store.

void Osmium::Storage::ObjectStore::relation ( const shared_ptr< Osmium::OSM::Relation const > &  relation) [inline]

Insert shared_ptr of Relation into object store.

void Osmium::Storage::ObjectStore::way ( const shared_ptr< Osmium::OSM::Way const > &  way) [inline]

Insert shared_ptr of Way into object store.


Member Data Documentation


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines