coastline 0.0.4
Loading...
Searching...
No Matches
ptr32memory.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstddef>
4
5namespace coastline {
6
9public:
17 explicit Ptr32Memory(std::size_t bytes);
21 Ptr32Memory(const Ptr32Memory &) = delete;
23 Ptr32Memory &operator=(const Ptr32Memory &) = delete;
24
26 void *Data() const {
27 return m_data;
28 }
29
30private:
31 void *m_data = nullptr;
32 std::size_t m_bytes;
33};
34
35} // namespace coastline
Ptr32Memory(const Ptr32Memory &)=delete
Copying is disabled because the mapping has exclusive lifetime management.
~Ptr32Memory()
Release the mapping after all converted pointers into it are no longer used.
Ptr32Memory & operator=(const Ptr32Memory &)=delete
Assignment is disabled because converted pointers require a stable mapping address.
void * Data() const
Definition ptr32memory.h:26
Ptr32Memory(std::size_t bytes)
Allocate writable memory, or throw when no representable mapping is available.
Definition assetimport.h:11