Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4436 in orxonox.OLD for orxonox/trunk/src/lib/lang


Ignore:
Timestamp:
Jun 1, 2005, 12:50:07 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: baseObject now implements loading of objectNames

Location:
orxonox/trunk/src/lib/lang
Files:
2 edited

Legend:

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

    r4435 r4436  
    1818
    1919#include "base_object.h"
    20 #include "stdincl.h"
    21 
     20#include "load_param.h"
    2221
    2322using namespace std;
     
    2524
    2625/**
    27    \brief standard constructor
     26   \brief sets the name from a LoadXML-Element
     27   \param root the element to load from
    2828*/
    29 BaseObject::BaseObject ()
     29BaseObject::BaseObject(const TiXmlElement* root)
    3030{
    3131  this->className = NULL;
     
    3434
    3535  this->objectName = NULL;
     36
     37  if (root)
     38    this->loadParams(root);
    3639}
    37 
    3840
    3941/**
     
    4749}
    4850
     51/**
     52   \brief loads parameters
     53   \param root the element to load from
     54*/
     55void BaseObject::loadParams(const TiXmlElement* root)
     56{
     57  // name setup
     58  LoadParam<BaseObject>(root, "name", this, &BaseObject::setName)
     59    .describe("the name of the Object at hand");
     60}
    4961
    5062/**
  • orxonox/trunk/src/lib/lang/base_object.h

    r4435 r4436  
    99
    1010#include "class_list.h"
     11#ifndef NULL
     12#define NULL 0x0
     13#endif
     14
     15class TiXmlElement;
    1116
    1217//! A class all other classes are derived from
     
    1419
    1520 public:
    16   BaseObject ();
     21  BaseObject (const TiXmlElement* root = NULL);
    1722  virtual ~BaseObject ();
     23
     24  void loadParams(const TiXmlElement* root);
    1825
    1926  void setClassID(int id);
Note: See TracChangeset for help on using the changeset viewer.