12 template <std::u
int32_t = 21, std::u
int32_t = 5>
13 class BSUntypedPointerHandle;
15 template <
class,
class = BSUntypedPo
interHandle<>>
16 class BSPointerHandle;
18 template <
class,
class = HandleManager>
19 class BSPointerHandleManagerInterface;
21 template <std::u
int32_t FREE_LIST_BITS, std::u
int32_t AGE_SHIFT>
37 _handle(a_rhs._handle)
52 if (
this != std::addressof(a_rhs)) {
53 _handle = a_rhs._handle;
65 [[nodiscard]]
explicit operator bool() const noexcept {
return has_value(); }
66 [[nodiscard]]
bool has_value() const noexcept {
return _handle != 0; }
70 void reset() noexcept { _handle = 0; }
74 return a_lhs.value() == a_rhs.value();
79 return !(a_lhs == a_rhs);
87 extern template class BSUntypedPointerHandle<>;
89 template <
class T,
class Handle>
102 std::is_convertible_v<
114 std::is_convertible_v<
119 _handle(a_rhs._handle)
128 std::is_convertible_v<
141 std::is_convertible_v<
147 _handle = a_rhs._handle;
153 void reset() noexcept { _handle.reset(); }
164 [[nodiscard]]
explicit operator bool() const noexcept {
return _handle.has_value(); }
168 return a_lhs._handle == a_rhs._handle;
173 return !(a_lhs == a_rhs);
177 template <
class,
class>
180 void get_handle(T* a_ptr);
181 bool get_smartptr(
NiPointer<T>& a_smartPointerOut)
const;
204 template <
class T,
class Manager>
221 return func(a_handle, a_smartPointerOut);
225 extern template class BSPointerHandleManagerInterface<Actor>;
226 extern template class BSPointerHandleManagerInterface<Projectile>;
227 extern template class BSPointerHandleManagerInterface<TESObjectREFR>;
229 template <
class T,
class Handle>
230 void BSPointerHandle<T, Handle>::get_handle(T* a_ptr)
235 template <
class T,
class Handle>
236 bool BSPointerHandle<T, Handle>::get_smartptr(NiPointer<T>& a_smartPointerOut)
const
Definition: BSPointerHandle.h:91
NiPointer< T > get() const
Definition: BSPointerHandle.h:155
friend bool operator==(const BSPointerHandle &a_lhs, const BSPointerHandle &a_rhs) noexcept
Definition: BSPointerHandle.h:166
~BSPointerHandle() noexcept=default
BSPointerHandle & operator=(const BSPointerHandle< Y, Handle > &a_rhs) noexcept
Definition: BSPointerHandle.h:145
native_handle_type native_handle() const noexcept
Definition: BSPointerHandle.h:162
friend bool operator!=(const BSPointerHandle &a_lhs, const BSPointerHandle &a_rhs) noexcept
Definition: BSPointerHandle.h:171
BSPointerHandle & operator=(BSPointerHandle &&) noexcept=default
BSPointerHandle & operator=(const BSPointerHandle &) noexcept=default
typename Handle::value_type native_handle_type
Definition: BSPointerHandle.h:93
BSPointerHandle() noexcept=default
BSPointerHandle(const BSPointerHandle< Y, Handle > &a_rhs) noexcept
Definition: BSPointerHandle.h:118
Definition: BSPointerHandle.h:206
static bool GetSmartPointer(const BSPointerHandle< T > &a_handle, NiPointer< T > &a_smartPointerOut)
Definition: BSPointerHandle.h:217
static BSPointerHandle< T > GetHandle(T *a_ptr)
Definition: BSPointerHandle.h:210
T value_type
Definition: BSPointerHandle.h:208
Definition: BSPointerHandle.h:23
friend bool operator==(const BSUntypedPointerHandle &a_lhs, const BSUntypedPointerHandle &a_rhs) noexcept
Definition: BSPointerHandle.h:72
~BSUntypedPointerHandle() noexcept
Definition: BSPointerHandle.h:46
friend bool operator!=(const BSUntypedPointerHandle &a_lhs, const BSUntypedPointerHandle &a_rhs) noexcept
Definition: BSPointerHandle.h:77
bool has_value() const noexcept
Definition: BSPointerHandle.h:66
value_type value() const noexcept
Definition: BSPointerHandle.h:68
BSUntypedPointerHandle() noexcept=default
BSUntypedPointerHandle & operator=(BSUntypedPointerHandle &&a_rhs) noexcept
Definition: BSPointerHandle.h:50
BSUntypedPointerHandle & operator=(value_type a_rhs) noexcept
Definition: BSPointerHandle.h:59
@ kAgeShift
Definition: BSPointerHandle.h:30
@ kFreeListBits
Definition: BSPointerHandle.h:29
BSUntypedPointerHandle(value_type a_handle) noexcept
Definition: BSPointerHandle.h:42
void reset() noexcept
Definition: BSPointerHandle.h:70
BSUntypedPointerHandle & operator=(const BSUntypedPointerHandle &) noexcept=default
std::uint32_t value_type
Definition: BSPointerHandle.h:25
Definition: NiSmartPointer.h:9
Definition: Relocation.h:858
constexpr REL::ID GetHandle(static_cast< std::uint64_t >(16212))
constexpr REL::ID GetSmartPointer(static_cast< std::uint64_t >(12332))
Definition: AbsorbEffect.h:6
Definition: NiBinaryStream.h:94
std::uint32_t operator()(const BSPointerHandle< T > &a_handle) const noexcept
Definition: BSPointerHandle.h:198