Coverage Report

Created: 2025-07-11 06:36

/src/ogre/OgreMain/include/OgreSharedPtr.h
Line
Count
Source (jump to first uncovered line)
1
/*
2
-----------------------------------------------------------------------------
3
This source file is part of OGRE
4
    (Object-oriented Graphics Rendering Engine)
5
For the latest info, see http://www.ogre3d.org/
6
7
Copyright (c) 2000-2014 Torus Knot Software Ltd
8
9
Permission is hereby granted, free of charge, to any person obtaining a copy
10
of this software and associated documentation files (the "Software"), to deal
11
in the Software without restriction, including without limitation the rights
12
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
copies of the Software, and to permit persons to whom the Software is
14
furnished to do so, subject to the following conditions:
15
16
The above copyright notice and this permission notice shall be included in
17
all copies or substantial portions of the Software.
18
19
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
THE SOFTWARE.
26
-----------------------------------------------------------------------------
27
*/
28
#ifndef __SharedPtr_H__
29
#define __SharedPtr_H__
30
31
#include "OgrePrerequisites.h"
32
33
namespace Ogre {
34
    /** \addtogroup Core
35
    *  @{
36
    */
37
    /** \addtogroup General
38
    *  @{
39
    */
40
    using std::static_pointer_cast;
41
    using std::dynamic_pointer_cast;
42
43
    /// @deprecated for backwards compatibility only, rather use shared_ptr directly
44
    template<class T> class SharedPtr : public shared_ptr<T>
45
    {
46
    public:
47
0
        SharedPtr(std::nullptr_t) {}
48
298
        SharedPtr() {}
Ogre::SharedPtr<Ogre::Material>::SharedPtr()
Line
Count
Source
48
33
        SharedPtr() {}
Unexecuted instantiation: Ogre::SharedPtr<Ogre::TerrainMaterialGenerator>::SharedPtr()
Ogre::SharedPtr<Ogre::Texture>::SharedPtr()
Line
Count
Source
48
4
        SharedPtr() {}
Unexecuted instantiation: Ogre::SharedPtr<Ogre::HardwareIndexBuffer>::SharedPtr()
Ogre::SharedPtr<Ogre::DataStream>::SharedPtr()
Line
Count
Source
48
261
        SharedPtr() {}
Unexecuted instantiation: Ogre::SharedPtr<Ogre::HardwareVertexBuffer>::SharedPtr()
Unexecuted instantiation: Ogre::SharedPtr<Ogre::BspLevel>::SharedPtr()
Unexecuted instantiation: Ogre::SharedPtr<Ogre::MemoryDataStream>::SharedPtr()
49
        template< class Y>
50
8.46k
        explicit SharedPtr(Y* ptr) : shared_ptr<T>(ptr) {}
Ogre::SharedPtr<Ogre::DataStream>::SharedPtr<Ogre::FileStreamDataStream>(Ogre::FileStreamDataStream*)
Line
Count
Source
50
7.37k
        explicit SharedPtr(Y* ptr) : shared_ptr<T>(ptr) {}
Ogre::SharedPtr<Ogre::DataStream>::SharedPtr<Ogre::MemoryDataStream>(Ogre::MemoryDataStream*)
Line
Count
Source
50
1.09k
        explicit SharedPtr(Y* ptr) : shared_ptr<T>(ptr) {}
51
        template< class Y, class Deleter >
52
        SharedPtr( Y* ptr, Deleter d ) : shared_ptr<T>(ptr, d) {}
53
260
        SharedPtr(const SharedPtr& r) : shared_ptr<T>(r) {}
Ogre::SharedPtr<Ogre::DataStream>::SharedPtr(Ogre::SharedPtr<Ogre::DataStream> const&)
Line
Count
Source
53
260
        SharedPtr(const SharedPtr& r) : shared_ptr<T>(r) {}
Unexecuted instantiation: Ogre::SharedPtr<Ogre::Material>::SharedPtr(Ogre::SharedPtr<Ogre::Material> const&)
Unexecuted instantiation: Ogre::SharedPtr<Ogre::HardwarePixelBuffer>::SharedPtr(Ogre::SharedPtr<Ogre::HardwarePixelBuffer> const&)
Unexecuted instantiation: Ogre::SharedPtr<Ogre::HardwareVertexBuffer>::SharedPtr(Ogre::SharedPtr<Ogre::HardwareVertexBuffer> const&)
Unexecuted instantiation: Ogre::SharedPtr<Ogre::TerrainMaterialGenerator>::SharedPtr(Ogre::SharedPtr<Ogre::TerrainMaterialGenerator> const&)
Unexecuted instantiation: Ogre::SharedPtr<Ogre::Texture>::SharedPtr(Ogre::SharedPtr<Ogre::Texture> const&)
Unexecuted instantiation: Ogre::SharedPtr<Ogre::HardwareIndexBuffer>::SharedPtr(Ogre::SharedPtr<Ogre::HardwareIndexBuffer> const&)
Unexecuted instantiation: Ogre::SharedPtr<Ogre::BspLevel>::SharedPtr(Ogre::SharedPtr<Ogre::BspLevel> const&)
54
        template<class Y>
55
0
        SharedPtr(const SharedPtr<Y>& r) : shared_ptr<T>(r) {}
56
57
        // implicit conversion from and to shared_ptr
58
        template<class Y>
59
1.09k
        SharedPtr(const shared_ptr<Y>& r) : shared_ptr<T>(r) {}
Ogre::SharedPtr<Ogre::MemoryDataStream>::SharedPtr<Ogre::MemoryDataStream>(std::__1::shared_ptr<Ogre::MemoryDataStream> const&)
Line
Count
Source
59
1.09k
        SharedPtr(const shared_ptr<Y>& r) : shared_ptr<T>(r) {}
Unexecuted instantiation: Ogre::SharedPtr<Ogre::HardwareVertexBuffer>::SharedPtr<Ogre::HardwareVertexBuffer>(std::__1::shared_ptr<Ogre::HardwareVertexBuffer> const&)
Unexecuted instantiation: Ogre::SharedPtr<Ogre::BspLevel>::SharedPtr<Ogre::BspLevel>(std::__1::shared_ptr<Ogre::BspLevel> const&)
Unexecuted instantiation: Ogre::SharedPtr<Ogre::HardwareIndexBuffer>::SharedPtr<Ogre::HardwareIndexBuffer>(std::__1::shared_ptr<Ogre::HardwareIndexBuffer> const&)
Unexecuted instantiation: Ogre::SharedPtr<Ogre::Material>::SharedPtr<Ogre::Material>(std::__1::shared_ptr<Ogre::Material> const&)
60
        operator const shared_ptr<T>&() { return static_cast<shared_ptr<T>&>(*this); }
61
0
        SharedPtr<T>& operator=(const Ogre::SharedPtr<T>& rhs) {shared_ptr<T>::operator=(rhs); return *this;}
Unexecuted instantiation: Ogre::SharedPtr<Ogre::HardwareBuffer>::operator=(Ogre::SharedPtr<Ogre::HardwareBuffer> const&)
Unexecuted instantiation: Ogre::SharedPtr<Ogre::Material>::operator=(Ogre::SharedPtr<Ogre::Material> const&)
Unexecuted instantiation: Ogre::SharedPtr<Ogre::AnimableValue>::operator=(Ogre::SharedPtr<Ogre::AnimableValue> const&)
Unexecuted instantiation: Ogre::SharedPtr<Ogre::TerrainMaterialGenerator>::operator=(Ogre::SharedPtr<Ogre::TerrainMaterialGenerator> const&)
Unexecuted instantiation: Ogre::SharedPtr<Ogre::Texture>::operator=(Ogre::SharedPtr<Ogre::Texture> const&)
Unexecuted instantiation: Ogre::SharedPtr<Ogre::HardwareVertexBuffer>::operator=(Ogre::SharedPtr<Ogre::HardwareVertexBuffer> const&)
Unexecuted instantiation: Ogre::SharedPtr<Ogre::HardwareIndexBuffer>::operator=(Ogre::SharedPtr<Ogre::HardwareIndexBuffer> const&)
Unexecuted instantiation: Ogre::SharedPtr<Ogre::DataStream>::operator=(Ogre::SharedPtr<Ogre::DataStream> const&)
Unexecuted instantiation: Ogre::SharedPtr<Ogre::BspLevel>::operator=(Ogre::SharedPtr<Ogre::BspLevel> const&)
Unexecuted instantiation: Ogre::SharedPtr<Ogre::MemoryDataStream>::operator=(Ogre::SharedPtr<Ogre::MemoryDataStream> const&)
62
        // so swig recognizes it should forward the operators
63
20.5k
        T* operator->() const { return shared_ptr<T>::operator->(); }
Unexecuted instantiation: Ogre::SharedPtr<Ogre::GpuSharedParameters>::operator->() const
Unexecuted instantiation: Ogre::SharedPtr<Ogre::Material>::operator->() const
Unexecuted instantiation: Ogre::SharedPtr<Ogre::HardwareVertexBuffer>::operator->() const
Unexecuted instantiation: Ogre::SharedPtr<Ogre::GpuProgramParameters>::operator->() const
Ogre::SharedPtr<Ogre::MemoryDataStream>::operator->() const
Line
Count
Source
63
2.18k
        T* operator->() const { return shared_ptr<T>::operator->(); }
Ogre::SharedPtr<Ogre::DataStream>::operator->() const
Line
Count
Source
63
18.3k
        T* operator->() const { return shared_ptr<T>::operator->(); }
Unexecuted instantiation: Ogre::SharedPtr<Ogre::Mesh>::operator->() const
Unexecuted instantiation: Ogre::SharedPtr<Ogre::Texture>::operator->() const
Unexecuted instantiation: Ogre::SharedPtr<Ogre::HardwarePixelBuffer>::operator->() const
Unexecuted instantiation: Ogre::SharedPtr<Ogre::TerrainMaterialGenerator>::operator->() const
Unexecuted instantiation: Ogre::SharedPtr<Ogre::HardwareIndexBuffer>::operator->() const
Unexecuted instantiation: Ogre::SharedPtr<Ogre::AbstractNode>::operator->() const
Unexecuted instantiation: Ogre::SharedPtr<Ogre::BspLevel>::operator->() const
64
65
        /// @deprecated use Ogre::static_pointer_cast instead
66
        template<typename Y>
67
        OGRE_DEPRECATED SharedPtr<Y> staticCast() const { return static_pointer_cast<Y>(*this); }
68
        /// @deprecated use Ogre::dynamic_pointer_cast instead
69
        template<typename Y>
70
        OGRE_DEPRECATED SharedPtr<Y> dynamicCast() const { return dynamic_pointer_cast<Y>(*this); }
71
        /// @deprecated this api will be dropped. use reset(T*) instead
72
        OGRE_DEPRECATED void bind(T* rep) { shared_ptr<T>::reset(rep); }
73
        /// @deprecated use use_count() instead
74
        OGRE_DEPRECATED unsigned int useCount() const { return shared_ptr<T>::use_count(); }
75
        /// @deprecated use get() instead
76
        OGRE_DEPRECATED T* getPointer() const { return shared_ptr<T>::get(); }
77
        /// @deprecated use SharedPtr::operator bool instead
78
        OGRE_DEPRECATED bool isNull(void) const { return !shared_ptr<T>::operator bool(); }
79
        /// @deprecated use reset() instead
80
        OGRE_DEPRECATED void setNull() { shared_ptr<T>::reset(); }
81
    };
82
    /** @} */
83
    /** @} */
84
}
85
86
87
88
#endif