EPAM B2BITS C++ Bovespa MarketData handler  1.28.2
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
B2bits::MonthYear Class Reference

Encapsulates MonthYear FIX type. More...

#include <b2bits/types/MonthYear.h>

Public Types

enum  Week {
  NA, w1, w2, w3,
  w4, w5
}
 

Public Member Functions

 MonthYear () noexcept
 Constructor. More...
 
 MonthYear (int year, int month) noexcept
 Creates object from year and month. More...
 
 MonthYear (int year, int month, int day) noexcept
 Creates object from year, month and day. More...
 
 MonthYear (int year, int month, Week week) noexcept
 Creates object from year, month and week. More...
 
int year () const noexcept
 Returns year. More...
 
int month () const noexcept
 Returns month. More...
 
int day () const noexcept
 Returns day. More...
 
Week week () const noexcept
 Returns week. More...
 
std::string & toFixString (std::string *dest) const
 
char * toFixString (char *buf, char *end) const noexcept
 
u32 toDecimal () const noexcept
 Returns value in decimal format (YYYYMMDDW) More...
 
u32 toYYYYMMDD () const noexcept
 Returns value in decimal format. More...
 
u32 toYYYYMM () const noexcept
 Returns value in decimal format. More...
 
bool operator== (const MonthYear &v) const noexcept
 Compares two MonthYear. More...
 
bool operator!= (const MonthYear &v) const noexcept
 Compares two MonthYear. More...
 

Static Public Member Functions

static MonthYear fromFixString (AsciiString val) noexcept
 Constructs object from FIX string. More...
 
static MonthYear fromDecimal (u32 val) noexcept
 Constructs object from decimal date format (YYYYMMDDW). More...
 
static MonthYear fromDecimalString (AsciiString val) noexcept
 Constructs object from decimal date format (YYYYMMDDW). More...
 
static MonthYear fromString (AsciiString val) noexcept
 Constructs object from string. More...
 
static MonthYear fromYYYYMM (u32 val) noexcept
 Constructs object from decimal date format (YYYYMM). More...
 
static MonthYear fromYYYYMMDD (u32 val) noexcept
 Constructs object from decimal date format (YYYYMMDD). More...
 

Static Public Attributes

static const unsigned int ValueSizeWithWeek = sizeof( "YYYYMMwD" ) - 1
 Maximum buffer size required to store value. More...
 
static const unsigned int ValueSizeWithDay = sizeof( "YYYYMMDD" ) - 1
 Maximum buffer size required to store value. More...
 
static const unsigned int ValueSizeNoDay = sizeof( "YYYYMM" ) - 1
 Maximum buffer size required to store value. More...
 
static const unsigned int ValueSize = ValueSizeWithWeek
 Maximum buffer size required to store value. More...
 

Detailed Description

Encapsulates MonthYear FIX type.

Member Enumeration Documentation

Enumerator
NA 
w1 
w2 
w3 
w4 
w5 

Constructor & Destructor Documentation

B2bits::MonthYear::MonthYear ( )
noexcept

Constructor.

B2bits::MonthYear::MonthYear ( int  year,
int  month 
)
noexcept

Creates object from year and month.

B2bits::MonthYear::MonthYear ( int  year,
int  month,
int  day 
)
noexcept

Creates object from year, month and day.

B2bits::MonthYear::MonthYear ( int  year,
int  month,
Week  week 
)
noexcept

Creates object from year, month and week.

Member Function Documentation

int B2bits::MonthYear::day ( ) const
noexcept

Returns day.

static MonthYear B2bits::MonthYear::fromDecimal ( u32  val)
staticnoexcept

Constructs object from decimal date format (YYYYMMDDW).

static MonthYear B2bits::MonthYear::fromDecimalString ( AsciiString  val)
staticnoexcept

Constructs object from decimal date format (YYYYMMDDW).

static MonthYear B2bits::MonthYear::fromFixString ( AsciiString  val)
staticnoexcept

Constructs object from FIX string.

static MonthYear B2bits::MonthYear::fromString ( AsciiString  val)
staticnoexcept

Constructs object from string.

static MonthYear B2bits::MonthYear::fromYYYYMM ( u32  val)
staticnoexcept

Constructs object from decimal date format (YYYYMM).

static MonthYear B2bits::MonthYear::fromYYYYMMDD ( u32  val)
staticnoexcept

Constructs object from decimal date format (YYYYMMDD).

int B2bits::MonthYear::month ( ) const
noexcept

Returns month.

bool B2bits::MonthYear::operator!= ( const MonthYear v) const
inlinenoexcept

Compares two MonthYear.

bool B2bits::MonthYear::operator== ( const MonthYear v) const
inlinenoexcept

Compares two MonthYear.

u32 B2bits::MonthYear::toDecimal ( ) const
noexcept

Returns value in decimal format (YYYYMMDDW)

std::string& B2bits::MonthYear::toFixString ( std::string *  dest) const

Converts value stored in object to FIX string. and stores value to dest

char* B2bits::MonthYear::toFixString ( char *  buf,
char *  end 
) const
noexcept

Converts value stored in object to FIX string. and stores value to dest

u32 B2bits::MonthYear::toYYYYMM ( ) const
noexcept

Returns value in decimal format.

u32 B2bits::MonthYear::toYYYYMMDD ( ) const
noexcept

Returns value in decimal format.

Week B2bits::MonthYear::week ( ) const
noexcept

Returns week.

int B2bits::MonthYear::year ( ) const
noexcept

Returns year.

Member Data Documentation

const unsigned int B2bits::MonthYear::ValueSize = ValueSizeWithWeek
static

Maximum buffer size required to store value.

const unsigned int B2bits::MonthYear::ValueSizeNoDay = sizeof( "YYYYMM" ) - 1
static

Maximum buffer size required to store value.

const unsigned int B2bits::MonthYear::ValueSizeWithDay = sizeof( "YYYYMMDD" ) - 1
static

Maximum buffer size required to store value.

const unsigned int B2bits::MonthYear::ValueSizeWithWeek = sizeof( "YYYYMMwD" ) - 1
static

Maximum buffer size required to store value.