7 #ifndef NAZARA_SPARSEPTR_HPP 8 #define NAZARA_SPARSEPTR_HPP 12 #include <Nazara/Prerequesites.hpp> 14 #include <type_traits> 22 using BytePtr =
typename std::conditional<std::is_const<T>::value,
const UInt8*, UInt8*>::type;
23 using VoidPtr =
typename std::conditional<std::is_const<T>::value,
const void*,
void*>::type;
28 SparsePtr(VoidPtr ptr, std::size_t stride);
38 void Reset(VoidPtr ptr,
int stride);
45 explicit operator bool()
const;
81 #include <Nazara/Core/SparsePtr.inl> 83 #endif // NAZARA_SPARSEPTR_HPP bool operator<=(const SparsePtr &ptr) const
Compares the SparsePtr to another one.
Definition: SparsePtr.inl:471
TODO: Inherit SoundEmitter from Node.
Definition: Algorithm.hpp:12
SparsePtr operator-(int count) const
Gets the SparsePtr with an offset.
Definition: SparsePtr.inl:289
SparsePtr & operator--()
Gets the SparsePtr with the previous element.
Definition: SparsePtr.inl:387
SparsePtr operator+(int count) const
Gets the SparsePtr with an offset.
Definition: SparsePtr.inl:263
T & operator[](int index) const
Gets the ith element of the stride pointer.
Definition: SparsePtr.inl:250
bool operator!=(const SparsePtr &ptr) const
Compares the SparsePtr to another one.
Definition: SparsePtr.inl:432
VoidPtr GetPtr() const
Gets the original pointer.
Definition: SparsePtr.inl:89
Core class that represents a pointer and the step between two elements.
Definition: SparsePtr.hpp:19
bool operator<(const SparsePtr &ptr) const
Compares the SparsePtr to another one.
Definition: SparsePtr.inl:445
SparsePtr & operator+=(int count)
Gets the SparsePtr with an offset.
Definition: SparsePtr.inl:328
int GetStride() const
Gets the stride.
Definition: SparsePtr.inl:100
bool operator>=(const SparsePtr &ptr) const
Compares the SparsePtr to another one.
Definition: SparsePtr.inl:484
void SetStride(int stride)
Sets the stride.
Definition: SparsePtr.inl:193
SparsePtr()
Constructs a SparsePtr object by default.
Definition: SparsePtr.inl:24
SparsePtr & operator++()
Gets the SparsePtr with the next element.
Definition: SparsePtr.inl:356
T & operator*() const
Dereferences the pointer.
Definition: SparsePtr.inl:226
SparsePtr & operator-=(int count)
Gets the SparsePtr with an offset.
Definition: SparsePtr.inl:343
bool operator==(const SparsePtr &ptr) const
Compares the SparsePtr to another one.
Definition: SparsePtr.inl:419
void SetPtr(VoidPtr ptr)
Sets the pointer.
Definition: SparsePtr.inl:181
T * operator->() const
Dereferences the pointer.
Definition: SparsePtr.inl:237
void Reset()
Resets the SparsePtr.
Definition: SparsePtr.inl:110
bool operator>(const SparsePtr &ptr) const
Compares the SparsePtr to another one.
Definition: SparsePtr.inl:458