QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
|
#include <period.hpp>
Public Member Functions | |
Period ()=default | |
Period (Integer n, TimeUnit units) | |
Period (Frequency f) | |
Integer | length () const |
TimeUnit | units () const |
Frequency | frequency () const |
Period & | operator+= (const Period &) |
Period & | operator-= (const Period &) |
Period & | operator*= (Integer) |
Period & | operator/= (Integer) |
void | normalize () |
Period | normalized () const |
Private Attributes | |
Integer | length_ = 0 |
TimeUnit | units_ = Days |
Related Functions | |
(Note that these are not member functions.) | |
Real | years (const Period &) |
Real | months (const Period &) |
Real | weeks (const Period &) |
Real | days (const Period &) |
template<typename T > | |
Period | operator* (T n, TimeUnit units) |
template<typename T > | |
Period | operator* (TimeUnit units, T n) |
Period | operator- (const Period &) |
Period | operator* (Integer n, const Period &) |
Period | operator* (const Period &, Integer n) |
Period | operator/ (const Period &, Integer n) |
Period | operator+ (const Period &, const Period &) |
Period | operator- (const Period &, const Period &) |
bool | operator< (const Period &, const Period &) |
bool | operator== (const Period &, const Period &) |
bool | operator!= (const Period &, const Period &) |
bool | operator> (const Period &, const Period &) |
bool | operator<= (const Period &, const Period &) |
bool | operator>= (const Period &, const Period &) |
std::ostream & | operator<< (std::ostream &, const Period &) |
This class provides a Period (length + TimeUnit) class and implements a limited algebra.
Definition at line 44 of file period.hpp.
|
default |
Definition at line 47 of file period.hpp.
Definition at line 29 of file period.cpp.
Integer length | ( | ) | const |
TimeUnit units | ( | ) | const |
Frequency frequency | ( | ) | const |
Definition at line 69 of file period.cpp.
Definition at line 134 of file period.cpp.
Definition at line 223 of file period.cpp.
void normalize | ( | ) |
Period normalized | ( | ) | const |
Definition at line 147 of file period.hpp.
Definition at line 152 of file period.hpp.
Definition at line 390 of file period.cpp.
Definition at line 380 of file period.cpp.
Definition at line 386 of file period.cpp.
Definition at line 162 of file period.hpp.
Definition at line 166 of file period.hpp.
Definition at line 170 of file period.hpp.
Definition at line 174 of file period.hpp.
Definition at line 178 of file period.hpp.
|
related |
|
private |
Definition at line 60 of file period.hpp.
Definition at line 61 of file period.hpp.