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


C++ ISerializer类代码示例

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


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

示例1: Serialize

void CCmpPathfinder::Serialize(ISerializer& serialize)
{
    SerializeVector<SerializeLongRequest>()(serialize, "long requests", m_AsyncLongPathRequests);
    SerializeVector<SerializeShortRequest>()(serialize, "short requests", m_AsyncShortPathRequests);
    serialize.NumberU32_Unbounded("next ticket", m_NextAsyncTicket);
    serialize.NumberU16_Unbounded("same turn moves count", m_SameTurnMovesCount);
}
开发者ID:righnatios,项目名称:0ad,代码行数:7,代码来源:CCmpPathfinder.cpp

示例2: writeScene

void Controller::writeScene(int plugin, const QString & filename)
{
    ISerializer * s;
    s = pl->getWriter(plugin, filename);
//    s = new WriterXML(filename);
    World * w = model->setScene();
    s->sWorld(w);
    delete s;
}
开发者ID:abashkirtsev,项目名称:RayTracer,代码行数:9,代码来源:controller.cpp

示例3: write_worker

 virtual void write_worker(IWork *worker) override
 {
    ISerializable *object = dynamic_cast<ISerializable*>(worker);
    if (object != nullptr)
    {
       ISerializer* serializer = dynamic_cast<ISerializer*>(this);
       serializer->write_string(typeid(*worker).raw_name());
       object->serialize(serializer);
    }
 }
开发者ID:JuanDValenciano,项目名称:Beginning-Cpp-Programming,代码行数:10,代码来源:team_builder.cpp

示例4: serialize

void CompoundCommand::serialize(ISerializer& serializer) const
{
	serializer.serialize(getId());
	serializer.serialize(getSubCommands().size());
	for (auto& c : getSubCommands())
	{
		serializer.serialize(c.first);
	}
	getMacroObject().getBase<MacroObject>()->serialize(serializer);
}
开发者ID:Aidanboneham,项目名称:wgtf,代码行数:10,代码来源:compound_command.cpp

示例5: Serialize

	virtual void Serialize(ISerializer& serialize)
	{
		// TODO: store the actor name, if !debug and it differs from the template

		if (serialize.IsDebug())
		{
			serialize.String("actor", m_ActorName, 0, 256);
		}

		SerializeCommon(serialize);
	}
开发者ID:stonefruit,项目名称:0ad,代码行数:11,代码来源:CCmpVisualActor.cpp

示例6: saveRedoData

void RPURU::saveRedoData(ISerializer& serializer, const ReflectedPropertyUndoRedoHelper& helper)
{
	const char* propertyHeaderTag = RPURU::getPropertyHeaderTag();
	// write header
	serializer.serialize(propertyHeaderTag);
	// write root object id
	serializer.serialize(helper.objectId_.toString());
	// write property fullPath
	serializer.serialize(helper.path_);
	// write value
	serializer.serialize(helper.postValue_);
}
开发者ID:Aidanboneham,项目名称:wgtf,代码行数:12,代码来源:reflectedproperty_undoredo_helper.cpp

示例7: Serialize

	virtual void Serialize(ISerializer& serialize)
	{
		JSContext* cx = GetSimContext().GetScriptInterface().GetContext();
		JSAutoRequest rq(cx);

		serialize.NumberU32_Unbounded("num commands", (u32)m_LocalQueue.size());
		for (size_t i = 0; i < m_LocalQueue.size(); ++i)
		{
			serialize.NumberI32_Unbounded("player", m_LocalQueue[i].player);
			serialize.ScriptVal("data", &m_LocalQueue[i].data);
		}
	}
开发者ID:righnatios,项目名称:0ad,代码行数:12,代码来源:CCmpCommandQueue.cpp

示例8: serialize

void KeysStorage::serialize(ISerializer& serializer, const std::string& name) {
  serializer.beginObject(name);

  serializer(creationTimestamp, "creation_timestamp");

  serializer(spendPublicKey, "spend_public_key");
  serializer(spendSecretKey, "spend_secret_key");

  serializer(viewPublicKey, "view_public_key");
  serializer(viewSecretKey, "view_secret_key");

  serializer.endObject();
}
开发者ID:RAY-official,项目名称:catalyst,代码行数:13,代码来源:KeysStorage.cpp

示例9: deserialize

