Re: [Quickfix-users] bug in repeated group? or in my code?
Brought to you by:
orenmnero
From: Hei C. <str...@ya...> - 2009-07-19 08:46:47
|
Djalma, Thanks for pointing out my stupid mistake...I found that few minutes after I posted. Sorry for the spam. For the catch-by-reference problem, it is very odd (or probably my C++ is too rusty to realize the actual problem). If I try to catch by reference for FieldNotFound, the FieldNotFound catch block isn't entered. Very old. I am using gcc 3.x on redhat. It seems like a compiler problem to me. Let me try to see if I can upgrade my compiler or try on another box. Thanks. ________________________________ From: Djalma Rosa dos Santos Filho <drs...@gm...> To: "Qui...@li..." <qui...@li...> Sent: Saturday, July 18, 2009 10:32:19 AM Subject: Re: [Quickfix-users] bug in repeated group? or in my code? QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html QuickFIX Support: http://www.quickfixengine.org/services.html Hei, The field 271 (MDEntrySize) is an optional field and it is not present in the first instance of your repeating group. 268=4 279=1 269=1 5450=2 55=USD/JPY 461=RCSXXX 63=0 270=93.06 279=1 If you want to avoid the FieldNotFound exception you must check the presense of the field with isSetField. I`ve never got problems to catch FIX::FieldNotFound by reference, what is the compiler error? Djalma On Mon, Jul 13, 2009 at 8:47 PM, Hei Chan<str...@ya...> wrote: > QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html > QuickFIX Support: http://www.quickfixengine.org/services.html > > > Hi, > > I am using the latest C++ version of quickfix. > > Here is the part of the dictionary I used: > > <message name="MarketDataIncrementalRefresh" msgtype="X" msgcat="app"> > <group name="NoMDEntries" required="Y"> > <field name="MDUpdateAction" required="Y" /> > <field name="MDEntryType" required="Y" /> > <field name="MDElementName" required="Y" /> > <field name="Symbol" required="Y" /> > <field name="CFICode" required="Y" /> > <field name="SettlType" required="Y" /> > <field name="QuoteCondition" required="N" /> > <field name="MDEntryPx" required="N" /> > <field name="TradeCondition" required="N" /> > <field name="MDEntrySize" required="N" /> > <component name="Parties" required="N" /> > <field name="PriceTimeStamp" required="N" /> > </group> > </message> > > I used the following to traverse the groups: > void someFunction(const FIX::message& message) { > FIX44::MarketDataIncrementalRefresh::NoMDEntries group; > FIX::MDUpdateAction action; > > FIX::MDEntryType entryType; > FIX::MDEntryPx rate; > FIX::MDEntrySize size; > FIX::QuoteCondition quoteCondition; > > for(int i = 1; i <= entryCount; i++) > { > message.getGroup(i, group); > group.get(action); > if (action.getValue() == FIX::MDUpdateAction_CHANGE) { > printf("get entryType\n"); > group.get(entryType); > bool hasTradeCondition = false; > try { > printf("get trade condition\n"); > group.get(tradeCondition); > hasTradeCondition = true; > printf("has trade condition\n"); > } > catch (FIX::FieldNotFound) {} > > std::string sizeStr; > std::string rateStr; > printf("get size\n"); > group.get(size); > printf("get price\n"); > group.get(rate); > printf("convert\n"); > sizeStr = size.getString(); > rateStr = rate.getString(); > printf("got price\n"); > > } > else { > printf("Unexpected update action: %c\n", action.getValue()); > } > } > } > > When it tries to retrieve the value of field 271 (MDEntrySize), it throws a FIX::FieldNotFound exception. > Here is the incoming FIX message: > 8=FIX.4.4 > 9=323 > 35=X > 49=[...] > 56=[...] > 34=6 > 52=20090113-23:29:06.725 > 268=4 > 279=1 > 269=1 > 5450=2 > 55=USD/JPY > 461=RCSXXX > 63=0 > 270=93.06 > 279=1 > 269=1 > 5450=46 > 55=USD/JPY > 461=RCSXXX > 63=0 > 270=93.06 > 271=2000000 > 279=1 > 269=1 > 5450=54 > 55=USD/JPY > 461=RCSXXX > 63=0 > 270=93.07 > 271=0 > 279=1 > 269=1 > 5450=52 > 55=USD/JPY > 461=RCSXXX > 63=0 > 270=93.08 > 271=2000000 > 10=086 > > It seems okay to me. > > I used the log viewer to open the log file, and it doesn't parse the groups correct either. > > Any idea? > > Side question: how come I can't catch FIX::FieldNotFound by reference? > > Thanks in advance. > > > ------------------------------------------------------------------------------ > Enter the BlackBerry Developer Challenge > This is your chance to win up to $100,000 in prizes! For a limited time, > vendors submitting new applications to BlackBerry App World(TM) will have > the opportunity to enter the BlackBerry Developer Challenge. See full prize > details at: http://p.sf.net/sfu/Challenge > _______________________________________________ > Quickfix-users mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfix-users > > |