當前位置: 首頁>>代碼示例>>C#>>正文


C# MamaMsg.tryU64方法代碼示例

本文整理匯總了C#中Wombat.MamaMsg.tryU64方法的典型用法代碼示例。如果您正苦於以下問題:C# MamaMsg.tryU64方法的具體用法?C# MamaMsg.tryU64怎麽用?C# MamaMsg.tryU64使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Wombat.MamaMsg的用法示例。


在下文中一共展示了MamaMsg.tryU64方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: handleRecap

        private void handleRecap(
			MamdaSubscription subscription,
			MamaMsg msg)
        {
            // Synchronize the current Order Book in case a snapshot is being created
            if (mFullBook != null)
            {
                lock (mFullBook)
                {
                    msg.tryU64(MamaReservedFields.SenderId, ref mPreviousSenderId);
                    handleStandardFields(subscription, msg, false);
                    if (createDeltaFromMamaMsg(mTempmDeltaBook, msg))
                    {
                        mDeltaBook.setSymbol(subscription.getSymbol());
                        mDeltaBook.setBookTime(msg.getDateTime(MamdaOrderBookFields.BOOK_TIME, mSrcTime));
                        mDeltaBook.setAsDeltaDifference(mFullBook, mTempmDeltaBook);
                        mFullBook.copy(mTempmDeltaBook);
                        mFullBook.setSymbol(subscription.getSymbol());
                        mFullBook.setBookTime(mDeltaBook.getBookTime());
                        mFullBook.setIsConsistent(true);
                        invokeRecapHandlers(subscription, msg);
                    }
                }
            }
            else
            {
                handleStandardFields(subscription, msg, false);
                // Set the delta to be the contents of the recap.
                if (createDeltaFromMamaMsg(mDeltaBook, msg))
                {
                        mDeltaBook.setSymbol(subscription.getSymbol());
                    invokeRecapHandlers(subscription, msg);
                }
            }
            mGotInitial = true;
        }
開發者ID:jacobraj,項目名稱:MAMA,代碼行數:36,代碼來源:MamdaOrderBookListener.cs

示例2: handleStandardFields

        private void handleStandardFields(
			MamdaSubscription subscription,
			MamaMsg msg,
			bool checkSeqNum)
        {
            long seqNum = 0;
            msg.tryI64(MamaReservedFields.SeqNum, ref seqNum);
            ulong senderId = 0;
            msg.tryU64(MamaReservedFields.SenderId, ref senderId);
            if (checkSeqNum)
            {
                if ((seqNum != 0) && (mSeqNum != (seqNum - 1)))
                {
                    mGapBegin = mSeqNum + 1;
                    mGapEnd   = seqNum   - 1;
                    invokeGapHandlers(subscription, msg);
                    if (mFullBook != null && senderId == mPreviousSenderId)
                    {
                        mFullBook.setIsConsistent(false);
                    }
                }
            }
            mSeqNum = seqNum;
            mPreviousSenderId = senderId;
            msg.tryI64(MamdaOrderBookFields.SEQNUM, ref mEventSeqNum);
            msg.tryDateTime(MamdaOrderBookFields.SRC_TIME, ref mSrcTime);
            msg.tryDateTime(MamdaOrderBookFields.ACTIVITY_TIME, ref mActTime);
        }
開發者ID:jacobraj,項目名稱:MAMA,代碼行數:28,代碼來源:MamdaOrderBookListener.cs

示例3: getEntriesInfo

        private bool getEntriesInfo(MamaMsg entMsg)
        {
            int priceLevelEntryActionInt = 0;
            ulong mPriceLevelEntrySizeUlong = 0;

            if (entMsg.tryI32(MamdaOrderBookFields.ENTRY_ACTION, ref priceLevelEntryActionInt))
            {
                mPriceLevelEntryAction = (sbyte) priceLevelEntryActionInt;
            }

            entMsg.tryU64 (MamdaOrderBookFields.ENTRY_SIZE, ref mPriceLevelEntrySizeUlong);
            mPriceLevelEntrySize = (long) mPriceLevelEntrySizeUlong;

            mPriceLevelEntryTime = entMsg.getDateTime(MamdaOrderBookFields.ENTRY_TIME, mPriceLevelTime);

            if(entMsg.tryStringAnsi (MamdaOrderBookFields.ENTRY_ID, ref mPriceLevelEntryIdIntPtr))
            {
                return true;
            }
            else
            {
                return false;
            }
        }
開發者ID:jacobraj,項目名稱:MAMA,代碼行數:24,代碼來源:MamdaBookAtomicListener.cs


注:本文中的Wombat.MamaMsg.tryU64方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。