OnixS C++ SGX Titan ITCH Market Data Handler  1.2.2
API documentation
Timestamp Class Reference

#include <OnixS/SgxTitan/MarketData/Itch/Timestamp.h>

Public Member Functions

 Timestamp ()
 
 Timestamp (unsigned int year, Month::Enum month, unsigned int day, unsigned int hour=0, unsigned int minute=0, unsigned int second=0, unsigned int nanosecond=0)
 
unsigned year () const
 
Month::Enum month () const
 
unsigned int day () const
 
void date (YearMonthDay &) const
 
unsigned int hour () const
 
unsigned int minute () const
 
unsigned int second () const
 
unsigned int millisecond () const
 
unsigned int microsecond () const
 
unsigned int nanosecond () const
 
const TimeSpansinceEpoch () const
 
bool operator== (const Timestamp &) const
 
bool operator!= (const Timestamp &) const
 
bool operator< (const Timestamp &) const
 
std::string toString (TimestampFormat::Enum=TimestampFormat::YYYYMMDDHHMMSSNsec) const
 
void toString (std::string &str, TimestampFormat::Enum=TimestampFormat::YYYYMMDDHHMMSSNsec) const
 

Static Public Member Functions

static Timestamp epoch ()
 
static Timestamp utcNow ()
 
static Timestamp now ()
 
static Timestamp parse (const std::string &, TimestampFormat::Enum=TimestampFormat::YYYYMMDDHHMMSSNsec)
 
static Timestamp parse (unsigned long long presentation, TimestampFormat::Enum format)
 

Friends

struct HandlerCore::Common::TimeHelper
 

Detailed Description

Definition at line 84 of file Timestamp.h.

Constructor & Destructor Documentation

Timestamp ( )

Initializes as Jan 1, 0001, 00:00:00.

Definition at line 51 of file Timestamp.cpp.

Timestamp ( unsigned int  year,
Month::Enum  month,
unsigned int  day,
unsigned int  hour = 0,
unsigned int  minute = 0,
unsigned int  second = 0,
unsigned int  nanosecond = 0 
)

Initializes date-time from all details.

Definition at line 57 of file Timestamp.cpp.

Member Function Documentation

void date ( YearMonthDay ymd) const

Returns date part of timestamp.

Definition at line 94 of file Timestamp.cpp.

unsigned int day ( ) const

day of month component of timestamp Valid values are 1 through 31.

Definition at line 88 of file Timestamp.cpp.

Timestamp epoch ( )
static

Epoch.

Definition at line 279 of file Timestamp.cpp.

unsigned int hour ( ) const

Hour component of timestamp. Valid values are 0 through 23.

Definition at line 105 of file Timestamp.cpp.

unsigned int microsecond ( ) const
inline

Microsecond component of timestamp Valid values are 0 through 999999.

Definition at line 215 of file Timestamp.h.

unsigned int millisecond ( ) const
inline

Millisecond component of timestamp Valid values are 0 through 999.

Definition at line 208 of file Timestamp.h.

unsigned int minute ( ) const

Minute component of timestamp Valid values are 0 through 59.

Definition at line 111 of file Timestamp.cpp.

Month::Enum month ( ) const

Month component of timestamp.

Definition at line 81 of file Timestamp.cpp.

unsigned int nanosecond ( ) const
inline

Nanosecond component of timestamp Valid values are 0 through 999999999.

Definition at line 222 of file Timestamp.h.

Timestamp now ( )
static

Returns the current local time.

Note
Timestamp resolution depends on capabilities of an operating system.

Definition at line 183 of file Timestamp.cpp.

bool operator!= ( const Timestamp other) const

Compares instance with another one.

Definition at line 131 of file Timestamp.cpp.

bool operator< ( const Timestamp other) const

Tests whether instance is less than another one.

Definition at line 139 of file Timestamp.cpp.

bool operator== ( const Timestamp other) const

Compares instance with another one.

Definition at line 123 of file Timestamp.cpp.

Timestamp parse ( const std::string &  str,
TimestampFormat::Enum  format = TimestampFormat::YYYYMMDDHHMMSSNsec 
)
static

Parses timestamp from its text presentation assuming it's in specified format ("YYYYMMDD-HH:MM:SS.sssssssss" by default).

Definition at line 190 of file Timestamp.cpp.

Timestamp parse ( unsigned long long  presentation,
TimestampFormat::Enum  format 
)
static

Parses timestamp from its numeric presentation.

Definition at line 245 of file Timestamp.cpp.

unsigned int second ( ) const

Second component of timestamp Valid values are 0 through 59.

Definition at line 117 of file Timestamp.cpp.

const TimeSpan & sinceEpoch ( ) const
inline

Time span since Jan 1, 0001, 00:00:00.

Definition at line 229 of file Timestamp.h.

std::string toString ( TimestampFormat::Enum  format = TimestampFormat::YYYYMMDDHHMMSSNsec) const
inline

Returns timestamp text presentation in requested format ("YYYYMMDD-HH:MM:SS.sssssssss" by default).

Definition at line 236 of file Timestamp.h.

void toString ( std::string &  str,
TimestampFormat::Enum  format = TimestampFormat::YYYYMMDDHHMMSSNsec 
) const

Appends timestamp text presentation in requested format ("YYYYMMDD-HH:MM:SS.sssssssss" by default).

Definition at line 147 of file Timestamp.cpp.

Timestamp utcNow ( )
static

Returns the current UTC time.

Note
Timestamp resolution depends on capabilities of an operating system.

Definition at line 176 of file Timestamp.cpp.

unsigned year ( ) const

Year component of timestamp.

Definition at line 75 of file Timestamp.cpp.

Friends And Related Function Documentation

friend struct HandlerCore::Common::TimeHelper
friend

Definition at line 194 of file Timestamp.h.


The documentation for this class was generated from the following files: