libjmmcg  build_2176
A C++ library containing an eclectic mix of useful, advanced components.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
jmmcg::exchanges::FIX::common::Message< MsgVer > Class Template Reference

The basic, underlying type used to implement FIX message reading. More...

#include <messages.hpp>

Inheritance diagram for jmmcg::exchanges::FIX::common::Message< MsgVer >:
[legend]
Collaboration diagram for jmmcg::exchanges::FIX::common::Message< MsgVer >:
[legend]

Public Types

enum  : MsgTypes_t { type_const =static_cast<MsgTypes_t>(msg_version_t::msg_type::tag) }
 
using Header_t = Header< MsgVer >
 
using msg_version_t = typename Header_t::msg_version_t
 
using element_type = typename Header_t::element_type
 
using pointer = typename Header_t::pointer
 
using const_pointer = typename Header_t::const_pointer
 
using size_type = typename Header_t::size_type
 
- Public Types inherited from jmmcg::exchanges::FIX::common::Header< MsgVer >
enum  : bool { has_static_size =false }
 
enum  : std::size_t { header_t_size =msg_version_t::fix_template_body_length_offset+sizeof(JMMCG_FIX_MSG_BODY_LENGTH_NULL)+1 }
 
using msg_version_t = MsgVer
 
using element_type = char
 
using pointer = element_type *
 
using const_pointer = element_type const *
 
using size_type = std::size_t
 

Public Member Functions

constexpr __stdcall Message () noexcept(true)
 Wrap a FIX message contained in an array of chars that has been written into from a socket or elsewhere. More...
 
constexpr __stdcall Message (logon_args_t const &) noexcept(true)
 
constexpr __stdcall Message (logoff_args_t const &) noexcept(true)
 
template<class SrcMsg >
__stdcall Message (SrcMsg const &msg)=delete
 Create a message from the source message, into the underlying buffer. More...
 
template<class SrcMsg , class RefData >
__stdcall Message (SrcMsg const &msg, RefData const &ref_data)=delete
 Create a message from the source message, into the underlying buffer. More...
 
template<class RefData , class... Fields>
 Message (RefData const &ref_data, Fields...fields)
 
constexpr size_type __fastcall size () const noexcept(true)
 Determine the size of the referenced message. More...
 
template<FieldsFast field>
constexpr bool __fastcall search () const noexcept(true)
 Determine if the specified tag is in the referenced message. More...
 
checksum_t generate_checksum (size_type body_len) const noexcept(true)
 Generate the checksum for the referenced FIX message. More...
 
constexpr bool is_valid () const noexcept(true)
 Verify that the referenced FIX message is valid. More...
 
constexpr bool is_checksum_valid (size_type body_len, const_pointer start_of_checksum_value) const noexcept(true)
 Verify that the checksum of the referenced FIX message is valid. More...
 
std::string to_string () const noexcept(false)
 
template<>
 Message (exchanges::BATSBOE::common::OrderExecution const &msg)
 
template<>
 Message (exchanges::BATSBOE::common::OrderRejected const &msg)
 
template<>
 Message (exchanges::BATSBOE::common::CancelRejected const &msg)
 
template<>
 Message (exchanges::BATSBOE::common::UserModifyRejected const &msg)
 
template<>
 Message (exchanges::BATSBOE::common::OrderCancelled const &msg)
 
template<>
 Message (MIT::BIT::MsgTypes::ExecutionReport const &msg, MIT::BIT::ref_data_t rd)
 
template<>
 Message (MIT::JSE::MsgTypes::ExecutionReport const &msg, MIT::JSE::ref_data_t rd)
 
template<>
 Message (MIT::LSE::MsgTypes::ExecutionReport const &msg, MIT::LSE::ref_data_t rd)
 
template<>
 Message (MIT::OSLO::MsgTypes::ExecutionReport const &msg, MIT::OSLO::ref_data_t rd)
 
template<>
 Message (MIT::TRQ::MsgTypes::ExecutionReport const &msg, MIT::TRQ::ref_data_t rd)
 
template<>
 Message (MIT::BIT::MsgTypes::ExecutionReport const &msg)
 
template<>
 Message (MIT::JSE::MsgTypes::ExecutionReport const &msg)
 
template<>
 Message (MIT::LSE::MsgTypes::ExecutionReport const &msg)
 
template<>
 Message (MIT::OSLO::MsgTypes::ExecutionReport const &msg)
 
template<>
 Message (MIT::TRQ::MsgTypes::ExecutionReport const &msg)
 
template<>
 Message (MIT::BIT::MsgTypes::OrderCancelReject const &msg)
 
template<>
 Message (MIT::JSE::MsgTypes::OrderCancelReject const &msg)
 
template<>
 Message (MIT::LSE::MsgTypes::OrderCancelReject const &msg)
 
template<>
 Message (MIT::OSLO::MsgTypes::OrderCancelReject const &msg)
 
