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


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

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


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

示例1: locker

bool ZBlackBerryServer::Handler_ManagerChanged::Read(const ZStreamR& r)
	{
	const bool req = r.ReadBool();

	ZGuardRMtxR locker(fMutex);
	if (!req)
		{
		fState = eState_SendClosed;
		locker.Release();
		//##ZStreamerWriter::Wake();
		return false;
		}

	switch (fState)
		{
		case eState_Quiet:
			{
			fState = eState_Waiting;
			return true;
			}
		case eState_Changed:
			{
			fState = eState_SendChanged;
			locker.Release();
			//##ZStreamerWriter::Wake();
			return true;
			}
		}

	ZUnimplemented();
	return false;
	}
开发者ID:zoolib,项目名称:zoolib_old,代码行数:32,代码来源:ZBlackBerryServer.cpp

示例2:

/// \sa ZBlackBerry::Device_Client::Read
bool ZBlackBerryServer::Handler_DeviceFinished::Read(const ZStreamR& r)
	{
	ZLOGFUNCTION(eDebug + 2);

	const bool req = r.ReadBool();
	ZAssert(!req);

	fOpen = false;
	//##ZStreamerWriter::Wake();
	return false;
	}
开发者ID:zoolib,项目名称:zoolib_old,代码行数:12,代码来源:ZBlackBerryServer.cpp

示例3:

ZTBQuery::SortSpec::SortSpec(const ZStreamR& iStreamR)
:	fPropName(iStreamR),
	fAscending(iStreamR.ReadBool()),
	fStrength(iStreamR.ReadUInt8())
	{}
开发者ID:,项目名称:,代码行数:5,代码来源:

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