OnixS C++ CME MDP Premium Market Data Handler 5.10.2
Users' manual and API documentation
Loading...
Searching...
No Matches
Timestamp Class Reference

#include <OnixS/CME/MDH/messaging/Time.h>

Public Types

enum  
typedef UInt64 Ticks
typedef UInt32 Year
using Month = OnixS::CME::MDH::Messaging::Month::Enum
typedef UInt32 Day
typedef UInt32 Hour
typedef UInt32 Minute
typedef UInt32 Second
typedef UInt32 Millisecond
typedef UInt32 Microsecond
typedef UInt32 Nanosecond

Public Member Functions

std::string toString (TimestampFormat::Enum=TimestampFormat::YYYYMMDDHHMMSSnsec) const
 Timestamp (Ticks ticks=0) noexcept
 Timestamp (Year year, Month month, Day day, Hour hour=0, Minute minute=0, Second second=0, Nanosecond nanosecond=0)
 Timestamp (const Timestamp &other) noexcept
Year year () const
Month month () const
Day day () const
Hour hour () const noexcept
Minute minute () const noexcept
Second second () const noexcept
Millisecond millisecond () const noexcept
Microsecond microsecond () const noexcept
Nanosecond nanosecond () const noexcept
Timestamp date () const noexcept
TimeSpan time () const noexcept
Ticks sinceEpoch () const noexcept
Timestampoperator= (const Timestamp &other) noexcept
void swap (Timestamp &other) noexcept

Static Public Member Functions

static Timestamp fromStr (const std::string &, TimestampFormat::Enum=TimestampFormat::YYYYMMDDHHMMSSnsec)
static Timestamp now () noexcept
static Timestamp utcNow () noexcept

Detailed Description

Definition at line 424 of file Time.h.

Member Typedef Documentation

◆ Day

typedef UInt32 Day

Integral type presenting the day component.

Definition at line 437 of file Time.h.

◆ Hour

typedef UInt32 Hour

Integral type presenting the hour component.

Definition at line 440 of file Time.h.

◆ Microsecond

Integral type presenting the microsecond component.

Definition at line 452 of file Time.h.

◆ Millisecond

Integral type presenting the millisecond component.

Definition at line 449 of file Time.h.

◆ Minute

typedef UInt32 Minute

Integral type presenting the minute component.

Definition at line 443 of file Time.h.

◆ Month

Type presenting the month component.

Definition at line 434 of file Time.h.

◆ Nanosecond

typedef UInt32 Nanosecond

Integral type presenting the nanosecond component.

Definition at line 455 of file Time.h.

◆ Second

typedef UInt32 Second

Integral type presenting the second component.

Definition at line 446 of file Time.h.

◆ Ticks

typedef UInt64 Ticks

Integral type storing internal ticks.

Definition at line 428 of file Time.h.

◆ Year

typedef UInt32 Year

Integral type presenting the year component.

Definition at line 431 of file Time.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
Size 

Definition at line 615 of file Time.h.

Constructor & Destructor Documentation

◆ Timestamp() [1/3]

Timestamp ( Ticks ticks = 0)
inlineexplicitnoexcept

Initializes from the number of ticks since epoch.

Definition at line 462 of file Time.h.

◆ Timestamp() [2/3]

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

Explicit time-stamp initialization.

Input parameters are validated, therefore constructor throws an exception if input values do not fit into their valid ranges.

Definition at line 471 of file Time.h.

◆ Timestamp() [3/3]

Timestamp ( const Timestamp & other)
inlinenoexcept

Definition at line 484 of file Time.h.

Member Function Documentation

◆ date()

Timestamp date ( ) const
inlinenoexcept
Returns
the Timestamp without a time part.

Definition at line 562 of file Time.h.

◆ day()

Day day ( ) const
inline
Returns
Day component

Definition at line 514 of file Time.h.

◆ fromStr()

Timestamp fromStr ( const std::string & str,
TimestampFormat::Enum format = TimestampFormat::YYYYMMDDHHMMSSnsec )
inlinestatic

De-serializes a timestamp from the given string.

Exceptions
std::runtime_errorif the de-serialization is impossible.

Definition at line 779 of file Time.h.

◆ hour()

Hour hour ( ) const
inlinenoexcept
Returns
the Hour component

Definition at line 526 of file Time.h.

◆ microsecond()

Microsecond microsecond ( ) const
inlinenoexcept
Returns
the Microsecond component.

Definition at line 550 of file Time.h.

◆ millisecond()

Millisecond millisecond ( ) const
inlinenoexcept
Returns
the Millisecond component.

Definition at line 544 of file Time.h.

◆ minute()

Minute minute ( ) const
inlinenoexcept
Returns
the Minute component.

Definition at line 532 of file Time.h.

◆ month()

Month month ( ) const
inline
Returns
the Month component.

Definition at line 502 of file Time.h.

◆ nanosecond()

Nanosecond nanosecond ( ) const
inlinenoexcept
Returns
the Nanosecond component.

Definition at line 556 of file Time.h.

◆ now()

Timestamp now ( )
staticnoexcept

Current local time.

◆ operator=()

Timestamp & operator= ( const Timestamp & other)
inlinenoexcept

Definition at line 579 of file Time.h.

◆ second()

Second second ( ) const
inlinenoexcept
Returns
the Second component.

Definition at line 538 of file Time.h.

◆ sinceEpoch()

Ticks sinceEpoch ( ) const
inlinenoexcept
Returns
the number of nanoseconds since the Epoch (01-01-1970).

Definition at line 574 of file Time.h.

◆ swap()

void swap ( Timestamp & other)
inlinenoexcept

Exchanges the value.

Definition at line 587 of file Time.h.

◆ time()

TimeSpan time ( ) const
inlinenoexcept
Returns
the Time part of timestamp.

Definition at line 568 of file Time.h.

◆ toString()

std::string toString ( TimestampFormat::Enum format = TimestampFormat::YYYYMMDDHHMMSSnsec) const
inline
Returns
a human-readable presentation.

Definition at line 808 of file Time.h.

◆ utcNow()

Timestamp utcNow ( )
staticnoexcept

Current utc time.

◆ year()

Year year ( ) const
inline
Returns
the Year component.

Definition at line 490 of file Time.h.