OnixS C++ B3 BOE Binary Order Entry 1.3.0
API Documentation
Loading...
Searching...
No Matches
Timestamp Class Reference

Public Types

typedef UInt64 Ticks
typedef UInt32 Year
typedef OnixS::B3::BOE::Messaging::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

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)

Detailed Description

Definition at line 467 of file Time.h.

Member Typedef Documentation

◆ Day

typedef UInt32 Day

Integral type presenting the day component.

Definition at line 482 of file Time.h.

◆ Hour

typedef UInt32 Hour

Integral type presenting the hour component.

Definition at line 485 of file Time.h.

◆ Microsecond

typedef UInt32 Microsecond

Integral type presenting the microsecond component.

Definition at line 497 of file Time.h.

◆ Millisecond

typedef UInt32 Millisecond

Integral type presenting the millisecond component.

Definition at line 494 of file Time.h.

◆ Minute

typedef UInt32 Minute

Integral type presenting the minute component.

Definition at line 488 of file Time.h.

◆ Month

Type presenting the month component.

Definition at line 479 of file Time.h.

◆ Nanosecond

typedef UInt32 Nanosecond

Integral type presenting the nanosecond component.

Definition at line 500 of file Time.h.

◆ Second

typedef UInt32 Second

Integral type presenting the second component.

Definition at line 491 of file Time.h.

◆ Ticks

typedef UInt64 Ticks

Integral type storing internal ticks.

Definition at line 471 of file Time.h.

◆ Year

typedef UInt32 Year

Integral type presenting the year component.

Definition at line 474 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 507 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 515 of file Time.h.

◆ Timestamp() [3/3]

Timestamp ( const Timestamp & other)
inlinenoexcept

Definition at line 531 of file Time.h.

Member Function Documentation

◆ date()

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

Definition at line 603 of file Time.h.

◆ day()

Day day ( ) const
inline
Returns
Day component

Definition at line 557 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 838 of file Time.h.

◆ hour()

Hour hour ( ) const
inlinenoexcept
Returns
the Hour component

Definition at line 567 of file Time.h.

◆ microsecond()

Microsecond microsecond ( ) const
inlinenoexcept
Returns
the Microsecond component.

Definition at line 591 of file Time.h.

◆ millisecond()

Millisecond millisecond ( ) const
inlinenoexcept
Returns
the Millisecond component.

Definition at line 585 of file Time.h.

◆ minute()

Minute minute ( ) const
inlinenoexcept
Returns
the Minute component.

Definition at line 573 of file Time.h.

◆ month()

Month month ( ) const
inline
Returns
the Month component.

Definition at line 547 of file Time.h.

◆ nanosecond()

Nanosecond nanosecond ( ) const
inlinenoexcept
Returns
the Nanosecond component.

Definition at line 597 of file Time.h.

◆ operator=()

Timestamp & operator= ( const Timestamp & other)
inlinenoexcept

Definition at line 627 of file Time.h.

◆ second()

Second second ( ) const
inlinenoexcept
Returns
the Second component.

Definition at line 579 of file Time.h.

◆ sinceEpoch()

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

Definition at line 622 of file Time.h.

◆ swap()

void swap ( Timestamp & other)
inlinenoexcept

Exchanges the value.

Definition at line 635 of file Time.h.

◆ time()

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

Definition at line 613 of file Time.h.

◆ toString()

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

Definition at line 872 of file Time.h.

◆ year()

Year year ( ) const
inline
Returns
the Year component.

Definition at line 537 of file Time.h.