24 #include <OnixS/Senaf/MarketData/Export.h> 28 namespace OnixS {
namespace Senaf {
namespace MarketData {
65 TimeSpan(
int hours,
int minutes,
int seconds,
int nanoseconds = 0);
73 TimeSpan(
int days,
int hours,
int minutes,
int seconds,
int nanoseconds);
77 TimeSpan(
long long totalSeconds,
int nanoseconds);
83 long long totalSeconds()
const;
103 int milliseconds()
const;
107 int microseconds()
const;
111 int nanoseconds()
const;
114 bool operator==(
const TimeSpan& other)
const;
117 bool operator!=(
const TimeSpan& other)
const;
120 bool operator<(
const TimeSpan& other)
const;
123 bool operator>(
const TimeSpan& other)
const;
143 static TimeSpan deserialize(
const std::string& str);
146 static TimeSpan deserialize(
unsigned long long presentation, TimeSpanFormat format);
170 toString(str, format);
199 static Enum deserialize(
const char*);
202 static const char* toString(
Enum);
225 static Enum deserialize(
const char*);
228 static const char* toString(
Enum);
247 YearMonth(
unsigned int year, Month month);
254 unsigned int year()
const;
270 std::string toString()
const;
273 void toString(std::string&)
const;
277 static YearMonth deserialize(
unsigned long long);
323 Date(
unsigned int year, Month month,
unsigned int day);
330 unsigned int day()
const;
333 bool operator==(
const Date& other)
const;
336 bool operator!=(
const Date& other)
const;
339 bool operator<(
const Date& other)
const;
342 bool operator>(
const Date& other)
const;
354 std::string toString()
const;
357 void toString(std::string&)
const;
361 static Date deserialize(
unsigned long long);
367 Date(
unsigned int year, Month month,
unsigned int day,
const NoVerify&);
418 Timestamp(
unsigned year, Month month,
unsigned day);
443 unsigned int year()
const;
449 unsigned int day()
const;
452 unsigned int hour()
const;
455 unsigned int minute()
const;
458 unsigned int second()
const;
461 unsigned int millisecond()
const;
464 unsigned int microsecond()
const;
467 unsigned int nanosecond()
const;
473 void date(
Date&)
const;
479 DayOfWeek dayOfWeek()
const;
482 bool operator==(
const Timestamp& other)
const;
485 bool operator!=(
const Timestamp& other)
const;
488 bool operator<(
const Timestamp& other)
const;
491 bool operator>(
const Timestamp& other)
const;
520 static Timestamp deserialize(
const std::string&);
524 static Timestamp deserialize(
unsigned long long presentation, TimestampFormat format);
535 return static_cast<unsigned int>(sinceEpoch_.hours());
540 return static_cast<unsigned int>(sinceEpoch_.minutes());
545 return static_cast<unsigned int>(sinceEpoch_.seconds());
550 return static_cast<unsigned int>(sinceEpoch_.milliseconds());
555 return static_cast<unsigned int>(sinceEpoch_.microseconds());
560 return static_cast<unsigned int>(sinceEpoch_.nanoseconds());
567 toString(str, format);
Represents date without time component.
std::string toString() const
Serializes into text (YYYYMM) presentation.
std::string toString() const
Serializes date into YYYYMMDD presentation.
static const TimeSpan Zero
Time interval of zero length.
unsigned int nanosecond() const
Nanosecond component of timestamp.
Identifies months in year.
Months::Enum Month
Identifies months in year.
long long totalSeconds() const
Whole number of seconds in time interval.
std::string toString(TimestampFormat format=TimestampFormats::YYYYMMDDHHMMSSnsec) const
unsigned int millisecond() const
Millisecond component of timestamp.
TimeSpan operator-(const Date &left, const Date &right)
Calculates time interval between two given dates.
TimeSpanFormats::Enum TimeSpanFormat
Time span format.
Represents timestamp without time-zone information.
void toString(std::string &str, TimeSpanFormat format=TimeSpanFormats::SDHHMMSSnsec) const
unsigned int microsecond() const
Microsecond component of timestamp.
unsigned int year() const
Identifies day within week.
DaysOfWeek::Enum DayOfWeek
Identifies day within week.
unsigned int second() const
Second component of timestamp.
TimestampFormats::Enum TimestampFormat
Timestamp format.
unsigned int minute() const
Minute component of timestamp.
unsigned int hour() const
Hour component of timestamp.