[Quickfix-developers] [Fwd: Re: Enumerating all repeating groups in a FIX message]
Brought to you by:
orenmnero
From: Dale W. <wi...@oc...> - 2009-04-30 15:52:13
|
Hi Alex, I accidentally deleted one too many lines when I stripped away the noise from this method. The missing line is: fieldMap.getGroup(ng + 1, fieldTag,groupMap); which assigns the value to the groupMap. I'm not using the C# mapping, so you'll have to do some research into what methods are exposed. Worse case is you'll have to add some unmanaged C++ code to iterate thru the fields and pass them up to the .NET world. Dale Alex Marangos wrote: > Dale, > > Thanks - though I still have a couple of questions... > > In your [begin group entry] block, it seems to me there's some missing code - "groupMap" is not assigned any value before you recursively call decodeFieldMap. > > Also, in C# (which is what I'm using right now), the compiler complains that it can't convert QuickFix.Group to QuickFix.FieldMap - and I can't see any methods that would allow me to retrieve the FieldMap from a Group. How do I achieve this bit? > > Thanks again. > Alexandros > > > > > > > ----- Original Message ---- > From: Dale Wilson <wi...@oc...> > To: Alex Marangos <ale...@ya...> > Cc: qui...@li... > Sent: Wednesday, 29 April, 2009 20:11:54 > Subject: Re: [Quickfix-developers] Enumerating all repeating groups in a FIX message > > Alex Marangos wrote: > >> Alternatively, is there a way to enumerate through *all* fields of the message, regardless of whether they are in a group or not? >> >> >> > void decodeFieldMap (const FIX::FieldMap & fieldMap) > { > FIX::FieldMap::Fields::const_iterator mapEnd = fieldMap.end(); > for (FIX::FieldMap::Fields::const_iterator mapPos = fieldMap.begin(); > mapPos != mapEnd; > ++mapPos) > { > const FIX::FieldBase & field = (*mapPos).second; > [do something with the field] > > int fieldTag = (*mapPos).first; > int nGroups = fieldMap.groupCount(fieldTag); > if(nGroups != 0) > { > [do start of group processing] > for (int ng = 0; ng < nGroups; ++ng) > { > [begin group entry] > FIX::FieldMap groupMap; > decodeFieldMap (groupMap); > } > [do end of group processing] > } > } > } > > Dale > > > > |