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

Provides minimal functionality to work with prepared fields. More...

#include <B2BITS_PreparedMessage.h>

+ Inheritance diagram for Engine::GenericPreparedMessage:
+ Collaboration diagram for Engine::GenericPreparedMessage:

Public Member Functions

 GenericPreparedMessage () throw ()
 Default constructor. More...
 
 GenericPreparedMessage (FIXMessage const *msg, unsigned char tagsDelimiter='\x01')
 Conversion constructor. More...
 
char * get (PreparedFieldIndex index, std::size_t *size) throw ()
 Returns pointer to the buffer where field value is stored. More...
 
bool isFieldReserved (PreparedFieldIndex index) const
 Returns true, if field by gived index was reserved and user can write value; otherwise false. More...
 
void set (PreparedFieldIndex index, char const *value, std::size_t size) throw ()
 Copies passed value to the message. More...
 
void set (PreparedFieldIndex index, AsciiString value) throw ()
 Copies passed value to the message. More...
 
void set (PreparedFieldIndex index, Decimal value) throw ()
 Copies passed value to the message. More...
 
bool set (PreparedFieldIndex index, System::u32 value) throw ()
 Copies passed value to the message. More...
 
bool set (PreparedFieldIndex index, System::i32 value) throw ()
 Copies passed value to the message. More...
 
bool set (PreparedFieldIndex index, System::u64 value) throw ()
 
Copies passed value to the message More...
 
bool set (PreparedFieldIndex index, System::i64 value) throw ()
 Copies passed value to the message. More...
 
void set (PreparedFieldIndex index, char value) throw ()
 Copies passed value to the message. More...
 
void set (PreparedFieldIndex index, bool value) throw ()
 Copies passed value to the message. More...
 
void set (PreparedFieldIndex index, UTCTimestamp value) throw ()
 Copies passed value to the message. More...
 
void set (PreparedFieldIndex index, const TZTimeHelper::UTCTimestamp &value) throw ()
 Copies passed value to the message. More...
 
virtual ~GenericPreparedMessage () throw ()
 Polymorphous destructor. More...
 
- Public Member Functions inherited from Engine::PreparedMessage
char * getCheckSum (size_t *size) throw ()
 Returns pointer to buffer of the CheckSum field. More...
 
char * getMsgSeqNum (size_t *size) throw ()
 Returns pointer to buffer of the MsgSeqNum field. More...
 
bool isLastMsgSeqNumProcessedReserved () const throw ()
 Returns true, if LastMsgSeqNumProcessed is initalized. More...
 
bool isSendingTimeReserved () const throw ()
 Returns true, if SendingTime is initalized. More...
 
 PreparedMessage () throw ()
 
char const * rawMsg () const throw ()
 Returns pointer to the RAW FIX message. More...
 
std::size_t rawMsgSize () const throw ()
 Returns size of the RAW FIX message. More...
 
void setCheckSum (char const *value) throw ()
 Updates CheckSum value. More...
 
void setLastMsgSeqNumProcessed (int value) throw ()
 Updates LastMsgSeqNumProcessed value. More...
 
int setMsgSeqNum (int value) throw ()
 Updates MsgSeqNum value. More...
 
void setSendingTime (char const *value, std::size_t size) throw ()
 Updates SendingTime value. More...
 
void setSendingTime (UTCTimestamp value) throw ()
 Updates SendingTime value. More...
 
void setSendingTime (const TZTimeHelper::UTCTimestamp &value) throw ()
 Updates SendingTime value. More...
 
size_t sizeSendingTimeReserved () const throw ()
 Returns size reserved for SendingTime. More...
 
void updateCheckSum () throw ()
 Recalculates checksum. More...
 
virtual ~PreparedMessage () throw ()
 Polymorphous destructor. More...
 

Static Public Attributes

static int const FieldCount = 20
 

Additional Inherited Members

- Public Types inherited from Engine::PreparedMessage
enum  {
  First = 1000, MsgSeqNum = First, CheckSum, SendingTime,
  LastMsgSeqNumProcessed, Last
}
 Enumerates indexes for fields. More...
 
- Protected Member Functions inherited from Engine::PreparedMessage
char * getChecked (PreparedFieldIndex index, std::size_t *size)
 Returns pointer to the buffer where field value is stored. More...
 
void setBuffer (char *buf, char const *msgStart, std::size_t msgSize) throw ()
 Acquires passed buffer and its size. More...
 
void setMsgSize (std::size_t msgSize) throw ()
 Updates size of the RAW FIX message. More...
 
void setMsgStart (char const *msgStart) throw ()
 Updates pointer to the RAW FIX message. More...
 
- Static Protected Member Functions inherited from Engine::PreparedMessage
static void set (Field const &field, char const *value, std::size_t size) throw ()
 Copies passed value to the message. More...
 
static void set (Field const &field, char value) throw ()
 Copies passed value to the message. More...
 
static void set (Field const &field, bool value) throw ()
 Copies passed value to the message. More...
 
static void set (Field const &field, UTCTimestamp value) throw ()
 Copies passed value to the message. More...
 
static void set (Field const &field, const TZTimeHelper::UTCTimestamp &value) throw ()
 Copies passed value to the message. More...
 