void CompoundCommand::deserialize(ISerializer& serializer)
{
	size_t size = 0;
	serializer.deserialize(size);

	std::string id;
	for (size_t i = 0; i < size; ++i)
	{
		serializer.deserialize(id);
		addCommand(id.c_str(), ObjectHandle());
	}
	getMacroObject().getBase<MacroObject>()->deserialize(serializer);
}
开发者ID:Aidanboneham,项目名称:wgtf,代码行数:13,代码来源:compound_command.cpp

示例10: serialize

void serialize(TransactionOutputTarget& output, ISerializer& serializer) {
  if (serializer.type() == ISerializer::OUTPUT) {
    BinaryVariantTagGetter tagGetter;
    uint8_t tag = boost::apply_visitor(tagGetter, output);
    serializer.binary(&tag, sizeof(tag), "type");

    VariantSerializer visitor(serializer, "data");
    boost::apply_visitor(visitor, output);
  } else {
    uint8_t tag;
    serializer.binary(&tag, sizeof(tag), "type");

    getVariantValue(serializer, tag, output);
  }
}
开发者ID:dinastyoffreedom,项目名称:dinastycoin,代码行数:15,代码来源:CryptoNoteSerialization.cpp

示例11: s

bool WalletUnconfirmedTransactions::serialize(ISerializer& s) {
  s(m_unconfirmedTxs, "transactions");
  if (s.type() == ISerializer::INPUT) {
    collectUsedOutputs();
  }
  return true;
}
开发者ID:bitumencoin,项目名称:valentinecoinwallet,代码行数:7,代码来源:WalletUnconfirmedTransactions.cpp

示例12: serialize

void serialize(const char* file)
{
   project_manager pm("Agnes");
   pm.add_team_member(new cpp_developer("Bill"));
   pm.add_team_member(new cpp_developer("Chris"));
   pm.add_team_member(new cpp_developer("Dave"));
   pm.add_team_member(new database_admin("Edith"));
   print_team(&pm);

   cout << endl << "writing to " << file << endl;

   file_writer writer(file);
   ISerializer* ser = dynamic_cast<ISerializer*>(&writer);
   ser->write_worker(&pm);
   writer.close();
}
开发者ID:JuanDValenciano,项目名称:Beginning-Cpp-Programming,代码行数:16,代码来源:team_builder.cpp

示例13: serialize

 void BlockIndex::serialize(ISerializer& s) {
   if (s.type() == ISerializer::INPUT) {
     readSequence<Crypto::Hash>(std::back_inserter(m_container), "index", s);
   } else {
     writeSequence<Crypto::Hash>(m_container.begin(), m_container.end(), "index", s);
   }
 }
开发者ID:niekjex,项目名称:BankCoin,代码行数:7,代码来源:BlockIndex.cpp

示例14: serialize

	void serialize(ISerializer& serializer) override
	{
		serializer.write("count", m_prefabs.size());

		for (PrefabResource* res : m_resources)
		{
			serializer.write("resource", res->getPath().c_str());
		}
		serializer.write("resource", "");

		for (int i = 0; i < m_instances.size(); ++i)
		{
			u64 prefab = m_instances.getKey(i);
			if ((prefab & 0xffffFFFF) != prefab) continue;
			Entity entity = m_instances.at(i);
			while(entity.isValid())
			{
				serializer.write("prefab", (u32)prefab);
				serializer.write("pos", m_universe->getPosition(entity));
				serializer.write("rot", m_universe->getRotation(entity));
				serializer.write("scale", m_universe->getScale(entity));
				entity = m_prefabs[entity.index].next;
			}
		}
		serializer.write("prefab", (u32)0);
	}
开发者ID:nem0,项目名称:LumixEngine,代码行数:26,代码来源:prefab_system.cpp

示例15: item

bool IObjectMapPropertyType<KeyType, ValueType>::DoSerialize(
	BidirectionalSerializer &bidi, KeyType &key, ValueType &value)
{
	bool result = true;
	ISerializer *serializer = bidi.Serializer();

	Command item(Command::EITEM);

	Command attribute(Command::EATTRIBUTE, "key");

	if(false == serializer->BeginCommand(item))
		result = false;
	if(false == serializer->BeginCommand(attribute))
		result = false;

	serializer->Hint( "map_key" );
	bidi | key;
	if(false == serializer->EndCommand(attribute))
		result = false;
		
	serializer->Hint( "map_value" );
	bidi | value;
	if(false == serializer->EndCommand(item))
		result = false;

	if(false == result)
		bidi.Fail();

	return bidi.Succeeded();
}
开发者ID:andemi02,项目名称:orkid,代码行数:30,代码来源:IObjectMapPropertyType.hpp


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