OnixS ICE iMpact Multicast Price Feed Handler C++ library  8.15.1
API documentation
Message Deserialization

API

For each message class there is a constructor and the deserialize method which accepts a pointer to raw data buffer and its size. This buffer should contain all message data including message type and body length (i.e. header).

Under the hood, the constructor calls deserialize method so you can use the same object to deserialize from different data samples.

Note
It is important to pass a buffer with the message header because deserialize method uses absolute offsets, i.e. first field should be located after three bytes of the message header.

Example

1 std::ifstream ifs("FuturesProductDefinition.bin");
2 
3 char msgType = 0;
4 ifs.read(&msgType, sizeof(msgType));
5 
6 unsigned short bodyLen = 0;
7 ifs.read((char*)&bodyLen, sizeof(bodyLen));
8 bodyLen = rotate(bodyLen);
9 
10 const size_t offset = sizeof(msgType) + sizeof(bodyLen);
11 const size_t msgSize = offset + bodyLen;
12 std::vector<char> data(msgSize);
13 ifs.read(&data[offset], bodyLen);
14 
15 FuturesProductDefinition msg(&data[0], data.size());