static bool set (Field const &field, System::u32 value) throw ()
 Copies passed value to the message. More...
 
static bool set (Field const &field, System::u64 value) throw ()
 Copies passed value to the message. More...
 
static bool set (Field const &field, System::i32 value) throw ()
 Copies passed value to the message. More...
 
static bool set (Field const &field, System::i64 value) throw ()
 Copies passed value to the message. More...
 
static void set (Field const &field, Decimal const &value) throw ()
 Copies passed value to the message. More...
 

Detailed Description

Provides minimal functionality to work with prepared fields.

Implements PreparedMessage.

Constructor & Destructor Documentation

◆ GenericPreparedMessage() [1/2]

Engine::GenericPreparedMessage::GenericPreparedMessage ( )
throw (
)

Default constructor.

◆ GenericPreparedMessage() [2/2]

Engine::GenericPreparedMessage::GenericPreparedMessage ( FIXMessage const *  msg,
unsigned char  tagsDelimiter = '\x01' 
)
explicit

Conversion constructor.

◆ ~GenericPreparedMessage()

virtual Engine::GenericPreparedMessage::~GenericPreparedMessage ( )
throw (
)
virtual

Polymorphous destructor.

Member Function Documentation

◆ get()

char * Engine::GenericPreparedMessage::get ( PreparedFieldIndex  index,
std::size_t *  size 
)
throw (
)
inline

Returns pointer to the buffer where field value is stored.

Parameters
[in]indexIndex of the field
[out]sizeSize of the field value
Note
Please use this method carefully. User takes on responsibility to field value format.

◆ isFieldReserved()

bool Engine::GenericPreparedMessage::isFieldReserved ( PreparedFieldIndex  index) const
inline

Returns true, if field by gived index was reserved and user can write value; otherwise false.

Returns
true, if field by gived index was reserved and user can write value; otherwise false.

References FieldCount.

◆ set() [1/11]

void Engine::GenericPreparedMessage::set ( PreparedFieldIndex  index,
char const *  value,
std::size_t  size 
)
throw (
)
inline

Copies passed value to the message.

References FieldCount, and Engine::PreparedMessage::set().

◆ set() [2/11]

void Engine::GenericPreparedMessage::set ( PreparedFieldIndex  index,
AsciiString  value 
)
throw (
)
inline

Copies passed value to the message.

References FieldCount, and Engine::PreparedMessage::set().

◆ set() [3/11]

void Engine::GenericPreparedMessage::set ( PreparedFieldIndex  index,
Decimal  value 
)
throw (
)
inline

Copies passed value to the message.

References FieldCount, and Engine::PreparedMessage::set().

◆ set() [4/11]

bool Engine::GenericPreparedMessage::set ( PreparedFieldIndex  index,
System::u32  value 
)
throw (
)
inline

Copies passed value to the message.

Returns
0 if value was written successfully; non-zero if stored buffer is too small to keep passed value.

References FieldCount, and Engine::PreparedMessage::set().

◆ set() [5/11]

bool Engine::GenericPreparedMessage::set ( PreparedFieldIndex  index,
System::i32  value 
)
throw (
)
inline

Copies passed value to the message.

Returns
0 if value was written successfully; non-zero if stored buffer is too small to keep passed value.

References FieldCount, and Engine::PreparedMessage::set().

◆ set() [6/11]

bool Engine::GenericPreparedMessage::set ( PreparedFieldIndex  index,
System::u64  value 
)
throw (
)
inline


Copies passed value to the message

Copies passed value to the message.

Returns
0 if value was written successfully; non-zero if stored buffer is too small to keep passed value.
0 if value was written successfully; non-zero if stored buffer is too small to keep passed value.

References FieldCount, and Engine::PreparedMessage::set().

◆ set() [7/11]

bool Engine::GenericPreparedMessage::set ( PreparedFieldIndex  index,
System::i64  value 
)
throw (
)
inline

Copies passed value to the message.

Returns
0 if value was written successfully; non-zero if stored buffer is too small to keep passed value.

References FieldCount, and Engine::PreparedMessage::set().

◆ set() [8/11]

void Engine::GenericPreparedMessage::set ( PreparedFieldIndex  index,
char  value 
)
throw (
)
inline

Copies passed value to the message.

References FieldCount, and Engine::PreparedMessage::set().

◆ set() [9/11]

void Engine::GenericPreparedMessage::set ( PreparedFieldIndex  index,
bool  value 
)
throw (
)
inline

Copies passed value to the message.

References FieldCount, and Engine::PreparedMessage::set().

◆ set() [10/11]

void Engine::GenericPreparedMessage::set ( PreparedFieldIndex  index,
UTCTimestamp  value 
)
throw (
)
inline

Copies passed value to the message.

References FieldCount, and Engine::PreparedMessage::set().

◆ set() [11/11]

void Engine::GenericPreparedMessage::set ( PreparedFieldIndex  index,
const TZTimeHelper::UTCTimestamp value 
)
throw (
)
inline

Copies passed value to the message.

References FieldCount, and Engine::PreparedMessage::set().

Member Data Documentation

◆ FieldCount

int const Engine::GenericPreparedMessage::FieldCount = 20
static

Referenced by isFieldReserved(), and set().