{{Quickfixn}} Question about GetGroup

S Tan stan.quickfixn at gmail.com
Mon Apr 9 02:30:22 PDT 2012


Hi there,

At the bottom of http://quickfixn.org/tutorial/repeating-groups, we see
this code

var noSidesGrp = new QuickFix.FIX44.TradeCaptureReport.NoSidesGroup();
for(int grpIndex = 1; grpIndex<= message.GetInt(Tags.NoSides); grpIndex +=
1)
{
   noSidesGrp = message.GetGroup(grpIndex, Tags.NoSides);
}

This won't compile in VS2010 as noSidesGrp has type
QuickFix.FIX44.TradeCaptureReport.NoSidesGroup but message.GetGroup returns
the base class Group.

Is there any way we can call GetGroup and obtain the correct subclass of
Group based on the input tags? I've looked into the UnitTests and they
mostly test the base class Group.

I think in QuickFix/C++ we can call message.GetGroup(grpIndex, noSidesGrp)
so that GetGroup gets the type information. Perhaps not quite idiomatic C#.

stan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quickfixn.com/pipermail/quickfixn-quickfixn.com/attachments/20120409/0a6c1fd8/attachment.htm>


More information about the Quickfixn mailing list