OnixS C++ FIX Engine 4.14.0
Users' manual and API documentation
Loading...
Searching...
No Matches
ISbeFieldEncoder Class Referenceabstract

#include <OnixS/FIXEngine/FIX/SbeCustomization.h>

Public Member Functions

virtual ~ISbeFieldEncoder ()=default
virtual SbeWireSize queryFixedSize (unsigned version)=0
virtual void encode (SbeBinaryOutputStream out, unsigned version, const SbeConstFieldAccess &field)=0

Detailed Description

The interface of custom encoder for the FIX field.

The interface must be implemented by the custom encoder that encodes a FIX field.

The encoder is attached to the particular field during the ISbeCustomCoderLibrary::queryEncoder.

Definition at line 1036 of file SbeCustomization.h.

Constructor & Destructor Documentation

◆ ~ISbeFieldEncoder()

virtual ~ISbeFieldEncoder ( )
virtualdefault

Member Function Documentation

◆ encode()

virtual void encode ( SbeBinaryOutputStream out,
unsigned version,
const SbeConstFieldAccess & field )
pure virtual

Encodes the FIX field to the binary stream.

This method is used to encode the FIX field value to the binary data. The core encoder calls it if user code provided the custom encoder for the particular FIX field.

Note
If the field is a fixed-length field, the number of written bytes must be exactly the same as reported via queryFixedSize.
Parameters
outThe binary data stream for the encoded data.
versionThe version of the FIX message being encoded.
fieldThe FIX field to encode.

◆ queryFixedSize()

virtual SbeWireSize queryFixedSize ( unsigned version)
pure virtual

Query for the size of the encoded field.

This method should return the size of the encoded field if the field has a fixed binary size. In a case of a variable-length field, the method is not called and is considered to return zero.