Samchon Framework for CPP  1.0.0
ProgressEvent.cpp
1 #include <samchon/library/ProgressEvent.hpp>
2 
3 using namespace samchon::library;
4 
5 ProgressEvent::ProgressEvent(EventDispatcher *source, size_t numerator, size_t denominator)
6  : Event(source, ProgressEvent::PROGRESS)
7 {
8  this->numerator = numerator;
9  this->denominator = denominator;
10 }
11 
12 auto ProgressEvent::getNumerator() const -> size_t
13 {
14  return numerator;
15 };
16 auto ProgressEvent::getDenominator() const -> size_t
17 {
18  return denominator;
19 };
20 auto ProgressEvent::getPercent() const -> double
21 {
22  return numerator / (double)denominator;
23 };
auto getPercent() const -> double
Get percentage of the progress.
auto getNumerator() const -> size_t
Get numerator, number of current progress.
size_t denominator
The number of total progress.
Package of libraries.
Definition: library.hpp:84
auto getDenominator() const -> size_t
Get denominator, number of total progress.
Represent an event running on background.
Definition: Event.hpp:42
Event representing a progress.
Abstract class for dispatching Event.
size_t numerator
The number of current progress.
ProgressEvent(EventDispatcher *, size_t, size_t)
Construct from source and progress.