• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ readObject函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中readObject函数的典型用法代码示例。如果您正苦于以下问题:C++ readObject函数的具体用法?C++ readObject怎么用?C++ readObject使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: readObject

 //----------------------------------------------------------------------
 void WalkmeshFileSerializer::readObject( Ogre::DataStreamPtr &stream
                                         ,WalkmeshFileSerializer::Triangle &pDest)
 {
     readObject( stream, pDest.a );
     readObject( stream, pDest.b );
     readObject( stream, pDest.c );
 }
开发者ID:adrielvel,项目名称:q-gears,代码行数:8,代码来源:FF7WalkmeshFileSerializer.cpp


示例2: readString

    //---------------------------------------------------------------------
    void SkeletonSerializer::readBone(DataStreamPtr& stream, Skeleton* pSkel)
    {
        // char* name
        String name = readString(stream);
        // unsigned short handle            : handle of the bone, should be contiguous & start at 0
        unsigned short handle;
        readShorts(stream, &handle, 1);

        // Create new bone
        Bone* pBone = pSkel->createBone(name, handle);

        // Vector3 position                 : position of this bone relative to parent 
        Vector3 pos;
        readObject(stream, pos);
        pBone->setPosition(pos);
        // Quaternion orientation           : orientation of this bone relative to parent 
        Quaternion q;
        readObject(stream, q);
        pBone->setOrientation(q);

#if OGRE_SERIALIZER_VALIDATE_CHUNKSIZE
        // Hack to fix chunk size validation:
        mChunkSizeStack.back() += calcStringSize(name);
#endif
        // TODO: don't depend on mCurrentstreamLen in next skeleton format!
        // Currently we use wrong chunk sizes, but we can't fix it, because we depend on mCurrentstreamLen
        // Do we have scale?
        if (mCurrentstreamLen > calcBoneSizeWithoutScale(pSkel, pBone))
        {
            Vector3 scale;
            readObject(stream, scale);
            pBone->setScale(scale);
        }
        
    }
开发者ID:bsmr-c-cpp,项目名称:ogre,代码行数:36,代码来源:OgreSkeletonSerializer.cpp


示例3: readObject

core::Error readObject(const json::Object& object,
                       const std::string& name1, T1* pValue1,
                       const std::string& name2, T2* pValue2,
                       const std::string& name3, T3* pValue3,
                       const std::string& name4, T4* pValue4,
                       const std::string& name5, T5* pValue5,
                       const std::string& name6, T6* pValue6,
                       const std::string& name7, T7* pValue7,
                       const std::string& name8, T8* pValue8,
                       const std::string& name9, T9* pValue9,
                       const std::string& name10, T10* pValue10)
{
   Error error = readObject(object,
                            name1, pValue1,
                            name2, pValue2,
                            name3, pValue3,
                            name4, pValue4,
                            name5, pValue5,
                            name6, pValue6,
                            name7, pValue7,
                            name8, pValue8,
                            name9, pValue9);
   if (error)
      return error;

   return readObject(object, name10, pValue10);
}
开发者ID:harupiko,项目名称:rstudio,代码行数:27,代码来源:JsonRpc.hpp


示例4: throw

void PersistEngine::read(PersistObject *&object) throw(PersistException)
{
  uint32_t id = 0;
  read(id);
  // Is the ID a NULL object?
  if (id == NullObject) {
    object = NULL;
    return;
  }

  // Do we already have this object in memory?
  if (id < myArchiveVector.size()) {
    object = myArchiveVector[id];
    return;
  }

  // Okay - read the identifier for the class in...
  std::string className = readClass();

  // is the pointer already initialized? if so then no need to reallocate
  if (object != NULL) {
    readObject(object);
    return;
  }

  // Create the object (of the relevant type)
  object = TypeManager::createInstanceOf(className.c_str());
  if (object) {
    // Okay then - we can make this object
    readObject(object);
  }
  else
    throw(PersistException(std::string("Unable to instantiate object of class ")+className));
}
开发者ID:oudream,项目名称:ucommon,代码行数:34,代码来源:persist.cpp


