tryU64() public method

Try to get a U64, unsigned 64 bit integer, field.
public tryU64 ( Wombat.MamaFieldDescriptor descriptor, ulong &result ) : bool
descriptor Wombat.MamaFieldDescriptor
result ulong
return bool
Example #1
0
        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;
        }
Example #2
0
        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);
        }
Example #3
0
        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;
            }
        }