Class implements a tenor object. More...
#include <tenor.hpp>
Public Member Functions | |
Tenor () | |
Constructor. More... | |
Tenor (TimeUnit) | |
Constructor - set unit, number is 1. More... | |
Tenor (int, TimeUnit) | |
Constructor - set unit and number. More... | |
Tenor (std::string) | |
Constructor - string. More... | |
Tenor | operator= (TimeUnit) |
Creates tenor by time unit as rvalue. More... | |
int | getNumberOfUnits () const |
returns number of time units More... | |
TimeUnit | getTimeUnit () const |
returns time unit More... | |
operator std::string () const | |
Converts tenor to std::string. More... | |
Private Attributes | |
TimeUnit | unit_ |
This variable holds type of time unit. More... | |
int | number_of_units_ |
This integer represents number of time units. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &, Tenor &) |
Prints tenor. More... | |
Detailed Description
Class implements a tenor object.
Tenor is a object that posses number of time units (see TimeUnit enumeration). Quotings in the market are given for certain tenors. This class helps to represent the concept on tenor.
Constructor & Destructor Documentation
julian::Tenor::Tenor | ( | ) |
Constructor.
This constructor set unit to Day and the number of units to 1.
julian::Tenor::Tenor | ( | TimeUnit | a | ) |
Constructor - set unit, number is 1.
This constructors builds object on the basis of provided time unit. Default number of units is 1.
julian::Tenor::Tenor | ( | int | n, |
TimeUnit | unit | ||
) |
Constructor - set unit and number.
This constructors builds object on the basis of provided time unit and integer.
julian::Tenor::Tenor | ( | std::string | str | ) |
Constructor - string.
This constructors builds object on the basis of string provided. The string should have form NU, where N is the number of units and U is:
- 'D' for Day
- 'W' for Week
- 'M' for Month
- 'Q' for Quarter
- 'Y' for year.
Member Function Documentation
int julian::Tenor::getNumberOfUnits | ( | ) | const |
returns number of time units
Method returns number of time units held by instance.
TimeUnit julian::Tenor::getTimeUnit | ( | ) | const |
returns time unit
Methods return name of time unit held by instance.
julian::Tenor::operator std::string | ( | ) | const |
Converts tenor to std::string.
Conversion operator to std::string.
Creates tenor by time unit as rvalue.
Methods overloads operator=. It enables to create tenors object by providing time unit as rvalue.
Friends And Related Function Documentation
|
friend |
Prints tenor.
This is definition of overloaded << operator that enables printing Tenor on console application.
Member Data Documentation
|
private |
This integer represents number of time units.
|
private |
This variable holds type of time unit.
The documentation for this class was generated from the following files:
- C:/Unix/home/OEM/jULIAN/src/dates/tenor.hpp
- C:/Unix/home/OEM/jULIAN/src/dates/tenor.cpp