B2BITS FIX Antenna C++ 2.33.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
Engine::UTCTimestamp Class Reference

Encapsulates UTCTimestamp FIX type. More...

#include <B2BITS_UTCTimestamp.h>

Public Types

typedef System::u64 value_type
 A type that represents internal representation of the date.
 

Public Member Functions

int day () const throw ()
 Returns day part of value.
 
int dayOfWeek () const throw ()
 Returns day of the week.
 
UTCTimestamp getWithoutMilliseconds () const throw ()
 Erases milliseconds.
 
int hour () const throw ()
 Returns day hour of value.
 
int millisecond () const throw ()
 Returns day millisecond of value.
 
int minute () const throw ()
 Returns day minute of value.
 
int month () const throw ()
 Returns month part of value.
 
bool operator!= (const UTCTimestamp &v) const throw ()
 Compare operators.
 
bool operator< (const UTCTimestamp &v) const throw ()
 Compare operators.
 
bool operator<= (const UTCTimestamp &v) const throw ()
 Compare operators.
 
bool operator== (const UTCTimestamp &v) const throw ()
 Compare operators.
 
bool operator> (const UTCTimestamp &v) const throw ()
 Compare operators.
 
bool operator>= (const UTCTimestamp &v) const throw ()
 Compare operators.
 
int second () const throw ()
 Returns day second of value.
 
System::u64 toDecimal () const throw ()
 Returns value in decimal format (YYYYMMDDHHMMSSzzz)
 
char * toFixString (char *buf, char *end, bool keepmsec=false) const throw ()
 Converts stored value to FIX string 'YYYYMMDD-HH:MM:SS.zzz'.
 
std::string & toFixString (std::string *dest, bool keepmsec=false) const
 Converts value stored in object to FIX string 'YYYYMMDD-HH:MM:SS.zzz'.
 
 UTCTimestamp () throw ()
 Default constructor.
 
 UTCTimestamp (int year, int month, int day, int hour, int minute, int second, int millisecond=0) throw ()
 Constructor. Constructs object from year, month, day, hour, minute, second and millisecond values.
 
int year () const throw ()
 Returns year part of value.
 

Static Public Member Functions

static UTCTimestamp fromDecimal (System::u64 val) throw ()
 Constructs object from decimal date format (YYYYMMDDHHMMSSzzz).
 
static UTCTimestamp fromDecimalString (AsciiString val) throw ()
 Constructs object from decimal date format (YYYYMMDDHHMMSSzzz).
 
static UTCTimestamp fromFixString (AsciiString val) throw ()
 Constructs object from FIX string (YYYYMMDD-HH:MM:SS.zzz).
 
static UTCTimestamp fromString (AsciiString val) throw ()
 Constructs object from decimal date format (YYYYMMDDHHMMSSzzz) or FIX string (YYYYMMDD-HH:MM:SS.zzz).
 
static UTCTimestamp fromTimeT (time_t t, int millis=0) throw ()
 Constructs object using time_t value.
 
static UTCTimestamp fromUnixTimeInMillis (System::u64 val) throw ()
 Constructs object using the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC.
 
static UTCTimestamp now (bool withMilliseconds=false) throw ()
 Returns UTCTimestamp with current time.
 

Static Public Attributes

static const unsigned int DecimalValueSizeNoMilliseconds = sizeof( "YYYYMMDDHHMMSS" ) - 1
 Maximum buffer size required to store value.
 
static const unsigned int DecimalValueSizeWithMilliseconds = sizeof( "YYYYMMDDHHMMSSsss" ) - 1
 Maximum buffer size required to store value.
 
static const unsigned int ValueSize = ValueSizeWithMilliseconds
 Maximum buffer size required to store value.
 
static const unsigned int ValueSizeNoMilliseconds = sizeof( "YYYYMMDD-HH:MM:SS" ) - 1
 Maximum buffer size required to store value.
 
static const unsigned int ValueSizeWithMilliseconds = sizeof( "YYYYMMDD-HH:MM:SS.sss" ) - 1
 Maximum buffer size required to store value.
 

Detailed Description

Encapsulates UTCTimestamp FIX type.

Member Typedef Documentation

◆ value_type

typedef System::u64 Engine::UTCTimestamp::value_type

A type that represents internal representation of the date.

Constructor & Destructor Documentation

◆ UTCTimestamp() [1/2]

Engine::UTCTimestamp::UTCTimestamp ( )
throw ( )

Default constructor.

Referenced by getWithoutMilliseconds().

◆ UTCTimestamp() [2/2]

Engine::UTCTimestamp::UTCTimestamp ( int year,
int month,
int day,
int hour,
int minute,
int second,
int millisecond = 0 )
throw ( )

Constructor. Constructs object from year, month, day, hour, minute, second and millisecond values.

Member Function Documentation

◆ day()

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

Returns day part of value.

◆ dayOfWeek()

int Engine::UTCTimestamp::dayOfWeek ( ) const
throw ( )

Returns day of the week.

0 means Sunday, 1 - Monday, 2 - Tuesday, ... 5 - Friday

◆ fromDecimal()

static UTCTimestamp Engine::UTCTimestamp::fromDecimal ( System::u64 val)
throw ( )
static

