typeForMsg() public method

Extract the type from the supplied message.
public typeForMsg ( ) : mamaMsgType
return mamaMsgType
コード例 #1
0
ファイル: MamdaSubscription.cs プロジェクト: jacobraj/MAMA
			public void onMsg(
				MamaSubscription subscription,
				MamaMsg msg)
			{
				mamaMsgType msgType = msg.typeForMsg();
				mamaMsgStatus msgStatus = msg.getStatus();

				switch (msgType)
				{
					case mamaMsgType.MAMA_MSG_TYPE_DELETE:
					case mamaMsgType.MAMA_MSG_TYPE_EXPIRE:
						subscription.deallocate();
						return;
				}

				switch (msgStatus)
				{
					case mamaMsgStatus.MAMA_MSG_STATUS_BAD_SYMBOL:
					case mamaMsgStatus.MAMA_MSG_STATUS_EXPIRED:
					case mamaMsgStatus.MAMA_MSG_STATUS_TIMEOUT:
						subscription.deallocate();
						return;
				}

				for (int i=0;i<mSubscription.mMsgListeners.Count;i++)
				{
					MamdaMsgListener listener = (MamdaMsgListener) mSubscription.mMsgListeners[i];
					listener.onMsg(mSubscription, msg, msgType);
				}
			}