OnixS C++ FIX Engine  4.2.0
API Documentation
Timestamp Class Reference

#include <OnixS/FIXEngine/FIX/Timestamp.h>

Public Member Functions

 Timestamp ()
 
 Timestamp (TotalSeconds seconds, Nanosecond nanosecond)
 
 Timestamp (TotalSeconds seconds, Picosecond picosecond)
 
 Timestamp (Year year, Month::Enum month, Day day, Hour hour=0, Minute minute=0, Second second=0, Nanosecond nanosecond=0)
 
 Timestamp (Year year, Month::Enum month, Day day, Hour hour, Minute minute, Second second, Picosecond picosecond)
 
Year year () const
 
Month::Enum month () const
 
Day day () const
 
void date (YearMonthDay &) const
 
Hour hour () const
 
Minute minute () const
 
Second second () const
 
Millisecond millisecond () const
 
Microsecond microsecond () const
 
Nanosecond nanosecond () const
 
Picosecond picosecond () const
 
TotalSeconds totalSeconds () const
 
bool operator== (const Timestamp &) const
 
bool operator!= (const Timestamp &) const
 
bool operator< (const Timestamp &) const
 
Timestampoperator+= (const TimeSpan &)
 
Timestampoperator-= (const TimeSpan &)
 
std::string toString (TimestampFormat::Enum=TimestampFormat::YYYYMMDDHHMMSSNsec) const
 
void toString (std::string &str, TimestampFormat::Enum=TimestampFormat::YYYYMMDDHHMMSSNsec) const
 

Static Public Member Functions

static Timestamp utc ()
 
static Timestamp local ()
 
static Timestamp parse (const std::string &, TimestampFormat::Enum=TimestampFormat::YYYYMMDDHHMMSSNsec)
 

Friends

class TimeManager
 

Detailed Description

Definition at line 91 of file Timestamp.h.

Constructor & Destructor Documentation

Timestamp ( )

Constructs uninitialized instance.

Timestamp ( TotalSeconds  seconds,
Nanosecond  nanosecond 
)
inline

Initializes from seconds and nanoseconds since Jan 1, 0001, 00:00:00.

Definition at line 222 of file Timestamp.h.

Timestamp ( TotalSeconds  seconds,
Picosecond  picosecond 
)
inline

Initializes from seconds and picoseconds since Jan 1, 0001, 00:00:00.

Definition at line 230 of file Timestamp.h.

Timestamp ( Year  year,
Month::Enum  month,
Day  day,
Hour  hour = 0,
Minute  minute = 0,
Second  second = 0,
Nanosecond  nanosecond = 0 
)

Initializes date-time from all details.

Timestamp ( Year  year,
Month::Enum  month,
Day  day,
Hour  hour,
Minute  minute,
Second  second,
Picosecond  picosecond 
)

Initializes date-time from all details.

Member Function Documentation

void date ( YearMonthDay ) const

Returns date part of timestamp.

Day day ( ) const

Current day of month.

Valid values are 1 through 31.

Hour hour ( ) const

Current hour.

Valid values are 0 through 23.

static Timestamp local ( )
static

Returns the current local time.

Note
Timestamp resolution depends on capabilities of an operating system.
Microsecond microsecond ( ) const
inline

Current microsecond.

Valid values are 0 through 999999.

Definition at line 253 of file Timestamp.h.

Millisecond millisecond ( ) const
inline

Current millisecond.

Valid values are 0 through 999.

Definition at line 246 of file Timestamp.h.

Minute minute ( ) const

Current minute.

Valid values are 0 through 59.

Month::Enum month ( ) const

Current month.

Nanosecond nanosecond ( ) const
inline

Current nanosecond.

Valid values are 0 through 999999999.

Definition at line 260 of file Timestamp.h.

bool operator!= ( const Timestamp ) const

Compares instance with another one.

Timestamp& operator+= ( const TimeSpan )

Increases instance by time span.

Timestamp& operator-= ( const TimeSpan )

Decreases instance by time span.

bool operator< ( const Timestamp ) const

Tests whether instance is less than another one.

bool operator== ( const Timestamp ) const

Compares instance with another one.

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

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

Picosecond picosecond ( ) const
inline

Current picosecond.

Valid values are 0 through 999999999999.

Definition at line 267 of file Timestamp.h.

Second second ( ) const

Current second.

Valid values are 0 through 59.

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 274 of file Timestamp.h.

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

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

TotalSeconds totalSeconds ( ) const
inline

Total number of seconds since Jan 1, 0001, 00:00:00.

Definition at line 239 of file Timestamp.h.

static Timestamp utc ( )
static

Returns the current UTC time.

Note
Timestamp resolution depends on capabilities of an operating system.
Year year ( ) const

Current year.

Friends And Related Function Documentation

friend class TimeManager
friend

Definition at line 215 of file Timestamp.h.


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