getType() public method

Extract the type
public getType ( ) : mamaMsgType
return mamaMsgType
 public void callMamdaOnMsg(MamdaSubscription sub, MamaMsg msg)
 {
     try
     {
         ArrayList msgListeners = new ArrayList();
         msgListeners = sub.getMsgListeners();
         IEnumerator iter = msgListeners.GetEnumerator();
         int size = msgListeners.Count;
         for (int i = 0; i < size; i++)
         {
             iter.MoveNext();
             MamdaMsgListener listener = (MamdaMsgListener)iter.Current;
             listener.onMsg(sub, msg, msg.getType());
         }
     }
     catch (Exception ex)
     {
         throw new MamdaDataException(ex.Message, ex);
     }
 }
Ejemplo n.º 2
0
        public void onMsg(MamaSubscription subscription,
            MamaMsg msg)
        {

            if (msg.getType() == mamaMsgType.MAMA_MSG_TYPE_INITIAL)
            {
                stats.mInitialMsgCount++;
            }
            else
                stats.mOtherMsgCount++;

            if (mamaLogLevel > MamaLogLevel.MAMA_LOG_LEVEL_NORMAL)
            {
                Console.WriteLine("msg.getSymbol msg.getStatus");
            }
        }
Ejemplo n.º 3
0
			public void onMsg (MamaSubscription subscription, MamaMsg msg)
			{
				switch (msg.getType())
				{
					case mamaMsgType.MAMA_MSG_TYPE_INITIAL:
						char[] delimiter = {','};
						string newSymbols = msg.getString (MamaReservedFields.SymbolList.getName(), (ushort)MamaReservedFields.SymbolList.getFid());
						string[] parsedSymbols = newSymbols.Split(delimiter);
						for (int i=0; i<parsedSymbols.Length; i++)
						{
							subjectList.Add ((Object)parsedSymbols[i]);
						}   
						Console.WriteLine("Received initial for symbol list subscription.  Updating list of symbols to subscribe to.\n");
						break;
					case mamaMsgType.MAMA_MSG_TYPE_END_OF_INITIALS:
						Console.WriteLine("End of initials.  Subscribing to symbols.\n");
						subscribeToSubjects();
						break;
					default:
						break;
				}
			}
Ejemplo n.º 4
0
			public void onMsg (MamaSubscription subscription, MamaMsg msg)
			{
				if (quietness < 1)
				{
					Console.WriteLine("Recieved message of type " + msg.stringForType (msg.getType()) + " for " + subscription.subscSymbol);
				}
			}
Ejemplo n.º 5
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);
                    }
                }
            }