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

C++ ReadObject函数代码示例

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

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



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

示例1: ReadShorts

    void DiMotionSerializerImpl::ReadAttachNodes( DiDataStreamPtr& stream,DiAttachSet* attachset )
    {
        uint16 numAttaches;

        ReadShorts(stream,&numAttaches,1);

        for (size_t i = 0; i < numAttaches; ++i)
        {
            DiString name = ReadString(stream);

            DiVec3 position;
            ReadObject(stream,position);

            DiQuat quat;
            ReadObject(stream,quat);

            bool hasscale;
            ReadBools(stream,&hasscale,1);

            DiVec3 scale = DiVec3::UNIT_SCALE;
            if (hasscale)
            {
                ReadObject(stream,scale);
            }

            DiAttachNode * pkAttachNode = attachset->CreateAttachNode(name);
            pkAttachNode->SetPosition(position);
            pkAttachNode->SetOrientation(quat);
            
            if (hasscale)
            {
                pkAttachNode->SetScale(scale);
            }
        }
    }
开发者ID:wangyanxing,项目名称:Demi3D,代码行数:35,代码来源:MotionSerial.cpp


示例2: ReadString

    void DiMotionSerializerImpl::ReadAttachClips( DiDataStreamPtr& stream, DiAnimation* motion )
    {
        DiString strName = ReadString(stream);

        DiNodeClip* nodeClip = motion->CreateAttachClip(strName);

        uint16 keyFrameNum = 0;
        ReadShorts(stream,&keyFrameNum,1);

        for (uint16 i = 0; i < keyFrameNum; ++i)
        {
            float time = 0;
            ReadFloats(stream,&time, 1);

            DiVec3 pos;
            ReadObject(stream,pos);

            DiQuat quat;
            ReadObject(stream,quat);

            bool hasScale = false;
            ReadBools(stream,&hasScale,1);

            DiVec3 scale = DiVec3::UNIT_SCALE;
            if (hasScale)
            {
                ReadObject(stream,scale);
            }

            DiTransformKeyFrame* key = nodeClip->CreateNodeKeyFrame(time);
            key->SetTranslate(pos);
            key->SetRotation(quat);
            key->SetScale(scale);
        }
    }
开发者ID:wangyanxing,项目名称:Demi3D,代码行数:35,代码来源:MotionSerial.cpp


示例3: ReadHeader

// Parses the entire contents of an XNB file.
void ContentReader::ReadXnb()
{
    // Read the XNB header.
    uint32_t endPosition = ReadHeader();

    ReadTypeManifest();

    uint32_t sharedResourceCount = Read7BitEncodedInt();

    // Read the primary asset data.
    Log.WriteLine("Asset:");

    ReadObject();

    // Read any shared resource instances.
    for (uint32_t i = 0 ; i < sharedResourceCount; i++)
    {
        Log.WriteLine("Shared resource %d:", i);
        
        ReadObject();
    }

    // Make sure we read the amount of data that the file header said we should.
    if (FilePosition() != endPosition)
    {
        throw app_exception("End position does not match XNB header: unexpected amount of data was read.");
    }
}
开发者ID:jlyonsmith,项目名称:ParseXnb,代码行数:29,代码来源:ContentReader.cpp


示例4: SecurityRange

   shared_ptr<SecurityRange>
   PersistentSecurityRange::ReadMatchingIP(const IPAddress &ipaddress)
   {
      shared_ptr<SecurityRange> empty;

      IPAddressSQLHelper helper;
      String sSQL;

      if (ipaddress.GetType() == IPAddress::IPV4)
      {
         shared_ptr<SecurityRange> pSR = shared_ptr<SecurityRange>(new SecurityRange());

         sSQL.Format(_T("select * from hm_securityranges where %s >= rangelowerip1 and %s <= rangeupperip1 and rangelowerip2 IS NULL and rangeupperip2 IS NULL order by rangepriorityid desc"), 
            String(helper.GetAddress1String(ipaddress)), String(helper.GetAddress1String(ipaddress)));

         if (!ReadObject(pSR, SQLCommand(sSQL)))
            return empty;

         return pSR;
      }
      else
      {
         // Read all IPv6 items.
         shared_ptr<SecurityRange> bestMatch;

         SQLCommand command(_T("select * from hm_securityranges where rangelowerip2 is not null order by rangepriorityid desc"));
         
         shared_ptr<DALRecordset> recordset = Application::Instance()->GetDBManager()->OpenRecordset(command);
         if (!recordset)
            return empty;

         while (!recordset->IsEOF())
         {
            shared_ptr<SecurityRange> securityRange = shared_ptr<SecurityRange>(new SecurityRange());

            if (ReadObject(securityRange, recordset) == false)
               return empty;

            if (ipaddress.WithinRange(securityRange->GetLowerIP(), securityRange->GetUpperIP()))
            {
               // This IP range matches the client. Does it have higher prio than the currently
               // matching?

               if (!bestMatch || securityRange->GetPriority() > bestMatch->GetPriority())
                  bestMatch = securityRange;
            }

            recordset->MoveNext();
         }

         return bestMatch;
      }


      
   }
开发者ID:Bill48105,项目名称:hmailserver,代码行数:56,代码来源:PersistentSecurityRange.cpp


示例5: ReadFile

         /// <summary>Reads all objects in the file</summary>
         /// <returns></returns>
         /// <exception cref="Logic::FileFormatException">File contains a syntax error</exception>
         /// <exception cref="Logic::IOException">An I/O error occurred</exception>
         TFilePtr  ReadFile(MainType t, GameVersion v)
         {
            // Skip comments
            while (ReadComment())
            {}

            // Parse header
            int  ver   = ReadInt(L"File version");
            int  count = ReadInt(L"Number of objects");

            // TODO: Validate version

            // Create file
            TFile<OBJ>* file = new TFile<OBJ>(count);
            TFilePtr output(file);

            // Parse objects
            for (int i = 0; i < count; ++i)
            {
               OBJ obj(t);

               // Read header/contents/footer
               ReadHeader(obj);
               ReadObject(obj, v);
               ReadFooter(obj);

               // Add to file
               file->Objects.push_back(obj);
            }

            // Return non-generic file
            return output;
         }
开发者ID:CyberSys,项目名称:X-Studio-2,代码行数:37,代码来源:TFileReader.hpp


示例6: io

static ZS_status_t
io()
{
	ZS_status_t ret;

	uint32_t wr_flags = 0;
	uint32_t i = 0;

	char key[256] = {'\0'};
	char value[256] = {'\0'};

	char *data = NULL;
	uint64_t len = 0;

	fprintf(fp,"****** io started ******\n");

	fprintf(fp,"****** Writing objects *******\n");
	for (i = 0; i < MAX_ITERATION; i++) {
		snprintf(key, 255, "%s_%d", "key", i);
		snprintf(value, 255, "%s_%d", "value", i);
		if(ZS_SUCCESS == (ret = WriteObject(cguid, key, value, wr_flags)))
		{
			fprintf(fp,"write sucessful: key%s\n", key);
		} else {
			fprintf(fp,"write failed: key=%s error=%s\n", key, ZSStrError(ret));
			goto exit_io;
		}

		/*
		 * Flush few object
		 */
		if (0 == (i % 2)) {
			if(ZS_SUCCESS == (ret = FlushObject(cguid, key)))
			{
				fprintf(fp,"flush sucessful: key%s\n", key);
			} else {
				fprintf(fp,"flush failed: key=%s error=%s\n", key, ZSStrError(ret));
				goto exit_io;
			}
		}
	}

	/*
	 * Issue read
	 */
	fprintf(fp,"****** Reading objects *******\n");

	for (i = 0; i < MAX_ITERATION; i++) {
		snprintf(key, 255, "%s_%d", "key", i);
		if(ZS_SUCCESS == (ret = ReadObject(cguid, key, &data, &len)))
		{
			fprintf(fp,"read successful: key=%s data=%s\n", key, data);
		} else {
			fprintf(fp,"read failed: read key= %s error=%s\n", key, ZSStrError(ret));
			goto exit_io;
		}
	}
exit_io:
	return ret;
}
开发者ID:AlfredChenxf,项目名称:zetascale,代码行数:60,代码来源:FDF_ShutdownIO.c


