WPILibC++ 2025.1.1
|
A custom intrusive shared pointer implementation without thread synchronization overhead. More...
Public Member Functions | |
constexpr | IntrusiveSharedPtr () noexcept=default |
Constructs an empty intrusive shared pointer. | |
constexpr | IntrusiveSharedPtr (std::nullptr_t) noexcept |
Constructs an empty intrusive shared pointer. | |
constexpr | IntrusiveSharedPtr (T *ptr) noexcept |
Constructs an intrusive shared pointer from the given pointer and takes ownership. | |
constexpr | ~IntrusiveSharedPtr () |
constexpr | IntrusiveSharedPtr (const IntrusiveSharedPtr< T > &rhs) noexcept |
Copy constructs from the given intrusive shared pointer. | |
constexpr IntrusiveSharedPtr< T > & | operator= (const IntrusiveSharedPtr< T > &rhs) noexcept |
Makes a copy of the given intrusive shared pointer. | |
constexpr | IntrusiveSharedPtr (IntrusiveSharedPtr< T > &&rhs) noexcept |
Move constructs from the given intrusive shared pointer. | |
constexpr IntrusiveSharedPtr< T > & | operator= (IntrusiveSharedPtr< T > &&rhs) noexcept |
Move assigns from the given intrusive shared pointer. | |
constexpr T * | Get () const noexcept |
Returns the internal pointer. | |
constexpr T & | operator* () const noexcept |
Returns the object pointed to by the internal pointer. | |
constexpr T * | operator-> () const noexcept |
Returns the internal pointer. | |
constexpr | operator bool () const noexcept |
Returns true if the internal pointer isn't nullptr. | |
Friends | |
constexpr bool | operator== (const IntrusiveSharedPtr< T > &lhs, const IntrusiveSharedPtr< T > &rhs) noexcept |
Returns true if the given intrusive shared pointers point to the same object. | |
constexpr bool | operator!= (const IntrusiveSharedPtr< T > &lhs, const IntrusiveSharedPtr< T > &rhs) noexcept |
Returns true if the given intrusive shared pointers point to different objects. | |
constexpr bool | operator== (const IntrusiveSharedPtr< T > &lhs, std::nullptr_t) noexcept |
Returns true if the left-hand intrusive shared pointer points to nullptr. | |
constexpr bool | operator== (std::nullptr_t, const IntrusiveSharedPtr< T > &rhs) noexcept |
Returns true if the right-hand intrusive shared pointer points to nullptr. | |
constexpr bool | operator!= (const IntrusiveSharedPtr< T > &lhs, std::nullptr_t) noexcept |
Returns true if the left-hand intrusive shared pointer doesn't point to nullptr. | |
constexpr bool | operator!= (std::nullptr_t, const IntrusiveSharedPtr< T > &rhs) noexcept |
Returns true if the right-hand intrusive shared pointer doesn't point to nullptr. | |
A custom intrusive shared pointer implementation without thread synchronization overhead.
Types used with this class should have three things:
void IntrusiveSharedPtrIncRefCount(T*)
that increments the reference count.void IntrusiveSharedPtrDecRefCount(T*)
that decrements the reference count and deallocates the pointed to object if the reference count reaches zero.T | The type of the object to be reference counted. |
|
constexprdefaultnoexcept |
Constructs an empty intrusive shared pointer.
|
inlineconstexprnoexcept |
Constructs an empty intrusive shared pointer.
|
inlineexplicitconstexprnoexcept |
Constructs an intrusive shared pointer from the given pointer and takes ownership.
|
inlineconstexpr |
|
inlineconstexprnoexcept |
Copy constructs from the given intrusive shared pointer.
|
inlineconstexprnoexcept |
Move constructs from the given intrusive shared pointer.
|
inlineconstexprnoexcept |
Returns the internal pointer.
|
inlineexplicitconstexprnoexcept |
Returns true if the internal pointer isn't nullptr.
|
inlineconstexprnoexcept |
Returns the object pointed to by the internal pointer.
|
inlineconstexprnoexcept |
Returns the internal pointer.
|
inlineconstexprnoexcept |
Makes a copy of the given intrusive shared pointer.
|
inlineconstexprnoexcept |
Move assigns from the given intrusive shared pointer.
|
friend |
Returns true if the given intrusive shared pointers point to different objects.
|
friend |
Returns true if the left-hand intrusive shared pointer doesn't point to nullptr.
|
friend |
Returns true if the right-hand intrusive shared pointer doesn't point to nullptr.
|
friend |
Returns true if the given intrusive shared pointers point to the same object.
|
friend |
Returns true if the left-hand intrusive shared pointer points to nullptr.
|
friend |
Returns true if the right-hand intrusive shared pointer points to nullptr.