예제 #1
0
파일: Messages.cs 프로젝트: buybackoff/iFix
        // Throws if the message is malformed.
        // Returns null if message type isn't recognized.
        // If the result is not null, it's guaranteed to inherit from Fix44.Message
        // and implement IClientMessage, IServerMessage, or both.
        public Mantle.IMessage CreateMessage(IEnumerator <Field> fields)
        {
            MsgType  msgType = FindMsgType(fields);
            IMessage msg     = NewMessage(msgType);

            if (msg != null)
            {
                while (fields.MoveNext())
                {
                    int tag = Deserialization.ParseInt(fields.Current.Tag);
                    msg.AcceptField(tag, fields.Current.Value);
                }
            }
            return(msg);
        }