本文整理汇总了C++中Serializable::toXml方法的典型用法代码示例。如果您正苦于以下问题:C++ Serializable::toXml方法的具体用法?C++ Serializable::toXml怎么用?C++ Serializable::toXml使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Serializable
的用法示例。
在下文中一共展示了Serializable::toXml方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: serialize
bool RangeProfilePlotManager::serialize(SessionItemSerializer& serializer) const
{
XMLWriter writer("RangeProfilePlotManager");
writer.addAttr("viewId", mpView->getId());
#pragma message(__FILE__ "(" STRING(__LINE__) ") : warning : We should be able to save the plot's session id and restore " \
"using that but the PlotWidget is not really part of the session. The following code is a work around and should be changed " \
"when OPTICKS-542 is implemented. (tclarke)")
writer.pushAddPoint(writer.addElement("plot"));
Serializable* pPlotSer = dynamic_cast<Serializable*>(mpPlot); // The imp side is serializable
VERIFY(pPlotSer);
if (!pPlotSer->toXml(&writer))
{
return false;
}
writer.popAddPoint();
writer.pushAddPoint(writer.addElement("plotView"));
Serializable* pPlotViewSer = dynamic_cast<Serializable*>(mpView); // The imp side is serializable
VERIFY(pPlotViewSer);
if (!pPlotViewSer->toXml(&writer))
{
return false;
}
writer.popAddPoint();
for (std::map<Signature*, std::string>::const_iterator sig = mSigPointSets.begin();
sig != mSigPointSets.end(); ++sig)
{
writer.pushAddPoint(writer.addElement("signature"));
writer.addAttr("sigId", sig->first->getId());
writer.addAttr("pointSetName", sig->second);
writer.popAddPoint();
}
if (!serializer.serialize(writer))
{
return false;
}
serializer.endBlock();
return DockWindowShell::serialize(serializer);
}