Git Product home page Git Product logo

Comments (15)

gbirchmeier avatar gbirchmeier commented on July 21, 2024

Mail list thread:
http://lists.quickfixn.com/pipermail/quickfixn-quickfixn.com/2012q2/000124.html

from quickfixn.

gbirchmeier avatar gbirchmeier commented on July 21, 2024

Has anyone looked at how Java does it?

from quickfixn.

judwhite avatar judwhite commented on July 21, 2024

A bit heavy handed, but would this work?

public void OnMessage(QuickFix.FIX42.MarketDataIncrementalRefresh message, SessionID sessionID)
{
    MDReqID mdReqID = message.MDReqID;

    int count = message.GetInt(Tags.NoMDEntries);
    var list = new List<QuickFix.Group>();
    for (int grpIndex = 1; grpIndex <= count; grpIndex++)
    {
        list.Add(message.GetGroup(grpIndex, Tags.NoMDEntries));        
    }

    foreach (var noMDEntriesGroup in list.OfType<QuickFix.FIX42.MarketDataIncrementalRefresh.NoMDEntriesGroup>())
    {
      // code omitted here
    }
}

If you're expecting them to all be NoMDEntriesGroup you might replace OfType with Cast.

from quickfixn.

judwhite avatar judwhite commented on July 21, 2024

Sorry I missed the part where you already tried the explicit cast. The above code probably won't be of any use.

from quickfixn.

loganm avatar loganm commented on July 21, 2024

Unfortunately, bigger hammers aren't the solution here. I've tried :).

So as far as a solution in code, what does everyone else think is the best method?

I'm a bit pressed for time but am willing to do some work on this. It'll make my life easier in the long run so my boss shouldn't mind.

from quickfixn.

gbirchmeier avatar gbirchmeier commented on July 21, 2024

We'd really like to maintain some semblance of similarity between QF/n and QF for C++/Java.

I'd really like to see how QF/J handles this. They might have a design we can steal. I'll have a look later if I can find the time.

from quickfixn.

blackhill avatar blackhill commented on July 21, 2024

I had the same problem with a MarketDataSnapshotFullRefresh.

A workaround was :

       QuickFix.Group mdGroup;

       for(int i = 1; i < message.GetInt(Tags.NoMDEntries);i++)
       {
           mdGroup = message.GetGroup(i, Tags.NoMDEntries);

           Console.WriteLine(mdGroup.GetString(Tags.MDEntryPx));
           Console.WriteLine(mdGroup.GetString(Tags.MDEntrySize));
       }

Hope this help !

S

from quickfixn.

loganm avatar loganm commented on July 21, 2024

That's how I ended up having to do it. Thanks Steven.

This is still a bug, so how should we go about fixing it? I don't mind doing some of the work, but I wouldn't want to attempt anything without guidance. I'm new to contributing to open source projects.

from quickfixn.

gbirchmeier avatar gbirchmeier commented on July 21, 2024

Notes on methods of other QF versions:

QF: msg.getGroup(1,group_object) (this is a member of Message, not FieldMap)
QF/j: msg.getGroup(1,group_object) and group_object=msg.getGroup(1,tag_int) (each are from FieldMap)
QF/n: group_object = msg.GetGroup(1, tag_int)

Java: http://quickfixj.org/quickfixj/usermanual/1.5.1/usage/repeating_groups.html
C++: http://www.quickfixengine.org/quickfix/doc/html/repeating_groups.html

from quickfixn.

gbirchmeier avatar gbirchmeier commented on July 21, 2024

Unit tests: https://github.com/gbirchmeier/quickfixn/tree/56_group

from quickfixn.

gbirchmeier avatar gbirchmeier commented on July 21, 2024

I see the root cause now. When Message::FromString() creates a Message object from a string, it constructs Group objects instead the type-specific subclasses of Group. Therefore, the objects retrieved by GetGroup() are also Group objects. You can't cast a base class to a subclass if it was never a subclass-type object in the first place.

So I need to see if we have some kind of Group factory to create the typed Group objects. If we don't, then I guess I need to generate one.

from quickfixn.

NickT1977 avatar NickT1977 commented on July 21, 2024

Each of the following classes implements IMessageFactory that has a method called 'Create' that returns a Typed Group object based on the arguments passed in, it has the following signiture:
public Group Create(string beginString, string msgType, int correspondingFieldID)

The classes are:
QuickFix.FIX40.MessageFactory();
QuickFix.FIX41.MessageFactory();
QuickFix.FIX42.MessageFactory();
QuickFix.FIX43.MessageFactory();
QuickFix.FIX44.MessageFactory();

from quickfixn.

gbirchmeier avatar gbirchmeier commented on July 21, 2024

Thanks, Nick. I figured it was in there somewhere, but couldn't remember where. With this, I will probably be able to knock this out this week.

from quickfixn.

gbirchmeier avatar gbirchmeier commented on July 21, 2024

I think I solved it on my branch. Will integrate tomorrow.
https://github.com/gbirchmeier/quickfixn/tree/56_group

from quickfixn.

gbirchmeier avatar gbirchmeier commented on July 21, 2024

Damn, still failing AT 14i in the FIX50x sets.

Note to self:
cd AcceptanceTest
runat.bat release 5006 definitions\server\fix50\14i_RepeatingGroupCountNotEqual.def cfg\at_50.cfg
runat.bat release 5007 definitions\server\fix50sp1\14i_RepeatingGroupCountNotEqual.def cfg\at_50_sp1.cfg
runat.bat release 5008 definitions\server\fix50sp2\14i_RepeatingGroupCountNotEqual.def cfg\at_50_sp2.cfg

from quickfixn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.