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


C++ Serial::readSign方法代码示例

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


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

示例1: loadState

   //
   // Thread::loadState
   //
   void Thread::loadState(Serial &in)
   {
      std::size_t count, countFull;

      in.readSign(Signature::Thread);

      module   = env->getModule(env->readModuleName(in));
      codePtr  = &module->codeV[ReadVLN<std::size_t>(in)];
      scopeGbl = env->getGlobalScope(ReadVLN<Word>(in));
      scopeHub = scopeGbl->getHubScope(ReadVLN<Word>(in));
      scopeMap = scopeHub->getMapScope(ReadVLN<Word>(in));
      scopeMod = scopeMap->getModuleScope(module);
      script   = env->readScript(in);
      delay    = ReadVLN<Word>(in);
      result   = ReadVLN<Word>(in);

      count = ReadVLN<std::size_t>(in);
      callStk.clear(); callStk.reserve(count + CallStkSize);
      while(count--)
         callStk.push(readCallFrame(in));

      count = ReadVLN<std::size_t>(in);
      dataStk.clear(); dataStk.reserve(count + DataStkSize);
      while(count--)
         dataStk.push(ReadVLN<Word>(in));

      countFull = ReadVLN<std::size_t>(in);
      count     = ReadVLN<std::size_t>(in);
      localArr.allocLoad(countFull, count);
      for(auto itr = localArr.beginFull(), end = localArr.end(); itr != end; ++itr)
         itr->loadState(in);

      countFull = ReadVLN<std::size_t>(in);
      count     = ReadVLN<std::size_t>(in);
      localReg.allocLoad(countFull, count);
      for(auto itr = localReg.beginFull(), end = localReg.end(); itr != end; ++itr)
         *itr = ReadVLN<Word>(in);

      countFull = ReadVLN<std::size_t>(in);
      count     = ReadVLN<std::size_t>(in);
      in.in->read(printBuf.getLoadBuf(countFull, count), countFull);

      state.state = static_cast<ThreadState::State>(ReadVLN<int>(in));
      state.data = ReadVLN<Word>(in);
      state.type = ReadVLN<Word>(in);

      in.readSign(~Signature::Thread);
   }
开发者ID:Altazimuth,项目名称:eternity,代码行数:51,代码来源:Thread.cpp


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