Changeset 10459 for code/branches
- Timestamp:
- May 24, 2015, 1:48:18 PM (10 years ago)
- Location:
- code/branches/core7
- Files:
-
- 1 added
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core7/src/libraries/core/Core.cc
r10458 r10459 57 57 #include "util/output/OutputManager.h" 58 58 #include "core/singleton/Scope.h" 59 #include "core/singleton/ScopedSingleton Wrapper.h"59 #include "core/singleton/ScopedSingletonIncludes.h" 60 60 #include "util/SignalHandler.h" 61 61 #include "PathConfig.h" -
code/branches/core7/src/libraries/core/input/KeyBinderManager.cc
r10458 r10459 31 31 #include "util/Output.h" 32 32 #include "util/Exception.h" 33 #include "core/singleton/ScopedSingleton Wrapper.h"33 #include "core/singleton/ScopedSingletonIncludes.h" 34 34 #include "core/config/ConfigValueIncludes.h" 35 35 #include "core/CoreIncludes.h" -
code/branches/core7/src/libraries/core/input/KeyDetector.cc
r10458 r10459 30 30 31 31 #include "core/CoreIncludes.h" 32 #include "core/singleton/ScopedSingleton Wrapper.h"32 #include "core/singleton/ScopedSingletonIncludes.h" 33 33 #include "core/command/ConsoleCommandIncludes.h" 34 34 #include "Button.h" -
code/branches/core7/src/libraries/core/object/DestroyLaterManager.cc
r10458 r10459 30 30 31 31 #include "core/CoreIncludes.h" 32 #include "core/singleton/ScopedSingleton Wrapper.h"32 #include "core/singleton/ScopedSingletonIncludes.h" 33 33 34 34 namespace orxonox -
code/branches/core7/src/libraries/core/singleton/ScopedSingletonWrapper.h
r10458 r10459 30 30 @file 31 31 @ingroup SingletonScope 32 @brief Definition of orxonox::ScopedSingletonWrapper , orxonox::ClassScopedSingletonWrapper, and the ManageScopedSingleton macro.32 @brief Definition of orxonox::ScopedSingletonWrapper and orxonox::ClassScopedSingletonWrapper. 33 33 34 34 ScopedSingletonWrapper is used to create and destroy Singletons that belong to … … 51 51 #include "util/Singleton.h" 52 52 #include "Scope.h" 53 54 /**55 @brief Creates an orxonox::ScopedSingletonWrapper for an orxonox::Singleton and registers it with orxonox::ScopeManager.56 @param className The name of the singleton class57 @param scope The scope in which the singleton should exist58 @param allowedToFail If true, the singleton is allowed to fail and thus a try-catch block is used when creating the singleton.59 60 If this macro is called for a singleton, it is wrapped in a ScopedSingletonWrapper and registered with ScopeManager61 and will thus be created if its scope becomes active and destroyed if is deactivated.62 63 64 Usually a singleton gets created automatically when it is first used, but it will never65 be destroyed (unless the singleton explicitly deletes itself). To allow controlled66 construction and destruction, the singleton can be put within a virtual scope. This is67 done by registering the singleton class with orxonox::ScopeManager. To68 do so, the ManageScopedSingleton() macro has to be called:69 70 @code71 ManageScopedSingleton(TestSingleton, ScopeID::Graphics, false); // muste be called in a source (*.cc) file72 @endcode73 74 @b Important: If you call ManageScopedSingleton(), you don't have to initialize singletonPtr_s anymore,75 because that's already done by the macro.76 77 Now the singleton TestSingleton gets automatically created if the scope Graphics becomes78 active and also gets destroyed if the scope is deactivated.79 80 Note that not all singletons must register with a scope, but it's recommended.81 82 */83 #define ManageScopedSingleton(className, scope, allowedToFail) \84 className* className::singletonPtr_s = NULL; \85 static ClassScopedSingletonWrapper<className, scope, allowedToFail> className##ScopedSingletonWrapper(#className)86 53 87 54 namespace orxonox -
code/branches/core7/src/libraries/network/Client.cc
r10458 r10459 52 52 #include "core/Game.h" 53 53 #include "core/commandline/CommandLineParser.h" 54 #include "core/singleton/ScopedSingleton Wrapper.h"54 #include "core/singleton/ScopedSingletonIncludes.h" 55 55 56 56 namespace orxonox -
code/branches/core7/src/libraries/network/LANDiscovery.cc
r10458 r10459 33 33 34 34 #include "core/CoreIncludes.h" 35 #include "core/singleton/ScopedSingleton Wrapper.h"35 #include "core/singleton/ScopedSingletonIncludes.h" 36 36 37 37 -
code/branches/core7/src/libraries/network/MasterServer.cc
r10458 r10459 31 31 #include "core/CoreIncludes.h" 32 32 #include "core/CorePrereqs.h" 33 #include "core/singleton/ScopedSingleton Wrapper.h"33 #include "core/singleton/ScopedSingletonIncludes.h" 34 34 #include "util/Output.h" 35 35 -
code/branches/core7/src/modules/designtools/ScreenshotManager.cc
r10458 r10459 48 48 #include "core/Resource.h" 49 49 #include "core/command/ConsoleCommandIncludes.h" 50 #include "core/singleton/ScopedSingleton Wrapper.h"50 #include "core/singleton/ScopedSingletonIncludes.h" 51 51 #include "util/StringUtils.h" 52 52 -
code/branches/core7/src/modules/designtools/SkyboxGenerator.cc
r10458 r10459 45 45 #include "core/command/ConsoleCommandIncludes.h" 46 46 #include "core/command/CommandExecutor.h" 47 #include "core/singleton/ScopedSingleton Wrapper.h"47 #include "core/singleton/ScopedSingletonIncludes.h" 48 48 49 49 #include "controllers/HumanController.h" -
code/branches/core7/src/modules/notifications/NotificationManager.cc
r10458 r10459 37 37 #include "core/CoreIncludes.h" 38 38 #include "core/LuaState.h" 39 #include "core/singleton/ScopedSingleton Wrapper.h"39 #include "core/singleton/ScopedSingletonIncludes.h" 40 40 41 41 #include "interfaces/NotificationListener.h" -
code/branches/core7/src/modules/pickup/PickupManager.cc
r10458 r10459 38 38 #include "core/GUIManager.h" 39 39 #include "core/class/Identifier.h" 40 #include "core/singleton/ScopedSingleton Wrapper.h"40 #include "core/singleton/ScopedSingletonIncludes.h" 41 41 #include "network/Host.h" 42 42 #include "network/NetworkFunction.h" -
code/branches/core7/src/modules/questsystem/QuestManager.cc
r10458 r10459 36 36 #include "util/Exception.h" 37 37 #include "util/OrxAssert.h" 38 #include "core/singleton/ScopedSingleton Wrapper.h"38 #include "core/singleton/ScopedSingletonIncludes.h" 39 39 #include "core/command/ConsoleCommand.h" 40 40 #include "core/GUIManager.h" -
code/branches/core7/src/orxonox/CameraManager.cc
r10458 r10459 38 38 #include "core/GraphicsManager.h" 39 39 #include "core/object/ObjectList.h" 40 #include "core/singleton/ScopedSingleton Wrapper.h"40 #include "core/singleton/ScopedSingletonIncludes.h" 41 41 #include "tools/Shader.h" 42 42 #include "graphics/Camera.h" -
code/branches/core7/src/orxonox/LevelManager.cc
r10458 r10459 36 36 #include <map> 37 37 38 #include "core/singleton/ScopedSingleton Wrapper.h"38 #include "core/singleton/ScopedSingletonIncludes.h" 39 39 #include "core/commandline/CommandLineIncludes.h" 40 40 #include "core/config/ConfigValueIncludes.h" -
code/branches/core7/src/orxonox/MoodManager.cc
r10458 r10459 29 29 #include "MoodManager.h" 30 30 31 #include "core/singleton/ScopedSingleton Wrapper.h"31 #include "core/singleton/ScopedSingletonIncludes.h" 32 32 #include "core/config/ConfigValueIncludes.h" 33 33 #include "core/CoreIncludes.h" -
code/branches/core7/src/orxonox/PlayerManager.cc
r10458 r10459 31 31 #include "core/CoreIncludes.h" 32 32 #include "core/GameMode.h" 33 #include "core/singleton/ScopedSingleton Wrapper.h"33 #include "core/singleton/ScopedSingletonIncludes.h" 34 34 35 35 #include "Level.h" -
code/branches/core7/src/orxonox/chat/ChatHistory.cc
r10458 r10459 28 28 29 29 #include "ChatHistory.h" 30 #include "core/singleton/ScopedSingleton Wrapper.h"30 #include "core/singleton/ScopedSingletonIncludes.h" 31 31 32 32 #ifndef CHATTEST -
code/branches/core7/src/orxonox/chat/ChatInputHandler.cc
r10458 r10459 47 47 #endif 48 48 49 #include "core/singleton/ScopedSingleton Wrapper.h"49 #include "core/singleton/ScopedSingletonIncludes.h" 50 50 #include "core/CoreIncludes.h" 51 51 #include "core/GUIManager.h" -
code/branches/core7/src/orxonox/chat/ChatManager.cc
r10458 r10459 31 31 32 32 #include "core/CoreIncludes.h" 33 #include "core/singleton/ScopedSingleton Wrapper.h"33 #include "core/singleton/ScopedSingletonIncludes.h" 34 34 #include "core/command/ConsoleCommandIncludes.h" 35 35 #include "network/Host.h" -
code/branches/core7/src/orxonox/overlays/InGameConsole.cc
r10458 r10459 50 50 #include "core/config/ConfigValueIncludes.h" 51 51 #include "core/command/ConsoleCommandIncludes.h" 52 #include "core/singleton/ScopedSingleton Wrapper.h"52 #include "core/singleton/ScopedSingletonIncludes.h" 53 53 #include "core/GUIManager.h" 54 54 #include "core/input/InputManager.h" -
code/branches/core7/src/orxonox/sound/SoundManager.cc
r10458 r10459 38 38 #include "util/Math.h" 39 39 #include "util/Clock.h" 40 #include "core/singleton/ScopedSingleton Wrapper.h"40 #include "core/singleton/ScopedSingletonIncludes.h" 41 41 #include "core/config/ConfigValueIncludes.h" 42 42 #include "core/CoreIncludes.h" -
code/branches/core7/test/core/singleton/ScopeTest.cc
r10458 r10459 1 1 #include <gtest/gtest.h> 2 #include "core/singleton/ScopedSingleton Wrapper.h"2 #include "core/singleton/ScopedSingletonIncludes.h" 3 3 4 4 namespace orxonox
Note: See TracChangeset
for help on using the changeset viewer.