B2BITS FIX Antenna C++ 2.33.0
|
Alternative for FIXMessage class. More...
#include <B2BITS_PreparedMessage.h>
Classes | |
struct | Field |
Prepared message field. More... | |
Public Types | |
enum | { First = 1000 , MsgSeqNum = First , CheckSum , SendingTime , LastMsgSeqNumProcessed , Last } |
Enumerates indexes for fields. More... | |
Public Member Functions | |
char * | getCheckSum (size_t *size) throw () |
Returns pointer to buffer of the CheckSum field. | |
char * | getMsgSeqNum (size_t *size) throw () |
Returns pointer to buffer of the MsgSeqNum field. | |
bool | isLastMsgSeqNumProcessedReserved () const throw () |
Returns true, if LastMsgSeqNumProcessed is initalized. | |
bool | isSendingTimeReserved () const throw () |
Returns true, if SendingTime is initalized. | |
PreparedMessage () throw () | |
char const * | rawMsg () const throw () |
Returns pointer to the RAW FIX message. | |
std::size_t | rawMsgSize () const throw () |
Returns size of the RAW FIX message. | |
void | setCheckSum (char const *value) throw () |
Updates CheckSum value. | |
void | setLastMsgSeqNumProcessed (int value) throw () |
Updates LastMsgSeqNumProcessed value. | |
int | setMsgSeqNum (int value) throw () |
Updates MsgSeqNum value. | |
void | setSendingTime (char const *value, std::size_t size) throw () |
Updates SendingTime value. | |
void | setSendingTime (const TZTimeHelper::UTCTimestamp &value) throw () |
Updates SendingTime value. | |
void | setSendingTime (UTCTimestamp value) throw () |
Updates SendingTime value. | |
size_t | sizeSendingTimeReserved () const throw () |
Returns size reserved for SendingTime. | |
void | updateCheckSum () throw () |
Recalculates checksum. | |
virtual | ~PreparedMessage () throw () |
Polymorphous destructor. | |
Protected Member Functions | |
char * | getChecked (PreparedFieldIndex index, std::size_t *size) |
Returns pointer to the buffer where field value is stored. | |
virtual void | initField (PreparedFieldIndex index, char *start, std::size_t size) |
Initialize PreparedField. | |
void | setBuffer (char *buf, char const *msgStart, std::size_t msgSize) throw () |
Acquires passed buffer and its size. | |
void | setMsgSize (std::size_t msgSize) throw () |
Updates size of the RAW FIX message. | |
void | setMsgStart (char const *msgStart) throw () |
Updates pointer to the RAW FIX message. | |
Static Protected Member Functions | |
static void | set (Field const &field, bool value) throw () |
Copies passed value to the message. | |
static void | set (Field const &field, char const *value, std::size_t size) throw () |
Copies passed value to the message. | |
static void | set (Field const &field, char value) throw () |
Copies passed value to the message. | |
static void | set (Field const &field, const TZTimeHelper::UTCTimestamp &value) throw () |
Copies passed value to the message. | |
static void | set (Field const &field, Decimal const &value) throw () |
Copies passed value to the message. | |
static bool | set (Field const &field, System::i32 value) throw () |
Copies passed value to the message. | |
static bool | set (Field const &field, System::i64 value) throw () |
Copies passed value to the message. | |
static bool | set (Field const &field, System::u32 value) throw () |
Copies passed value to the message. | |
static bool | set (Field const &field, System::u64 value) throw () |
Copies passed value to the message. | |
static void | set (Field const &field, UTCTimestamp value) throw () |
Copies passed value to the message. | |
Friends | |
class | FIXMessage |
Alternative for FIXMessage class.
Improves latency of the Session::put method if user sends same message many times and size of the volatile fields do not change. Volatile fields are fields which user changes between Session::put calls (e.g. OrderQty, Price, TransactTime, etc).
Sample of usage:
anonymous enum |
Engine::PreparedMessage::PreparedMessage | ( | ) | ||||
throw | ( | ) |
|
virtual |
Polymorphous destructor.
|
protected |
Returns pointer to the buffer where field value is stored.
[in] | index | Index of the field |
[out] | size | Size of the field value |
Utils::Exception | if index is out of range |
|
inline |
Returns pointer to buffer of the CheckSum field.
|
inline |
Returns pointer to buffer of the MsgSeqNum field.
|
protectedvirtual |
Initialize PreparedField.
Used by FA in the FIXMessage::prepare.
|
inline |
Returns true, if LastMsgSeqNumProcessed is initalized.
References First, LastMsgSeqNumProcessed, and Engine::PreparedMessage::Field::size_.
|
inline |
Returns true, if SendingTime is initalized.
References First, SendingTime, and Engine::PreparedMessage::Field::size_.
|
inline |
Returns pointer to the RAW FIX message.
|
inline |
Returns size of the RAW FIX message.
|
inlinestaticprotected |
Copies passed value to the message.
|
inlinestaticprotected |
Copies passed value to the message.
Referenced by setCheckSum(), setLastMsgSeqNumProcessed(), setMsgSeqNum(), setSendingTime(), setSendingTime(), and setSendingTime().
|
inlinestaticprotected |
Copies passed value to the message.
|
inlinestaticprotected |
Copies passed value to the message.
References Engine::TZTimeHelper::Microseconds, Engine::TZTimeHelper::Milliseconds, Engine::TZTimeHelper::Nanoseconds, Engine::TZTimeHelper::Picoseconds, Engine::TZTimeHelper::Seconds, Engine::TZTimeHelper::utcTimestampToString(), Engine::TZTimeHelper::ValueSizeBufferTZTimestamp, Engine::TZTimeHelper::ValueSizeUTCTimestampMicro, Engine::TZTimeHelper::ValueSizeUTCTimestampMilli, Engine::TZTimeHelper::ValueSizeUTCTimestampNano, Engine::TZTimeHelper::ValueSizeUTCTimestampPico, and Engine::TZTimeHelper::ValueSizeUTCTimestampSec.
|
inlinestaticprotected |
Copies passed value to the message.
|
inlinestaticprotected |
Copies passed value to the message.
|
inlinestaticprotected |
Copies passed value to the message.
|
inlinestaticprotected |
Copies passed value to the message.
|
inlinestaticprotected |
Copies passed value to the message.
|
inlinestaticprotected |
Copies passed value to the message.
References Engine::UTCTimestamp::ValueSizeNoMilliseconds, and Engine::UTCTimestamp::ValueSizeWithMilliseconds.
|
inlineprotected |
Acquires passed buffer and its size.
Used by FA in the FIXMessage::prepare
|
inline |
|
inline |
Updates LastMsgSeqNumProcessed value.
References set().
|
inline |
|
inlineprotected |
Updates size of the RAW FIX message.
|
inlineprotected |
Updates pointer to the RAW FIX message.
|
inline |
Updates SendingTime value.
References set().
|
inline |
Updates SendingTime value.
References set().
|
inline |
Updates SendingTime value.
References set().
|
inline |
Returns size reserved for SendingTime.
References First, SendingTime, and Engine::PreparedMessage::Field::size_.
void Engine::PreparedMessage::updateCheckSum | ( | ) | ||||
throw | ( | ) |
Recalculates checksum.
|
friend |