OnixS C++ CME iLink 3 Binary Order Entry Handler  1.12.0
API Documentation
Schema Versioning
CME describes the SBE Schema Versioning in the iLink 3 - Simple Binary Encoding documentation.
The OnixS::CME::iLink3::Messaging::SchemaTraits structure contains information about the highest SBE Schema Version that is supported by the SDK.

Schema Compatibility

OnixS::CME::iLink3::Messaging::SchemaTraits::Id: if this attribute is different from the ID of the SBE Schema that is used by CME, the Handler is incompatible with the particular CME environment. If an attempt to decode a message with a different schema id is made, an error will be reported and the connection will be terminated. In this case, please contact OnixS Support to obtain a newer version of the Handler.

OnixS::CME::iLink3::Messaging::SchemaTraits::MinimalVersion defines the minimal version supported. If an attempt to decode a message with a lower version is made, an error will be reported, and the connection will be terminated. If an attempt to create a message with a lower version is made, the exception is thrown.

OnixS::CME::iLink3::Messaging::SchemaTraits::Version: the latest supported version. It is the default version for creating outcoming messages.

Using Specific SBE Version

OnixS::CME::iLink3::SessionSettings::messagingSchemaVersion specifies the SBE messaging version to be used session-wide. The default value is OnixS::CME::iLink3::Messaging::SchemaTraits::Version. The session uses this version for session-level messages.

The Handler checks all the messages a user sends to comply with this attribute (this is done in debug mode only); otherwise, it throws an exception.

To create an application-level message of the lower version (but it is still should be higher than OnixS::CME::iLink3::Messaging::SchemaTraits::MinimalVersion), pass the required version to its constructor. For example:

typedef MessageHolder<NewOrderSingle514> NewOrderSingle;
NewOrderSingle order(SchemaTraits::MinimalVersion);

The Message can take the version from the Session's instance:

void onExecutionReportNew(const Messaging::ExecutionReportNew522&, Session* sn) ONIXS_ILINK3_OVERRIDE
typedef MessageHolder <NewOrderSingle514> NewOrderSingle;
NewOrderSingle order(*sn);

To obtain the SBE Schema version of the message, use the following member function:

void onExecutionReportNew(const Messaging::ExecutionReportNew522& msg, Session*) ONIXS_ILINK3_OVERRIDE
std::cout << "Message version: " << msg.version() << std::endl;

Accessing non-supported fields.

If an attempt is made to set the field not supported in the SBE Schema version (but available in higher versions) is made, the exception is thrown.

Such fields are processed as absent optional fields; false is returned in such a scenario.

If the message is available since a particular version, it is impossible to create it with the lower one: the exception is thrown.