Brief description of class still missing. More...
#include <XMLDinverGui.h>
Protected Member Functions | |
XMLMember | xml_member (XML_MEMBER_ARGS) |
void | xml_writeChildren (XML_WRITECHILDREN_ARGS) const |
Brief description of class still missing.
Full description of class still missing
XMLMember XMLDinverGui::xml_member | ( | XML_MEMBER_ARGS | ) | [protected, virtual] |
Re-implement this function to offer XML restore (children and properties) support to your class.
From tag and map (with contains the attibute value) return a unique identifier under the format of a XMLMember. XMLMember is initialized with 3 types of contructors:
Map of attributes can be inspected in this way (can be achived also in xml_setProperty()):
static const QString tmp("childrenName"); XMLRestoreAttributeIterator it=map.find(tmp); if(it!=map.end()) { // found attribute "childrenName" }
If the map of attributes is not used:
Q_UNUSED(attributes); if(tag=="x1") return XMLMember(0); else if(tag=="y1") return XMLMember(1); else if(tag=="x2") return XMLMember(2); else if(tag=="y2") return XMLMember(3); else return XMLMember(XMLMember::Unknown);
Arithmetic operations + and - apply to XMLMember to avoid confusion of property id numbers between inherited objects. Offset 3 corresponds to the number of properties defined in this object.
if(tag=="anInteger") return XMLMember(0); else if(tag=="aString") return XMLMember(1); else if(tag=="aDouble") return XMLMember(2); return AbstractLine::xml_member(tag, attributes, context)+3;
For the arguments of this function use Macro XML_MEMBER_ARGS.
Reimplemented from DinverCore::XMLDinver.
References DinverCore::XMLDinverContext::all(), dinverGui, QGpCoreTools::endl(), InversionThread::setForward(), QGpCoreTools::tr(), and TRACE.
{ TRACE; Q_UNUSED(attributes) XMLDinverContext * dinverContext=static_cast<XMLDinverContext *>(context); if(tag=="InversionThread") { if(dinverContext->all()) { InversionThread * t=new InversionThread; dinverGui->addThread(t); StreamRedirection sr(&App::stream(t)); AbstractForward * f=dinverGui->plugin()->createForward(); if(f) { t->setForward(f); return XMLMember(t); } else { App::stream() << tr("Error creating a new forward object, skipping run") << endl; return XMLMember(XMLMember::Skip); } } else { return XMLMember(XMLMember::Skip); } } else return XMLDinver::xml_member(tag, attributes, context); }
void XMLDinverGui::xml_writeChildren | ( | XML_WRITECHILDREN_ARGS | ) | const [protected, virtual] |
Reimplemented from DinverCore::XMLDinver.
References DinverCore::XMLDinverContext::all(), dinverGui, and TRACE.
{ TRACE; XMLDinver::xml_writeChildren(s, context); XMLDinverContext * dinverContext=static_cast<XMLDinverContext *>(context); if(dinverContext->all()) { ThreadList ts=dinverGui->threads(); for(ThreadList::const_iterator it=ts.begin();it!=ts.end();++it) { (*it)->xml_save(s, context); } } }