3 #ifndef SAMPLES_SOURCES_HEAP_GAMEHEAP_GAMEHEAP_H_
4 #define SAMPLES_SOURCES_HEAP_GAMEHEAP_GAMEHEAP_H_
12 static HeapHandle createHeap(
void* mem,
size_t size)
NLIB_NOEXCEPT;
15 HeapHandle() NLIB_NOEXCEPT : m_Idx(0) {}
16 HeapHandle(
const HeapHandle& h) NLIB_NOEXCEPT : m_Idx(h.m_Idx) {}
17 HeapHandle& operator=(
const HeapHandle& rhs) NLIB_NOEXCEPT {
22 void* alloc(
size_t size,
size_t alignment = 8) NLIB_NOEXCEPT;
23 void free(
void* ptr) NLIB_NOEXCEPT;
25 void freeAll() NLIB_NOEXCEPT;
33 bool isValid() NLIB_NOEXCEPT;
34 bool isClean() NLIB_NOEXCEPT;
37 explicit HeapHandle(
int h) NLIB_NOEXCEPT : m_Idx(h) {}
41 friend HeapHandle GetThreadDefaultHeapHandle() NLIB_NOEXCEPT;
42 friend
void SetThreadDefaultHeapHandle(HeapHandle h) NLIB_NOEXCEPT;
43 friend
bool operator==(const HeapHandle& lhs, const HeapHandle& rhs) NLIB_NOEXCEPT;
44 friend
bool operator!=(const HeapHandle& lhs, const HeapHandle& rhs) NLIB_NOEXCEPT;
47 inline
bool operator==(const HeapHandle& lhs, const HeapHandle& rhs) NLIB_NOEXCEPT {
48 return lhs.m_Idx == rhs.m_Idx;
51 inline bool operator!=(
const HeapHandle& lhs,
const HeapHandle& rhs) NLIB_NOEXCEPT {
52 return lhs.m_Idx != rhs.m_Idx;
60 HeapHandle GetThreadDefaultHeapHandle() NLIB_NOEXCEPT;
61 void SetThreadDefaultHeapHandle(HeapHandle h) NLIB_NOEXCEPT;
65 IDisposer(HeapHandle h) NLIB_NOEXCEPT : m_Handle(h) {}
66 void Destroy() NLIB_NOEXCEPT {
71 HeapHandle GetHeapHandle() const NLIB_NOEXCEPT {
return m_Handle; }
74 virtual ~IDisposer() NLIB_NOEXCEPT {
84 #endif // SAMPLES_SOURCES_HEAP_GAMEHEAP_GAMEHEAP_H_
#define NLIB_NOEXCEPT
環境に合わせてnoexcept 又は同等の定義がされます。
bool operator!=(const HeapHash &rhs, const HeapHash &lhs)
2つのサマリを比較して等価でなければ、trueを返します。