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

#include <progress.hpp>

Inheritance diagram for Osmium::Handler::Progress:
Inheritance graph
[legend]
Collaboration diagram for Osmium::Handler::Progress:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Progress (int s=1000)
void hide_cursor () const
void show_cursor () const
void init (Osmium::OSM::Meta &) const
void node (const shared_ptr< Osmium::OSM::Node const > &)
void way (const shared_ptr< Osmium::OSM::Way const > &)
void relation (const shared_ptr< Osmium::OSM::Relation const > &)
void final () const

Private Member Functions

void update_display (bool show_per_second=true) const

Private Attributes

uint64_t count_nodes
uint64_t count_ways
uint64_t count_relations
int step
bool is_a_tty
timeval first_node
timeval first_way
timeval first_relation

Detailed Description

Simple handler that shows progress on terminal by counting the number of nodes, ways, and relations already read and printing those counts to stdout.

If stdout is not a terminal, nothing is printed.

Note that this handler will hide the cursor. If the program is terminated before the final handler is called, it will not be re-activated. Call show_cursor() from an interrupt handler or similar, to do this properly.


Constructor & Destructor Documentation

Osmium::Handler::Progress::Progress ( int  s = 1000) [inline]

Initialize handler.

Parameters:
sStep, after how many nodes/ways/relations the display should be updated. (default 1000).

Member Function Documentation

void Osmium::Handler::Progress::final ( ) const [inline]

Reimplemented from Osmium::Handler::Base.

void Osmium::Handler::Progress::hide_cursor ( ) const [inline]

Reimplemented from Osmium::Handler::Base.

void Osmium::Handler::Progress::node ( const shared_ptr< Osmium::OSM::Node const > &  ) [inline]
void Osmium::Handler::Progress::relation ( const shared_ptr< Osmium::OSM::Relation const > &  ) [inline]
void Osmium::Handler::Progress::show_cursor ( ) const [inline]
void Osmium::Handler::Progress::update_display ( bool  show_per_second = true) const [inline, private]
void Osmium::Handler::Progress::way ( const shared_ptr< Osmium::OSM::Way const > &  ) [inline]

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