7 #ifndef NAZARA_OBJECTHANDLE_HPP 8 #define NAZARA_OBJECTHANDLE_HPP 10 #include <Nazara/Core/Algorithm.hpp> 15 template<
typename T>
class HandledObject;
20 friend HandledObject<T>;
33 void Reset(T*
object =
nullptr);
41 explicit operator bool()
const;
58 template<
typename T> std::ostream& operator<<(std::ostream& out, const ObjectHandle<T>& handle);
60 template<
typename T>
bool operator==(
const ObjectHandle<T>& lhs,
const ObjectHandle<T>& rhs);
61 template<
typename T>
bool operator==(
const T& lhs,
const ObjectHandle<T>& rhs);
62 template<
typename T>
bool operator==(
const ObjectHandle<T>& lhs,
const T& rhs);
64 template<
typename T>
bool operator!=(
const ObjectHandle<T>& lhs,
const ObjectHandle<T>& rhs);
65 template<
typename T>
bool operator!=(
const T& lhs,
const ObjectHandle<T>& rhs);
66 template<
typename T>
bool operator!=(
const ObjectHandle<T>& lhs,
const T& rhs);
68 template<
typename T>
bool operator<(const ObjectHandle<T>& lhs,
const ObjectHandle<T>& rhs);
69 template<
typename T>
bool operator<(const T& lhs, const ObjectHandle<T>& rhs);
70 template<
typename T>
bool operator<(const ObjectHandle<T>& lhs,
const T& rhs);
72 template<
typename T>
bool operator<=(const ObjectHandle<T>&,
const ObjectHandle<T>& rhs);
73 template<
typename T>
bool operator<=(const T& lhs, const ObjectHandle<T>& rhs);
74 template<
typename T>
bool operator<=(const ObjectHandle<T>& lhs,
const T& rhs);
76 template<
typename T>
bool operator>(
const ObjectHandle<T>& lhs,
const ObjectHandle<T>& rhs);
77 template<
typename T>
bool operator>(
const T& lhs,
const ObjectHandle<T>& rhs);
78 template<
typename T>
bool operator>(
const ObjectHandle<T>& lhs,
const T& rhs);
80 template<
typename T>
bool operator>=(
const ObjectHandle<T>& lhs,
const ObjectHandle<T>& rhs);
81 template<
typename T>
bool operator>=(
const T& lhs,
const ObjectHandle<T>& rhs);
82 template<
typename T>
bool operator>=(
const ObjectHandle<T>& lhs,
const T& rhs);
84 template<
typename T>
struct PointedType<
ObjectHandle<T>> {
typedef T type; };
85 template<
typename T>
struct PointedType<const
ObjectHandle<T>> {
typedef T type; };
94 #include <Nazara/Core/ObjectHandle.inl> 96 #endif // NAZARA_OBJECTHANDLE_HPP TODO: Inherit SoundEmitter from Node.
Definition: Algorithm.hpp:12
bool operator>(const Bitset< Block, Allocator > &lhs, const Nz::Bitset< Block, Allocator > &rhs)
Compares two bitsets.
Definition: Bitset.inl:1566
Core class that represents a string.
Definition: String.hpp:22
bool operator!=(const Bitset< Block, Allocator > &lhs, const Nz::Bitset< Block, Allocator > &rhs)
Compares two bitsets.
Definition: Bitset.inl:1503
~ObjectHandle()
Destructs the object and calls reset with nullptr.
Definition: ObjectHandle.inl:69
void Reset(T *object=nullptr)
Resets the content of the ObjectHandle with another object.
Definition: ObjectHandle.inl:100
ObjectHandle & operator=(T *object)
Assigns the entity into this.
Definition: ObjectHandle.inl:232
T * operator->() const
Dereferences the ObjectHandle.
Definition: ObjectHandle.inl:220
void OnObjectDestroyed()
Action to do on object destruction.
Definition: ObjectHandle.inl:271
ObjectHandle & Swap(ObjectHandle &handle)
Swaps the content of the two ObjectHandle.
Definition: ObjectHandle.inl:152
bool IsValid() const
Checks whether the object is valid.
Definition: ObjectHandle.inl:89
T * GetObject() const
Gets the underlying object.
Definition: ObjectHandle.inl:79
ObjectHandle()
Constructs a ObjectHandle object by default.
Definition: ObjectHandle.inl:22
Core class that represents a object handle.
Definition: HandledObject.hpp:16
bool operator==(const Bitset< Block, Allocator > &lhs, const Nz::Bitset< Block, Allocator > &rhs)
Compares two bitsets.
Definition: Bitset.inl:1469
Nz::String ToString() const
Gives a string representation.
Definition: ObjectHandle.inl:179
bool operator>=(const Bitset< Block, Allocator > &lhs, const Nz::Bitset< Block, Allocator > &rhs)
Compares two bitsets.
Definition: Bitset.inl:1580
void OnObjectMoved(T *newObject)
Action to do on object move.
Definition: ObjectHandle.inl:281