{{Quickfixn}} Question about GetGroup

Logan Moore logan.moore at velocitytrade.com
Mon Apr 9 23:46:12 PDT 2012


Hi Stan,

I'm having the same problem with QuickFix.FIX42.MarketDataIncrementalRefresh.NoMDEntriesGroup

Looking over the code now, I think the solution is to either add a whole bunch of implicit conversion operators to the base Group class, or a constructor to each of the derived classes that accepts the base class as a parameter. The constructor route seems safer/easier because you can't use it out of context unknowingly.

Logan

From: quickfixn-bounces at lists.quickfixn.com [mailto:quickfixn-bounces at lists..quickfixn.com] On Behalf Of S Tan
Sent: Monday, 9 April 2012 9:30 p.m.
To: quickfixn at lists.quickfixn.com
Subject: {{Quickfixn}} Question about GetGroup

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



------------------------------------------------------------------------------------------------------------
This email and its attachments may be confidential and are intended solely for the use of the individual to whom it is addressed. 
Any views or opinions expressed are solely those of the author and do not necessarily represent those of Velocity Trade (VT) or any of its affiliates.  In no way are the contents of this email be viewed as a solicitation of any kind.  If you are not the intended recipient of this email and its attachments, you must take no action based upon them, nor must you copy or show them to anyone. 
Please contact the sender if you believe you have received this email in error. Velocity Trade Foreign Exchange Services Ltd is an Authorised Representative of Velocity Trade International Limited - regulated by the Financial Services Authority (FSA No. 497263). 
The VT Group is also regulated by the Australian Securities and Investment Commission; the Financial Markets Authority in New Zealand; the FSB, South Africa and is registered with Fintrac Canada. VT is a member of the Johannesburg Stock Exchange. VT has offices in Toronto, Montreal, New York, London, Cape Town, Auckland and Sydney.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quickfixn.com/pipermail/quickfixn-quickfixn.com/attachments/20120410/f9d95b4c/attachment-0001.htm>


More information about the Quickfixn mailing list