Changeset 2173 for code/branches/objecthierarchy2/src/core
- Timestamp:
- Nov 10, 2008, 2:06:09 AM (16 years ago)
- Location:
- code/branches/objecthierarchy2/src/core
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy2/src/core/BaseObject.cc
r2171 r2173 109 109 std::list<std::string> eventnames; 110 110 111 if (mode == XMLPort::LoadObject )111 if (mode == XMLPort::LoadObject || mode == XMLPort::ExpandObject) 112 112 { 113 113 for (ticpp::Iterator<ticpp::Element> child = events->FirstChildElement(false); child != child.end(); child++) -
code/branches/objecthierarchy2/src/core/CorePrereqs.h
r2087 r2173 69 69 { 70 70 LoadObject, 71 SaveObject 71 SaveObject, 72 ExpandObject 72 73 }; 73 74 } -
code/branches/objecthierarchy2/src/core/Template.cc
r2171 r2173 43 43 44 44 this->bIsLink_ = false; 45 this->bLoadDefaults_ = true; 45 46 this->bIsReturningXMLElement_ = false; 46 47 this->baseclassIdentifier_ = 0; … … 56 57 SUPER(Template, XMLPort, xmlelement, mode); 57 58 58 XMLPortParam(Template, "link", setLink, getLink, xmlelement, mode); 59 XMLPortParam(Template, "baseclass", setBaseclass, getBaseclass, xmlelement, mode); 59 XMLPortParam(Template, "link", setLink, getLink, xmlelement, mode); 60 XMLPortParam(Template, "baseclass", setBaseclass, getBaseclass, xmlelement, mode); 61 XMLPortParam(Template, "defaults", setLoadDefaults, getLoadDefaults, xmlelement, mode).defaultValues(true); 60 62 61 63 Element* element = xmlelement.FirstChildElement(false); … … 134 136 135 137 Element temp = ((TiXmlElement*)&this->getXMLElement()); 136 object->XMLPort(temp, XMLPort::LoadObject); 138 139 if (this->bLoadDefaults_) 140 object->XMLPort(temp, XMLPort::LoadObject); 141 else 142 object->XMLPort(temp, XMLPort::ExpandObject); 137 143 } 138 144 -
code/branches/objecthierarchy2/src/core/Template.h
r2171 r2173 53 53 { return this->link_; } 54 54 55 inline void setLoadDefaults(bool bLoadDefaults) 56 { this->bLoadDefaults_ = bLoadDefaults; } 57 inline bool getLoadDefaults() const 58 { return this->bLoadDefaults_; } 59 55 60 inline void setXMLElement(const TiXmlElement& xmlelement) 56 61 { this->xmlelement_ = xmlelement; } … … 75 80 Identifier* baseclassIdentifier_; 76 81 bool bIsLink_; 82 bool bLoadDefaults_; 77 83 mutable bool bIsReturningXMLElement_; 78 84 }; -
code/branches/objecthierarchy2/src/core/XMLPort.h
r2171 r2173 336 336 this->parseParams_.mode = mode; 337 337 338 if ( mode == XMLPort::LoadObject)338 if ((mode == XMLPort::LoadObject) || (mode == XMLPort::ExpandObject)) 339 339 { 340 340 try 341 341 { 342 342 std::string attribute = xmlelement.GetAttribute(this->paramname_); 343 if ((attribute.size() > 0) || ( this->loadexecutor_->allDefaultValuesSet()))343 if ((attribute.size() > 0) || ((mode != XMLPort::ExpandObject) && this->loadexecutor_->allDefaultValuesSet())) 344 344 { 345 345 COUT(5) << this->owner_->getLoaderIndentation() << "Loading parameter " << this->paramname_ << " in " << this->identifier_->getName() << " (objectname " << this->owner_->getName() << ")." << std::endl << this->owner_->getLoaderIndentation(); 346 if (this->loadexecutor_->parse(object, attribute, ",") )346 if (this->loadexecutor_->parse(object, attribute, ",") || (mode == XMLPort::ExpandObject)) 347 347 this->parseResult_ = PR_finished; 348 348 else 349 349 this->parseResult_ = PR_waiting_for_default_values; 350 350 } 351 else if (mode == XMLPort::ExpandObject) 352 this->parseResult_ = PR_finished; 351 353 else 352 354 this->parseResult_ = PR_waiting_for_default_values; … … 473 475 XMLPortObjectContainer& port(T* object, Element& xmlelement, XMLPort::Mode mode) 474 476 { 475 if ( mode == XMLPort::LoadObject)477 if ((mode == XMLPort::LoadObject) || (mode == XMLPort::ExpandObject)) 476 478 { 477 479 try
Note: See TracChangeset
for help on using the changeset viewer.