ModErn Text Analysis
META Enumerates Textual Applications
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
include
util
progress.h
Go to the documentation of this file.
1
10
#ifndef META_UTIL_PROGRESS_H_
11
#define META_UTIL_PROGRESS_H_
12
13
#include <chrono>
14
#include <string>
15
16
namespace
meta
17
{
18
namespace
printing
19
{
20
27
class
progress
28
{
29
public
:
42
progress
(
const
std::string& prefix, uint64_t
length
,
43
int
interval = 500, uint64_t min_iters = 10);
44
50
void
print_endline
(
bool
endline);
51
56
~progress
();
57
62
void
operator()
(uint64_t iter);
63
67
void
end
();
68
72
void
clear
()
const
;
73
74
private
:
76
std::string
prefix_
;
78
std::chrono::steady_clock::time_point
start_
;
80
std::chrono::steady_clock::time_point
last_update_
;
82
uint64_t
last_iter_
;
84
uint64_t
length_
;
86
int
interval_
;
91
uint64_t
min_iters_
;
93
uint64_t
str_len_
;
95
bool
finished_
;
97
bool
endline_
;
98
};
99
}
100
}
101
#endif
meta::printing::progress::operator()
void operator()(uint64_t iter)
Updates the progress indicator.
Definition:
progress.cpp:59
meta::printing::progress::progress
progress(const std::string &prefix, uint64_t length, int interval=500, uint64_t min_iters=10)
Constructs a progress reporter with the given prefix and iteration length.
Definition:
progress.cpp:38
meta::printing::progress::finished_
bool finished_
Whether or not we have finished the job.
Definition:
progress.h:95
meta::printing::progress::length_
uint64_t length_
The total number of iterations.
Definition:
progress.h:84
meta::printing::progress::last_update_
std::chrono::steady_clock::time_point last_update_
The time of the last update.
Definition:
progress.h:80
meta::utf::length
uint64_t length(const std::string &str)
Definition:
utf.cpp:136
meta::printing::progress::prefix_
std::string prefix_
The prefix for the progress report message.
Definition:
progress.h:76
meta::printing::progress::last_iter_
uint64_t last_iter_
The last iteration number.
Definition:
progress.h:82
meta::printing::progress::interval_
int interval_
The length of time, in milliseconds, to wait between updates.
Definition:
progress.h:86
meta::printing::progress::~progress
~progress()
Destroys this progress reporter.
Definition:
progress.cpp:120
meta::printing::progress::clear
void clear() const
Clears the last line the progress bar wrote.
Definition:
progress.cpp:115
meta
The ModErn Text Analysis toolkit is a suite of natural language processing, classification, information retreival, data mining, and other applications of text processing.
Definition:
analyzer.h:24
meta::printing::progress::start_
std::chrono::steady_clock::time_point start_
The start time of the job.
Definition:
progress.h:78
meta::printing::progress::end
void end()
Marks the progress indicator as having finished.
Definition:
progress.cpp:106
meta::printing::progress::endline_
bool endline_
Whether or not we should print an endline when done.
Definition:
progress.h:97
meta::printing::progress::print_endline
void print_endline(bool endline)
Sets whether or not an endline should be printed at completion.
Definition:
progress.cpp:54
meta::printing::progress::str_len_
uint64_t str_len_
The length of the last progress output message.
Definition:
progress.h:93
meta::printing::progress::min_iters_
uint64_t min_iters_
The minimum number of iterations that must pass before progress reporting will be considered...
Definition:
progress.h:91
meta::printing::progress
Simple class for reporting progress of lengthy operations.
Definition:
progress.h:27
Generated on Tue Mar 3 2015 23:20:16 for ModErn Text Analysis by
1.8.9.1