本文整理汇总了C++中ISerializer::serialize方法的典型用法代码示例。如果您正苦于以下问题:C++ ISerializer::serialize方法的具体用法?C++ ISerializer::serialize怎么用?C++ ISerializer::serialize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISerializer
的用法示例。
在下文中一共展示了ISerializer::serialize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
示例2: 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_);
}
示例3: serializeDefinitions
//==============================================================================
bool ContextDefinitionManager::serializeDefinitions(ISerializer& serializer)
{
std::set<const IClassDefinition*> genericDefs;
for (auto& definition : contextDefinitions_)
{
if (definition->isGeneric())
{
genericDefs.insert(definition);
}
}
serializer.serialize(genericDefs.size());
for (auto& classDef : genericDefs)
{
TF_ASSERT(classDef);
serializer.serialize(classDef->getName());
const auto & parentNames = classDef->getParentNames();
if (parentNames.size() == 0)
{
serializer.serialize("");
}
else
{
bool first = true;
for (const auto & parentName : parentNames )
{
if (first)
{
serializer.serialize(parentName);
first = false;
}
else
{
serializer.serialize("|");
serializer.serialize(parentName);
}
}
}
// write all properties
std::vector<IBasePropertyPtr> baseProps;
for (PropertyIterator pi = classDef->directProperties().begin(), end = classDef->directProperties().end();
(pi != end); ++pi)
{
auto metaData = findFirstMetaData<MetaNoSerializationObj>(*(*pi), *this);
if (metaData != nullptr)
{
continue;
}
baseProps.push_back(*pi);
}
size_t count = baseProps.size();
serializer.serialize(count);
for (auto baseProp : baseProps)
{
TF_ASSERT(baseProp);
serializer.serialize(baseProp->getName());
auto metaType = MetaType::find(baseProp->getType());
if (metaType != nullptr)
{
serializer.serialize(metaType->name());
}
else
{
serializer.serialize(baseProp->getType().getName());
}
uint32_t flags = 0;
flags |= baseProp->isCollection() ? ContextDefinitionManagerDetails::IS_COLLECTION : 0;
serializer.serialize(flags);
}
}
genericDefs.clear();
return true;
}