template<class T>
ObjectPtr class
| Template parameters | |
|---|---|
| T | the type of the underlying instance (must extend bpf:: |
Contents
The object smart pointer, allows you to automatically reset all instances of ObjectPtr when a given underlying instance is destroyed This class only works with types extending the Object class
Constructors, destructors, conversion operators
Public functions
- auto operator==(T* other) const -> bool
- auto operator!=(T* other) const -> bool
- auto operator==(const ObjectPtr<T>& other) const -> bool
- auto operator!=(const ObjectPtr<T>& other) const -> bool
-
template<typename T1>auto operator==(const ObjectPtr<T1>& other) const -> bool noexcept
-
template<typename T1>auto operator!=(const ObjectPtr<T1>& other) const -> bool noexcept
- auto operator->() const -> T*
- auto operator*() const -> T&
-
template<typename R, typename U, typename... Args>auto operator->*(R(U::*)(Args...) fn) const -> std::enable_if<std::is_class<U>::value && std::is_same<T, U>::value, RawMemberFunction<U, R, R(U::*)(Args...)>>::type
-
template<typename R, typename U, typename... Args>auto operator->*(R(U::*)(Args...) const fn) const -> std::enable_if<std::is_class<U>::value && std::is_same<T, U>::value, RawMemberFunction<U, R, R(U::*)(Args...) const >>::type
- auto Raw() const -> T* noexcept
- auto operator=(T* other) -> ObjectPtr<T>&
- auto operator=(const ObjectPtr<T>& other) -> ObjectPtr<T>&
- auto operator=(ObjectPtr<T>&& other) -> ObjectPtr<T>& noexcept
-
template<typename T1>auto Cast() const -> ObjectPtr<T1>
Function documentation
template<class T>
bool bpf:: memory:: ObjectPtr<T>:: operator==(T* other) const
| Parameters | |
|---|---|
| other | operand |
| Returns | true if this equal other, false otherwise |
Compare ObjectPtr
template<class T>
bool bpf:: memory:: ObjectPtr<T>:: operator!=(T* other) const
| Parameters | |
|---|---|
| other | operand |
| Returns | false if this equal other, true otherwise |
Compare ObjectPtr
template<class T>
bool bpf:: memory:: ObjectPtr<T>:: operator==(const ObjectPtr<T>& other) const
| Parameters | |
|---|---|
| other | operand |
| Returns | true if this equal other, false otherwise |
Compare ObjectPtr
template<class T>
bool bpf:: memory:: ObjectPtr<T>:: operator!=(const ObjectPtr<T>& other) const
| Parameters | |
|---|---|
| other | operand |
| Returns | false if this equal other, true otherwise |
Compare ObjectPtr
template<class T>
template<typename T1>
bool bpf:: memory:: ObjectPtr<T>:: operator==(const ObjectPtr<T1>& other) const noexcept
| Template parameters | |
|---|---|
| T1 | type to compare with |
| Parameters | |
| other | operand |
| Returns | true if this equal other, false otherwise |
Compare ObjectPtr
template<class T>
template<typename T1>
bool bpf:: memory:: ObjectPtr<T>:: operator!=(const ObjectPtr<T1>& other) const noexcept
| Template parameters | |
|---|---|
| T1 | type to compare with |
| Parameters | |
| other | operand |
| Returns | false if this equal other, true otherwise |
Compare ObjectPtr
template<class T>
T* bpf:: memory:: ObjectPtr<T>:: operator->() const
| Returns | pointer to T |
|---|
Access the wrapped object
template<class T>
T& bpf:: memory:: ObjectPtr<T>:: operator*() const
| Returns | reference to T |
|---|
Access the wrapped object
template<class T>
template<typename R, typename U, typename... Args>
std::enable_if<std::is_class<U>::value && std::is_same<T, U>::value, RawMemberFunction<U, R, R(U::*)(Args...)>>::type bpf:: memory:: ObjectPtr<T>:: operator->*(R(U::*)(Args...) fn) const
| Template parameters | |
|---|---|
| R | the function return type |
| U | the object type which must be the same as T |
| Args | the types of the function arguments |
| Parameters | |
| fn | the function pointer itself |
| Returns | RawMemberFunction |
Call a pointer to a member function on this smart pointer
template<class T>
template<typename R, typename U, typename... Args>
std::enable_if<std::is_class<U>::value && std::is_same<T, U>::value, RawMemberFunction<U, R, R(U::*)(Args...) const >>::type bpf:: memory:: ObjectPtr<T>:: operator->*(R(U::*)(Args...) const fn) const
| Template parameters | |
|---|---|
| R | the function return type |
| U | the object type which must be the same as T |
| Args | the types of the function arguments |
| Parameters | |
| fn | the function pointer itself |
| Returns | RawMemberFunction |
Call a pointer to a member function on this smart pointer
template<class T>
T* bpf:: memory:: ObjectPtr<T>:: Raw() const noexcept
| Returns | low-level raw pointer |
|---|
Returns the raw pointer
template<class T>
template<typename T1>
ObjectPtr<T1> bpf:: memory:: ObjectPtr<T>:: Cast() const
| Template parameters | |
|---|---|
| T1 | the type to cast to |
| Returns | new casted ObjectPtr |
| Exceptions | |
| ClassCastException | in debug only if the class cannot be casted |
Quick casting function