OnixS CME Drop Copy Handler C++ library  5.7.1
API documentation
YearMonth Class Reference

#include <OnixS/CME/DropCopy/Time.h>

Public Member Functions

 YearMonth ()
 
 YearMonth (UInt32 year, Month month)
 
 YearMonth (UInt32 year, Month month, UInt32 day)
 
 YearMonth (UInt32 year, Month month, WeekCode week)
 
 YearMonth (const YearMonth &other)
 
UInt32 year () const
 
Month month () const
 
UInt32 day () const
 
WeekCode week () const
 
bool hasDay () const
 
bool hasWeek () const
 
bool operator== (const YearMonth &) const
 
bool operator!= (const YearMonth &) const
 
bool operator< (const YearMonth &other) const
 
bool operator> (const YearMonth &other) const
 
YearMonthoperator= (const YearMonth &other)
 
std::string toString () const
 
void toString (std::string &) const
 

Static Public Member Functions

static YearMonth deserialize (const StringRef &)
 

Detailed Description

Represents month-year pair. Year must fit into [0001, 9999] range. Month must fit into [01, 12] range.

Definition at line 277 of file Time.h.

Constructor & Destructor Documentation

YearMonth ( )

Initializes instance as Jan, 0001.

YearMonth ( UInt32  year,
Month  month 
)

Initializes instance with given values according YYYYMM (year/month) format. Input parameters are checked for validness.

Exceptions
exceptionif input parameters do not fit into a valid range.
YearMonth ( UInt32  year,
Month  month,
UInt32  day 
)

Initializes instance with given values according YYYYMMDD (year/month/day) format. Input parameters are checked for validness.

Exceptions
exceptionif input parameters do not fit into a valid range.
YearMonth ( UInt32  year,
Month  month,
WeekCode  week 
)

Initializes instance with given values according YYYYMMWW (year/month/week) format. Input parameters are checked for validness.

Exceptions
exceptionif input parameters do not fit into a valid range.
YearMonth ( const YearMonth other)

Initializes as copy of other instance.

Member Function Documentation

UInt32 day ( ) const
inline

Day component. Valid range of values is [01, 31].

Definition at line 323 of file Time.h.

static YearMonth deserialize ( const StringRef )
static

De-serializes instance from its string presentation (YYYYMM/YYYYMMDD/YYYYMMWW) as it's used by CME Globex.

bool hasDay ( ) const
inline

Checks that instance has valid day component. Note: it's not valid to have both valid day and week, only one of them allowed.

Definition at line 337 of file Time.h.

bool hasWeek ( ) const
inline

Checks that instance has valid week component. Note: it's not valid to have both valid day and week, only one of them allowed.

Definition at line 344 of file Time.h.

Month month ( ) const
inline

Month component. Valid range of values is [01, 12].

Definition at line 316 of file Time.h.

bool operator!= ( const YearMonth ) const

Compares with other instance for inequality.

bool operator< ( const YearMonth other) const

Checks whether this instance is less than other one. Note: when comparing objects with different date components, e.g. days vs weeks (but same year and month) following order is applied: YYYYMM < YYYYMMWW < YYYYMMDD

YearMonth& operator= ( const YearMonth other)
bool operator== ( const YearMonth ) const

Compares with other instance for equality.

bool operator> ( const YearMonth other) const

Checks whether this instance is greater than other one. Note: when comparing objects with different date components, e.g. days vs weeks (but same year and month) following order is applied: YYYYMMDD > YYYYMMWW > YYYYMM

std::string toString ( ) const
inline

Serializes into text (YYYYMM/YYYYMMDD/YYYYMMWW) presentation.

Definition at line 394 of file Time.h.

void toString ( std::string &  ) const

Serializes into text (YYYYMM/YYYYMMDD/YYYYMMWW) presentation.

WeekCode week ( ) const
inline

Week component. Valid range of values is [1, 5].

Definition at line 330 of file Time.h.

UInt32 year ( ) const
inline

Year component. Valid range of values is [0001, 9999].

Definition at line 309 of file Time.h.


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