begin() public method

public begin ( MamaMsgIterator &iterator ) : void
iterator MamaMsgIterator
return void
Esempio n. 1
0
		private void displayAllFields(MamaMsg msg)
		{
			MamaMsgIterator iterator = new MamaMsgIterator(null);
			MamaMsgField field;
			msg.begin(ref iterator);
			while ((field = iterator.getField()) != null)
			{
				displayField(field);
				iterator++;
			}
		}
Esempio n. 2
0
            public void onMsg(MamaSubscription subscription, MamaMsg msg)
            {
                // Create a field callback class to display the field contents
                ListenerFieldCallback fieldCallback = new ListenerFieldCallback(m_dictionary, m_iterator, m_quietness);

                if (m_quietness < 2)
                {
                    Console.WriteLine(subscription.subscSource + "." +
                             subscription.subscSymbol + " TYPE: " +
                             msg.getType() + " Status: " +
                             msg.getStatus());
                }

                if (m_quietness < 1)
                {
                    if (m_iterator)
                    {
                        // Set the iterator to the beginning of the message
                        msg.begin(ref m_messageIterator);

                        // Keep going until there are no more fields
                        MamaMsgField field = m_messageIterator.getField();
                        while (field != null)
                        {
                            // Display the field
                            fieldCallback.displayField(field, 0);

                            m_messageIterator++;

                            // Get the next field
                            field = m_messageIterator.getField();
                        }
                    }

                    else
                    {
                        // Otherwise use the iteration function on the message itself
                        int indentlevel = 0;
                        msg.iterateFields(fieldCallback, m_dictionary, indentlevel);
                    }
                }
            }