Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 22, 2006, 2:36:54 PM (18 years ago)
Author:
bensch
Message:

new_class_id: many more classes done

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/new_class_id/src/lib/lang/new_object_list.h

    r9685 r9686  
    1515
    1616
     17
     18/**
     19 * @brief Use this macro to easily declare a Class to store its own ObjectListDeclaration
     20 * @param ClassName the Name of the Class.
     21 * @note: Using this inside of a Class means, that you loose the member: _objectList, while defining
     22 * two new functions objectList() and classID().
     23 */
    1724#define NewObjectListDeclaration(ClassName) \
    1825  public: \
    19    static const NewObjectList<ClassName>& objectList() { return ClassName::_objectList; }; \
     26   static inline const NewObjectList<ClassName>& objectList() { return ClassName::_objectList; }; \
     27   static inline const NewClassID classID() { return ClassName::_objectList.identity(); }; \
    2028  private: \
    2129   static NewObjectList<ClassName> _objectList
     
    4048
    4149public:
     50  inline const NewClassID& identity() const { return _identity; };
    4251  inline int id() const { return _identity.id(); };
    4352  inline const std::string& name() const { return _identity.name(); };
    4453  bool operator==(int id) const { return _identity == id; };
     54  bool operator==(const NewClassID& id) const { return _identity == id; };
    4555  bool operator==(const std::string& name) const { return _identity == name; };
    4656
Note: See TracChangeset for help on using the changeset viewer.