@@ -35,15 +35,13 @@ namespace database {
3535// / Readers and writers are always prepositioned at data, and are limited to
3636// / the extent the record/slab size is known (limit can always be removed).
3737// / Streams are always initialized from first element byte up to file limit.
38- template <typename Link, typename Key, size_t Size>
38+ template <typename Link, size_t Size>
3939class arraymap
4040{
4141public:
4242 DEFAULT_COPY_MOVE_DESTRUCT (arraymap);
4343
44- using key = Key;
4544 using link = Link;
46- using iterator = database::iterator<Link, Key, Size>;
4745
4846 arraymap (storage& header, storage& body, const Link& buckets) NOEXCEPT;
4947
@@ -89,18 +87,15 @@ class arraymap
8987 // / Query interface, iterator is not thread safe.
9088 // / -----------------------------------------------------------------------
9189
92- // / Return the link at the top of the conflict list (for table scanning).
93- Link top (const Link& list) const NOEXCEPT;
94-
9590 // / True if an instance of object with key exists.
96- bool exists (const Key& key) const NOEXCEPT;
91+ bool exists (size_t key) const NOEXCEPT;
9792
98- // / Return first element link or terminal if not found/error.
99- Link first ( const Key& key) const NOEXCEPT;
93+ // / Return element link at key or terminal if not found/error.
94+ Link at ( size_t key) const NOEXCEPT;
10095
10196 // / Get first element matching the search key, false if not found/error.
10297 template <typename Element, if_equal<Element::size, Size> = true >
103- bool find ( const Key& key, Element& element) const NOEXCEPT;
98+ bool at ( size_t key, Element& element) const NOEXCEPT;
10499
105100 // / Get element at link, false if deserialize error.
106101 template <typename Element, if_equal<Element::size, Size> = true >
@@ -109,7 +104,7 @@ class arraymap
109104 // / Allocate, set, commit element to key.
110105 // / Expands table AND HEADER as necessary.
111106 template <typename Element, if_equal<Element::size, Size> = true >
112- bool put (const Key& key, const Element& element) NOEXCEPT;
107+ bool put (size_t key, const Element& element) NOEXCEPT;
113108
114109protected:
115110 // / Get element at link using memory object, false if deserialize error.
@@ -121,7 +116,7 @@ class arraymap
121116 static constexpr auto is_slab = (Size == max_size_t );
122117
123118 using head = database::arrayhead<Link>;
124- using body = database::manager<Link, Key , Size>;
119+ using body = database::manager<Link, system::data_array< 0 > , Size>;
125120
126121 // Thread safe (index/top/push).
127122 // Not thread safe (create/open/close/backup/restore).
@@ -132,14 +127,13 @@ class arraymap
132127};
133128
134129template <typename Element>
135- using array_map = arraymap<linkage<Element::pk>, system::data_array<Element::sk>,
136- Element::size>;
130+ using array_map = arraymap<linkage<Element::pk>, Element::size>;
137131
138132} // namespace database
139133} // namespace libbitcoin
140134
141- #define TEMPLATE template <typename Link, typename Key, size_t Size>
142- #define CLASS arraymap<Link, Key, Size>
135+ #define TEMPLATE template <typename Link, size_t Size>
136+ #define CLASS arraymap<Link, Size>
143137
144138#include < bitcoin/database/impl/primitives/arraymap.ipp>
145139
0 commit comments