Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6517 in orxonox.OLD for trunk/src/lib/lang/base_object.cc


Ignore:
Timestamp:
Jan 17, 2006, 11:13:05 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: each BaseObject saves its TiXmlElement as a TiXmlNode*.
This will be good for
1.) sync in network
2.) saving entitites

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/lang/base_object.cc

    r6498 r6517  
    3232 * @param root the element to load from
    3333 */
    34 BaseObject::BaseObject(const TiXmlElement* root)
     34BaseObject::BaseObject()
    3535{
    3636  this->className = "BaseObject";
     
    3939  this->objectName = NULL;
    4040  this->classList = NULL;
    41 
    42   if (root)
    43     this->loadParams(root);
     41  this->xmlElem = NULL;
    4442
    4543//  ClassList::addToClassList(this, this->classID, "BaseObject");
     
    5654  if (this->objectName)
    5755    delete[] this->objectName;
     56  if (this->xmlElem != NULL)
     57    delete this->xmlElem;
    5858}
    5959
     
    6464void BaseObject::loadParams(const TiXmlElement* root)
    6565{
     66  // all loadParams should sometime arrive here.
     67  assert (root != NULL);
     68
     69  if (this->xmlElem != NULL)
     70    delete this->xmlElem;
     71  this->xmlElem = root->Clone();
    6672  // name setup
    6773  LoadParam(root, "name", this, BaseObject, setName)
Note: See TracChangeset for help on using the changeset viewer.