You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// In current implementation, decoder.include() can only be called
// exactly once per decoder/encoder
decoder.include(descriptions);
const char* first = reinterpret_cast<const char*>(databuf);
const char* last = reinterpret_cast<const char*>(databuf + nbytes);
std::cout<<"NBYTES:"<<nbytes<<std::endl;
mfast::message_cref msg = decoder.decode(first, last);
// Caveat 1: the variable *first* would be updated to the start of next unread position after decode().
// Caveat 2: msg is only valid before next decoder.decode() is called or decoder object is destroyed.
std::cout<<"MSGID: "<<msg.id()<<" "<<msg.name()<<std::endl;
if (msg.id() == MDIFastTemplates::MDPacketHeader::the_id)
{
MDIFastTemplates::MDPacketHeader_cref ref = static_cast<MDIFastTemplates::MDPacketHeader_cref>(msg);
uint32_t sequenceNumber;
memcpy(&sequenceNumber , ref.get_PacketSeqNum().data() , 4);
std::cout << ref.get_SenderCompID().name()<<" "<< ref.get_SenderCompID().value()<<" "<<ref.get_SenderCompID().id()<<std::endl;
std::cout << ref.get_PacketSeqNum().name()<<" "<<sequenceNumber<<" "<<std::endl;
first = first + 17;
message_printer printer(std::cout);
printer.visit(ref, 0);
}
if(msg.id() == MDIFastTemplates::DepthSnapshot::the_id){
MDIFastTemplates::DepthSnapshot_cref ref = static_cast<MDIFastTemplates::DepthSnapshot_cref>(msg);
std::cout<<ref.get_MsgType().name()<<" "<<ref.get_MsgType().value()<<" "<<ref.get_MsgType().id()<<std::endl;
}
Hi,
i am getting a data-buff from a function that is FAST encoded and using mFAST for decoding the mssg.
`void BroadcastManagerFO::readBroadcast(unsigned char *databuf, int nbytes) {
// Read XML template from file
const mfast::templates_description* descriptions[] = {
MDIFastTemplates::description() // generated from fast_type_gen
};
mfast::fast_decoder decoder;
std::cout<<"--------------------DONE-----------------------"<<std::endl;
}`
Here databuff containing...Header + some other template
but why i am not able to get other template id apart from header?
is anything i am doing wrong
The text was updated successfully, but these errors were encountered: