本文整理汇总了C++中XmlDeserializer::getUsePointerContentSerialization方法的典型用法代码示例。如果您正苦于以下问题:C++ XmlDeserializer::getUsePointerContentSerialization方法的具体用法?C++ XmlDeserializer::getUsePointerContentSerialization怎么用?C++ XmlDeserializer::getUsePointerContentSerialization使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XmlDeserializer
的用法示例。
在下文中一共展示了XmlDeserializer::getUsePointerContentSerialization方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: deserialize
void Processor::deserialize(XmlDeserializer& s) {
// meta data
metaDataContainer_.deserialize(s);
// misc settings
s.deserialize("name", id_);
guiName_ = id_;
// deserialize properties
PropertyOwner::deserialize(s);
// ---
// the following entities are static resources that should not be dynamically created by the serializer
//
const bool usePointerContentSerialization = s.getUsePointerContentSerialization();
s.setUsePointerContentSerialization(true);
// deserialize inports using a temporary map
map<string, Port*> inportMap;
for (vector<Port*>::const_iterator it = inports_.begin(); it != inports_.end(); ++it)
inportMap[(*it)->getID()] = *it;
try {
s.deserialize("Inports", inportMap, "Port", "name");
}
catch (XmlSerializationNoSuchDataException& /*e*/){
// port key missing => just ignore
s.removeLastError();
}
// deserialize outports using a temporary map
map<string, Port*> outportMap;
for (vector<Port*>::const_iterator it = outports_.begin(); it != outports_.end(); ++it)
outportMap[(*it)->getID()] = *it;
try {
s.deserialize("Outports", outportMap, "Port", "name");
}
catch (XmlSerializationNoSuchDataException& /*e*/){
// port key missing => just ignore
s.removeLastError();
}
// deserialize interaction handlers using a temporary map
map<string, InteractionHandler*> handlerMap;
const std::vector<InteractionHandler*>& handlers = getInteractionHandlers();
for (vector<InteractionHandler*>::const_iterator it = handlers.begin(); it != handlers.end(); ++it)
handlerMap[(*it)->getID()] = *it;
try {
s.deserialize("InteractionHandlers", handlerMap, "Handler", "name");
}
catch (XmlSerializationNoSuchDataException& /*e*/){
// interaction handler key missing => just ignore
s.removeLastError();
}
s.setUsePointerContentSerialization(usePointerContentSerialization);
// --- static resources end ---
firstProcessAfterDeserialization_ = true;
}
示例2: deserialize
void PropertyVector::deserialize(XmlDeserializer& s) {
Property::deserialize(s);
// deserialize the properties of the processor
typedef std::map<std::string, Property*> PropertyMapType;
PropertyMapType propertyMap;
for (std::vector<Property*>::const_iterator it = properties_.begin(); it != properties_.end(); ++it) {
propertyMap[(*it)->getID()] = *it;
}
const bool usePointerContentSerialization = s.getUsePointerContentSerialization();
s.setUsePointerContentSerialization(true);
s.deserialize("ElementProperties", propertyMap, "Property", "name");
s.setUsePointerContentSerialization(usePointerContentSerialization);
}
示例3: deserialize
void PropertyOwner::deserialize(XmlDeserializer& s) {
// create temporary property map for deserialization
std::map<std::string, Property*> propertyMap;
for (std::vector<Property*>::const_iterator it = properties_.begin(); it != properties_.end(); ++it)
propertyMap[(*it)->getID()] = *it;
// deserialize properties
const bool usePointerContentSerialization = s.getUsePointerContentSerialization();
s.setUsePointerContentSerialization(true);
try {
s.deserialize("Properties", propertyMap, "Property", "name");
}
catch (SerializationException& e) {
LWARNING(e.what());
}
s.setUsePointerContentSerialization(usePointerContentSerialization);
}