Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Jul 24, 2006, 11:09:47 AM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the proxy back

merged with commandsvn merge -r9346:HEAD https://svn.orxonox.net/orxonox/branches/proxy .

no conflicts

File:
1 edited

Legend:

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

    r8362 r9406  
    11/*!
    22 * @file base_object.h
    3   *  Definition of the base object class.
    4 
    5     This is a global handler for all classes.
    6 */
     3 * @brief Definition of the BaseObject class.
     4 *
     5 * This is a global handler for all classes Object and Class names
     6 *
     7 * BaseObject is the class, that handles object registration and
     8 * is the only write-access member of ClassList, where the Objects
     9 * References are stored.
     10 */
    711
    812
    9 #ifndef _BASE_OBJECT_H
    10 #define _BASE_OBJECT_H
     13#ifndef __BASE_OBJECT_H_
     14#define __BASE_OBJECT_H_
    1115
    1216#include "class_id.h"
     17#include "sigslot/slot.h"
     18
    1319#include <string>
    1420
     
    1824
    1925//! A class all other classes are derived from
    20 class BaseObject
     26class BaseObject : public sigslot::has_slots<>
    2127{
    2228
     
    2935  void setName (const std::string& newName);
    3036  /** returns the Name of this Object */
    31   inline const char* getName ()const { return this->objectName.c_str(); };
     37  inline const std::string& getName() const { return this->objectName; };
     38  /** returns the Name of this Object as a C-compliant string (const char*) */
     39  inline const char* getCName() const { return this->objectName.c_str(); };
    3240  /** @returns the XML-Element with whicht this Object was loaded */
    3341  inline TiXmlNode* getXmlElem() const { return this->xmlElem; };
    3442
    3543  /** @returns the className of the corresponding Object */
    36   inline const char* getClassName() const { return this->className.c_str(); };
     44  inline const std::string& getClassName() const { return this->className; }
     45  /** @returns the className of the corresponding Object as a C-compliant string (const char*) */
     46  inline const char* getClassCName() const { return this->className.c_str(); };
    3747  /** @returns the classID of the corresponding Object */
    3848  inline int getClassID() const { return this->classID; };
     
    4151  bool isA (ClassID classID) const;
    4252  bool isA (const std::string& className) const;
    43   void whatIs() const;
    4453
    45   bool operator==(const std::string& objectName);
    4654  /** @param classID comparer for a ClassID @returns true on match, false otherwise */
    47   bool operator==(ClassID classID) { return this->isA(classID); };
     55  bool operator==(ClassID classID) const  { return this->isA(classID); };
     56  bool operator==(const std::string& objectName) const;
    4857
    4958protected:
     
    5463
    5564private:
    56 
    5765  std::string        className;        //!< the name of the class
    5866  long               classID;          //!< this is the id from the class_id.h enumeration
     
    6472};
    6573
    66 #endif /* _BASE_OBJECT_H */
     74#endif /* __BASE_OBJECT_H_ */
Note: See TracChangeset for help on using the changeset viewer.