示例7: ReadToken

bool JsonString::ReadValue()  
{  
	Token token;  
	ReadToken(token);  
	bool successful = true;  

	switch(token.type_)  
	{  
	case tokenObjectBegin:  
		objnum++;  
		successful = ReadObject(token);  
		break;  
	case tokenArrayBegin:  
		successful = ReadArray(token);  
		break;  
	case tokenNumber:  
	case tokenString:  
	case tokenTrue:  
	case tokenFalse:  
	case tokenNull:  
		break;  
	default:  
		return false;  
	}  
	return successful;  
}  
开发者ID:Strongc,项目名称:myLib,代码行数:26,代码来源:JsonString.cpp


示例8: ReadMembers

void Stream::ReadMember(uint8* object, Type* pType)
{
	Type_type kind = pType->get_Kind();

	if (kind == type_class)
	{
		ReadMembers(object, static_cast<ClassType*>(pType));
	}
	else if (kind == type_pointer)
	{
		Type* pPointerTo = pType->GetPointerTo()->GetStripped();

		if (pPointerTo->get_Kind() == type_class)
		{
			*(void**)object = ReadObject();
		}
		else
		{
			ASSERT(0);
		}
	}
	else
	{
		Read(object, pType->get_sizeof());
	}
}
开发者ID:sigurdle,项目名称:FirstProject2,代码行数:26,代码来源:Remoting.cpp


示例9: Deserialize

    void Deserialize(T& t, const char* key)
    {
        Document& doc = m_jsutil.GetDocument();
        Value& jsonval = doc[key];

        ReadObject(t, jsonval);
    }
开发者ID:JerkWisdom,项目名称:zpublic,代码行数:7,代码来源:DeSerializer.hpp


示例10: selectCommand

void
PersistentRule::DeleteByAccountID(__int64 iAccountID)
{
    SQLCommand selectCommand("select * from hm_rules where ruleaccountid = @ACCOUNTID");
    selectCommand.AddParameter("@ACCOUNTID", iAccountID);

    shared_ptr<DALRecordset> pRS = Application::Instance()->GetDBManager()->OpenRecordset(selectCommand);
    if (!pRS)
        return ;

    bool bRetVal = false;
    while (!pRS->IsEOF())
    {
        // Create and read the fetch account.
        shared_ptr<Rule> oRule = shared_ptr<Rule>(new Rule);

        if (ReadObject(oRule, pRS))
        {
            // Delete this fetch account and all the
            // UID's connected to it.
            DeleteObject(oRule);
        }

        pRS->MoveNext();
    }

    // All the fetch accounts have been deleted.

}
开发者ID:jrallo,项目名称:hMailServer,代码行数:29,代码来源:PersistentRule.cpp


示例11: selectCommand

  bool
  PersistentDistributionList::ReadObject(std::shared_ptr<DistributionList> pDistList, __int64 iID)
  {
     SQLCommand selectCommand("select * from hm_distributionlists where distributionlistid = @LISTID");
     selectCommand.AddParameter("@LISTID", iID);
 
     return ReadObject(pDistList, selectCommand);
  }
开发者ID:AimaTeam-hehai,项目名称:hmailserver,代码行数:8,代码来源:PersistentDistributionList.cpp


示例12: command

   bool
   PersistentSecurityRange::ReadObject(shared_ptr<SecurityRange> pSR, __int64 lDBID)
   {
      SQLCommand command(_T("select * from hm_securityranges where rangeid = @RANGEID"));
      command.AddParameter("@RANGEID", lDBID);

      return ReadObject(pSR, command);
   }
开发者ID:Bill48105,项目名称:hmailserver,代码行数:8,代码来源:PersistentSecurityRange.cpp


示例13: GetLongValue

