EPAM B2BITS C++ Bovespa MarketData handler
1.27.1
|
Encapsulates UTCTimestamp FIX type. More...
#include <b2bits/types/UTCTimestamp.h>
Public Types | |
typedef u64 | value_type |
A type that represents internal representation of the date. More... | |
Public Member Functions | |
UTCTimestamp () throw () | |
Default constructor. More... | |
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. More... | |
bool | operator== (const UTCTimestamp &v) const throw () |
Compare operators. More... | |
bool | operator!= (const UTCTimestamp &v) const throw () |
Compare operators. More... | |
bool | operator< (const UTCTimestamp &v) const throw () |
Compare operators. More... | |
bool | operator> (const UTCTimestamp &v) const throw () |
Compare operators. More... | |
bool | operator>= (const UTCTimestamp &v) const throw () |
Compare operators. More... | |
bool | operator<= (const UTCTimestamp &v) const throw () |
Compare operators. More... | |
int | year () const throw () |
Returns year part of value. More... | |
int | month () const throw () |
Returns month part of value. More... | |
int | day () const throw () |
Returns day part of value. More... | |
int | hour () const throw () |
Returns day hour of value. More... | |
int | minute () const throw () |
Returns day minute of value. More... | |
int | second () const throw () |
Returns day second of value. More... | |
int | millisecond () const throw () |
Returns day millisecond of value. More... | |
int | dayOfWeek () const throw () |
std::string & | toFixString (std::string *dest, bool keepmsec=false) const |
Converts value stored in object to FIX string 'YYYYMMDD-HH:MM:SS.zzz'. More... | |
char * | toFixString (char *buf, char *end, bool keepmsec=false) const throw () |
u64 | toDecimal () const throw () |
Returns value in decimal format (YYYYMMDDHHMMSSzzz) More... | |
UTCTimestamp | getWithoutMilliseconds () const throw () |
Erases milliseconds. More... | |
u64 | toUnixTimeInMillis () const throw () |
Converts UTCTimestamp to number of milliseconds since Unix epoch. More... | |
Static Public Member Functions | |
static UTCTimestamp | fromFixString (AsciiString val) throw () |
Constructs object from FIX string (YYYYMMDD-HH:MM:SS.zzz). More... | |
static UTCTimestamp | fromDecimal (u64 val) throw () |
Constructs object from decimal date format (YYYYMMDDHHMMSSzzz). More... | |
static UTCTimestamp | fromDecimalString (AsciiString val) throw () |
Constructs object from decimal date format (YYYYMMDDHHMMSSzzz). More... | |
static UTCTimestamp | fromString (AsciiString val) throw () |
Constructs object from decimal date format (YYYYMMDDHHMMSSzzz) or FIX string (YYYYMMDD-HH:MM:SS.zzz). More... | |
static UTCTimestamp | fromUnixTimeInMillis (u64 val) throw () |
static UTCTimestamp | fromTimeT (time_t t, int millis=0) throw () |
static UTCTimestamp | now (bool withMilliseconds=false) throw () |
Static Public Attributes | |
static const unsigned int | ValueSizeWithMilliseconds = sizeof( "YYYYMMDD-HH:MM:SS.sss" ) - 1 |
Maximum buffer size required to store value. More... | |
static const unsigned int | ValueSizeNoMilliseconds = sizeof( "YYYYMMDD-HH:MM:SS" ) - 1 |
Maximum buffer size required to store value. More... | |
static const unsigned int | DecimalValueSizeWithMilliseconds = sizeof( "YYYYMMDDHHMMSSsss" ) - 1 |
Maximum buffer size required to store value. More... | |
static const unsigned int | DecimalValueSizeNoMilliseconds = sizeof( "YYYYMMDDHHMMSS" ) - 1 |
Maximum buffer size required to store value. More... | |
static const unsigned int | ValueSize = ValueSizeWithMilliseconds |
Maximum buffer size required to store value. More... | |
Encapsulates UTCTimestamp FIX type.
typedef u64 B2bits::UTCTimestamp::value_type |
A type that represents internal representation of the date.
B2bits::UTCTimestamp::UTCTimestamp | ( | ) | ||
throw | ( | |||
) |
Default constructor.
B2bits::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.
int B2bits::UTCTimestamp::day | ( | ) | const | |
throw | ( | |||
) |
Returns day part of value.
int B2bits::UTCTimestamp::dayOfWeek | ( | ) | const | |
throw | ( | |||
) |
Returns day of the week. 0 means Sunday, 1 - Monday, 2 - Tuesday, ... 5 - Friday
|
static |
Constructs object from decimal date format (YYYYMMDDHHMMSSzzz).
|
static |
Constructs object from decimal date format (YYYYMMDDHHMMSSzzz).
|
static |
Constructs object from FIX string (YYYYMMDD-HH:MM:SS.zzz).
|
static |
Constructs object from decimal date format (YYYYMMDDHHMMSSzzz) or FIX string (YYYYMMDD-HH:MM:SS.zzz).
|
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)
|
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)
|
inline |
Erases milliseconds.
int B2bits::UTCTimestamp::hour | ( | ) | const | |
throw | ( | |||
) |
Returns day hour of value.
int B2bits::UTCTimestamp::millisecond | ( | ) | const | |
throw | ( | |||
) |
Returns day millisecond of value.
int B2bits::UTCTimestamp::minute | ( | ) | const | |
throw | ( | |||
) |
Returns day minute of value.
int B2bits::UTCTimestamp::month | ( | ) | const | |
throw | ( | |||
) |
Returns month part of value.
|
static |
Returns UTCTimestamp with current time
withMilliseconds | Pass true to obtain time with milliseconds; false otherwise. |
|
inline |
Compare operators.
|
inline |
Compare operators.
|
inline |
Compare operators.
|
inline |
Compare operators.
|
inline |
Compare operators.
|
inline |
Compare operators.
int B2bits::UTCTimestamp::second | ( | ) | const | |
throw | ( | |||
) |
Returns day second of value.
u64 B2bits::UTCTimestamp::toDecimal | ( | ) | const | |
throw | ( | |||
) |
Returns value in decimal format (YYYYMMDDHHMMSSzzz)
std::string& B2bits::UTCTimestamp::toFixString | ( | std::string * | dest, |
bool | keepmsec = false |
||
) | const |
Converts value stored in object to FIX string 'YYYYMMDD-HH:MM:SS.zzz'.
char* B2bits::UTCTimestamp::toFixString | ( | char * | buf, |
char * | end, | ||
bool | keepmsec = false |
||
) | const | ||
throw | ( | ||
) |
Converts stored value to FIX string 'YYYYMMDD-HH:MM:SS.zzz'.
buf | Memory buffer enough to store string like YYYYMMDD-HH:MM:SS.zzz |
end | Pointer to past-the-end element of memory buffer |
keepmsec | Pass true to convert time with milliseconds |
u64 B2bits::UTCTimestamp::toUnixTimeInMillis | ( | ) | const | |
throw | ( | |||
) |
Converts UTCTimestamp to number of milliseconds since Unix epoch.
int B2bits::UTCTimestamp::year | ( | ) | const | |
throw | ( | |||
) |
Returns year part of value.
|
static |
Maximum buffer size required to store value.
|
static |
Maximum buffer size required to store value.
|
static |
Maximum buffer size required to store value.
|
static |
Maximum buffer size required to store value.
|
static |
Maximum buffer size required to store value.