19 const T*
get() const noexcept {
return ptr.get(); }
24 std::shared_ptr<T>
ptr;
55 buffer.data =
nullptr;
62 Buffer(
const T *t,
unsigned int size)
68 memcpy(
data, t, size);
88 buffer.data =
nullptr;
104 buffer.
data =
nullptr;
122 operator std::string_view()
const
125 return std::string_view();
126 return std::string_view(
reinterpret_cast<char*
>(
data),
m_size);
#define DISABLE_CLASS_COPY(C)
Definition basic_macros.h:26
T * data
Definition pointer.h:134
Buffer(const T *t, unsigned int size)
Definition pointer.h:62
Buffer & operator=(Buffer &&buffer)
Definition pointer.h:79
Buffer(unsigned int size)
Definition pointer.h:36
T & operator[](unsigned int i) const
Definition pointer.h:108
unsigned int m_size
Definition pointer.h:135
void copyTo(Buffer &buffer) const
Definition pointer.h:96
~Buffer()
Definition pointer.h:74
Buffer()
Definition pointer.h:31
T * operator*() const
Definition pointer.h:112
Buffer(const Buffer &)=delete
Buffer(Buffer &&buffer)
Definition pointer.h:49
Buffer & operator=(const Buffer &)=delete
void drop()
Definition pointer.h:130
unsigned int getSize() const
Definition pointer.h:117
const T * operator->() const noexcept
Definition pointer.h:21
const T & operator*() const noexcept
Definition pointer.h:20
ConstSharedPtr(T *ptr)
Definition pointer.h:16
std::shared_ptr< T > ptr
Definition pointer.h:24
const T * get() const noexcept
Definition pointer.h:19
ConstSharedPtr(const std::shared_ptr< T > &ptr)
Definition pointer.h:17
virtual ~IntrusiveReferenceCounted()=default
void grab() noexcept
Definition pointer.h:258
u32 m_refcount
Definition pointer.h:263
void drop() noexcept
Definition pointer.h:259
IntrusiveReferenceCounted()=default
T * operator*() const
Definition pointer.h:225
SharedBuffer(unsigned int size)
Definition pointer.h:156
unsigned int * refcount
Definition pointer.h:250
SharedBuffer(const Buffer< T > &buffer)
Definition pointer.h:204
unsigned int getSize() const
Definition pointer.h:229
SharedBuffer(const SharedBuffer &buffer)
Definition pointer.h:167
SharedBuffer & operator=(const SharedBuffer &buffer)
Definition pointer.h:174
unsigned int m_size
Definition pointer.h:249
SharedBuffer(const T *t, unsigned int size)
Definition pointer.h:188
T * data
Definition pointer.h:248
~SharedBuffer()
Definition pointer.h:216
T & operator[](unsigned int i) const
Definition pointer.h:220
SharedBuffer()
Definition pointer.h:149
void drop()
Definition pointer.h:238