Minetest 5.9.0-dev
 
Loading...
Searching...
No Matches
irr_ptr.h File Reference
#include <type_traits>
#include <utility>
#include "irrlichttypes.h"
#include "IReferenceCounted.h"
+ Include dependency graph for irr_ptr.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  irr_ptr< ReferenceCounted, class >
 Shared pointer for IrrLicht objects. More...
 

Functions

template<class ReferenceCounted >
irr_ptr< ReferenceCounted > grab (ReferenceCounted *object) noexcept
 Constructs a shared pointer as a secondary reference to an object.
 
template<typename ReferenceCounted >
bool operator== (const irr_ptr< ReferenceCounted > &a, const irr_ptr< ReferenceCounted > &b) noexcept
 
template<typename ReferenceCounted >
bool operator== (const irr_ptr< ReferenceCounted > &a, const ReferenceCounted *b) noexcept
 
template<typename ReferenceCounted >
bool operator== (const ReferenceCounted *a, const irr_ptr< ReferenceCounted > &b) noexcept
 
template<typename ReferenceCounted >
bool operator!= (const irr_ptr< ReferenceCounted > &a, const irr_ptr< ReferenceCounted > &b) noexcept
 
template<typename ReferenceCounted >
bool operator!= (const irr_ptr< ReferenceCounted > &a, const ReferenceCounted *b) noexcept
 
template<typename ReferenceCounted >
bool operator!= (const ReferenceCounted *a, const irr_ptr< ReferenceCounted > &b) noexcept
 
template<class T , class... Args>
irr_ptr< T > make_irr (Args &&... args)
 Same as std::make_unique<T>, but for irr_ptr.
 

Function Documentation

◆ grab()

template<class ReferenceCounted >
irr_ptr< ReferenceCounted > grab ( ReferenceCounted *  object)
noexcept

Constructs a shared pointer as a secondary reference to an object.

This function is intended to make a temporary reference to an object which is owned elsewhere so that it is not destroyed too early. To achieve that it does balanced reference counting, i.e. reference count is increased in this function and decreased when the returned pointer is destroyed.

References irr_ptr< ReferenceCounted, class >::grab().

Referenced by pauseNodeAnimation(), and GUIButtonImage::setFromStyle().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ make_irr()

template<class T , class... Args>
irr_ptr< T > make_irr ( Args &&...  args)

Same as std::make_unique<T>, but for irr_ptr.

◆ operator!=() [1/3]

template<typename ReferenceCounted >
bool operator!= ( const irr_ptr< ReferenceCounted > &  a,
const irr_ptr< ReferenceCounted > &  b 
)
noexcept

◆ operator!=() [2/3]

template<typename ReferenceCounted >
bool operator!= ( const irr_ptr< ReferenceCounted > &  a,
const ReferenceCounted *  b 
)
noexcept

◆ operator!=() [3/3]

template<typename ReferenceCounted >
bool operator!= ( const ReferenceCounted *  a,
const irr_ptr< ReferenceCounted > &  b 
)
noexcept

◆ operator==() [1/3]

template<typename ReferenceCounted >
bool operator== ( const irr_ptr< ReferenceCounted > &  a,
const irr_ptr< ReferenceCounted > &  b 
)
noexcept

◆ operator==() [2/3]

template<typename ReferenceCounted >
bool operator== ( const irr_ptr< ReferenceCounted > &  a,
const ReferenceCounted *  b 
)
noexcept

◆ operator==() [3/3]

template<typename ReferenceCounted >
bool operator== ( const ReferenceCounted *  a,
const irr_ptr< ReferenceCounted > &  b 
)
noexcept