template<>
 Message (MIT::TRQ::MsgTypes::OrderCancelReject const &msg)
 
template<>
 Message (MIT::BIT::MsgTypes::Reject const &msg)
 
template<>
 Message (MIT::JSE::MsgTypes::Reject const &msg)
 
template<>
 Message (MIT::LSE::MsgTypes::Reject const &msg)
 
template<>
 Message (MIT::OSLO::MsgTypes::Reject const &msg)
 
template<>
 Message (MIT::TRQ::MsgTypes::Reject const &msg)
 
template<>
 Message (MIT::BIT::MsgTypes::BusinessReject const &msg)
 
template<>
 Message (MIT::JSE::MsgTypes::BusinessReject const &msg)
 
template<>
 Message (MIT::LSE::MsgTypes::BusinessReject const &msg)
 
template<>
 Message (MIT::OSLO::MsgTypes::BusinessReject const &msg)
 
template<>
 Message (MIT::TRQ::MsgTypes::BusinessReject const &msg)
 
- Public Member Functions inherited from jmmcg::exchanges::FIX::common::Header< MsgVer >
constexpr __stdcall Header () noexcept(true)
 Create a FIX message from an array of chars read from a socket or elsewhere. More...
 
constexpr size_type length () const noexcept(true)
 Determine the total size of the referenced message. More...
 
template<FieldsFast field>
constexpr field_str_range_t
__fastcall 
find () noexcept(true)
 Determine if the specified tag is in the referenced message. More...
 
template<FieldsFast field>
constexpr field_str_range_t
const __fastcall 
find () const noexcept(true)
 Determine if the specified tag is in the referenced message. More...
 
MsgTypes type () const noexcept(true) __attribute__((pure))
 

Static Public Member Functions

template<FieldsFast field>
static constexpr
underlying_fix_data_buffer::iterator 
add_field_tag (underlying_fix_data_buffer::iterator data) noexcept(true)
 

Protected Member Functions

constexpr void finalise_msg (underlying_fix_data_buffer::iterator) noexcept(true)
 
- Protected Member Functions inherited from jmmcg::exchanges::FIX::common::Header< MsgVer >
template<MsgTypes MsgType>
constexpr
underlying_fix_data_buffer::iterator 
set_header () noexcept(true)
 
template<MsgTypes MsgType, class SrcMsg >
constexpr
underlying_fix_data_buffer::iterator 
set_sequence_num (SrcMsg const &msg) noexcept(true)
 

Additional Inherited Members

- Public Attributes inherited from jmmcg::exchanges::FIX::common::Header< MsgVer >
enum
jmmcg::exchanges::FIX::common::Header:: { ... }  
__attribute__
 
- Protected Attributes inherited from jmmcg::exchanges::FIX::common::Header< MsgVer >
__attribute__((aligned(16)))
char begin_string[sizeof(msg_version_t
enum_tags::mpl::to_array
< FieldsFast,
FieldsFast::BodyLength >
::element_type 
body_length_tag
 
char body_length_value [sizeof(JMMCG_FIX_MSG_BODY_LENGTH_NULL)-1]
 
enum_tags::mpl::to_array
< FieldsFast,
FieldsFast::MsgType >
::element_type 
msg_type_tag
 
underlying_fix_data_buffer data_
 

Detailed Description

template<class MsgVer>
class jmmcg::exchanges::FIX::common::Message< MsgVer >

The basic, underlying type used to implement FIX message reading.

Definition at line 113 of file messages.hpp.

Member Typedef Documentation

template<class MsgVer>
using jmmcg::exchanges::FIX::common::Message< MsgVer >::const_pointer = typename Header_t::const_pointer

Definition at line 119 of file messages.hpp.

template<class MsgVer>
using jmmcg::exchanges::FIX::common::Message< MsgVer >::element_type = typename Header_t::element_type

Definition at line 117 of file messages.hpp.

template<class MsgVer>
using jmmcg::exchanges::FIX::common::Message< MsgVer >::Header_t = Header<MsgVer>

Definition at line 115 of file messages.hpp.

template<class MsgVer>
using jmmcg::exchanges::FIX::common::Message< MsgVer >::msg_version_t = typename Header_t::msg_version_t

Definition at line 116 of file messages.hpp.

template<class MsgVer>
using jmmcg::exchanges::FIX::common::Message< MsgVer >::pointer = typename Header_t::pointer

Definition at line 118 of file messages.hpp.

template<class MsgVer>
using jmmcg::exchanges::FIX::common::Message< MsgVer >::size_type = typename Header_t::size_type

Definition at line 120 of file messages.hpp.

Member Enumeration Documentation

template<class MsgVer>
anonymous enum : MsgTypes_t
Enumerator
type_const 

Definition at line 122 of file messages.hpp.

Constructor & Destructor Documentation

template<class MsgVer >
constexpr __stdcall jmmcg::exchanges::FIX::common::Message< MsgVer >::Message ( )
inlineexplicitnoexcept

Wrap a FIX message contained in an array of chars that has been written into from a socket or elsewhere.

Parameters
bThe array of chars that must comprise a valid FIX message which is not automatically checked.

Definition at line 128 of file messages_impl.hpp.

template<class MsgVer >
constexpr __stdcall jmmcg::exchanges::FIX::common::Message< MsgVer >::Message ( logon_args_t const &  )
inlineexplicitnoexcept

Definition at line 133 of file messages_impl.hpp.

template<class MsgVer >
constexpr __stdcall jmmcg::exchanges::FIX::common::Message< MsgVer >::Message ( logoff_args_t const &  )
inlineexplicitnoexcept

Definition at line 138 of file messages_impl.hpp.

template<class MsgVer>
template<class SrcMsg >
__stdcall jmmcg::exchanges::FIX::common::Message< MsgVer >::Message ( SrcMsg const &  msg)
explicitdelete

Create a message from the source message, into the underlying buffer.

In debug builds the validity of the FIX message is checked.

If an error is generated, then this function will need to be specialised for the particular SrcMsg.

Parameters
msgThe source message from which the target message should be created.
template<class MsgVer>
template<class SrcMsg , class RefData >
__stdcall jmmcg::exchanges::FIX::common::Message< MsgVer >::Message ( SrcMsg const &  msg,
RefData const &  ref_data 
)
delete

Create a message from the source message, into the underlying buffer.

In debug builds the validity of the FIX message is checked.

If an error is generated, then this function will need to be specialised for the particular SrcMsg.

Parameters
msgThe source message from which the target message should be created.
ref_dataThe reference data to map from exchange-based instrument identifiers to client-based symbology.
template<class MsgVer>
template<class RefData , class... Fields>
jmmcg::exchanges::FIX::common::Message< MsgVer >::Message ( RefData const &  ref_data,
Fields...  fields 
)

Member Function Documentation

template<class MsgVer >
template<FieldsFast field>
constexpr underlying_fix_data_buffer::iterator jmmcg::exchanges::FIX::common::Message< MsgVer >::add_field_tag ( underlying_fix_data_buffer::iterator  data)
inlinestaticnoexcept

Definition at line 212 of file messages_impl.hpp.

template<class MsgVer >
constexpr void jmmcg::exchanges::FIX::common::Message< MsgVer >::finalise_msg ( underlying_fix_data_buffer::iterator  data)
inlineprotectednoexcept

Definition at line 233 of file messages_impl.hpp.

template<class MsgVer >
checksum_t jmmcg::exchanges::FIX::common::Message< MsgVer >::generate_checksum ( size_type  body_len) const
inlinenoexcept

Generate the checksum for the referenced FIX message.

Parameters
body_lenThe length of the body of the referenced FIX message.
Returns
The computed check sum.

Definition at line 162 of file messages_impl.hpp.

template<class MsgVer >
constexpr bool jmmcg::exchanges::FIX::common::Message< MsgVer >::is_checksum_valid ( size_type  body_len,
const_pointer  start_of_checksum_value 
) const
inlinenoexcept

Verify that the checksum of the referenced FIX message is valid.

Parameters
body_lenThe length of the body of the referenced FIX message.
start_of_checksum_valueA pointer to that start of the checksum value embedded in the referenced FIX message.
Returns
True is the checksum of the referenced FIX message is valid, false otherwise.

Definition at line 173 of file messages_impl.hpp.

template<class MsgVer >
constexpr bool jmmcg::exchanges::FIX::common::Message< MsgVer >::is_valid ( ) const
inlinenoexcept

Verify that the referenced FIX message is valid.

Returns
True is the referenced FIX message is valid, false otherwise.

Definition at line 179 of file messages_impl.hpp.

template<class MsgVer >
template<FieldsFast field>
constexpr bool __fastcall jmmcg::exchanges::FIX::common::Message< MsgVer >::search ( ) const
inlinenoexcept

Determine if the specified tag is in the referenced message.

Parameters
fieldThe field to be found. Note that the range must contain the field otherwise the behaviour shall be undefined.
Returns
True if the specified tag was found in the referenced message.

Definition at line 152 of file messages_impl.hpp.

template<class MsgVer >
constexpr Message< MsgVer >::size_type __fastcall jmmcg::exchanges::FIX::common::Message< MsgVer >::size ( void  ) const
inlinenoexcept

Determine the size of the referenced message.

The referenced message must be valid.

Returns
The size of the body of the message, excluding the version, size (itself) and checksum fields.
See Also
length()

Definition at line 143 of file messages_impl.hpp.

template<class MsgVer >
std::string jmmcg::exchanges::FIX::common::Message< MsgVer >::to_string ( ) const
inlinenoexcept

Definition at line 221 of file messages_impl.hpp.


The documentation for this class was generated from the following files: