当前位置: 首页>>代码示例>>C++>>正文


C++ ZStreamR::ReadUInt64方法代码示例

本文整理汇总了C++中ZStreamR::ReadUInt64方法的典型用法代码示例。如果您正苦于以下问题:C++ ZStreamR::ReadUInt64方法的具体用法?C++ ZStreamR::ReadUInt64怎么用?C++ ZStreamR::ReadUInt64使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ZStreamR的用法示例。


在下文中一共展示了ZStreamR::ReadUInt64方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

ZTBQueryNode_ID_Constant::ZTBQueryNode_ID_Constant(const ZStreamR& iStreamR)
	{
	if (uint32 theCount = sReadCount(iStreamR))
		{
		fIDs.reserve(theCount);
		while (theCount--)
			fIDs.push_back(iStreamR.ReadUInt64());
		}
	}
开发者ID:,项目名称:,代码行数:9,代码来源:

示例2: Read

bool ZTSWatcherServerAsync::Read(const ZStreamR& iStreamR)
{
    if (ZLOG(s, eDebug, "ZTSWatcherServerAsync"))
        s << "Read, start";

    EReq theReq = (EReq)iStreamR.ReadUInt8();

    switch (theReq)
    {
    case eReq_Close:
    {
        ZMutexLocker locker(fMutex);
        fSendClose = true;
        locker.Release();
        ZStreamerWriter::Wake();
        return false;
    }
    case eReq_IDs:
    {
        if (ZLOG(s, eDebug, "ZTSWatcherServerAsync"))
            s << "Read, eReq_IDs";
        const size_t theIDsNeeded = iStreamR.ReadCount();
        ZMutexLocker locker(fMutex);
        fIDsNeeded += theIDsNeeded;
        locker.Release();
        ZStreamerWriter::Wake();
        break;
    }
    case eReq_Sync:
    {
        if (ZLOG(s, eDebug, "ZTSWatcherServerAsync"))
            s << "Read, eReq_Sync";
        vector<uint64> removedIDs;
        if (uint32 theCount = iStreamR.ReadCount())
        {
            removedIDs.reserve(theCount);
            while (theCount--)
                removedIDs.push_back(iStreamR.ReadUInt64());
        }

        vector<uint64> addedIDs;
        if (uint32 theCount = iStreamR.ReadCount())
        {
            addedIDs.reserve(theCount);
            while (theCount--)
                addedIDs.push_back(iStreamR.ReadUInt64());
        }

        vector<int64> removedQueries;
        if (uint32 theCount = iStreamR.ReadCount())
        {
            removedQueries.reserve(theCount);
            while (theCount--)
                removedQueries.push_back(iStreamR.ReadInt64());
        }

        vector<ZTSWatcher::AddedQueryCombo> addedQueries;
        if (uint32 theCount = iStreamR.ReadCount())
        {
            addedQueries.reserve(theCount);
            while (theCount--)
            {
                const int64 theRefcon = iStreamR.ReadInt64();
                const bool thePrefetch = iStreamR.ReadBool();
                const size_t theSize = iStreamR.ReadCount();

                ZTSWatcher::AddedQueryCombo theCombo(theSize);
                theCombo.fRefcon = theRefcon;
                theCombo.fPrefetch = thePrefetch;

                iStreamR.Read(theCombo.fMemoryBlock.GetPtrMutable(), theSize);

                addedQueries.push_back(theCombo);
            }
        }

        vector<uint64> writtenTupleIDs;
        vector<ZTuple> writtenTuples;
        bool writeNeededSort = false;
        if (uint32 theCount = iStreamR.ReadCount())
        {
            writtenTupleIDs.reserve(theCount);
            writtenTuples.reserve(theCount);
            uint64 priorID = 0;
            while (theCount--)
            {
                const uint64 currentID = iStreamR.ReadUInt64();
                if (priorID >= currentID)
                    writeNeededSort = true;
                priorID = currentID;

                writtenTupleIDs.push_back(currentID);
                writtenTuples.push_back(ZTuple(iStreamR));
            }

            if (writeNeededSort)
                spSort(writtenTupleIDs, writtenTuples);
        }

        ZMutexLocker locker(fMutex);
//.........这里部分代码省略.........
开发者ID:zoolib,项目名称:zoolib_old,代码行数:101,代码来源:ZTSWatcherServerAsync.cpp


注:本文中的ZStreamR::ReadUInt64方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。