OnixS SGX Derivatives Handler for C++  2.17.0.0
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
YearMonth Class Reference

Represents month-year pair. More...

Classes

struct  NoVerify
 Suppresses verification. More...
 

Public Member Functions

 YearMonth ()
 Initializes instance as Jan, 0001.
 
 YearMonth (unsigned int year, Month month)
 Initializes instance with given values. More...
 
 YearMonth (const YearMonth &other)
 Initializes as copy of other instance.
 
unsigned int year () const
 Year component. More...
 
Month month () const
 Month component. More...
 
bool operator== (const YearMonth &) const
 Compares with other instance for equality.
 
bool operator!= (const YearMonth &) const
 Compares with other instance for inequality.
 
YearMonthoperator= (const YearMonth &other)
 
std::string toString () const
 Serializes into text (YYYYMM) presentation.
 
void toString (std::string &) const
 Serializes into text (YYYYMM) presentation.
 

Static Public Member Functions

static YearMonth deserialize (unsigned long long)
 De-serializes instance from its numeric presentation as it's used by CME Globex. More...
 

Protected Member Functions

 YearMonth (unsigned int, Month, const NoVerify &)
 Initializes instance without verifying input. More...
 

Detailed Description

Represents month-year pair.

Year must fit into [0001, 9999] range. Month must fit into [01, 12] range.

Constructor & Destructor Documentation

YearMonth ( unsigned int  year,
Month  month 
)

Initializes instance with given values.

Input parameters are checked for validness.

Exceptions
exceptionif input parameters do not fit into a valid range.
YearMonth ( unsigned  int,
Month  ,
const NoVerify  
)
protected

Initializes instance without verifying input.

Member Function Documentation

static YearMonth deserialize ( unsigned long  long)
static

De-serializes instance from its numeric presentation as it's used by CME Globex.

Month month ( ) const
inline

Month component.

Valid range of values is [01, 12].

unsigned int year ( ) const
inline

Year component.

Valid range of values is [0001, 9999].