timeUnit.hpp
Go to the documentation of this file.
1 #ifndef JULIAN_TIMEUNIT_HPP
2 #define JULIAN_TIMEUNIT_HPP
3 
4 #include <string>
5 #include <iostream>
6 
12 namespace julian {
13 
21  enum TimeUnit {
22  DAY,
23  WEEK,
24  MONTH,
25  QUARTER,
26  YEAR,
27  OVERNIGHT,
28  TOMORROWNEXT,
29  SPOTDATE,
30  TODAY,
31  SPOTNEXT
32  };
33 
38  template<class Archive>
39  void serialize(Archive & ar, TimeUnit & g, const unsigned int version) {
40  }
54  enum Weekday {
55  MON = 2,
56  TUE = 3,
57  WED = 4,
58  THU = 5,
59  FRI = 6,
60  SAT = 0,
61  SUN = 1
62  };
63 
68  enum Frequency {
69  NOFREQ = 0,
70  MONTHLY = 1,
71  QUARTERLY = 3,
72  SEMIANNUALLY = 6,
73  ANNUALLY = 12
74  };
78  inline std::ostream& operator<<(std::ostream & os, Frequency & f) {
79  switch(f) {
80  case NOFREQ: os << "NoFreq"; break;
81  case MONTHLY: os << "monthly"; break;
82  case QUARTERLY: os << "quarterly"; break;
83  case SEMIANNUALLY: os << "semiannually"; break;
84  case ANNUALLY: os << "annually"; break;
85  }
86  return os;
87  }
88 
98  enum NameOfMonth {
99  JAN = 1,
100  FEB = 2,
101  MAR = 3,
102  APR = 4,
103  MAY = 5,
104  JUN = 6,
105  JUL = 7,
106  AUG = 8,
107  SEP = 9,
108  OCT = 10,
109  NOV = 11,
110  DEC = 12
111  };
112 
124  };
125 
130  template<class Archive>
131  void serialize(Archive & ar, DayRollingConvention & g, const unsigned int version) {
132  }
133 } // namespace julian
134 #endif
Definition: timeUnit.hpp:119
Definition: timeUnit.hpp:121
Definition: timeUnit.hpp:118
TimeUnit
Definition: timeUnit.hpp:21
Definition: cadHoliday.cpp:3
std::ostream & operator<<(std::ostream &os, Frequency &f)
Overloading << operator for Frequency enumeration.
Definition: timeUnit.hpp:78
NameOfMonth
Definition: timeUnit.hpp:98
void serialize(Archive &ar, DayRollingConvention &g, const unsigned int version)
interface used by Boost serialization library
Definition: timeUnit.hpp:131
Definition: timeUnit.hpp:122
Definition: timeUnit.hpp:120
DayRollingConvention
Definition: timeUnit.hpp:117
Frequency
Definition: timeUnit.hpp:68
Definition: timeUnit.hpp:123
Weekday
Definition: timeUnit.hpp:54