diff options
| author | 2021-05-01 12:51:11 -0700 | |
|---|---|---|
| committer | 2021-05-05 16:40:54 -0700 | |
| commit | 9beb239634735dc026f55b20d31763cdc295d15c (patch) | |
| tree | b4a3715927ede917d8ad306a9d6185c0cf77e9c9 /src | |
| parent | fixup! hle: kernel: Migrate to KHandleTable. (diff) | |
| download | yuzu-9beb239634735dc026f55b20d31763cdc295d15c.tar.gz yuzu-9beb239634735dc026f55b20d31763cdc295d15c.tar.xz yuzu-9beb239634735dc026f55b20d31763cdc295d15c.zip | |
fixup! hle: kernel: Add initial impl. of KLinkedList.
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/kernel/k_linked_list.h | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/core/hle/kernel/k_linked_list.h b/src/core/hle/kernel/k_linked_list.h index 8218bac8d..500f44685 100644 --- a/src/core/hle/kernel/k_linked_list.h +++ b/src/core/hle/kernel/k_linked_list.h | |||
| @@ -15,19 +15,20 @@ class KernelCore; | |||
| 15 | 15 | ||
| 16 | class KLinkedListNode : public boost::intrusive::list_base_hook<>, | 16 | class KLinkedListNode : public boost::intrusive::list_base_hook<>, |
| 17 | public KSlabAllocated<KLinkedListNode> { | 17 | public KSlabAllocated<KLinkedListNode> { |
| 18 | private: | ||
| 19 | void* m_item; | ||
| 20 | 18 | ||
| 21 | public: | 19 | public: |
| 22 | KLinkedListNode() : m_item(nullptr) {} | 20 | KLinkedListNode() = default; |
| 23 | 21 | ||
| 24 | constexpr void Initialize(void* it) { | 22 | void Initialize(void* it) { |
| 25 | m_item = it; | 23 | m_item = it; |
| 26 | } | 24 | } |
| 27 | 25 | ||
| 28 | constexpr void* GetItem() const { | 26 | void* GetItem() const { |
| 29 | return m_item; | 27 | return m_item; |
| 30 | } | 28 | } |
| 29 | |||
| 30 | private: | ||
| 31 | void* m_item = nullptr; | ||
| 31 | }; | 32 | }; |
| 32 | 33 | ||
| 33 | template <typename T> | 34 | template <typename T> |
| @@ -61,13 +62,9 @@ public: | |||
| 61 | using iterator_category = std::bidirectional_iterator_tag; | 62 | using iterator_category = std::bidirectional_iterator_tag; |
| 62 | using value_type = typename KLinkedList::value_type; | 63 | using value_type = typename KLinkedList::value_type; |
| 63 | using difference_type = typename KLinkedList::difference_type; | 64 | using difference_type = typename KLinkedList::difference_type; |
| 64 | using pointer = typename std::conditional<Const, KLinkedList::const_pointer, | 65 | using pointer = std::conditional_t<Const, KLinkedList::const_pointer, KLinkedList::pointer>; |
| 65 | KLinkedList::pointer>::type; | 66 | using reference = |
| 66 | using reference = typename std::conditional<Const, KLinkedList::const_reference, | 67 | std::conditional_t<Const, KLinkedList::const_reference, KLinkedList::reference>; |
| 67 | KLinkedList::reference>::type; | ||
| 68 | |||
| 69 | private: | ||
| 70 | BaseIterator m_base_it; | ||
| 71 | 68 | ||
| 72 | public: | 69 | public: |
| 73 | explicit Iterator(BaseIterator it) : m_base_it(it) {} | 70 | explicit Iterator(BaseIterator it) : m_base_it(it) {} |
| @@ -117,6 +114,9 @@ public: | |||
| 117 | operator Iterator<true>() const { | 114 | operator Iterator<true>() const { |
| 118 | return Iterator<true>(m_base_it); | 115 | return Iterator<true>(m_base_it); |
| 119 | } | 116 | } |
| 117 | |||
| 118 | private: | ||
| 119 | BaseIterator m_base_it; | ||
| 120 | }; | 120 | }; |
| 121 | 121 | ||
| 122 | public: | 122 | public: |