Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/lib/lang/new_class_id.h @ 9664

Last change on this file since 9664 was 9664, checked in by bensch, 19 years ago

some more thoughts… but it looks like a hard one

File size: 681 bytes
RevLine 
[4838]1/*!
[9659]2 * @file new_class_id.h
3 * @brief Definition of a dynamically allocating ClassID
4 *
5 */
[1853]6
[9659]7#ifndef _NEW_CLASS_ID_H
8#define _NEW_CLASS_ID_H
[1853]9
[9659]10#include "type_info.h"
11#include <string>
[1853]12
[9663]13#include "new_object_list.h"
14
[9659]15//! A class to dynamically allocate ClassID's and support a isA operator
16class NewClassID
17{
18public:
19  NewClassID();
20  ~NewClassID();
[3245]21
[9664]22  template<class T> void registerObject(T* object, NewObjectList<T>& list);
[9663]23
[9659]24private:
[9664]25  NewObjectListBase*            _objectList;
[1853]26};
27
[9659]28
[9664]29template<class T> void NewClassID::registerObject(T* object, NewObjectList<T>& objectList)
30{
31  this->_objectList = &objectList;
32  objectList.registerObject(object);
33}
34
[9659]35#endif /* _NEW_CLASS_ID_H */
Note: See TracBrowser for help on using the repository browser.