B2BITS FIX Antenna C++  2.31.0
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
Engine::MonthYear Class Reference

Encapsulates MonthYear FIX type. More...

#include <B2BITS_MonthYear.h>

Public Types

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

Public Member Functions

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

Static Public Member Functions

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

Static Public Attributes

static const unsigned int ValueSize = ValueSizeWithWeek
 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 ValueSizeWithDay = sizeof( "YYYYMMDD" ) - 1
 Maximum buffer size required to store value. More...
 
static const unsigned int ValueSizeWithWeek = sizeof( "YYYYMMwD" ) - 1
 Maximum buffer size required to store value. More...
 

Detailed Description

Encapsulates MonthYear FIX type.

Member Enumeration Documentation

◆ Week

Enumerator
NA 
w1 
w2 
w3 
w4 
w5 

Constructor & Destructor Documentation

◆ MonthYear() [1/4]

Engine::MonthYear::MonthYear ( )
throw (
)

Constructor.

◆ MonthYear() [2/4]

Engine::MonthYear::MonthYear ( int  year,
int  month 
)
throw (
)

Creates object from year and month.

◆ MonthYear() [3/4]

Engine::MonthYear::MonthYear ( int  year,
int  month,
int  day 
)
throw (
)

Creates object from year, month and day.

◆ MonthYear() [4/4]

Engine::MonthYear::MonthYear ( int  year,
int  month,
Week  week 
)
throw (
)

Creates object from year, month and week.

Member Function Documentation

◆ day()

int Engine::MonthYear::day ( ) const
throw (
)

Returns day.

◆ fromDecimal()

static MonthYear Engine::MonthYear::fromDecimal ( System::u32  val)
throw (
)
static

Constructs object from decimal date format (YYYYMMDDW).

◆ fromDecimalString()

static MonthYear Engine::MonthYear::fromDecimalString ( AsciiString  val)
throw (
)
static

Constructs object from decimal date format (YYYYMMDDW).

◆ fromFixString()

static MonthYear Engine::MonthYear::fromFixString ( AsciiString  val)
throw (
)
static

Constructs object from FIX string.

◆ fromString()

static MonthYear Engine::MonthYear::fromString ( AsciiString  val)
throw (
)
static

Constructs object from string.

◆ fromYYYYMM()

static MonthYear Engine::MonthYear::fromYYYYMM ( System::u32  val)
throw (
)
static

Constructs object from decimal date format (YYYYMM).

◆ fromYYYYMMDD()

static MonthYear Engine::MonthYear::fromYYYYMMDD ( System::u32  val)
throw (
)
static

Constructs object from decimal date format (YYYYMMDD).

◆ month()

int Engine::MonthYear::month ( ) const
throw (
)

Returns month.

◆ operator!=()

bool Engine::MonthYear::operator!= ( const MonthYear v) const
throw (
)
inline

Compares two MonthYear.

◆ operator==()

bool Engine::MonthYear::operator== ( const MonthYear v) const
throw (
)
inline

Compares two MonthYear.

◆ toDecimal()

System::u32 Engine::MonthYear::toDecimal ( ) const
throw (
)

Returns value in decimal format (YYYYMMDDW)

◆ toFixString() [1/2]

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

Converts value stored in object to FIX string.

and stores value to dest

◆ toFixString() [2/2]

char* Engine::MonthYear::toFixString ( char *  buf,
char *  end 
) const
throw (
)

Converts value stored in object to FIX string.

and stores value to dest

◆ toYYYYMM()

System::u32 Engine::MonthYear::toYYYYMM ( ) const
throw (
)

Returns value in decimal format.

◆ toYYYYMMDD()

System::u32 Engine::MonthYear::toYYYYMMDD ( ) const
throw (
)

Returns value in decimal format.

◆ week()

Week Engine::MonthYear::week ( ) const
throw (
)

Returns week.

◆ year()

int Engine::MonthYear::year ( ) const
throw (
)

Returns year.

Member Data Documentation

◆ ValueSize

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

Maximum buffer size required to store value.

◆ ValueSizeNoDay

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

Maximum buffer size required to store value.

◆ ValueSizeWithDay

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

Maximum buffer size required to store value.

◆ ValueSizeWithWeek

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

Maximum buffer size required to store value.