bool EditorConfig::GetLongValue(const wxString& name, long& value)
{
    SimpleLongValue data;
    if(ReadObject(name, &data)) {
        value = data.GetValue();
        return true;
    }
    return false;
}
开发者ID:gahr,项目名称:codelite,代码行数:9,代码来源:editor_config.cpp


示例14: _CHECK_IO

bool SQFunctionProto::Load(SQVM *v,SQUserPointer up,SQREADFUNC read)
{
	SQInteger i, nsize = _literals.size();
	SQObjectPtr o;
	_CHECK_IO(CheckTag(v,read,up,SQ_CLOSURESTREAM_PART));
	_CHECK_IO(ReadObject(v, up, read, _sourcename));
	_CHECK_IO(ReadObject(v, up, read, _name));
	_CHECK_IO(CheckTag(v,read,up,SQ_CLOSURESTREAM_PART));
	_CHECK_IO(SafeRead(v,read,up, &nsize, sizeof(nsize)));
	for(i = 0;i < nsize; i++){
		_CHECK_IO(ReadObject(v, up, read, o));
		_literals.push_back(o);
	}
	_CHECK_IO(CheckTag(v,read,up,SQ_CLOSURESTREAM_PART));
	_CHECK_IO(SafeRead(v,read,up, &nsize, sizeof(nsize)));
	for(i = 0; i < nsize; i++){
		_CHECK_IO(ReadObject(v, up, read, o));
		_parameters.push_back(o);
	}
	_CHECK_IO(CheckTag(v,read,up,SQ_CLOSURESTREAM_PART));
	_CHECK_IO(SafeRead(v,read,up,&nsize,sizeof(nsize)));
	for(i = 0; i < nsize; i++){
		SQUnsignedInteger type;
		SQObjectPtr name;
		_CHECK_IO(SafeRead(v,read,up, &type, sizeof(SQUnsignedInteger)));
		_CHECK_IO(ReadObject(v, up, read, o));
		_CHECK_IO(ReadObject(v, up, read, name));
		_outervalues.push_back(SQOuterVar(name,o, (SQOuterType)type));
	}
	_CHECK_IO(CheckTag(v,read,up,SQ_CLOSURESTREAM_PART));
	_CHECK_IO(SafeRead(v,read,up,&nsize, sizeof(nsize)));
	for(i = 0; i < nsize; i++){
		SQLocalVarInfo lvi;
		_CHECK_IO(ReadObject(v, up, read, lvi._name));
		_CHECK_IO(SafeRead(v,read,up, &lvi._pos, sizeof(SQUnsignedInteger)));
		_CHECK_IO(SafeRead(v,read,up, &lvi._start_op, sizeof(SQUnsignedInteger)));
		_CHECK_IO(SafeRead(v,read,up, &lvi._end_op, sizeof(SQUnsignedInteger)));
		_localvarinfos.push_back(lvi);
	}
	_CHECK_IO(CheckTag(v,read,up,SQ_CLOSURESTREAM_PART));
	_CHECK_IO(SafeRead(v,read,up, &nsize,sizeof(nsize)));
	_lineinfos.resize(nsize);
	_CHECK_IO(SafeRead(v,read,up, &_lineinfos[0], sizeof(SQLineInfo)*nsize));
	_CHECK_IO(CheckTag(v,read,up,SQ_CLOSURESTREAM_PART));
	_CHECK_IO(SafeRead(v,read,up, &nsize, sizeof(nsize)));
	_instructions.resize(nsize);
	_CHECK_IO(SafeRead(v,read,up, &_instructions[0], sizeof(SQInstruction)*nsize));
	_CHECK_IO(CheckTag(v,read,up,SQ_CLOSURESTREAM_PART));
	_CHECK_IO(SafeRead(v,read,up, &nsize, sizeof(nsize)));
	for(i = 0; i < nsize; i++){
		o = SQFunctionProto::Create();
		_CHECK_IO(_funcproto(o)->Load(v, up, read));
		_functions.push_back(o);
	}
	_CHECK_IO(SafeRead(v,read,up, &_stacksize, sizeof(_stacksize)));
	_CHECK_IO(SafeRead(v,read,up, &_bgenerator, sizeof(_bgenerator)));
	_CHECK_IO(SafeRead(v,read,up, &_varparams, sizeof(_varparams)));
	return true;
}
开发者ID:brettminnie,项目名称:BDBGame,代码行数:59,代码来源:sqobject.cpp


