Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4591 in orxonox.OLD for orxonox/trunk/src/lib


Ignore:
Timestamp:
Jun 10, 2005, 6:21:25 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: restructure class_list.h so it supports inheritance-diagram

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

Legend:

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

    r4470 r4591  
    11
    22
    3 /* 
     3/*
    44   orxonox - the future of 3D-vertical-scrollers
    55
     
    3030{
    3131  this->className = NULL;
    32   this->id = -1;
     32  this->classID = CL_BASE_OBJECT;
    3333  this->finalized = false;
    3434
     
    4242   \brief standard deconstructor
    4343*/
    44 BaseObject::~BaseObject () 
     44BaseObject::~BaseObject ()
    4545{
    4646  //  delete []this->className;
     
    5757  // name setup
    5858  LoadParam<BaseObject>(root, "name", this, &BaseObject::setName)
    59     .describe("the name of the Object at hand");
     59  .describe("the name of the Object at hand");
    6060}
    6161
     
    6565   \param className the class name
    6666*/
    67 void BaseObject::setClassID(int id, const char* className)
     67void BaseObject::setClassID(long classID, const char* className)
    6868{
    69   this->id = id;
    70   this->className = className;
     69  this->setClassID(classID);
     70  this->setClassName(className);
    7171}
    7272
     
    7676   \param id a number for the class from class_list.h enumeration
    7777*/
    78 void BaseObject::setClassID (int id)
     78void BaseObject::setClassID (long classID)
    7979{
    80   this->id = id;
     80  this->classID = classID;
    8181}
    8282
     
    106106
    107107/**
    108   \brief set the name of the node
    109 
    110   for debug purposes realy usefull, not used to work properly
    111 */
    112 void BaseObject::setName (const char* newName)
     108  \brief set the name of the Object
     109 */
     110void BaseObject::setName (const char* objectName)
    113111{
    114112  if (this->objectName)
    115113    delete []this->objectName;
    116   if (newName)
     114  if (objectName)
    117115    {
    118       this->objectName = new char[strlen(newName)+1];
    119       strcpy(this->objectName, newName);
     116      this->objectName = new char[strlen(objectName)+1];
     117      strcpy(this->objectName, objectName);
    120118    }
    121   else 
     119  else
    122120    this->objectName = NULL;
    123121}
  • orxonox/trunk/src/lib/lang/base_object.h

    r4539 r4591  
    1 /*! 
     1/*!
    22    \file base_object.h
    33    \brief Definition of the base object class.
     
    3030  void setName (const char* newName);
    3131  /** \brief returns the Name of this Object */
    32   const char* getName (void)const { return this->objectName; };
     32  inline const char* getName (void)const { return this->objectName; };
    3333
    3434  /** \returns the className of the corresponding Object */
    35   inline const char* getClassName(void) const { return this->className;};
     35  inline const char* getClassName(void) const { return this->className; };
    3636  /** \returns the classID of the corresponding Object */
    37   inline int getClassID(void) const { return this->id; }
     37  inline int getClassID(void) const { return this->classID; }
    3838
    3939  //  bool isA (char* className);
     
    4444
    4545 protected:
    46   void setClassID(int id);
     46  void setClassID(long classID);
    4747  void setClassName(const char* className);
    48   void setClassID(int id, const char* className);
     48  void setClassID(long classID, const char* className);
    4949
    5050  /** \brief this finalizes an object and makes it ready to be garbage collected */
     
    5252
    5353 private:
    54   const char*    className;        //!< the name of the class
    55   int            id;               //!< this is the id from the class_list.h enumeration
     54  const char*    className;        //!< the name of the class
     55  long           classID;          //!< this is the id from the class_list.h enumeration
     56  char*          objectName;       //!< The name of this object
     57
    5658  bool           finalized;        //!< is true if the object is ready to be garbage collected
    57 
    58   char*          objectName;       //!< The name of this object               
    5959};
    6060
Note: See TracChangeset for help on using the changeset viewer.