示例5: readString

    //---------------------------------------------------------------------
    void SkeletonSerializer::readBone(DataStreamPtr& stream, Skeleton* pSkel)
    {
        // char* name
        String name = readString(stream);
        // unsigned short handle            : handle of the bone, should be contiguous & start at 0
        unsigned short handle;
        readShorts(stream, &handle, 1);

        // Create new bone
        Bone* pBone = pSkel->createBone(name, handle);

        // Vector3 position                 : position of this bone relative to parent 
        Vector3 pos;
        readObject(stream, pos);
        pBone->setPosition(pos);
        // Quaternion orientation           : orientation of this bone relative to parent 
        Quaternion q;
        readObject(stream, q);
        pBone->setOrientation(q);
        // Do we have scale?
        if (mCurrentstreamLen > calcBoneSizeWithoutScale(pSkel, pBone))
        {
            Vector3 scale;
            readObject(stream, scale);
            pBone->setScale(scale);
        }
    }
开发者ID:MrLobo,项目名称:El-Rayo-de-Zeus,代码行数:28,代码来源:OgreSkeletonSerializer.cpp


示例6: readFloats

    //---------------------------------------------------------------------
    void SkeletonSerializer::readKeyFrame(DataStreamPtr& stream, NodeAnimationTrack* track, 
        Skeleton* pSkel)
    {
        // float time                    : The time position (seconds)
        float time;
        readFloats(stream, &time, 1);

        TransformKeyFrame *kf = track->createNodeKeyFrame(time);

        // Quaternion rotate            : Rotation to apply at this keyframe
        Quaternion rot;
        readObject(stream, rot);
        kf->setRotation(rot);
        // Vector3 translate            : Translation to apply at this keyframe
        Vector3 trans;
        readObject(stream, trans);
        kf->setTranslate(trans);
        // Do we have scale?
        if (mCurrentstreamLen > calcKeyFrameSizeWithoutScale(pSkel, kf))
        {
            Vector3 scale;
            readObject(stream, scale);
            kf->setScale(scale);
        }
    }
开发者ID:MrLobo,项目名称:El-Rayo-de-Zeus,代码行数:26,代码来源:OgreSkeletonSerializer.cpp


示例7: readObject

CompareData::CompareData (SharedPtr<DataBlock> a, SharedPtr<DataBlock> b)
	: Operation	("CompareData")
	, m_a		(a)
	, m_b		(b)
{
	readObject(SharedPtr<Object>(a));
	readObject(SharedPtr<Object>(b));
}
开发者ID:crucible,项目名称:deqp,代码行数:8,代码来源:tcuThreadUtil.cpp


示例8: readInts

	void LodConfigSerializer::readLodProfile()
	{
		uint32 size = 0;
		readInts(mStream, &size, 1);
		mLodConfig->advanced.profile.clear();
		while(size--){
			ProfiledEdge pv;
			readObject(mStream, pv.src);
			readObject(mStream, pv.dst);
			readFloats(mStream, &pv.cost, 1);
			mLodConfig->advanced.profile.push_back(pv);
		}
	}
开发者ID:j-rivero,项目名称:ogre-acornacorn,代码行数:13,代码来源:OgreLodConfigSerializer.cpp


示例9: switch

void Uc::import(File & f) {
  for (;;) {
    Q3CString s;

    switch (f.read(s)) {
    case -1:
      f.eof();
      throw 0;
    case ')':
      return;
    case ATOM:
      if ((s == "logical_models") || 
          (s == "logical_presentations")) {
        f.read("(");
        f.read("list");
        f.read("unit_reference_list");
        readObjects(f);
      }
      else
	readObject(f, s);
      break;
    default:
      f.syntaxError(s);
    }
  }
}
开发者ID:SciBoy,项目名称:douml,代码行数:26,代码来源:Uc.cpp


示例10: while

static Obj *readDict( istream& is )
{
	string lhs;
	Obj *rhs;

	map<string,Obj*> ret;

	is.get();

	while( true ) {
		eat( is );
		if( is.peek() == '}' ) {
			is.get();
			return new DictObj( ret );
		}
		lhs = readID( is );
		eat( is );
		if( is.get() != '=' ) {
			throw ParseError( "Parse error: expected equals." );
		}
		rhs = readObject( is );
		ret[ lhs ] = rhs;
		eat( is );
		int ch = is.peek();
		if( ch == ';' ) {
			is.get();
		} else if( ch != '}' ) {
			throw ParseError( "Parse error: expected semicolon or brace." );
		}
	}
}
开发者ID:cychiuae,项目名称:recart-3tcetjorp-1144pmoc,代码行数:31,代码来源:parse.cpp


示例11: readObjectParam

