|
char const * | begin () const |
| Pointer to the beginning of the field value in the buffer.
|
|
char const * | end () const |
| Pointer to past-the-end of the field value in the buffer.
|
|
size_t | size () const |
| Size of the field value, in bytes.
|
|
|
std::string | as_string () const |
| Ascii value as std::string.
|
|
std::string_view | as_string_view () const |
| Ascii value as std::string_view.
|
|
char | as_char () const |
| Ascii value as char.
|
|
|
template<typename Int_type > |
void | as_decimal (Int_type &mantissa, Int_type &exponent) const |
| Ascii-to-decimal conversion.
|
|
|
template<typename Int_type > |
Int_type | as_int () const |
| Ascii-to-integer conversion.
|
|
|
bool | as_date (int &year, int &month, int &day) const |
| Ascii-to-date conversion.
|
|
bool | as_monthyear (int &year, int &month) const |
| Ascii-to-month-year conversion.
|
|
bool | as_timeonly (int &hour, int &minute, int &second, int &millisecond) const |
| Ascii-to-time conversion with millisecond precision.
|
|
bool | as_timeonly_nano (int &hour, int &minute, int &second, int &nanosecond) const |
| Ascii-to-time conversion with nanosecond precision.
|
|
bool | as_timestamp (int &year, int &month, int &day, int &hour, int &minute, int &second, int &millisecond) const |
| Ascii-to-timestamp conversion with millisecond precision.
|
|
bool | as_timestamp_nano (int &year, int &month, int &day, int &hour, int &minute, int &second, int &nanosecond) const |
| Ascii-to-timestamp conversion with nanosecond precision.
|
|
|
boost::gregorian::date | as_date () const |
| Ascii-to-date conversion.
|
|
boost::posix_time::time_duration | as_timeonly () const |
| Ascii-to-time conversion with millisecond precision.
|
|
boost::posix_time::time_duration | as_timeonly_nano () const |
| Ascii-to-time conversion with nanosecond precision.
|
|
boost::posix_time::ptime | as_timestamp () const |
| Ascii-to-timestamp conversion with millisecond precision.
|
|
boost::posix_time::ptime | as_timestamp_nano () const |
| Ascii-to-timestamp conversion with nanosecond precision.
|
|
|
template<typename Clock , typename Duration > |
bool | as_timestamp (std::chrono::time_point< Clock, Duration > &tp) const |
| Ascii-to-time-point conversion with millisecond precision.
|
|
template<typename Clock , typename Duration > |
bool | as_timestamp_nano (std::chrono::time_point< Clock, Duration > &tp) const |
| Ascii-to-time-point conversion with nanosecond precision.
|
|
template<typename Rep , typename Period > |
bool | as_timeonly (std::chrono::duration< Rep, Period > &dur) const |
| Ascii-to-time conversion.
|
|
template<typename Rep , typename Period > |
bool | as_timeonly_nano (std::chrono::duration< Rep, Period > &dur) const |
| Ascii-to-time conversion with nanosecond precision.
|
|
FIX field value for hffix::message_reader.
Usage
This class is a range begin(),end()
of pointers into a message_reader
buffer which delimit the value for one field.
FIX field values are an array of chars, and are usually ASCII. Type conversion deserialization is provided by the as_
family of methods.
Extension
Keep in mind that if you don't like the way any of the the as_
methods perform deserialization for a type, then you can deserialize the field value yourself, by reading the string delimited by begin(),end()
.
For example, these two statements should be equivalent for a field_value v
:
int i = v.as_int();
int i = boost::lexical_cast<int>(v.begin(), v.size());
Definition at line 1575 of file hffix.hpp.
template<typename Int_type >
void hffix::field_value::as_decimal |
( |
Int_type & |
mantissa, |
|
|
Int_type & |
exponent |
|
) |
| const |
|
inline |
Ascii-to-decimal conversion.
Converts an ascii string to a decimal float, of the form mantissa×10exponent.
Non-normalized. The exponent will always be less than or equal to zero. If the decimal float is an integer, the exponent will be zero.
- Template Parameters
-
Int_type | Integer type for the mantissa and exponent. |
- Parameters
-
[out] | mantissa | Reference to storage for the mantissa of the decimal float to be returned. |
[out] | exponent | Reference to storage for the exponent of the decimal float to be returned. |
Definition at line 1741 of file hffix.hpp.
template<typename Rep , typename Period >
bool hffix::field_value::as_timeonly_nano |
( |
std::chrono::duration< Rep, Period > & |
dur | ) |
const |
|
inline |
Ascii-to-time conversion with nanosecond precision.
Parses ascii and returns a time duration or time-of-day.
- Parameters
-
[out] | dur | The return value duration . |
- Returns
- True if parsing was successful and the return value was set, else False.
Definition at line 2121 of file hffix.hpp.
template<typename Clock , typename Duration >
bool hffix::field_value::as_timestamp |
( |
std::chrono::time_point< Clock, Duration > & |
tp | ) |
const |
|
inline |
Ascii-to-time-point conversion with millisecond precision.
Parses ascii and returns a std::chrono::time_point
.
Uses algorithms from http://howardhinnant.github.io/date_algorithms.html , which implement a proleptic Gregorian calendar. This will probably be superseded by C++20.
- Parameters
-
[out] | tp | The return value time_point . |
- Returns
- True if parsing was successful and
tp
was set, else False.
Definition at line 2058 of file hffix.hpp.
template<typename Clock , typename Duration >
bool hffix::field_value::as_timestamp_nano |
( |
std::chrono::time_point< Clock, Duration > & |
tp | ) |
const |
|
inline |
Ascii-to-time-point conversion with nanosecond precision.
Parses ascii and returns a std::chrono::time_point
.
Uses algorithms from http://howardhinnant.github.io/date_algorithms.html , which implement a proleptic Gregorian calendar. This will probably be superseded by C++20.
- Parameters
-
[out] | tp | The return value time_point . |
- Returns
- True if parsing was successful and
tp
was set, else False.
Definition at line 2079 of file hffix.hpp.