{{Quickfixn}} fix 4.4 - iterate on tags

Oscar Porta oscar.porta at gmail.com
Mon Mar 14 10:08:51 PDT 2016


Hi
sorry to bother you with a silly question but I didn't understand yet how
to solve this simple problem.
I have a FIX message in form of a string which I use to initialize aan
object FIX::Message.
I would like to iterate on the FIX tags in the order they appear in the
string.
The following is an extract of my code. Unfortunately the loop on the
iterator returns the tags in "alphabetical order.
Do you have any suggestion for my problem?
Thanks in advance.
Regards,
Oscar Porta


// -------------------------
void myFunc(char *inMsg)
{
    FIX::Message *fm = new FIX::Message(inMsg);

    // this iterates in "alphabetical" order
    for (FIX::Message::iterator it=fm->begin(); it!=fm->end(); it++)
    {
        FIX::FieldBase f = it->second;
        int i = it->first;
        std::string v = f.getString();
        printf("%d %s\n", i, v.c_str());
    }
}

with this input message
8=FIX.4.4 9=404 35=AE 34=2733 49=XLON_XCL 50=CERT 52=20160307-13:50:32.070
56=SECT_FIX_01 57=XCL_XLON 17=T6AG81JXIT 30=XLON 31=5.6 32=1464
55=GB0008754136 60=20160307-13:50:31 64=20160309 75=20160307 207=XLON 487=0
552=2 54=1 37=00QOlNRJ5boJ 11=INTERCCP 453=1 448=LCHLGB2L 447=D 452=1 581=3
15=GBP 528=P 54=2 37=00QOlNRJ5boI 11=05157090220000 453=1 448=UBSWGB24
447=D 452=1 581=3 15=GBP 528=P 570=N 571=T6AG81JXIT 828=0 10=232

produces the followin "alphabetical" list
11 INTERCCP
11 05157090220000
15 GBP
15 GBP
17 T6AG81JXIT
30 XLON
31 5.6
32 1464
37 00QOlNRJ5boJ
37 00QOlNRJ5boI
54 1
54 2
55 GB0008754136
60 20160307-13:50:31
64 20160309
75 20160307
207 XLON
447 D
447 D
448 LCHLGB2L
448 UBSWGB24
452 1
452 1
453 1
453 1
487 0
528 P
528 P
552 2
570 N
571 T6AG81JXIT
581 3
581 3
828 0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quickfixn.com/pipermail/quickfixn-quickfixn.com/attachments/20160314/be426da8/attachment-0002.htm>


More information about the Quickfixn mailing list