libjmmcg  build_2783
A C++ library containing an eclectic mix of useful, advanced components.
isimud::exchanges::FIX::common::Header< MsgVer > Class Template Reference

#include <messages.hpp>

Inheritance diagram for isimud::exchanges::FIX::common::Header< MsgVer >:
[legend]
Collaboration diagram for isimud::exchanges::FIX::common::Header< MsgVer >:
[legend]

Public Types

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
 
using MsgTypes_t = common::MsgTypes_t
 

Public Member Functions

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 const field_str_range_t __fastcall find () const noexcept(true)
 Determine if the specified tag is in the referenced message. More...
 
MsgTypes type () const noexcept(true) __attribute__((pure))
 
constexpr bool is_valid () const noexcept(true)
 Verify that the referenced FIX message is valid. More...
 
checksum_t generate_checksum (size_type body_len) const noexcept(true)
 Generate the checksum for the referenced FIX message. 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...
 

Public Attributes

enum isimud::exchanges::FIX::common::Header:: { ... }  __attribute__
 

Protected Member Functions

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)
 

Protected Attributes

ALIGN_TO_L1_CACHE char begin_string [sizeof(msg_version_t::MsgVer) -1]
 
jmmcg::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]
 
jmmcg::enum_tags::mpl::to_array< FieldsFast, FieldsFast::MsgType >::element_type msg_type_tag
 
underlying_fix_data_buffer data_
 

Detailed Description

template<class MsgVer>
class isimud::exchanges::FIX::common::Header< MsgVer >

Definition at line 111 of file messages.hpp.

Member Typedef Documentation

◆ const_pointer

template<class MsgVer>
using isimud::exchanges::FIX::common::Header< MsgVer >::const_pointer = element_type const *

Definition at line 116 of file messages.hpp.

◆ element_type

template<class MsgVer>
using isimud::exchanges::FIX::common::Header< MsgVer >::element_type = char

Definition at line 114 of file messages.hpp.

◆ msg_version_t

template<class MsgVer>
using isimud::exchanges::FIX::common::Header< MsgVer >::msg_version_t = MsgVer

Definition at line 113 of file messages.hpp.

◆ MsgTypes_t

template<class MsgVer>
using isimud::exchanges::FIX::common::Header< MsgVer >::MsgTypes_t = common::MsgTypes_t

Definition at line 118 of file messages.hpp.

◆ pointer

template<class MsgVer>
using isimud::exchanges::FIX::common::Header< MsgVer >::pointer = element_type *

Definition at line 115 of file messages.hpp.

◆ size_type

template<class MsgVer>
using isimud::exchanges::FIX::common::Header< MsgVer >::size_type = std::size_t

Definition at line 117 of file messages.hpp.

Member Enumeration Documentation

◆ anonymous enum

template<class MsgVer>
anonymous enum : bool
Enumerator
has_static_size 

The message is statically-sized, not dynamically, so sizeof(the derived message-type) is the amount to copy, i.e. length() returns sizeof(the derived message-type).

Definition at line 120 of file messages.hpp.

◆ anonymous enum

template<class MsgVer>
anonymous enum : std::size_t
Enumerator
header_t_size 

Definition at line 123 of file messages.hpp.

Constructor & Destructor Documentation

◆ Header()

template<class MsgVer >
constexpr __stdcall isimud::exchanges::FIX::common::Header< MsgVer >::Header ( )
inlineconstexprnoexcept

Create a FIX message from an array of chars read from a socket or elsewhere.

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

Parameters
bThe array of chars that must comprise a valid FIX message.

Definition at line 91 of file messages_impl.hpp.

Member Function Documentation

◆ find() [1/2]

template<class MsgVer >
template<FieldsFast field>
constexpr const field_str_range_t __fastcall isimud::exchanges::FIX::common::Header< MsgVer >::find ( ) const
inlineconstexprnoexcept

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 128 of file messages_impl.hpp.

◆ find() [2/2]

template<class MsgVer >
template<FieldsFast field>
constexpr field_str_range_t __fastcall isimud::exchanges::FIX::common::Header< MsgVer >::find ( )
inlineconstexprnoexcept

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 108 of file messages_impl.hpp.

◆ generate_checksum()

template<class MsgVer >
checksum_t isimud::exchanges::FIX::common::Header< 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 163 of file messages_impl.hpp.

◆ is_checksum_valid()

template<class MsgVer >
constexpr bool isimud::exchanges::FIX::common::Header< MsgVer >::is_checksum_valid ( size_type  body_len,
const_pointer  start_of_checksum_value 
) const
inlineconstexprnoexcept

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 174 of file messages_impl.hpp.

◆ is_valid()

template<class MsgVer >
constexpr bool isimud::exchanges::FIX::common::Header< MsgVer >::is_valid ( ) const
inlineconstexprnoexcept

Verify that the referenced FIX message is valid.

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

Definition at line 180 of file messages_impl.hpp.

◆ length()

template<class MsgVer >
constexpr Header< MsgVer >::size_type isimud::exchanges::FIX::common::Header< MsgVer >::length ( ) const
inlineconstexprnoexcept

Determine the total size of the referenced message.

The referenced message must be valid.

Returns
The size of the whole the message, including the version, size (itself) and checksum fields.
See also
size()

Definition at line 100 of file messages_impl.hpp.

◆ set_header()

template<class MsgVer >
template<MsgTypes MsgType>
constexpr underlying_fix_data_buffer::iterator isimud::exchanges::FIX::common::Header< MsgVer >::set_header ( )
inlineconstexprprotectednoexcept

Definition at line 212 of file messages_impl.hpp.

◆ set_sequence_num()

template<class MsgVer >
template<MsgTypes MsgType, class SrcMsg >
constexpr underlying_fix_data_buffer::iterator isimud::exchanges::FIX::common::Header< MsgVer >::set_sequence_num ( SrcMsg const &  msg)
inlineconstexprprotectednoexcept

Definition at line 230 of file messages_impl.hpp.

◆ type()

template<class MsgVer >
MsgTypes isimud::exchanges::FIX::common::Header< MsgVer >::type ( ) const
inlinenoexcept

Definition at line 146 of file messages_impl.hpp.

Member Data Documentation

◆ __attribute__

enum { ... } isimud::exchanges::FIX::common::Header< MsgVer >::__attribute__

◆ begin_string

template<class MsgVer>
ALIGN_TO_L1_CACHE char isimud::exchanges::FIX::common::Header< MsgVer >::begin_string[sizeof(msg_version_t::MsgVer) -1]
protected

Definition at line 185 of file messages.hpp.

◆ body_length_tag

template<class MsgVer>
jmmcg::enum_tags::mpl::to_array<FieldsFast, FieldsFast::BodyLength>::element_type isimud::exchanges::FIX::common::Header< MsgVer >::body_length_tag
protected

Definition at line 187 of file messages.hpp.

◆ body_length_value

template<class MsgVer>
char isimud::exchanges::FIX::common::Header< MsgVer >::body_length_value[sizeof(JMMCG_FIX_MSG_BODY_LENGTH_NULL) -1]
protected

Definition at line 188 of file messages.hpp.

◆ data_

template<class MsgVer>
underlying_fix_data_buffer isimud::exchanges::FIX::common::Header< MsgVer >::data_
protected

Definition at line 190 of file messages.hpp.

◆ msg_type_tag

template<class MsgVer>
jmmcg::enum_tags::mpl::to_array<FieldsFast, FieldsFast::MsgType>::element_type isimud::exchanges::FIX::common::Header< MsgVer >::msg_type_tag
protected

Definition at line 189 of file messages.hpp.


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