Loading...
Searching...
No Matches
osmium::util::VerboseOutput Class Reference

`#include <verbose_output.hpp>`

## Public Member Functions

| VerboseOutput (bool verbose=false) noexcept
std::time_t | runtime () const noexcept
bool | verbose () const noexcept
| Get "verbose" setting.
void | verbose (bool verbose) noexcept
| Set "verbose" setting.
template<typename T >
void | print (const T &value)

## Private Member Functions

void | start_line ()

## Private Attributes

std::time_t | m_start
| all time output will be relative to this start time
bool | m_verbose
| is verbose mode enabled?
bool | m_newline = true
| a newline was written, start next output with runtime

## Detailed Description

Osmium programs often run for a long time because of the amount of OSM data processed. This class helps with keeping the user up to date by offering an easy way for programs to optionally output verbose information about what's going on.

Use an object of this class instead of std::cerr as an output stream. Nothing is actually written if the object is not set to verbose mode. If it is set to verbose mode, each line is prepended with the running time, ie the time since the VerboseOutput object was created.

## Constructor & Destructor Documentation

## VerboseOutput()

osmium::util::VerboseOutput::VerboseOutput | ( | bool | verbose = `false` | ) |

inline explicit noexcept

## Member Function Documentation

## print()

template<typename T >

void osmium::util::VerboseOutput::print | ( | const T & | value | ) |

inline

## runtime()

std::time_t osmium::util::VerboseOutput::runtime | ( |  | ) | const

inline noexcept

## start_line()

void osmium::util::VerboseOutput::start_line | ( |  | ) |

inline private

If we remember that a newline was written as the last thing write out the time elapsed and reset the newline flag.

## verbose() [1/2]

bool osmium::util::VerboseOutput::verbose | ( |  | ) | const

inline noexcept

Get "verbose" setting.

## verbose() [2/2]

void osmium::util::VerboseOutput::verbose | ( | bool | verbose | ) |

inline noexcept

Set "verbose" setting.

## Member Data Documentation

## m_newline

bool osmium::util::VerboseOutput::m_newline = true

private

a newline was written, start next output with runtime

## m_start

std::time_t osmium::util::VerboseOutput::m_start

private

all time output will be relative to this start time

## m_verbose

bool osmium::util::VerboseOutput::m_verbose

private

is verbose mode enabled?

The documentation for this class was generated from the following file:

- include/osmium/util/verbose_output.hpp