Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7216 in orxonox.OLD for branches/std/src/lib/lang/class_list.h


Ignore:
Timestamp:
Mar 12, 2006, 8:54:30 AM (18 years ago)
Author:
bensch
Message:

orxonox/std:: compile and run again, with many more std::strings….

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/std/src/lib/lang/class_list.h

    r7165 r7216  
    1010#include "class_id.h"
    1111#include <list>
     12#include <string>
    1213#ifndef NULL
    1314#define NULL     0    //!< NULL
     
    3233class ClassList {
    3334  public:
    34     ClassList(ClassID classID, unsigned long classIDFull, const char* className);
     35    ClassList(ClassID classID, unsigned long classIDFull, const std::string& className);
    3536    virtual ~ClassList();
    3637
    3738    /* MAINTENANCE FUNCTIONS THESE ARE !!ONLY FOR BASEOBJECT !! */
    38     static ClassList*                     addToClassList(BaseObject* objectPointer, ClassID classID, unsigned long classIDFull, const char* className);
     39    static ClassList*                     addToClassList(BaseObject* objectPointer, ClassID classID, unsigned long classIDFull, const std::string& className);
    3940    static void                           removeFromClassList(BaseObject* objectPointer);
    4041
     
    4243
    4344    static const std::list<BaseObject*>*  getList(ClassID classID = CL_NULL);// { return (ClassList* fl = ClassList::getClassList(classID) != NULL)? &(fl->objectList) : NULL; };
    44     static const std::list<BaseObject*>*  getList(const char* className); // { return (ClassList* fl = ClassList::getClassList(className) != NULL)? &(fl->objectList) : NULL;  };
    45     static const std::list<const char*>*  getClassNames();
    46     static BaseObject*                    getObject(const char* name, ClassID classID = CL_NULL);
     45    static const std::list<BaseObject*>*  getList(const std::string& className); // { return (ClassList* fl = ClassList::getClassList(className) != NULL)? &(fl->objectList) : NULL;  };
     46    static const std::list<std::string>*  getClassNames();
     47    static BaseObject*                    getObject(const std::string& name, ClassID classID = CL_NULL);
    4748    static bool                           exists(const BaseObject* object, ClassID classID = CL_NULL);
    4849
     
    5152    static void                           whatIs(const BaseObject* object);
    5253
    53     static const char*                    IDToString(ClassID classID = CL_NULL);
    54     static ClassID                        StringToID(const char* className);
     54    static const std::string&             IDToString(ClassID classID = CL_NULL);
     55    static ClassID                        StringToID(const std::string& className);
    5556    static void                           debug(unsigned int debugLevel = 0, ClassID classID = CL_NULL);
    56     static void                           debugS(const char* className = NULL, unsigned int debugLevel = 0);
     57    static void                           debugS(const std::string& className = "", unsigned int debugLevel = 0);
    5758
    5859    inline bool                           operator==(ClassID classID) { return (this->classID == classID); };
    59     bool                                  operator==(const char* className);
     60    bool                                  operator==(const std::string& className);
    6061    inline ClassID                        getLeafClassID() const { return this->classID; };
    6162
    6263  private:
    6364    static ClassList*                     getClassList(ClassID classID);
    64     static ClassList*                     getClassList(const char* className);
     65    static ClassList*                     getClassList(const std::string& className);
    6566
    6667  private:
    67     ClassID                         classID;                //!< ClassID stored in this ClassList
    68     unsigned long                   classIDFull;            //!< The Full ClassID of this Class.
     68    ClassID                               classID;                //!< ClassID stored in this ClassList
     69    unsigned long                         classIDFull;            //!< The Full ClassID of this Class.
    6970
    70     const char*                     className;              //!< Name of the Class Stored here
     71    const std::string                     className;              //!< Name of the Class Stored here
    7172
    72     std::list<BaseObject*>          objectList;             //!< A list of Objects belonging to this Class
     73    std::list<BaseObject*>                objectList;             //!< A list of Objects belonging to this Class
    7374
    7475    // STATIC MEMBERS
    75     static std::list<ClassList>*    classList;              //!< The first Class in the List
    76     static std::list<const char*>   classNames;             //!< a List of all Names of all classes, that have registered so far.
     76    static std::list<ClassList>*          classList;              //!< The first Class in the List
     77    static std::list<std::string>         classNames;             //!< a List of all Names of all classes, that have registered so far.
    7778};
    7879
Note: See TracChangeset for help on using the changeset viewer.