Changeset 2485 for code/branches/presentation/src/core/XMLPort.h
- Timestamp:
- Dec 16, 2008, 6:01:13 PM (16 years ago)
- Location:
- code/branches/presentation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation
-
code/branches/presentation/src/core/XMLPort.h
r2459 r2485 43 43 #include "CorePrereqs.h" 44 44 45 #include <cassert> 45 46 #include "util/Debug.h" 46 47 #include "util/Exception.h" … … 369 370 } 370 371 372 ~XMLPortClassParamContainer() 373 { 374 assert(this->loadexecutor_); 375 delete this->loadexecutor_; 376 if (this->saveexecutor_) 377 delete this->saveexecutor_; 378 } 379 371 380 XMLPortParamContainer& port(BaseObject* owner, T* object, Element& xmlelement, XMLPort::Mode mode) 372 381 { … … 376 385 this->parseParams_.mode = mode; 377 386 378 if ( mode == XMLPort::LoadObject)387 if ((mode == XMLPort::LoadObject) || (mode == XMLPort::ExpandObject)) 379 388 { 380 389 try 381 390 { 382 391 std::string attribute = xmlelement.GetAttribute(this->paramname_); 383 if ((attribute.size() > 0) || ( this->loadexecutor_->allDefaultValuesSet()))392 if ((attribute.size() > 0) || ((mode != XMLPort::ExpandObject) && this->loadexecutor_->allDefaultValuesSet())) 384 393 { 385 394 COUT(5) << this->owner_->getLoaderIndentation() << "Loading parameter " << this->paramname_ << " in " << this->identifier_->getName() << " (objectname " << this->owner_->getName() << ")." << std::endl << this->owner_->getLoaderIndentation(); 386 if (this->loadexecutor_->parse(object, attribute, ",") )395 if (this->loadexecutor_->parse(object, attribute, ",") || (mode == XMLPort::ExpandObject)) 387 396 this->parseResult_ = PR_finished; 388 397 else 389 398 this->parseResult_ = PR_waiting_for_default_values; 390 399 } 400 else if (mode == XMLPort::ExpandObject) 401 this->parseResult_ = PR_finished; 391 402 else 392 403 this->parseResult_ = PR_waiting_for_default_values; … … 511 522 } 512 523 524 ~XMLPortClassObjectContainer() 525 { 526 assert(this->loadexecutor_); 527 delete this->loadexecutor_; 528 if (this->saveexecutor_) 529 delete this->saveexecutor_; 530 } 531 513 532 XMLPortObjectContainer& port(T* object, Element& xmlelement, XMLPort::Mode mode) 514 533 { 515 if ( mode == XMLPort::LoadObject)534 if ((mode == XMLPort::LoadObject) || (mode == XMLPort::ExpandObject)) 516 535 { 517 536 try
Note: See TracChangeset
for help on using the changeset viewer.