core::Error readObjectParam(const json::Array& params,
                            unsigned int index,
                            const std::string& name1, T1* pValue1,
                            const std::string& name2, T2* pValue2,
                            const std::string& name3, T3* pValue3,
                            const std::string& name4, T4* pValue4,
                            const std::string& name5, T5* pValue5,
                            const std::string& name6, T6* pValue6,
                            const std::string& name7, T7* pValue7,
                            const std::string& name8, T8* pValue8,
                            const std::string& name9, T9* pValue9,
                            const std::string& name10, T10* pValue10)
{
   json::Object object;
   Error error = json::readParam(params, index, &object);
   if (error)
      return error;

   return readObject(object,
                     name1, pValue1,
                     name2, pValue2,
                     name3, pValue3,
                     name4, pValue4,
                     name5, pValue5,
                     name6, pValue6,
                     name7, pValue7,
                     name8, pValue8,
                     name9, pValue9,
                     name10, pValue10);
}
开发者ID:harupiko,项目名称:rstudio,代码行数:30,代码来源:JsonRpc.hpp


示例12: read2ByteBool

    //---------------------------------------------------------------------
    void
    BackgroundFileSerializer::readObject( Ogre::DataStreamPtr &stream, Page &pDest )
    {
        read2ByteBool( stream, pDest.enabled );
        if( !pDest.enabled ) return;

        readShort( stream, pDest.unknown_02 );
        readShort( stream, pDest.value_size );
        if( pDest.value_size != 1 && pDest.value_size != 2 )
        {
            OGRE_EXCEPT(Ogre::Exception::ERR_INVALIDPARAMS
                ,"Page value_size other then 1 and 2 is not supported"
                ,"BackgroundFileSerializer::readObject" );
        }

        size_t color_count( BackgroundFile::PAGE_DATA_SIZE );
        pDest.colors.clear();
        pDest.data.clear();

        if( pDest.value_size == 2 )
        {
            pDest.colors.reserve( color_count );
            for( size_t i( color_count ); i--; )
            {
                Color colourDest;
                readObject( stream, colourDest );
                pDest.colors.push_back( colourDest );
            }
        }
        else
        {
            pDest.data.resize( color_count );
            stream->read( &pDest.data[0], color_count );
        }
    }
开发者ID:adrielvel,项目名称:q-gears,代码行数:36,代码来源:QGearsBackgroundFileSerializer.cpp


示例13: throw

//------------------------------------------------------------------------------
void IFile::load(const char *fileName) throw (std::ios_base::failure)
{
  if (loaded_)
  {
    unload();
    loaded_ = false;
  }

  fileName_ = std::string(fileName);

  fileIn_.close(); //TODO: necessary?

  fileIn_.open(fileName, std::ios::binary | std::ios::in);

  if (fileIn_.fail())
  {
    fileIn_.close();
    throw std::ios_base::failure("Cant read file: \"" + fileName_ + "\"");
  }
  else
  {
    readObject(fileIn_);
    loaded_ = true;
  }
}
开发者ID:Jon0,项目名称:genie,代码行数:26,代码来源:IFile.cpp


示例14:

bool SceneTutorial27::InitObjects()
{
    if( ! readObject("Data/Object2.txt", obj) ) {
        return false;
    }
    
    return true;
}
开发者ID:byjo,项目名称:graphics-practice,代码行数:8,代码来源:SceneTutorial27.cpp


示例15: createCondensedObjects

static std::vector<readObject> createCondensedObjects(std::vector<T> reads) {
  std::vector<readObject> ans;
  readVec::allSetCondensedSeq(reads);
  for (const auto& read : reads) {
    ans.emplace_back(readObject(seqInfo(read.seqBase_.name_, read.condensedSeq,
                                        read.condensedSeqQual)));
  }
  return ans;
}
开发者ID:bailey-lab,项目名称:bibseq,代码行数:9,代码来源:seqToolsUtils.hpp


示例16: readSectionHeader

 //---------------------------------------------------------------------
 void
 BackgroundFileSerializer::readTexture( Ogre::DataStreamPtr &stream
                                       ,BackgroundFile *pDest )
 {
     readSectionHeader( stream, SECTION_NAME_TEXTURE );
     for (auto& page : pDest->getPages())
     {
         readObject(stream, page);
     }
 }
开发者ID:adrielvel,项目名称:q-gears,代码行数:11,代码来源:QGearsBackgroundFileSerializer.cpp


示例17: readBullet

void Save::readBullet(Bullet* mBullet, string& property, string& value)
{
	if (!readObject(mBullet, property, value))
	{
		if (!property.compare("speedXY"))
		{
			mBullet->setSpeedXY(stof(value));
			mBullet->getEntity2d()->setBoundingAreas("../SpaceGame/resources/green_beam_collisions.xml");
		}
	}
}
开发者ID:uzunov-dimitar,项目名称:TeamRocketGame,代码行数:11,代码来源:Save.cpp


