本文整理汇总了C++中ZStreamR::ReadInt64方法的典型用法代码示例。如果您正苦于以下问题:C++ ZStreamR::ReadInt64方法的具体用法?C++ ZStreamR::ReadInt64怎么用?C++ ZStreamR::ReadInt64使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZStreamR
的用法示例。
在下文中一共展示了ZStreamR::ReadInt64方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
//.........这里部分代码省略.........