void PropertyOwner::deserialize(IvwDeserializer& d) { // This is for finding renamed composites, and moving old properties to new composites. NodeVersionConverter tvc(this, &PropertyOwner::findPropsForComposites); d.convertVersion(&tvc); std::vector<std::string> identifers; for (Property* p : properties_) identifers.push_back(p->getIdentifier()); StandardIdentifier<Property> propertyIdentifier; d.deserialize("Properties", properties_, "Property", propertyIdentifier); for (size_t i = 0; i < properties_.size(); ++i) { Property* p = properties_[i]; auto it = std::find_if(identifers.begin(), identifers.end(), [&p](const std::string& id) -> bool { return id == p->getIdentifier(); }); // Property is created in the de-serialization, assume ownership if (it == identifers.end()) { notifyObserversWillAddProperty(p, i); p->setOwner(this); if (dynamic_cast<EventProperty*>(p)) { eventProperties_.push_back(static_cast<EventProperty*>(p)); } if (dynamic_cast<CompositeProperty*>(p)) { compositeProperties_.push_back(static_cast<CompositeProperty*>(p)); } ownedProperties_.emplace_back(p); notifyObserversDidAddProperty(p, i); } } }
IvwDeserializer::IvwDeserializer(IvwDeserializer& s, bool allowReference) : IvwSerializeBase(s.getFileName(), allowReference) { try { doc_.LoadFile(); rootElement_ = doc_.FirstChildElement(); storeReferences(rootElement_); } catch (TxException& e) { throw AbortException(e.what(), IvwContext); } }
void TrackballAction::deserialize(IvwDeserializer& d) { d.deserialize("action", name_); for (int i = 0; i < COUNT; ++i) { if (actionNames_[i] == name_) { action_ = i; break; } } }
void Processor::deserialize(IvwDeserializer& d) { std::string identifier; d.deserialize("identifier", identifier, true); setIdentifier(identifier); // Need to use setIdentifier to make sure we get a unique id. d.deserialize("InteractonHandlers", interactionHandlers_, "InteractionHandler"); StandardIdentifier<Port> inportIdentifier; d.deserialize("InPorts", inports_, "InPort", inportIdentifier); d.deserialize("OutPorts", outports_, "OutPort", inportIdentifier); for (auto elem : inports_) { elem->setProcessor(this); } for (auto elem : outports_) { elem->setProcessor(this); } PropertyOwner::deserialize(d); MetaDataOwner::deserialize(d); }
void Port::deserialize(IvwDeserializer& d) { d.deserialize("identifier", identifier_, true); }
virtual void deserialize(IvwDeserializer& d) { d.deserialize("classVariable", value_); }
void MouseEvent::deserialize(IvwDeserializer& d) { InteractionEvent::deserialize(d); d.deserialize("button", button_); d.deserialize("state", state_); d.deserialize("wheelOrientation", wheelOrientation_); }
void CompositeProperty::deserialize(IvwDeserializer& d){ Property::deserialize(d); PropertyOwner::deserialize(d); d.deserialize("collapsed", collapsed_); }
void PropertySemantics::deserialize(IvwDeserializer& d) { d.deserialize("semantics", semantic_, true); }