示例18: readSatellite

void Save::readSatellite(Satellite* mSatellite, string& property, string& value)
{
	if (!readObject(mSatellite, property, value))
	{
		if (!property.compare("orbitRadius"))
		{
			mSatellite->setOrbitRadius(stof(value));
			mSatellite->getEntity2d()->setBoundingCircle("satellite", mSatellite->getSurface()->getWidth() / 2.0f, mSatellite->getSurface()->getWidth() / 2.0f, mSatellite->getSurface()->getWidth() / 2.0f);
			getMI()->_animationManager->addToSurface(mSatellite->getAnimationDust(), "../SpaceGame/resources/animations/dust.xml", IND_ALPHA, IND_32, 255, 0, 255);
		}
	}
}
开发者ID:uzunov-dimitar,项目名称:TeamRocketGame,代码行数:12,代码来源:Save.cpp


示例19: readPlanet

void Save::readPlanet(Planet* mPlanet, string& property, string& value)
{
	if (!readObject(mPlanet, property, value))
	{
		
		if (!property.compare("circleTrajectory"))
		{
			mPlanet->setCircleTrajectory(stoi(value));
		}
		if (!property.compare("orbitRadius"))
		{
			mPlanet->setOrbitRadius(stof(value));
			mPlanet->getEntity2d()->setBoundingCircle("planet", mPlanet->getSurface()->getWidth() / 2.0f, mPlanet->getSurface()->getWidth() / 2.0f, mPlanet->getSurface()->getWidth() / 2.0f);
		}
		if (!property.compare("timer"))
		{
			mPlanet->setTimer(stof(value));
		}
		if (!property.compare("shootingFrequency"))
		{
			mPlanet->setShootingFrequency(stof(value));
		}
		if (!property.compare(0, 6, "bullet"))
		{
			// extract the serial number of the bullet
			int id = std::stoi(property.substr(6, property.find_first_of("-") - 6));
			if (mPlanet->getBullets().size() <= id)
			{
				mPlanet->getBullets().push_back(new Bullet());
				mPlanet->getBullets().back()->setMI(getMI());
			}

			// change property so that it contains only the actual property of the bullet
			property = property.substr(property.find_first_of("-") + 1, property.find_first_of("]") - property.find_first_of("-") - 1);
			readBullet(mPlanet->getBullets().back(), property, value);
		}
		if (!property.compare(0, 9, "satellite"))
		{
			// extract the serial number of the satellite
			int id = std::stoi(property.substr(9, 1));
			if (mPlanet->getSatellites().size() <= id)
			{
				mPlanet->getSatellites().push_back(new Satellite());
				mPlanet->getSatellites().back()->setMI(getMI());
			}

			// change property so that it contains only the actual property of the satellite
			property = property.substr(property.find_first_of("-") + 1, property.find_first_of("]") - property.find_first_of("-") - 1);
			readSatellite(mPlanet->getSatellites().back(), property, value);
		}
	}
}
开发者ID:uzunov-dimitar,项目名称:TeamRocketGame,代码行数:52,代码来源:Save.cpp


示例20: skipCommentTokens

bool
Reader::readValue()
{
   Token token;
   skipCommentTokens( token );
   bool successful = true;

   if ( collectComments_  &&  !commentsBefore_.empty() )
   {
      currentValue().setComment( commentsBefore_, commentBefore );
      commentsBefore_ = "";
   }


   switch ( token.type_ )
   {
   case tokenObjectBegin:
      successful = readObject( token );
      break;
   case tokenArrayBegin:
      successful = readArray( token );
      break;
   case tokenNumber:
      successful = decodeNumber( token );
      break;
   case tokenString:
      successful = decodeString( token );
      break;
   case tokenTrue:
      currentValue() = true;
      break;
   case tokenFalse:
      currentValue() = false;
      break;
   case tokenNull:
      currentValue() = Value();
      break;
   default:
      return addError( "Syntax error: value, object or array expected.", token );
   }

   if ( collectComments_ )
   {
      lastValueEnd_ = current_;
      lastValue_ = &currentValue();
   }

   return successful;
}
开发者ID:herryRiver,项目名称:sdl_core_v3.6_wince,代码行数:49,代码来源:json_reader.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ readPacket函数代码示例发布时间:2022-05-30
下一篇:
C++ readMessage函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap