From 7bb8fa4108704dce7f8d12db109c32f8a976f67d Mon Sep 17 00:00:00 2001 From: Pavel Rojtberg Date: Sat, 9 Nov 2024 18:17:01 +0100 Subject: [PATCH] Main: drop custom SharedPtr indirection --- .../include/OgreLodCollapseCostOutside.h | 1 - .../include/OgreMeshLodGenerator.h | 1 - .../MeshLodGenerator/src/OgreLodBuffer.h | 1 - .../src/OgreLodInputProviderMesh.h | 1 - .../src/OgreLodOutputProviderMesh.h | 1 - Components/Overlay/include/OgreFont.h | 3 +- .../include/OgreShaderSubRenderState.h | 2 +- .../OgreShaderExHardwareSkinningTechnique.h | 6 +-- .../include/OgreTerrainMaterialGenerator.h | 3 +- OgreMain/include/Ogre.i | 16 ++----- OgreMain/include/OgreArchive.h | 2 +- OgreMain/include/OgreController.h | 24 +++++----- OgreMain/include/OgreControllerManager.h | 5 +- OgreMain/include/OgreDataStream.h | 1 - OgreMain/include/OgreGpuProgram.h | 1 - OgreMain/include/OgreGpuProgramParams.h | 1 - OgreMain/include/OgreHardwareBuffer.h | 8 ++-- OgreMain/include/OgreHardwareIndexBuffer.h | 1 - OgreMain/include/OgreHardwarePixelBuffer.h | 1 - OgreMain/include/OgreHardwareVertexBuffer.h | 1 - OgreMain/include/OgreMaterial.h | 1 - OgreMain/include/OgreMesh.h | 1 - OgreMain/include/OgrePrerequisites.h | 46 ++++++++++--------- OgreMain/include/OgreScriptCompiler.h | 9 ++-- OgreMain/include/OgreSharedPtr.h | 16 +++---- OgreMain/include/OgreSkeleton.h | 1 - OgreMain/include/OgreStringVector.h | 3 +- OgreMain/include/OgreTexture.h | 1 - OgreMain/include/OgreWorkQueue.h | 1 - OgreMain/src/OgreScriptCompiler.cpp | 4 +- OgreMain/src/OgreStableHeaders.h | 1 - .../BSPSceneManager/include/OgreBspLevel.h | 2 +- .../Direct3D11/include/OgreD3D11Driver.h | 3 +- .../Direct3D11/include/OgreD3D11DriverList.h | 2 +- .../include/OgreD3D11Prerequisites.h | 4 +- .../Direct3D11/src/OgreD3D11DriverList.cpp | 2 +- .../Direct3D9/include/OgreD3D9Prerequisites.h | 6 +-- .../GLSupport/include/OgreGLContext.h | 5 +- .../include/OgreShaderExTextureAtlasSampler.h | 2 +- 39 files changed, 78 insertions(+), 112 deletions(-) diff --git a/Components/MeshLodGenerator/include/OgreLodCollapseCostOutside.h b/Components/MeshLodGenerator/include/OgreLodCollapseCostOutside.h index 4e9bc8f917e..49974ef8370 100644 --- a/Components/MeshLodGenerator/include/OgreLodCollapseCostOutside.h +++ b/Components/MeshLodGenerator/include/OgreLodCollapseCostOutside.h @@ -33,7 +33,6 @@ #include "OgreLodPrerequisites.h" #include "OgreLodCollapseCost.h" #include "OgreLodData.h" -#include "OgreSharedPtr.h" #include "OgreHeaderPrefix.h" namespace Ogre diff --git a/Components/MeshLodGenerator/include/OgreMeshLodGenerator.h b/Components/MeshLodGenerator/include/OgreMeshLodGenerator.h index b916b0ade7f..26834e247b4 100644 --- a/Components/MeshLodGenerator/include/OgreMeshLodGenerator.h +++ b/Components/MeshLodGenerator/include/OgreMeshLodGenerator.h @@ -36,7 +36,6 @@ #include "OgreLodOutputProvider.h" #include "OgreLodCollapseCost.h" #include "OgreLodCollapser.h" -#include "OgreSharedPtr.h" #include "OgreSingleton.h" #include "OgreWorkQueue.h" diff --git a/Components/MeshLodGenerator/src/OgreLodBuffer.h b/Components/MeshLodGenerator/src/OgreLodBuffer.h index 728d7386b30..70296aa4d99 100644 --- a/Components/MeshLodGenerator/src/OgreLodBuffer.h +++ b/Components/MeshLodGenerator/src/OgreLodBuffer.h @@ -30,7 +30,6 @@ #define _LodBuffer_H__ #include "OgreLodPrerequisites.h" -#include "OgreSharedPtr.h" #include "OgreHeaderPrefix.h" namespace Ogre diff --git a/Components/MeshLodGenerator/src/OgreLodInputProviderMesh.h b/Components/MeshLodGenerator/src/OgreLodInputProviderMesh.h index f6e4bcad58e..bbb4bd432fe 100644 --- a/Components/MeshLodGenerator/src/OgreLodInputProviderMesh.h +++ b/Components/MeshLodGenerator/src/OgreLodInputProviderMesh.h @@ -33,7 +33,6 @@ #include "OgreLodPrerequisites.h" #include "OgreLodInputProvider.h" #include "OgreLodData.h" -#include "OgreSharedPtr.h" #include "OgreLogManager.h" #include "OgreRenderOperation.h" #include "OgreHeaderPrefix.h" diff --git a/Components/MeshLodGenerator/src/OgreLodOutputProviderMesh.h b/Components/MeshLodGenerator/src/OgreLodOutputProviderMesh.h index 2e1b693bc9b..14e3203cb9a 100644 --- a/Components/MeshLodGenerator/src/OgreLodOutputProviderMesh.h +++ b/Components/MeshLodGenerator/src/OgreLodOutputProviderMesh.h @@ -32,7 +32,6 @@ #include "OgreLodPrerequisites.h" #include "OgreLodOutputProvider.h" -#include "OgreSharedPtr.h" #include "OgreHeaderPrefix.h" namespace Ogre diff --git a/Components/Overlay/include/OgreFont.h b/Components/Overlay/include/OgreFont.h index 127465cb944..265085bed0a 100644 --- a/Components/Overlay/include/OgreFont.h +++ b/Components/Overlay/include/OgreFont.h @@ -30,7 +30,6 @@ THE SOFTWARE #include "OgreOverlayPrerequisites.h" #include "OgreResource.h" #include "OgreCommon.h" -#include "OgreSharedPtr.h" #include "OgreColourValue.h" #include "OgreException.h" @@ -344,7 +343,7 @@ namespace Ogre void _setMaterial(const MaterialPtr& mat); }; - typedef SharedPtr FontPtr; + typedef shared_ptr FontPtr; /** @} */ /** @} */ } diff --git a/Components/RTShaderSystem/include/OgreShaderSubRenderState.h b/Components/RTShaderSystem/include/OgreShaderSubRenderState.h index 07def5f61ed..26c94c42714 100644 --- a/Components/RTShaderSystem/include/OgreShaderSubRenderState.h +++ b/Components/RTShaderSystem/include/OgreShaderSubRenderState.h @@ -40,7 +40,7 @@ namespace RTShader { * @{ */ -typedef SharedPtr SubRenderStateAccessorPtr; +typedef shared_ptr SubRenderStateAccessorPtr; /// Computes the position of the vertex in projection space, allows using instancing _OgreRTSSExport extern const String SRS_TRANSFORM; diff --git a/Components/RTShaderSystem/src/OgreShaderExHardwareSkinningTechnique.h b/Components/RTShaderSystem/src/OgreShaderExHardwareSkinningTechnique.h index dfc5988fa35..02017c3ccf8 100644 --- a/Components/RTShaderSystem/src/OgreShaderExHardwareSkinningTechnique.h +++ b/Components/RTShaderSystem/src/OgreShaderExHardwareSkinningTechnique.h @@ -249,9 +249,9 @@ class HardwareSkinning : public SubRenderState */ bool addFunctionInvocations(ProgramSet* programSet) override; - SharedPtr mLinear; - SharedPtr mDualQuat; - SharedPtr mActiveTechnique; + shared_ptr mLinear; + shared_ptr mDualQuat; + shared_ptr mActiveTechnique; ///The factory which created this sub render state const HardwareSkinningFactory* mCreator; diff --git a/Components/Terrain/include/OgreTerrainMaterialGenerator.h b/Components/Terrain/include/OgreTerrainMaterialGenerator.h index ea2cbeb58b1..d584342eaeb 100644 --- a/Components/Terrain/include/OgreTerrainMaterialGenerator.h +++ b/Components/Terrain/include/OgreTerrainMaterialGenerator.h @@ -31,7 +31,6 @@ THE SOFTWARE. #include "OgreTerrainPrerequisites.h" #include "OgrePixelFormat.h" -#include "OgreSharedPtr.h" namespace Ogre { @@ -191,7 +190,7 @@ namespace Ogre }; - typedef SharedPtr TerrainMaterialGeneratorPtr; + typedef shared_ptr TerrainMaterialGeneratorPtr; /** @} */ /** @} */ diff --git a/OgreMain/include/Ogre.i b/OgreMain/include/Ogre.i index d7850673f65..dba6b11e2d6 100644 --- a/OgreMain/include/Ogre.i +++ b/OgreMain/include/Ogre.i @@ -160,8 +160,7 @@ JNIEnv* OgreJNIGetEnv() { %define SHARED_PTR(classname) // %shared_ptr(type); -%ignore Ogre::SharedPtr::operator const shared_ptr&; -%template(classname ## Ptr) Ogre::SharedPtr; +%template(classname ## Ptr) std::shared_ptr; %enddef %ignore *::operator[]; @@ -266,13 +265,6 @@ ADD_REPR(TRect) // Basic Data Types %include "OgreException.h" -%ignore Ogre::SharedPtr::useCount; -%ignore Ogre::SharedPtr::bind; -%ignore Ogre::SharedPtr::getPointer; -%ignore Ogre::SharedPtr::setNull; -%ignore Ogre::SharedPtr::isNull; -%ignore Ogre::SharedPtr::setUseCount; -%include "OgreSharedPtr.h" %ignore Ogre::Any::getType; // deprecated %ignore Ogre::Any::destroy; // deprecated %ignore Ogre::Any::isEmpty; // deprecated @@ -284,7 +276,7 @@ ADD_REPR(Radian) %template(RayTestResult) std::pair; %include "OgreStringVector.h" %template(StringList) std::vector; // actual vector -%template(StringListPtr) Ogre::SharedPtr >; +%template(StringListPtr) std::shared_ptr >; %include "OgreFileSystemLayer.h" // Linear Algebra %ignore Ogre::Vector<2, Ogre::Real>::Vector(float, float, float); @@ -607,8 +599,8 @@ SHARED_PTR(StringInterface); %ignore Ogre::TextureUnitState::setAnimatedTextureName( const String* const, size_t, Real = 0 ); %include "OgreTextureUnitState.h" %template(ControllerFloat) Ogre::Controller; -%template(ControllerValueFloatPtr) Ogre::SharedPtr >; -%template(ControllerFunctionPtr) Ogre::SharedPtr >; +%template(ControllerValueFloatPtr) std::shared_ptr >; +%template(ControllerFunctionPtr) std::shared_ptr >; %include "OgreControllerManager.h" %include "OgrePredefinedControllers.h" SHARED_PTR(Compositor); diff --git a/OgreMain/include/OgreArchive.h b/OgreMain/include/OgreArchive.h index fddd33d5069..dc45fe80646 100644 --- a/OgreMain/include/OgreArchive.h +++ b/OgreMain/include/OgreArchive.h @@ -64,7 +64,7 @@ namespace Ogre { }; typedef std::vector FileInfoList; - typedef SharedPtr FileInfoListPtr; + typedef shared_ptr FileInfoListPtr; /** Archive-handling class. diff --git a/OgreMain/include/OgreController.h b/OgreMain/include/OgreController.h index 6925ba71007..e98bb284321 100644 --- a/OgreMain/include/OgreController.h +++ b/OgreMain/include/OgreController.h @@ -30,8 +30,6 @@ THE SOFTWARE. #include "OgrePrerequisites.h" -#include "OgreSharedPtr.h" - namespace Ogre { /** \addtogroup Core @@ -130,11 +128,11 @@ namespace Ogre { { protected: /// Source value - SharedPtr< ControllerValue > mSource; + shared_ptr< ControllerValue > mSource; /// Destination value - SharedPtr< ControllerValue > mDest; + shared_ptr< ControllerValue > mDest; /// Function - SharedPtr< ControllerFunction > mFunc; + shared_ptr< ControllerFunction > mFunc; /// Controller is enabled or not bool mEnabled; @@ -146,8 +144,8 @@ namespace Ogre { Requires source and destination values, and a function object. None of these are destroyed with the Controller when it is deleted (they can be shared) so you must delete these as appropriate. */ - Controller(const SharedPtr< ControllerValue >& src, - const SharedPtr< ControllerValue >& dest, const SharedPtr< ControllerFunction >& func) + Controller(const shared_ptr< ControllerValue >& src, + const shared_ptr< ControllerValue >& dest, const shared_ptr< ControllerFunction >& func) : mSource(src), mDest(dest), mFunc(func) { mEnabled = true; @@ -159,23 +157,23 @@ namespace Ogre { /// Sets the input controller value - void setSource(const SharedPtr< ControllerValue >& src) + void setSource(const shared_ptr< ControllerValue >& src) { mSource = src; } /// Gets the input controller value - const SharedPtr< ControllerValue >& getSource(void) const + const shared_ptr< ControllerValue >& getSource(void) const { return mSource; } /// Sets the output controller value - void setDestination(const SharedPtr< ControllerValue >& dest) + void setDestination(const shared_ptr< ControllerValue >& dest) { mDest = dest; } /// Gets the output controller value - const SharedPtr< ControllerValue >& getDestination(void) const + const shared_ptr< ControllerValue >& getDestination(void) const { return mDest; } @@ -194,14 +192,14 @@ namespace Ogre { /** Sets the function object to be used by this controller. */ - void setFunction(const SharedPtr< ControllerFunction >& func) + void setFunction(const shared_ptr< ControllerFunction >& func) { mFunc = func; } /** Returns a pointer to the function object used by this controller. */ - const SharedPtr< ControllerFunction >& getFunction(void) const + const shared_ptr< ControllerFunction >& getFunction(void) const { return mFunc; } diff --git a/OgreMain/include/OgreControllerManager.h b/OgreMain/include/OgreControllerManager.h index cf5a4581517..d9dfea5b8e5 100644 --- a/OgreMain/include/OgreControllerManager.h +++ b/OgreMain/include/OgreControllerManager.h @@ -33,7 +33,6 @@ THE SOFTWARE. #include "OgreCommon.h" #include "OgreSingleton.h" #include "OgreTextureUnitState.h" -#include "OgreSharedPtr.h" #include "OgreHeaderPrefix.h" namespace Ogre { @@ -44,8 +43,8 @@ namespace Ogre { * @{ */ - typedef SharedPtr< ControllerValue > ControllerValueRealPtr; - typedef SharedPtr< ControllerFunction > ControllerFunctionRealPtr; + typedef shared_ptr< ControllerValue > ControllerValueRealPtr; + typedef shared_ptr< ControllerFunction > ControllerFunctionRealPtr; /** Class for managing Controller instances. diff --git a/OgreMain/include/OgreDataStream.h b/OgreMain/include/OgreDataStream.h index 7130cd8f984..f1fa7cf9793 100644 --- a/OgreMain/include/OgreDataStream.h +++ b/OgreMain/include/OgreDataStream.h @@ -29,7 +29,6 @@ THE SOFTWARE. #define __DataStream_H__ #include "OgrePrerequisites.h" -#include "OgreSharedPtr.h" #include #include "OgreHeaderPrefix.h" diff --git a/OgreMain/include/OgreGpuProgram.h b/OgreMain/include/OgreGpuProgram.h index 51d2a6332c6..e446486b493 100644 --- a/OgreMain/include/OgreGpuProgram.h +++ b/OgreMain/include/OgreGpuProgram.h @@ -34,7 +34,6 @@ THE SOFTWARE. #include "OgreGpuProgramParams.h" #include "OgreHeaderPrefix.h" #include "OgreVector.h" -#include "OgreSharedPtr.h" namespace Ogre { diff --git a/OgreMain/include/OgreGpuProgramParams.h b/OgreMain/include/OgreGpuProgramParams.h index 2ac44e1f22a..950d89277a9 100644 --- a/OgreMain/include/OgreGpuProgramParams.h +++ b/OgreMain/include/OgreGpuProgramParams.h @@ -32,7 +32,6 @@ Copyright (c) 2000-2014 Torus Knot Software Ltd // Precompiler options #include "OgrePrerequisites.h" -#include "OgreSharedPtr.h" #include "OgreSerializer.h" #include "OgreAny.h" #include "Threading/OgreThreadHeaders.h" diff --git a/OgreMain/include/OgreHardwareBuffer.h b/OgreMain/include/OgreHardwareBuffer.h index 26ebd76ce39..508037e6f99 100644 --- a/OgreMain/include/OgreHardwareBuffer.h +++ b/OgreMain/include/OgreHardwareBuffer.h @@ -402,11 +402,11 @@ namespace Ogre { : pBuf(0), pData(0) { lock(p, offset, length, options); } template - HardwareBufferLockGuard(const SharedPtr& p, HardwareBuffer::LockOptions options) + HardwareBufferLockGuard(const shared_ptr& p, HardwareBuffer::LockOptions options) : pBuf(0), pData(0) { lock(p.get(), options); } template - HardwareBufferLockGuard(const SharedPtr& p, size_t offset, size_t length, HardwareBuffer::LockOptions options) + HardwareBufferLockGuard(const shared_ptr& p, size_t offset, size_t length, HardwareBuffer::LockOptions options) : pBuf(0), pData(0) { lock(p.get(), offset, length, options); } ~HardwareBufferLockGuard() { unlock(); } @@ -438,11 +438,11 @@ namespace Ogre { } template - void lock(const SharedPtr& p, HardwareBuffer::LockOptions options) + void lock(const shared_ptr& p, HardwareBuffer::LockOptions options) { lock(p.get(), options); } template - void lock(const SharedPtr& p, size_t offset, size_t length, HardwareBuffer::LockOptions options) + void lock(const shared_ptr& p, size_t offset, size_t length, HardwareBuffer::LockOptions options) { lock(p.get(), offset, length, options); } HardwareBuffer* pBuf; diff --git a/OgreMain/include/OgreHardwareIndexBuffer.h b/OgreMain/include/OgreHardwareIndexBuffer.h index 5dbb5bedf8e..eac40800b77 100644 --- a/OgreMain/include/OgreHardwareIndexBuffer.h +++ b/OgreMain/include/OgreHardwareIndexBuffer.h @@ -31,7 +31,6 @@ THE SOFTWARE. // Precompiler options #include "OgrePrerequisites.h" #include "OgreHardwareBuffer.h" -#include "OgreSharedPtr.h" namespace Ogre { class HardwareBufferManagerBase; diff --git a/OgreMain/include/OgreHardwarePixelBuffer.h b/OgreMain/include/OgreHardwarePixelBuffer.h index 0f43c5d4ff0..04a08a1bab1 100644 --- a/OgreMain/include/OgreHardwarePixelBuffer.h +++ b/OgreMain/include/OgreHardwarePixelBuffer.h @@ -32,7 +32,6 @@ THE SOFTWARE. #include "OgrePrerequisites.h" #include "OgreHardwareBuffer.h" #include "OgreImage.h" -#include "OgreSharedPtr.h" #include "OgreHeaderPrefix.h" namespace Ogre { diff --git a/OgreMain/include/OgreHardwareVertexBuffer.h b/OgreMain/include/OgreHardwareVertexBuffer.h index e6e3734843a..9148b2a86c8 100644 --- a/OgreMain/include/OgreHardwareVertexBuffer.h +++ b/OgreMain/include/OgreHardwareVertexBuffer.h @@ -31,7 +31,6 @@ THE SOFTWARE. // Precompiler options #include "OgrePrerequisites.h" #include "OgreHardwareBuffer.h" -#include "OgreSharedPtr.h" #include "OgreColourValue.h" #include "OgreHeaderPrefix.h" diff --git a/OgreMain/include/OgreMaterial.h b/OgreMain/include/OgreMaterial.h index ef234d94b0f..32ef5ffa79c 100644 --- a/OgreMain/include/OgreMaterial.h +++ b/OgreMain/include/OgreMaterial.h @@ -35,7 +35,6 @@ THE SOFTWARE. #include "OgreColourValue.h" #include "OgreBlendMode.h" #include "OgreHeaderPrefix.h" -#include "OgreSharedPtr.h" namespace Ogre { diff --git a/OgreMain/include/OgreMesh.h b/OgreMain/include/OgreMesh.h index 2be90dc7e46..e6e5ce2dc9f 100644 --- a/OgreMain/include/OgreMesh.h +++ b/OgreMain/include/OgreMesh.h @@ -36,7 +36,6 @@ THE SOFTWARE. #include "OgreAnimation.h" #include "OgreAnimationTrack.h" #include "OgreHeaderPrefix.h" -#include "OgreSharedPtr.h" #include "OgreUserObjectBindings.h" #include "OgreVertexIndexData.h" diff --git a/OgreMain/include/OgrePrerequisites.h b/OgreMain/include/OgrePrerequisites.h index 3eb3880349a..4f461dd17e8 100644 --- a/OgreMain/include/OgrePrerequisites.h +++ b/OgreMain/include/OgrePrerequisites.h @@ -287,29 +287,31 @@ OGRE_DEBUG_NS_END using std::shared_ptr; using std::unique_ptr; - template class SharedPtr; - typedef SharedPtr AnimableValuePtr; - typedef SharedPtr CompositorPtr; - typedef SharedPtr DataStreamPtr; - typedef SharedPtr GpuProgramPtr; - typedef SharedPtr GpuNamedConstantsPtr; - typedef SharedPtr GpuLogicalBufferStructPtr; - typedef SharedPtr GpuSharedParametersPtr; - typedef SharedPtr GpuProgramParametersPtr; - typedef SharedPtr HardwareBufferPtr; - typedef SharedPtr HardwareIndexBufferPtr; - typedef SharedPtr HardwarePixelBufferPtr; - typedef SharedPtr HardwareVertexBufferPtr; - typedef SharedPtr MaterialPtr; - typedef SharedPtr MemoryDataStreamPtr; - typedef SharedPtr MeshPtr; - typedef SharedPtr PatchMeshPtr; - typedef SharedPtr RenderToVertexBufferPtr; - typedef SharedPtr ResourcePtr; - typedef SharedPtr ShadowCameraSetupPtr; - typedef SharedPtr SkeletonPtr; - typedef SharedPtr TexturePtr; + using std::static_pointer_cast; + using std::dynamic_pointer_cast; + + typedef shared_ptr AnimableValuePtr; + typedef shared_ptr CompositorPtr; + typedef shared_ptr DataStreamPtr; + typedef shared_ptr GpuProgramPtr; + typedef shared_ptr GpuNamedConstantsPtr; + typedef shared_ptr GpuLogicalBufferStructPtr; + typedef shared_ptr GpuSharedParametersPtr; + typedef shared_ptr GpuProgramParametersPtr; + typedef shared_ptr HardwareBufferPtr; + typedef shared_ptr HardwareIndexBufferPtr; + typedef shared_ptr HardwarePixelBufferPtr; + typedef shared_ptr HardwareVertexBufferPtr; + typedef shared_ptr MaterialPtr; + typedef shared_ptr MemoryDataStreamPtr; + typedef shared_ptr MeshPtr; + typedef shared_ptr PatchMeshPtr; + typedef shared_ptr RenderToVertexBufferPtr; + typedef shared_ptr ResourcePtr; + typedef shared_ptr ShadowCameraSetupPtr; + typedef shared_ptr SkeletonPtr; + typedef shared_ptr TexturePtr; typedef RenderToVertexBufferPtr RenderToVertexBufferSharedPtr; //!< @deprecated typedef HardwareIndexBufferPtr HardwareIndexBufferSharedPtr; //!< @deprecated diff --git a/OgreMain/include/OgreScriptCompiler.h b/OgreMain/include/OgreScriptCompiler.h index 88bcbc292aa..8ef4f94c30c 100644 --- a/OgreMain/include/OgreScriptCompiler.h +++ b/OgreMain/include/OgreScriptCompiler.h @@ -29,7 +29,6 @@ THE SOFTWARE. #ifndef __SCRIPTCOMPILER_H_ #define __SCRIPTCOMPILER_H_ -#include "OgreSharedPtr.h" #include "OgreSingleton.h" #include "OgreScriptLoader.h" #include "OgreGpuProgram.h" @@ -60,9 +59,9 @@ namespace Ogre /** The ConcreteNode is the struct that holds an un-conditioned sub-tree of parsed input */ struct ConcreteNode; - typedef SharedPtr ConcreteNodePtr; + typedef shared_ptr ConcreteNodePtr; typedef std::list ConcreteNodeList; - typedef SharedPtr ConcreteNodeListPtr; + typedef shared_ptr ConcreteNodeListPtr; struct ConcreteNode : public ScriptCompilerAlloc { String token, file; @@ -84,9 +83,9 @@ namespace Ogre ANT_VARIABLE_ACCESS }; class AbstractNode; - typedef SharedPtr AbstractNodePtr; + typedef shared_ptr AbstractNodePtr; typedef std::list AbstractNodeList; - typedef SharedPtr AbstractNodeListPtr; + typedef shared_ptr AbstractNodeListPtr; class _OgreExport AbstractNode : public AbstractNodeAlloc { diff --git a/OgreMain/include/OgreSharedPtr.h b/OgreMain/include/OgreSharedPtr.h index 830d3be667e..3b65a853c7b 100644 --- a/OgreMain/include/OgreSharedPtr.h +++ b/OgreMain/include/OgreSharedPtr.h @@ -37,8 +37,6 @@ namespace Ogre { /** \addtogroup General * @{ */ - using std::static_pointer_cast; - using std::dynamic_pointer_cast; /// @deprecated for backwards compatibility only, rather use shared_ptr directly template class SharedPtr : public shared_ptr @@ -64,20 +62,20 @@ namespace Ogre { /// @deprecated use Ogre::static_pointer_cast instead template - OGRE_DEPRECATED SharedPtr staticCast() const { return static_pointer_cast(*this); } + SharedPtr staticCast() const { return static_pointer_cast(*this); } /// @deprecated use Ogre::dynamic_pointer_cast instead template - OGRE_DEPRECATED SharedPtr dynamicCast() const { return dynamic_pointer_cast(*this); } + SharedPtr dynamicCast() const { return dynamic_pointer_cast(*this); } /// @deprecated this api will be dropped. use reset(T*) instead - OGRE_DEPRECATED void bind(T* rep) { shared_ptr::reset(rep); } + void bind(T* rep) { shared_ptr::reset(rep); } /// @deprecated use use_count() instead - OGRE_DEPRECATED unsigned int useCount() const { return shared_ptr::use_count(); } + unsigned int useCount() const { return shared_ptr::use_count(); } /// @deprecated use get() instead - OGRE_DEPRECATED T* getPointer() const { return shared_ptr::get(); } + T* getPointer() const { return shared_ptr::get(); } /// @deprecated use SharedPtr::operator bool instead - OGRE_DEPRECATED bool isNull(void) const { return !shared_ptr::operator bool(); } + bool isNull(void) const { return !shared_ptr::operator bool(); } /// @deprecated use reset() instead - OGRE_DEPRECATED void setNull() { shared_ptr::reset(); } + void setNull() { shared_ptr::reset(); } }; /** @} */ /** @} */ diff --git a/OgreMain/include/OgreSkeleton.h b/OgreMain/include/OgreSkeleton.h index c172cc4329b..360f264aa7c 100644 --- a/OgreMain/include/OgreSkeleton.h +++ b/OgreMain/include/OgreSkeleton.h @@ -34,7 +34,6 @@ THE SOFTWARE. #include "OgreStringVector.h" #include "OgreAnimation.h" #include "OgreHeaderPrefix.h" -#include "OgreSharedPtr.h" namespace Ogre { /** \addtogroup Core diff --git a/OgreMain/include/OgreStringVector.h b/OgreMain/include/OgreStringVector.h index 5b37ebe6e1d..4e9c161085d 100644 --- a/OgreMain/include/OgreStringVector.h +++ b/OgreMain/include/OgreStringVector.h @@ -29,7 +29,6 @@ THE SOFTWARE. #define _StringVector_H__ #include "OgrePrerequisites.h" -#include "OgreSharedPtr.h" #include "OgreString.h" namespace Ogre { @@ -41,7 +40,7 @@ namespace Ogre { */ typedef std::vector StringVector; - typedef SharedPtr StringVectorPtr; + typedef shared_ptr StringVectorPtr; /** @} */ /** @} */ diff --git a/OgreMain/include/OgreTexture.h b/OgreMain/include/OgreTexture.h index a2b90783fee..766ffdb39fc 100644 --- a/OgreMain/include/OgreTexture.h +++ b/OgreMain/include/OgreTexture.h @@ -33,7 +33,6 @@ THE SOFTWARE. #include "OgreResource.h" #include "OgreImage.h" #include "OgreHeaderPrefix.h" -#include "OgreSharedPtr.h" namespace Ogre { diff --git a/OgreMain/include/OgreWorkQueue.h b/OgreMain/include/OgreWorkQueue.h index 686ff60ade1..581961a340f 100644 --- a/OgreMain/include/OgreWorkQueue.h +++ b/OgreMain/include/OgreWorkQueue.h @@ -30,7 +30,6 @@ THE SOFTWARE. #include "OgrePrerequisites.h" #include "OgreAny.h" -#include "OgreSharedPtr.h" #include "OgreCommon.h" #include "Threading/OgreThreadHeaders.h" #include "OgreHeaderPrefix.h" diff --git a/OgreMain/src/OgreScriptCompiler.cpp b/OgreMain/src/OgreScriptCompiler.cpp index f98589b1cff..75ee4db5db6 100644 --- a/OgreMain/src/OgreScriptCompiler.cpp +++ b/OgreMain/src/OgreScriptCompiler.cpp @@ -527,7 +527,7 @@ namespace Ogre AbstractNodeList ScriptCompiler::locateTarget(const AbstractNodeList& nodes, const Ogre::String &target) { - SharedPtr iter = nullptr; + shared_ptr iter = nullptr; // Search for a top-level object node for(auto i : nodes) @@ -612,7 +612,7 @@ namespace Ogre } // Create a vector storing each pairing of override between source and destination - typedef SharedPtr ObjectAbstractNodePtr; + typedef shared_ptr ObjectAbstractNodePtr; std::vector > overrides; // A list of indices for each destination node tracks the minimum // source node they can index-match against diff --git a/OgreMain/src/OgreStableHeaders.h b/OgreMain/src/OgreStableHeaders.h index b5f425a589d..df573fdff11 100644 --- a/OgreMain/src/OgreStableHeaders.h +++ b/OgreMain/src/OgreStableHeaders.h @@ -100,7 +100,6 @@ extern "C" { #include "OgreSceneNode.h" #include "OgreScriptCompiler.h" #include "OgreSerializer.h" -#include "OgreSharedPtr.h" #include "OgreSimpleRenderable.h" #include "OgreSimpleSpline.h" #include "OgreSingleton.h" diff --git a/PlugIns/BSPSceneManager/include/OgreBspLevel.h b/PlugIns/BSPSceneManager/include/OgreBspLevel.h index 46079bcbbbe..a608760064a 100644 --- a/PlugIns/BSPSceneManager/include/OgreBspLevel.h +++ b/PlugIns/BSPSceneManager/include/OgreBspLevel.h @@ -257,7 +257,7 @@ namespace Ogre { }; - typedef SharedPtr BspLevelPtr; + typedef shared_ptr BspLevelPtr; /** @} */ /** @} */ } diff --git a/RenderSystems/Direct3D11/include/OgreD3D11Driver.h b/RenderSystems/Direct3D11/include/OgreD3D11Driver.h index 877667e3bca..bb103d99560 100644 --- a/RenderSystems/Direct3D11/include/OgreD3D11Driver.h +++ b/RenderSystems/Direct3D11/include/OgreD3D11Driver.h @@ -29,7 +29,6 @@ THE SOFTWARE. #define __D3D11DRIVER_H__ #include "OgreD3D11Prerequisites.h" -#include "OgreSharedPtr.h" namespace Ogre { @@ -43,7 +42,7 @@ namespace Ogre ComPtr mDXGIAdapter; DXGI_ADAPTER_DESC1 mAdapterIdentifier; unsigned mSameNameAdapterIndex; - SharedPtr mVideoModeList; + shared_ptr mVideoModeList; public: // Constructors diff --git a/RenderSystems/Direct3D11/include/OgreD3D11DriverList.h b/RenderSystems/Direct3D11/include/OgreD3D11DriverList.h index 2288a5521a0..91a49ae7ef0 100644 --- a/RenderSystems/Direct3D11/include/OgreD3D11DriverList.h +++ b/RenderSystems/Direct3D11/include/OgreD3D11DriverList.h @@ -49,7 +49,7 @@ namespace Ogre D3D11Driver* findByName( const String &name ); // never fail but can return default driver if requested is not found private: - std::vector > mDriverList; + std::vector > mDriverList; unsigned mHiddenDriversCount; }; } diff --git a/RenderSystems/Direct3D11/include/OgreD3D11Prerequisites.h b/RenderSystems/Direct3D11/include/OgreD3D11Prerequisites.h index f13d76829ee..60e706a1d0b 100644 --- a/RenderSystems/Direct3D11/include/OgreD3D11Prerequisites.h +++ b/RenderSystems/Direct3D11/include/OgreD3D11Prerequisites.h @@ -121,8 +121,8 @@ namespace Ogre class D3D11HardwarePixelBuffer; class D3D11RenderTarget; - typedef SharedPtr D3D11HLSLProgramPtr; - typedef SharedPtr D3D11TexturePtr; + typedef shared_ptr D3D11HLSLProgramPtr; + typedef shared_ptr D3D11TexturePtr; //------------------------------------------- // Windows setttings diff --git a/RenderSystems/Direct3D11/src/OgreD3D11DriverList.cpp b/RenderSystems/Direct3D11/src/OgreD3D11DriverList.cpp index 2274c6194ff..5423433fd77 100644 --- a/RenderSystems/Direct3D11/src/OgreD3D11DriverList.cpp +++ b/RenderSystems/Direct3D11/src/OgreD3D11DriverList.cpp @@ -125,7 +125,7 @@ namespace Ogre //----------------------------------------------------------------------- D3D11Driver* D3D11DriverList::item( const String &name ) { - for(std::vector >::iterator it = mDriverList.begin(), it_end = mDriverList.end(); it != mDriverList.end(); ++it) + for(std::vector >::iterator it = mDriverList.begin(), it_end = mDriverList.end(); it != mDriverList.end(); ++it) { if((*it)->DriverDescription() == name) return (*it).get(); diff --git a/RenderSystems/Direct3D9/include/OgreD3D9Prerequisites.h b/RenderSystems/Direct3D9/include/OgreD3D9Prerequisites.h index ffebe9175df..8369bb0d172 100644 --- a/RenderSystems/Direct3D9/include/OgreD3D9Prerequisites.h +++ b/RenderSystems/Direct3D9/include/OgreD3D9Prerequisites.h @@ -91,9 +91,9 @@ namespace Ogre class D3D9VertexDeclaration; class D3D9Resource; - typedef SharedPtr D3D9GpuProgramPtr; - typedef SharedPtr D3D9HLSLProgramPtr; - typedef SharedPtr D3D9TexturePtr; + typedef shared_ptr D3D9GpuProgramPtr; + typedef shared_ptr D3D9HLSLProgramPtr; + typedef shared_ptr D3D9TexturePtr; //------------------------------------------- // Windows setttings diff --git a/RenderSystems/GLSupport/include/OgreGLContext.h b/RenderSystems/GLSupport/include/OgreGLContext.h index 0478d206d6f..09e9f348452 100644 --- a/RenderSystems/GLSupport/include/OgreGLContext.h +++ b/RenderSystems/GLSupport/include/OgreGLContext.h @@ -30,7 +30,6 @@ THE SOFTWARE. #include "OgreGLSupportPrerequisites.h" #include "OgreGLStateCacheManagerCommon.h" -#include "OgreSharedPtr.h" namespace Ogre { @@ -78,7 +77,7 @@ namespace Ogre { if(!mStateCacheManager) { StateCacheManager* stateCache = OGRE_NEW StateCacheManager; stateCache->initializeCache(); - mStateCacheManager = SharedPtr(stateCache); + mStateCacheManager = shared_ptr(stateCache); } return static_cast(mStateCacheManager.get()); } @@ -90,7 +89,7 @@ namespace Ogre { protected: bool initialized; - SharedPtr mStateCacheManager; + shared_ptr mStateCacheManager; std::vector mVaoDeferredForDestruction; std::vector mFboDeferredForDestruction; }; diff --git a/Samples/ShaderSystem/include/OgreShaderExTextureAtlasSampler.h b/Samples/ShaderSystem/include/OgreShaderExTextureAtlasSampler.h index 0089761a11c..5673e56c9c6 100644 --- a/Samples/ShaderSystem/include/OgreShaderExTextureAtlasSampler.h +++ b/Samples/ShaderSystem/include/OgreShaderExTextureAtlasSampler.h @@ -66,7 +66,7 @@ struct TextureAtlasRecord }; typedef std::vector TextureAtlasTable; -typedef SharedPtr TextureAtlasTablePtr; +typedef shared_ptr TextureAtlasTablePtr; typedef std::map TextureAtlasMap;