Constructs object from decimal date format (YYYYMMDDHHMMSSzzz).

◆ fromDecimalString()

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

Constructs object from decimal date format (YYYYMMDDHHMMSSzzz).

◆ fromFixString()

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

Constructs object from FIX string (YYYYMMDD-HH:MM:SS.zzz).

◆ fromString()

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

Constructs object from decimal date format (YYYYMMDDHHMMSSzzz) or FIX string (YYYYMMDD-HH:MM:SS.zzz).

◆ fromTimeT()

static UTCTimestamp Engine::UTCTimestamp::fromTimeT ( time_t t,
int millis = 0 )
throw ( )
static

Constructs object using time_t value.

In case of error (if passed value is too large) function returns zero UTCTimestamp (00000000-00:00:00.000)

◆ fromUnixTimeInMillis()

static UTCTimestamp Engine::UTCTimestamp::fromUnixTimeInMillis ( System::u64 val)
throw ( )
static

Constructs object using the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC.

In case of error (if passed value is too large) function returns zero UTCTimestamp (00000000-00:00:00.000)

◆ getWithoutMilliseconds()

UTCTimestamp Engine::UTCTimestamp::getWithoutMilliseconds ( ) const
throw ( )
inline

Erases milliseconds.

References UTCTimestamp().

◆ hour()

int Engine::UTCTimestamp::hour ( ) const
throw ( )

Returns day hour of value.

◆ millisecond()

int Engine::UTCTimestamp::millisecond ( ) const
throw ( )

Returns day millisecond of value.

◆ minute()

int Engine::UTCTimestamp::minute ( ) const
throw ( )

Returns day minute of value.

◆ month()

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

Returns month part of value.

◆ now()

static UTCTimestamp Engine::UTCTimestamp::now ( bool withMilliseconds = false)
throw ( )
static

Returns UTCTimestamp with current time.

Parameters
withMIllisecondsPass to to obtain time with milliseconds; false otherwise.
Returns
Instance of the UTCTimestamp which contains current time.

◆ operator!=()

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

Compare operators.

◆ operator<()

bool Engine::UTCTimestamp::operator< ( const UTCTimestamp & v) const
throw ( )
inline

Compare operators.

◆ operator<=()

bool Engine::UTCTimestamp::operator<= ( const UTCTimestamp & v) const
throw ( )
inline

Compare operators.

◆ operator==()

bool Engine::UTCTimestamp::operator== ( const UTCTimestamp & v) const
throw ( )
inline

Compare operators.

◆ operator>()

bool Engine::UTCTimestamp::operator> ( const UTCTimestamp & v) const
throw ( )
inline

Compare operators.

◆ operator>=()

bool Engine::UTCTimestamp::operator>= ( const UTCTimestamp & v) const
throw ( )
inline

Compare operators.

◆ second()

int Engine::UTCTimestamp::second ( ) const
throw ( )

Returns day second of value.

◆ toDecimal()

System::u64 Engine::UTCTimestamp::toDecimal ( ) const
throw ( )

Returns value in decimal format (YYYYMMDDHHMMSSzzz)

◆ toFixString() [1/2]

char * Engine::UTCTimestamp::toFixString ( char * buf,
char * end,
bool keepmsec = false ) const
throw ( )

Converts stored value to FIX string 'YYYYMMDD-HH:MM:SS.zzz'.

Parameters
bufMemory buffer enough to store string like YYYYMMDD-HH:MM:SS.zzz
Returns
pointer to the first character of the result. Last character of result is last character of the 'buf' parameter.

◆ toFixString() [2/2]

std::string & Engine::UTCTimestamp::toFixString ( std::string * dest,
bool keepmsec = false ) const

Converts value stored in object to FIX string 'YYYYMMDD-HH:MM:SS.zzz'.

◆ year()

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

Returns year part of value.

Member Data Documentation

◆ DecimalValueSizeNoMilliseconds

const unsigned int Engine::UTCTimestamp::DecimalValueSizeNoMilliseconds = sizeof( "YYYYMMDDHHMMSS" ) - 1
static

Maximum buffer size required to store value.

◆ DecimalValueSizeWithMilliseconds

const unsigned int Engine::UTCTimestamp::DecimalValueSizeWithMilliseconds = sizeof( "YYYYMMDDHHMMSSsss" ) - 1
static

Maximum buffer size required to store value.

◆ ValueSize

const unsigned int Engine::UTCTimestamp::ValueSize = ValueSizeWithMilliseconds
static

Maximum buffer size required to store value.

◆ ValueSizeNoMilliseconds

const unsigned int Engine::UTCTimestamp::ValueSizeNoMilliseconds = sizeof( "YYYYMMDD-HH:MM:SS" ) - 1
static

Maximum buffer size required to store value.

Referenced by Engine::PreparedMessage::set().

◆ ValueSizeWithMilliseconds

const unsigned int Engine::UTCTimestamp::ValueSizeWithMilliseconds = sizeof( "YYYYMMDD-HH:MM:SS.sss" ) - 1
static

Maximum buffer size required to store value.

Referenced by Engine::PreparedMessage::set().