Changeset 9659
- Timestamp:
- Aug 18, 2013, 4:57:51 PM (11 years ago)
- Location:
- code/branches/core6
- Files:
-
- 49 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core6/src/libraries/core/BaseObject.cc
r9638 r9659 57 57 BaseObject::BaseObject(Context* context) : bInitialized_(false) 58 58 { 59 Register RootObject(BaseObject);59 RegisterObject(BaseObject); 60 60 61 61 this->bInitialized_ = true; -
code/branches/core6/src/libraries/core/Core.cc
r9658 r9659 179 179 // Do this soon after the ConfigFileManager has been created to open up the 180 180 // possibility to configure everything below here 181 Register RootObject(Core);181 RegisterObject(Core); 182 182 orxout(internal_info) << "configuring Core" << endl; 183 183 this->setConfigValues(); … … 516 516 DevModeListener::DevModeListener() 517 517 { 518 Register RootObject(DevModeListener);518 RegisterObject(DevModeListener); 519 519 } 520 520 } -
code/branches/core6/src/libraries/core/CoreIncludes.h
r9646 r9659 37 37 @brief Defines several very important macros used to register objects, register classes, and to work with identifiers. 38 38 39 Every class needs the @c RegisterObject(class) macro in its constructor. If the class is an interface 40 or the @c BaseObject itself, it needs the macro @c RegisterRootObject(class) instead. 39 Every class needs the @c RegisterObject(class) macro in its constructor. 41 40 42 41 To register @a class in the class-hierarchy, use the @c RegisterClass(class) macro outside of the class implementation, 43 42 so it gets executed statically before @c main(). If you don't want @a class to be loadable, but still register it, call 44 43 @c RegisterUnloadableClass(class). 44 45 Abstract classes are registered with @c RegisterAbstractClass(class). For abstract classes, the inheritance must be 46 defined manually with @c RegisterAbstractClass(class).inheritsFrom(Class(parent)). Multiple parent classes can be defined 47 by chaining the above command. 45 48 46 49 Example: … … 125 128 126 129 /** 127 @brief Intern macro, containing the common parts of @c RegisterObject and @c RegisterRootObject. 128 @param ClassName The name of the class 129 @param bRootClass True if the class is directly derived from orxonox::OrxonoxClass 130 */ 131 #define InternRegisterObject(ClassName) \ 130 @brief Registers a newly created object in the framework. Has to be called at the beginning of the constructor of @a ClassName. 131 @param ClassName The name of the class 132 */ 133 #define RegisterObject(ClassName) \ 132 134 if (ClassIdentifier<ClassName>::getIdentifier(#ClassName)->initializeObject(this)) \ 133 135 return; \ 134 136 else \ 135 137 ((void)0) 136 137 /**138 @brief Registers a newly created object in the framework. Has to be called at the beginning of the constructor of @a ClassName.139 @param ClassName The name of the class140 */141 #define RegisterObject(ClassName) \142 InternRegisterObject(ClassName)143 144 /**145 @brief Registers a newly created object in the framework. Has to be called at the beginning of the constructor of @a ClassName.146 @param ClassName The name of the class147 148 In contrast to RegisterObject, this is used for classes that inherit directly from149 orxonox::OrxonoxClass, namely all interfaces and orxonox::BaseObject.150 */151 #define RegisterRootObject(ClassName) \152 InternRegisterObject(ClassName)153 138 154 139 /** -
code/branches/core6/src/libraries/core/GUIManager.cc
r9558 r9659 256 256 , destructionHelper_(this) 257 257 { 258 Register RootObject(GUIManager);258 RegisterObject(GUIManager); 259 259 260 260 orxout(internal_status) << "initializing GUIManager..." << endl; -
code/branches/core6/src/libraries/core/Game.cc
r9560 r9659 112 112 113 113 // Do this after the Core creation! 114 Register RootObject(Game);114 RegisterObject(Game); 115 115 this->setConfigValues(); 116 116 -
code/branches/core6/src/libraries/core/ViewportEventListener.cc
r9656 r9659 36 36 ViewportEventListener::ViewportEventListener() 37 37 { 38 Register RootObject(ViewportEventListener);38 RegisterObject(ViewportEventListener); 39 39 } 40 40 } -
code/branches/core6/src/libraries/core/WindowEventListener.cc
r9656 r9659 39 39 WindowEventListener::WindowEventListener() 40 40 { 41 Register RootObject(WindowEventListener);41 RegisterObject(WindowEventListener); 42 42 } 43 43 -
code/branches/core6/src/libraries/core/XMLNameListener.cc
r9656 r9659 36 36 XMLNameListener::XMLNameListener() 37 37 { 38 Register RootObject(XMLNameListener);38 RegisterObject(XMLNameListener); 39 39 } 40 40 } -
code/branches/core6/src/libraries/core/command/Shell.cc
r9658 r9659 68 68 , bScrollable_(bScrollable) 69 69 { 70 Register RootObject(Shell);70 RegisterObject(Shell); 71 71 72 72 OutputManager::getInstance().registerListener(this); -
code/branches/core6/src/libraries/core/input/InputBuffer.cc
r9658 r9659 39 39 InputBuffer::InputBuffer() 40 40 { 41 Register RootObject(InputBuffer);41 RegisterObject(InputBuffer); 42 42 43 43 this->cursor_ = 0; … … 59 59 InputBuffer::InputBuffer(const std::string& allowedChars) 60 60 { 61 Register RootObject(InputBuffer);61 RegisterObject(InputBuffer); 62 62 63 63 this->maxLength_ = 1024; -
code/branches/core6/src/libraries/core/input/InputManager.cc
r9589 r9659 98 98 , calibratorCallbackHandler_(0) 99 99 { 100 Register RootObject(InputManager);100 RegisterObject(InputManager); 101 101 102 102 orxout(internal_status, context::input) << "InputManager: Constructing..." << endl; -
code/branches/core6/src/libraries/core/input/JoyStick.cc
r9559 r9659 51 51 : super(id, oisInputManager) 52 52 { 53 Register RootObject(JoyStick);53 RegisterObject(JoyStick); 54 54 this->setConfigValues(); 55 55 // Initialise POV and Slider states -
code/branches/core6/src/libraries/core/input/KeyBinder.cc
r9559 r9659 58 58 mousePosition_[1] = 0.0; 59 59 60 Register RootObject(KeyBinder);60 RegisterObject(KeyBinder); 61 61 62 62 // initialise all buttons and half axes to avoid creating everything with 'new' -
code/branches/core6/src/libraries/core/input/Mouse.cc
r8729 r9659 54 54 : super(id, oisInputManager) 55 55 { 56 Register RootObject(Mouse);56 RegisterObject(Mouse); 57 57 this->windowResized(this->getWindowWidth(), this->getWindowHeight()); 58 58 -
code/branches/core6/src/libraries/network/ClientConnectionListener.cc
r9656 r9659 39 39 ClientConnectionListener::ClientConnectionListener() 40 40 { 41 Register RootObject(ClientConnectionListener);41 RegisterObject(ClientConnectionListener); 42 42 } 43 43 -
code/branches/core6/src/libraries/network/Host.cc
r9557 r9659 145 145 NetworkChatListener::NetworkChatListener() 146 146 { 147 Register RootObject(NetworkChatListener);147 RegisterObject(NetworkChatListener); 148 148 } 149 149 -
code/branches/core6/src/libraries/network/NetworkFunction.cc
r9658 r9659 44 44 NetworkFunctionBase::NetworkFunctionBase(const std::string& name) 45 45 { 46 RegisterRootObject(NetworkFunctionBase);46 RegisterObject(NetworkFunctionBase); 47 47 48 48 static uint32_t networkID = 0; -
code/branches/core6/src/libraries/network/synchronisable/Synchronisable.cc
r9656 r9659 53 53 Synchronisable::Synchronisable(Context* context) 54 54 { 55 RegisterRootObject(Synchronisable);55 RegisterObject(Synchronisable); 56 56 static uint32_t idCounter=0; 57 57 objectMode_=0x1; // by default do not send data to server -
code/branches/core6/src/libraries/tools/Timer.cc
r9658 r9659 140 140 { 141 141 this->init(); 142 Register RootObject(Timer);142 RegisterObject(Timer); 143 143 } 144 144 … … 153 153 { 154 154 this->init(); 155 Register RootObject(Timer);155 RegisterObject(Timer); 156 156 157 157 this->setTimer(interval, bLoop, executor, bKillAfterCall); -
code/branches/core6/src/libraries/tools/interfaces/ToolsInterfaceCompilation.cc
r9656 r9659 50 50 TimeFactorListener::TimeFactorListener() 51 51 { 52 Register RootObject(TimeFactorListener);52 RegisterObject(TimeFactorListener); 53 53 } 54 54 … … 74 74 Tickable::Tickable() 75 75 { 76 Register RootObject(Tickable);76 RegisterObject(Tickable); 77 77 } 78 78 } -
code/branches/core6/src/modules/designtools/ScreenshotManager.cc
r9579 r9659 69 69 ScreenshotManager::ScreenshotManager() : finalPicturePB_(NULL), data_(NULL) 70 70 { 71 Register RootObject(ScreenshotManager);71 RegisterObject(ScreenshotManager); 72 72 73 73 this->setConfigValues(); -
code/branches/core6/src/modules/designtools/SkyboxGenerator.cc
r9558 r9659 68 68 SkyboxGenerator::SkyboxGenerator() 69 69 { 70 Register RootObject(SkyboxGenerator);70 RegisterObject(SkyboxGenerator); 71 71 72 72 this->setConfigValues(); -
code/branches/core6/src/modules/notifications/NotificationManager.cc
r8858 r9659 55 55 NotificationManager::NotificationManager() 56 56 { 57 Register RootObject(NotificationManager);57 RegisterObject(NotificationManager); 58 58 59 59 orxout(internal_info, context::notifications) << "NotificatioManager created." << endl; -
code/branches/core6/src/modules/weapons/projectiles/BasicProjectile.cc
r9657 r9659 50 50 BasicProjectile::BasicProjectile() 51 51 { 52 Register RootObject(BasicProjectile);// Register the BasicProjectile class to the core52 RegisterObject(BasicProjectile);// Register the BasicProjectile class to the core 53 53 54 54 this->bDestroy_ = false; -
code/branches/core6/src/orxonox/LevelManager.cc
r9560 r9659 59 59 LevelManager::LevelManager() 60 60 { 61 Register RootObject(LevelManager);61 RegisterObject(LevelManager); 62 62 this->setConfigValues(); 63 63 -
code/branches/core6/src/orxonox/MoodManager.cc
r9558 r9659 43 43 MoodManager::MoodManager() 44 44 { 45 Register RootObject(MoodManager);45 RegisterObject(MoodManager); 46 46 this->setConfigValues(); 47 47 … … 95 95 MoodListener::MoodListener() 96 96 { 97 Register RootObject(MoodListener);97 RegisterObject(MoodListener); 98 98 } 99 99 -
code/branches/core6/src/orxonox/PawnManager.cc
r8351 r9659 39 39 PawnManager::PawnManager() 40 40 { 41 Register RootObject(PawnManager);41 RegisterObject(PawnManager); 42 42 } 43 43 -
code/branches/core6/src/orxonox/PlayerManager.cc
r8858 r9659 43 43 PlayerManager::PlayerManager() 44 44 { 45 Register RootObject(PlayerManager);45 RegisterObject(PlayerManager); 46 46 47 47 // this->getConnectedClients(); -
code/branches/core6/src/orxonox/chat/ChatManager.cc
r9657 r9659 117 117 ChatListener::ChatListener() 118 118 { 119 Register RootObject(ChatListener);119 RegisterObject(ChatListener); 120 120 } 121 121 } -
code/branches/core6/src/orxonox/gamestates/GSMainMenu.cc
r9558 r9659 66 66 : GameState(info) 67 67 { 68 Register RootObject(GSMainMenu);68 RegisterObject(GSMainMenu); 69 69 70 70 InputManager::getInstance().createInputState("MainMenuHackery", true, true)->setKeyHandler(KeyBinderManager::getInstance().getDefaultAsHandler()); -
code/branches/core6/src/orxonox/interfaces/InterfaceCompilation.cc
r9656 r9659 54 54 GametypeMessageListener::GametypeMessageListener() 55 55 { 56 Register RootObject(GametypeMessageListener);56 RegisterObject(GametypeMessageListener); 57 57 } 58 58 … … 64 64 PlayerTrigger::PlayerTrigger() 65 65 { 66 Register RootObject(PlayerTrigger);66 RegisterObject(PlayerTrigger); 67 67 68 68 this->isForPlayer_ = false; … … 84 84 RadarListener::RadarListener() 85 85 { 86 Register RootObject(RadarListener);86 RegisterObject(RadarListener); 87 87 } 88 88 … … 94 94 TeamColourable::TeamColourable() 95 95 { 96 Register RootObject(TeamColourable);96 RegisterObject(TeamColourable); 97 97 } 98 98 … … 104 104 Rewardable::Rewardable() 105 105 { 106 Register RootObject(Rewardable);106 RegisterObject(Rewardable); 107 107 } 108 108 } -
code/branches/core6/src/orxonox/interfaces/NotificationListener.cc
r8706 r9659 53 53 NotificationListener::NotificationListener() 54 54 { 55 Register RootObject(NotificationListener);55 RegisterObject(NotificationListener); 56 56 } 57 57 -
code/branches/core6/src/orxonox/interfaces/PickupCarrier.cc
r9656 r9659 49 49 PickupCarrier::PickupCarrier() 50 50 { 51 Register RootObject(PickupCarrier);51 RegisterObject(PickupCarrier); 52 52 } 53 53 -
code/branches/core6/src/orxonox/interfaces/PickupListener.cc
r8351 r9659 47 47 PickupListener::PickupListener() 48 48 { 49 Register RootObject(PickupListener);49 RegisterObject(PickupListener); 50 50 } 51 51 -
code/branches/core6/src/orxonox/interfaces/Pickupable.cc
r9656 r9659 54 54 Pickupable::Pickupable() : used_(false), pickedUp_(false) 55 55 { 56 Register RootObject(Pickupable);56 RegisterObject(Pickupable); 57 57 58 58 this->carrier_ = NULL; -
code/branches/core6/src/orxonox/interfaces/RadarViewable.cc
r9656 r9659 53 53 , scale_(1.0f) 54 54 { 55 Register RootObject(RadarViewable);55 RegisterObject(RadarViewable); 56 56 57 57 this->uniqueId_=getUniqueNumberString(); -
code/branches/core6/src/orxonox/sound/BaseSound.cc
r9657 r9659 52 52 , pitch_ (1.0) 53 53 { 54 Register RootObject(BaseSound);54 RegisterObject(BaseSound); 55 55 56 56 // Initialise audioSource_ to a value that is not a source -
code/branches/core6/src/orxonox/sound/SoundManager.cc
r9558 r9659 69 69 : effectsPoolSize_(0) 70 70 { 71 Register RootObject(SoundManager);71 RegisterObject(SoundManager); 72 72 73 73 orxout(user_status) << "Loading sound" << endl; -
code/branches/core6/test/core/class/IdentifiableTest.cc
r9601 r9659 10 10 { 11 11 public: 12 IdentifiableTest() { Register RootObject(IdentifiableTest); }12 IdentifiableTest() { RegisterObject(IdentifiableTest); } 13 13 }; 14 14 } -
code/branches/core6/test/core/class/IdentifierClassHierarchyTest.cc
r9653 r9659 24 24 BaseInterface1() 25 25 { 26 Register RootObject(BaseInterface1);26 RegisterObject(BaseInterface1); 27 27 } 28 28 … … 35 35 BaseInterface2() 36 36 { 37 Register RootObject(BaseInterface2);37 RegisterObject(BaseInterface2); 38 38 } 39 39 … … 64 64 BaseClass() 65 65 { 66 Register RootObject(BaseClass);66 RegisterObject(BaseClass); 67 67 } 68 68 }; -
code/branches/core6/test/core/class/IdentifierExternalClassHierarchyTest.cc
r9653 r9659 12 12 Interface() 13 13 { 14 Register RootObject(Interface);14 RegisterObject(Interface); 15 15 } 16 16 … … 23 23 BaseClass() 24 24 { 25 Register RootObject(BaseClass);25 RegisterObject(BaseClass); 26 26 } 27 27 }; -
code/branches/core6/test/core/class/IdentifierSimpleClassHierarchyTest.cc
r9653 r9659 14 14 Interface() 15 15 { 16 Register RootObject(Interface);16 RegisterObject(Interface); 17 17 } 18 18 … … 25 25 BaseClass() 26 26 { 27 Register RootObject(BaseClass);27 RegisterObject(BaseClass); 28 28 } 29 29 }; -
code/branches/core6/test/core/class/IdentifierTest.cc
r9601 r9659 10 10 { 11 11 public: 12 TestClass() { Register RootObject(TestClass); }12 TestClass() { RegisterObject(TestClass); } 13 13 }; 14 14 -
code/branches/core6/test/core/class/SubclassIdentifierTest.cc
r9649 r9659 12 12 { 13 13 public: 14 TestClass(Context* context = NULL) { Register RootObject(TestClass); }14 TestClass(Context* context = NULL) { RegisterObject(TestClass); } 15 15 }; 16 16 -
code/branches/core6/test/core/class/SuperTest.cc
r9649 r9659 15 15 TestClass(Context* context = NULL) : BaseObject(context), changedNameBase_(false), xmlPortBase_(false), modeBase_(XMLPort::NOP) 16 16 { 17 Register RootObject(TestClass);17 RegisterObject(TestClass); 18 18 } 19 19 -
code/branches/core6/test/core/object/ContextTest.cc
r9650 r9659 11 11 { 12 12 public: 13 SubclassContext() : Context(NULL) { Register RootObject(SubclassContext); }13 SubclassContext() : Context(NULL) { RegisterObject(SubclassContext); } 14 14 }; 15 15 -
code/branches/core6/test/core/object/IteratorTest.cc
r9649 r9659 14 14 { 15 15 public: 16 TestInterface() { Register RootObject(TestInterface); }16 TestInterface() { RegisterObject(TestInterface); } 17 17 }; 18 18 … … 20 20 { 21 21 public: 22 TestClass() { Register RootObject(TestClass); }22 TestClass() { RegisterObject(TestClass); } 23 23 MOCK_METHOD0(test, void()); 24 24 }; -
code/branches/core6/test/core/object/ListableTest.cc
r9649 r9659 10 10 { 11 11 public: 12 ListableClassTest() { Register RootObject(ListableClassTest); }12 ListableClassTest() { RegisterObject(ListableClassTest); } 13 13 }; 14 14 -
code/branches/core6/test/core/object/ObjectListIteratorTest.cc
r9649 r9659 13 13 { 14 14 public: 15 ListableTest() { Register RootObject(ListableTest); }15 ListableTest() { RegisterObject(ListableTest); } 16 16 MOCK_METHOD0(test, void()); 17 17 };
Note: See TracChangeset
for help on using the changeset viewer.