DECLARE_EXPORT void SolverMRP::endElement(XMLInput& pIn, const Attribute& pAttr, const DataElement& pElement) { if (pAttr.isA(Tags::tag_constraints)) setConstraints(pElement.getInt()); else if (pAttr.isA(Tags::tag_autocommit)) setAutocommit(pElement.getBool()); else if (pAttr.isA(Tags::tag_userexit_flow)) setUserExitFlow(pElement.getString()); else if (pAttr.isA(Tags::tag_userexit_demand)) setUserExitDemand(pElement.getString()); else if (pAttr.isA(Tags::tag_userexit_buffer)) setUserExitBuffer(pElement.getString()); else if (pAttr.isA(Tags::tag_userexit_resource)) setUserExitResource(pElement.getString()); else if (pAttr.isA(Tags::tag_userexit_operation)) setUserExitOperation(pElement.getString()); else if (pAttr.isA(Tags::tag_plantype)) setPlanType(pElement.getInt()); // Less common parameters else if (pAttr.isA(tag_iterationthreshold)) setIterationThreshold(pElement.getDouble()); else if (pAttr.isA(tag_iterationaccuracy)) setIterationAccuracy(pElement.getDouble()); else if (pAttr.isA(tag_lazydelay)) setLazyDelay(pElement.getTimeperiod()); // Default parameters else Solver::endElement(pIn, pAttr, pElement); }
void HasDescription::endElement(DataInput& pIn, const Attribute& pAttr, const DataElement& pElement) { if (pAttr.isA(Tags::tag_category)) setCategory(pElement.getString()); else if (pAttr.isA(Tags::tag_subcategory)) setSubCategory(pElement.getString()); else if (pAttr.isA(Tags::tag_description)) setDescription(pElement.getString()); else if (pAttr.isA(Tags::tag_source)) setSource(pElement.getString()); }
DECLARE_EXPORT void SetupMatrix::Rule::endElement (XMLInput& pIn, const Attribute& pAttr, const DataElement& pElement) { if (pAttr.isA(Tags::tag_priority)) setPriority(pElement.getInt()); else if (pAttr.isA(Tags::tag_fromsetup)) setFromSetup(pElement.getString()); else if (pAttr.isA(Tags::tag_tosetup)) setToSetup(pElement.getString()); else if (pAttr.isA(Tags::tag_duration)) setDuration(pElement.getTimeperiod()); else if (pAttr.isA(Tags::tag_cost)) setCost(pElement.getDouble()); }
DECLARE_EXPORT void Solver::endElement(XMLInput& pIn, const Attribute& pAttr, const DataElement& pElement) { if (pAttr.isA(Tags::tag_loglevel)) { int i = pElement.getInt(); if (i<0 || i>USHRT_MAX) throw DataException("Invalid log level" + pElement.getString()); setLogLevel(i); } }
DECLARE_EXPORT void ResourceSkill::endElement (XMLInput& pIn, const Attribute& pAttr, const DataElement& pElement) { if (pAttr.isA (Tags::tag_resource)) { Resource *r = dynamic_cast<Resource*>(pIn.getPreviousObject()); if (r) setResource(r); else throw LogicException("Incorrect object type during read operation"); } else if (pAttr.isA (Tags::tag_skill)) { Skill *s = dynamic_cast<Skill*>(pIn.getPreviousObject()); if (s) setSkill(s); else throw LogicException("Incorrect object type during read operation"); } else if (pAttr.isA(Tags::tag_priority)) setPriority(pElement.getInt()); else if (pAttr.isA(Tags::tag_effective_end)) setEffectiveEnd(pElement.getDate()); else if (pAttr.isA(Tags::tag_effective_start)) setEffectiveStart(pElement.getDate()); else if (pAttr.isA(Tags::tag_action)) { delete static_cast<Action*>(pIn.getUserArea()); pIn.setUserArea( new Action(MetaClass::decodeAction(pElement.getString().c_str())) ); } else if (pIn.isObjectEnd()) { // The resourceskill data is now all read in. See if it makes sense now... Action a = pIn.getUserArea() ? *static_cast<Action*>(pIn.getUserArea()) : ADD_CHANGE; delete static_cast<Action*>(pIn.getUserArea()); try { validate(a); } catch (...) { delete this; throw; } } }
DECLARE_EXPORT void Skill::endElement (XMLInput& pIn, const Attribute& pAttr, const DataElement& pElement) { if (pAttr.isA(Tags::tag_source)) setSource(pElement.getString()); }