本文整理汇总了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);
}
示例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;
}
示例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);
}
}
示例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);
}
示例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);
}
示例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_);
}
示例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);
}
}
示例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();
}
示例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);
}
示例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);
}
}
示例11: s
bool WalletUnconfirmedTransactions::serialize(ISerializer& s) {
s(m_unconfirmedTxs, "transactions");
if (s.type() == ISerializer::INPUT) {
collectUsedOutputs();
}
return true;
}
示例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();
}
示例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);
}
}
示例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);
}
示例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();
}