Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7221 in orxonox.OLD for trunk/src/lib/lang/base_object.h


Ignore:
Timestamp:
Mar 15, 2006, 3:10:45 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the std-branche back, it runs on windows and Linux

svn merge https://svn.orxonox.net/orxonox/branches/std . -r7202:HEAD

File:
1 edited

Legend:

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

    r6587 r7221  
    1616#endif
    1717
     18#include <string>
    1819#include "stdincl.h"
    1920
     
    3031
    3132  virtual void loadParams(const TiXmlElement* root);
    32   void setName (const char* newName);
     33  void setName (const std::string& newName);
    3334  /** returns the Name of this Object */
    34   inline const char* getName ()const { return this->objectName; };
     35  inline const char* getName ()const { return this->objectName.c_str(); };
    3536  /** @returns the XML-Element with whicht this Object was loaded */
    3637  inline TiXmlNode* getXmlElem() const { return this->xmlElem; };
    3738
    3839  /** @returns the className of the corresponding Object */
    39   inline const char* getClassName() const { return this->className; };
     40  inline const char* getClassName() const { return this->className.c_str(); };
    4041  /** @returns the classID of the corresponding Object */
    4142  inline int getClassID() const { return this->classID; };
     
    4344
    4445  bool isA (ClassID classID) const;
    45   bool isA (const char* className) const;
     46  bool isA (const std::string& className) const;
    4647  void whatIs() const;
    4748
    48   bool operator==(const char* objectName);
     49  bool operator==(const std::string& objectName);
    4950  /** @param classID comparer for a ClassID @returns true on match, false otherwise */
    5051  bool operator==(ClassID classID) { return this->isA(classID); };
     
    5455
    5556 protected:
    56   void setClassID(ClassID classID, const char* className);
     57   void setClassID(ClassID classID, const std::string& className);
    5758
    5859 private:
    59     const char*        className;        //!< the name of the class
     60    std::string        className;        //!< the name of the class
    6061    long               classID;          //!< this is the id from the class_id.h enumeration
    61     char*              objectName;       //!< The name of this object
     62    std::string        objectName;       //!< The name of this object
    6263
    6364    ClassList*         classList;        //!< Pointer to the ClassList this Object is inside of
Note: See TracChangeset for help on using the changeset viewer.