OnixS C++ Eurex T7 Market and Reference Data (EMDI, MDI, RDI, EOBI) Handlers 19.0.0
Users' manual and API documentation
Loading...
Searching...
No Matches
Timestamp Class Reference

#include <OnixS/Eurex/MarketData/Timestamp.h>

Public Types

typedef UInt64 Ticks
typedef UInt32 Year
typedef OnixS::Eurex::MarketData::Month::Enum Month
typedef UInt32 Day
typedef UInt32 Hour
typedef UInt32 Minute
typedef UInt32 Second
typedef UInt32 Millisecond
typedef UInt32 Microsecond
typedef UInt32 Nanosecond

Public Member Functions

 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
Nanosecond nanosecond () const noexcept
Timestamp date () const noexcept
TimeSpan time () const noexcept
Ticks sinceEpoch () const noexcept
Timestampoperator= (const Timestamp &other)
void swap (Timestamp &other)
std::string toString (TimestampFormat::Enum format=TimestampFormat::YYYYMMDDHHMMSSNsec)

Static Public Member Functions

static Timestamp utcNow ()
static Timestamp now ()
static Timestamp parse (unsigned long long presentation, TimestampFormat::Enum format=TimestampFormat::YYYYMMDD)

Detailed Description

Definition at line 450 of file Timestamp.h.

Member Typedef Documentation

◆ Day

typedef UInt32 Day

Integral type presenting day component.

Definition at line 463 of file Timestamp.h.

◆ Hour

typedef UInt32 Hour

Integral type presenting hour component.

Definition at line 466 of file Timestamp.h.

◆ Microsecond

Integral type presenting microsecond component.

Definition at line 478 of file Timestamp.h.

◆ Millisecond

Integral type presenting millisecond component.

Definition at line 475 of file Timestamp.h.

◆ Minute

typedef UInt32 Minute

Integral type presenting minute component.

Definition at line 469 of file Timestamp.h.

◆ Month

Type presenting month component.

Definition at line 460 of file Timestamp.h.

◆ Nanosecond

typedef UInt32 Nanosecond

Integral type presenting nanosecond component.

Definition at line 481 of file Timestamp.h.

◆ Second

typedef UInt32 Second

Integral type presenting second component.

Definition at line 472 of file Timestamp.h.

◆ Ticks

typedef UInt64 Ticks

Integral type storing internal ticks.

Definition at line 454 of file Timestamp.h.

◆ Year

typedef UInt32 Year

Integral type presenting year component.

Definition at line 457 of file Timestamp.h.

Constructor & Destructor Documentation

◆ Timestamp() [1/3]

Timestamp ( Ticks ticks = 0)
inlineexplicitnoexcept

Initializes from number of ticks since epoch.

Definition at line 493 of file Timestamp.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 exception if input values do not fit into their valid ranges.

Definition at line 503 of file Timestamp.h.

◆ Timestamp() [3/3]

Timestamp ( const Timestamp & other)
inlinenoexcept

Initializes as copy of other instance.

Definition at line 509 of file Timestamp.h.

Member Function Documentation

◆ date()

Timestamp date ( ) const
inlinenoexcept

Timestamp without a time part.

Definition at line 581 of file Timestamp.h.

◆ day()

Day day ( ) const
inline

Day component of given time point.

Definition at line 535 of file Timestamp.h.

◆ hour()

Hour hour ( ) const
inlinenoexcept

Hour component of given time point.

Definition at line 545 of file Timestamp.h.

◆ microsecond()

Microsecond microsecond ( ) const
inline

Microsecond component of given time point.

Definition at line 569 of file Timestamp.h.

◆ millisecond()

Millisecond millisecond ( ) const
inlinenoexcept

Millisecond component of given time point.

Definition at line 563 of file Timestamp.h.

◆ minute()

Minute minute ( ) const
inlinenoexcept

Minute component of given time point.

Definition at line 551 of file Timestamp.h.

◆ month()

Month month ( ) const
inline

Month component of given time point.

Definition at line 525 of file Timestamp.h.

◆ nanosecond()

Nanosecond nanosecond ( ) const
inlinenoexcept

Nanosecond component of given time point.

Definition at line 575 of file Timestamp.h.

◆ now()

Timestamp now ( )
static

Returns current local time.

◆ operator=()

Timestamp & operator= ( const Timestamp & other)
inline

Reinitializes as copy of given instance.

Definition at line 600 of file Timestamp.h.

◆ parse()

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

Parses timestamp from its numeric presentation (like 20201115) only YYYYMMDD is supported

◆ second()

Second second ( ) const
inlinenoexcept

Second component of given time point.

Definition at line 557 of file Timestamp.h.

◆ sinceEpoch()

Ticks sinceEpoch ( ) const
inlinenoexcept

Number of nanoseconds since the Epoch (01-01-1970).

Definition at line 593 of file Timestamp.h.

◆ swap()

void swap ( Timestamp & other)
inline

Exchanges value with other instance.

Definition at line 610 of file Timestamp.h.

◆ time()

TimeSpan time ( ) const
inlinenoexcept

Time part of timestamp.

Definition at line 587 of file Timestamp.h.

◆ toString()

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

Serializes timestamp according to specified pattern.

Definition at line 830 of file Timestamp.h.

◆ utcNow()

Timestamp utcNow ( )
static

Returns current UTC time.

◆ year()

Year year ( ) const
inline

Year component of given time point.

Definition at line 515 of file Timestamp.h.