Changeset 5629 in orxonox.OLD for branches/world_entities/src/util
- Timestamp:
- Nov 18, 2005, 12:32:35 PM (19 years ago)
- Location:
- branches/world_entities/src/util
- Files:
-
- 3 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/world_entities/src/util/Makefile.am
r5558 r5629 5 5 6 6 libORXutils_a_SOURCES = fast_factory.cc \ 7 object_manager.cc \ 7 8 loading/factory.cc \ 8 9 garbage_collector.cc \ … … 18 19 track/pilot_node.cc \ 19 20 track/track_manager.cc \ 20 track/track_node.cc 21 track/track_node.cc 21 22 22 23 noinst_HEADERS = fast_factory.h \ 24 object_manager.h \ 23 25 garbage_collector.h \ 24 26 state.h \ -
branches/world_entities/src/util/Makefile.in
r5558 r5629 54 54 libORXutils_a_AR = $(AR) $(ARFLAGS) 55 55 libORXutils_a_LIBADD = 56 am_libORXutils_a_OBJECTS = fast_factory.$(OBJEXT) factory.$(OBJEXT) \ 56 am_libORXutils_a_OBJECTS = fast_factory.$(OBJEXT) \ 57 object_manager.$(OBJEXT) factory.$(OBJEXT) \ 57 58 garbage_collector.$(OBJEXT) state.$(OBJEXT) \ 58 59 user_control.$(OBJEXT) animation3d.$(OBJEXT) \ … … 190 191 noinst_LIBRARIES = libORXutils.a 191 192 libORXutils_a_SOURCES = fast_factory.cc \ 193 object_manager.cc \ 192 194 loading/factory.cc \ 193 195 garbage_collector.cc \ … … 203 205 track/pilot_node.cc \ 204 206 track/track_manager.cc \ 205 track/track_node.cc 207 track/track_node.cc 206 208 207 209 noinst_HEADERS = fast_factory.h \ 210 object_manager.h \ 208 211 garbage_collector.h \ 209 212 state.h \ … … 278 281 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/load_param.Po@am__quote@ 279 282 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/load_param_description.Po@am__quote@ 283 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/object_manager.Po@am__quote@ 280 284 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pilot_node.Po@am__quote@ 281 285 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resource_manager.Po@am__quote@ -
branches/world_entities/src/util/fast_factory.cc
r5041 r5629 13 13 */ 14 14 15 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_ OBJECT_MANAGER15 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_LOAD 16 16 17 17 #include "fast_factory.h" -
branches/world_entities/src/util/object_manager.cc
r5628 r5629 16 16 //#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY 17 17 18 #include " proto_singleton.h"18 #include "object_manager.h" 19 19 20 20 using namespace std; … … 24 24 * standard constructor 25 25 */ 26 ProtoSingleton::ProtoSingleton()26 ObjectManager::ObjectManager () 27 27 { 28 this->setClassID(CL_PROTO_ID, "ProtoSingleton"); 29 this->setName("ProtoSingleton"); 30 31 /* If you make a new class, what is most probably the case when you write this file 32 don't forget to: 33 1. Add the new file new_class.cc to the ./src/Makefile.am 34 2. Add the class identifier to ./src/class_id.h eg. CL_NEW_CLASS 35 !!!!!!!!!! IMPORTANT FOR SINGLETON !!!!!!!!!!!!!!!! 36 3. SingleTon MUST be CL_NEW_CLASS = 0x00000fxx 37 38 Advanced Topics: 39 - if you want to let your object be managed via the ObjectManager make sure to read 40 the object_manager.h header comments. You will use this most certanly only if you 41 make many objects of your class, like a weapon bullet. 42 */ 28 this->setClassID(CL_OBJECT_MANAGER, "ObjectManager"); 29 this->setName("ObjectManager"); 43 30 } 44 31 … … 46 33 * the singleton reference to this class 47 34 */ 48 ProtoSingleton* ProtoSingleton::singletonRef = NULL;35 ObjectManager* ObjectManager::singletonRef = NULL; 49 36 50 37 /** 51 38 @brief standard deconstructor 52 39 */ 53 ProtoSingleton::~ProtoSingleton()40 ObjectManager::~ObjectManager () 54 41 { 55 ProtoSingleton::singletonRef = NULL;42 ObjectManager::singletonRef = NULL; 56 43 } -
branches/world_entities/src/util/object_manager.h
r5628 r5629 1 1 /*! 2 * @file proto_singleton.h2 * @file object_manager.h 3 3 * @brief Definition of the ... singleton Class 4 4 */ 5 5 6 #ifndef _ PROTO_SINGLETON_H7 #define _ PROTO_SINGLETON_H6 #ifndef _OBJECT_MANAGER_H 7 #define _OBJECT_MANAGER_H 8 8 9 9 #include "base_object.h" … … 12 12 13 13 //! A default singleton class. 14 class ProtoSingleton: public BaseObject {14 class ObjectManager : public BaseObject { 15 15 16 16 public: 17 virtual ~ ProtoSingleton(void);17 virtual ~ObjectManager(void); 18 18 /** @returns a Pointer to the only object of this Class */ 19 inline static ProtoSingleton* getInstance(void) { if (!singletonRef) singletonRef = new ProtoSingleton(); returnsingletonRef; };19 inline static ObjectManager* getInstance(void) { if (!ObjectManager::singletonRef) ObjectManager::singletonRef = new ObjectManager(); return ObjectManager::singletonRef; }; 20 20 21 21 private: 22 ProtoSingleton(void);23 static ProtoSingleton* singletonRef;22 ObjectManager(void); 23 static ObjectManager* singletonRef; 24 24 }; 25 25 26 #endif /* _ PROTO_SINGLETON_H */26 #endif /* _OBJECT_MANAGER_H */
Note: See TracChangeset
for help on using the changeset viewer.