示例15: command

   bool
   PersistentAlias::ReadObject(std::shared_ptr<Alias> pAccount, __int64 ObjectID)
   {
      SQLCommand command("select * from hm_aliases where aliasid = @ALIASID");
      command.AddParameter("@ALIASID", ObjectID);

      bool bResult = ReadObject(pAccount, command);

      return bResult;
   }
开发者ID:AimaTeam-hehai,项目名称:hmailserver,代码行数:10,代码来源:PersistentAlias.cpp


示例16: command

   bool
   PersistentIncomingRelay::ReadObject(boost::shared_ptr<IncomingRelay> pSR, int lDBID)
   {
      SQLCommand command("select * from hm_incoming_relays where relayid = @RELAYID");
      command.AddParameter("@RELAYID", lDBID);

      bool bResult = ReadObject(pSR, command);

      return bResult;
   }
开发者ID:bogri5520,项目名称:hMailServer,代码行数:10,代码来源:PersistentIncomingRelay.cpp


示例17: command

bool
PersistentAccount::ReadObject(boost::shared_ptr<Account> pAccount, __int64 ObjectID)
{
    String sSQL = "select * from hm_accounts where accountid = @ACCOUNTID";

    SQLCommand command(sSQL);
    command.AddParameter("@ACCOUNTID", ObjectID);

    return ReadObject(pAccount, command);
}
开发者ID:nberardi,项目名称:hMailServer,代码行数:10,代码来源:PersistentAccount.cpp


示例18: FinishTag

// ****************************************************************************
// Method: AccessViewerSession::ReadConfigFile
//
// Purpose: 
//   Reads the session file and stores it internally.
//
// Arguments:
//   filename : The name of the session file to open.
//
// Returns:    A pointer to the root data node or 0.
//
// Programmer: Brad Whitlock
// Creation:   Mon Nov 13 15:44:26 PST 2006
//
// Modifications:
//   Brad Whitlock, Tue Apr 22 12:19:30 PDT 2008
//   Skip the XML tag.
//
// ****************************************************************************
DataNode *
AccessViewerSession::ReadConfigFile(std::istream& in)
{
    // Skip the XML tag
    FinishTag(in);

    root = new DataNode("root");
    ReadObject(in, root);

    return GetRootNode();
}
开发者ID:HarinarayanKrishnan,项目名称:VisIt28RC_Trunk,代码行数:30,代码来源:AccessViewerSession.C


示例19: ReadObject

   bool
   PersistentDistributionList::ReadObject(std::shared_ptr<DistributionList> pDistList, const String &sAddress)
   {
      SQLStatement statement;

      statement.SetStatementType(SQLStatement::STSelect);
      statement.SetTable("hm_distributionlists");
      statement.AddWhereClauseColumn("distributionlistaddress", sAddress);

      return ReadObject(pDistList, statement.GetCommand());
   }  
开发者ID:AimaTeam-hehai,项目名称:hmailserver,代码行数:11,代码来源:PersistentDistributionList.cpp


示例20: ReadObject

   bool
   PersistentAlias::ReadObject(std::shared_ptr<Alias> pAlias, const String & sName)
   {
      SQLStatement statement;

      statement.SetStatementType(SQLStatement::STSelect);
      statement.SetTable("hm_aliases");
      statement.AddWhereClauseColumn("aliasname", sName);

      return ReadObject(pAlias, statement.GetCommand());
   }
开发者ID:AimaTeam-hehai,项目名称:hmailserver,代码行数:11,代码来源:PersistentAlias.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ ReadParams函数代码示例发布时间:2022-05-30
下一篇:
C++ ReadOK函数代码示例发布时间: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