Skip to content

Commit b401d2a

Browse files
committed
Rename head to hashhead.
1 parent 01e8666 commit b401d2a

File tree

12 files changed

+44
-43
lines changed

12 files changed

+44
-43
lines changed

Makefile.am

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ test_libbitcoin_database_test_SOURCES = \
7878
test/mocks/map_store.hpp \
7979
test/primitives/arrayhead.cpp \
8080
test/primitives/arraymap.cpp \
81+
test/primitives/hashhead.cpp \
8182
test/primitives/hashmap.cpp \
82-
test/primitives/head.cpp \
8383
test/primitives/iterator.cpp \
8484
test/primitives/linkage.cpp \
8585
test/primitives/manager.cpp \
@@ -161,8 +161,8 @@ include_bitcoin_database_impl_primitivesdir = ${includedir}/bitcoin/database/imp
161161
include_bitcoin_database_impl_primitives_HEADERS = \
162162
include/bitcoin/database/impl/primitives/arrayhead.ipp \
163163
include/bitcoin/database/impl/primitives/arraymap.ipp \
164+
include/bitcoin/database/impl/primitives/hashhead.ipp \
164165
include/bitcoin/database/impl/primitives/hashmap.ipp \
165-
include/bitcoin/database/impl/primitives/head.ipp \
166166
include/bitcoin/database/impl/primitives/iterator.ipp \
167167
include/bitcoin/database/impl/primitives/linkage.ipp \
168168
include/bitcoin/database/impl/primitives/manager.ipp \
@@ -208,8 +208,8 @@ include_bitcoin_database_primitivesdir = ${includedir}/bitcoin/database/primitiv
208208
include_bitcoin_database_primitives_HEADERS = \
209209
include/bitcoin/database/primitives/arrayhead.hpp \
210210
include/bitcoin/database/primitives/arraymap.hpp \
211+
include/bitcoin/database/primitives/hashhead.hpp \
211212
include/bitcoin/database/primitives/hashmap.hpp \
212-
include/bitcoin/database/primitives/head.hpp \
213213
include/bitcoin/database/primitives/iterator.hpp \
214214
include/bitcoin/database/primitives/linkage.hpp \
215215
include/bitcoin/database/primitives/manager.hpp \

builds/cmake/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,8 @@ if (with-tests)
286286
"../../test/mocks/map_store.hpp"
287287
"../../test/primitives/arrayhead.cpp"
288288
"../../test/primitives/arraymap.cpp"
289+
"../../test/primitives/hashhead.cpp"
289290
"../../test/primitives/hashmap.cpp"
290-
"../../test/primitives/head.cpp"
291291
"../../test/primitives/iterator.cpp"
292292
"../../test/primitives/linkage.cpp"
293293
"../../test/primitives/manager.cpp"

builds/msvc/vs2022/libbitcoin-database-test/libbitcoin-database-test.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@
8787
<ClCompile Include="..\..\..\..\test\mocks\chunk_storage.cpp" />
8888
<ClCompile Include="..\..\..\..\test\primitives\arrayhead.cpp" />
8989
<ClCompile Include="..\..\..\..\test\primitives\arraymap.cpp" />
90+
<ClCompile Include="..\..\..\..\test\primitives\hashhead.cpp" />
9091
<ClCompile Include="..\..\..\..\test\primitives\hashmap.cpp" />
91-
<ClCompile Include="..\..\..\..\test\primitives\head.cpp" />
9292
<ClCompile Include="..\..\..\..\test\primitives\iterator.cpp" />
9393
<ClCompile Include="..\..\..\..\test\primitives\linkage.cpp" />
9494
<ClCompile Include="..\..\..\..\test\primitives\manager.cpp" />

builds/msvc/vs2022/libbitcoin-database-test/libbitcoin-database-test.vcxproj.filters

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@
8484
<ClCompile Include="..\..\..\..\test\primitives\arraymap.cpp">
8585
<Filter>src\primitives</Filter>
8686
</ClCompile>
87-
<ClCompile Include="..\..\..\..\test\primitives\hashmap.cpp">
87+
<ClCompile Include="..\..\..\..\test\primitives\hashhead.cpp">
8888
<Filter>src\primitives</Filter>
8989
</ClCompile>
90-
<ClCompile Include="..\..\..\..\test\primitives\head.cpp">
90+
<ClCompile Include="..\..\..\..\test\primitives\hashmap.cpp">
9191
<Filter>src\primitives</Filter>
9292
</ClCompile>
9393
<ClCompile Include="..\..\..\..\test\primitives\iterator.cpp">

builds/msvc/vs2022/libbitcoin-database/libbitcoin-database.vcxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@
115115
<ClInclude Include="..\..\..\..\include\bitcoin\database\memory\utilities.hpp" />
116116
<ClInclude Include="..\..\..\..\include\bitcoin\database\primitives\arrayhead.hpp" />
117117
<ClInclude Include="..\..\..\..\include\bitcoin\database\primitives\arraymap.hpp" />
118+
<ClInclude Include="..\..\..\..\include\bitcoin\database\primitives\hashhead.hpp" />
118119
<ClInclude Include="..\..\..\..\include\bitcoin\database\primitives\hashmap.hpp" />
119-
<ClInclude Include="..\..\..\..\include\bitcoin\database\primitives\head.hpp" />
120120
<ClInclude Include="..\..\..\..\include\bitcoin\database\primitives\iterator.hpp" />
121121
<ClInclude Include="..\..\..\..\include\bitcoin\database\primitives\linkage.hpp" />
122122
<ClInclude Include="..\..\..\..\include\bitcoin\database\primitives\manager.hpp" />
@@ -155,8 +155,8 @@
155155
<None Include="..\..\..\..\include\bitcoin\database\impl\memory\simple_writer.ipp" />
156156
<None Include="..\..\..\..\include\bitcoin\database\impl\primitives\arrayhead.ipp" />
157157
<None Include="..\..\..\..\include\bitcoin\database\impl\primitives\arraymap.ipp" />
158+
<None Include="..\..\..\..\include\bitcoin\database\impl\primitives\hashhead.ipp" />
158159
<None Include="..\..\..\..\include\bitcoin\database\impl\primitives\hashmap.ipp" />
159-
<None Include="..\..\..\..\include\bitcoin\database\impl\primitives\head.ipp" />
160160
<None Include="..\..\..\..\include\bitcoin\database\impl\primitives\iterator.ipp" />
161161
<None Include="..\..\..\..\include\bitcoin\database\impl\primitives\linkage.ipp" />
162162
<None Include="..\..\..\..\include\bitcoin\database\impl\primitives\manager.ipp" />

builds/msvc/vs2022/libbitcoin-database/libbitcoin-database.vcxproj.filters

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,10 @@
188188
<ClInclude Include="..\..\..\..\include\bitcoin\database\primitives\arraymap.hpp">
189189
<Filter>include\bitcoin\database\primitives</Filter>
190190
</ClInclude>
191-
<ClInclude Include="..\..\..\..\include\bitcoin\database\primitives\hashmap.hpp">
191+
<ClInclude Include="..\..\..\..\include\bitcoin\database\primitives\hashhead.hpp">
192192
<Filter>include\bitcoin\database\primitives</Filter>
193193
</ClInclude>
194-
<ClInclude Include="..\..\..\..\include\bitcoin\database\primitives\head.hpp">
194+
<ClInclude Include="..\..\..\..\include\bitcoin\database\primitives\hashmap.hpp">
195195
<Filter>include\bitcoin\database\primitives</Filter>
196196
</ClInclude>
197197
<ClInclude Include="..\..\..\..\include\bitcoin\database\primitives\iterator.hpp">
@@ -304,10 +304,10 @@
304304
<None Include="..\..\..\..\include\bitcoin\database\impl\primitives\arraymap.ipp">
305305
<Filter>include\bitcoin\database\impl\primitives</Filter>
306306
</None>
307-
<None Include="..\..\..\..\include\bitcoin\database\impl\primitives\hashmap.ipp">
307+
<None Include="..\..\..\..\include\bitcoin\database\impl\primitives\hashhead.ipp">
308308
<Filter>include\bitcoin\database\impl\primitives</Filter>
309309
</None>
310-
<None Include="..\..\..\..\include\bitcoin\database\impl\primitives\head.ipp">
310+
<None Include="..\..\..\..\include\bitcoin\database\impl\primitives\hashmap.ipp">
311311
<Filter>include\bitcoin\database\impl\primitives</Filter>
312312
</None>
313313
<None Include="..\..\..\..\include\bitcoin\database\impl\primitives\iterator.ipp">

include/bitcoin/database.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
#include <bitcoin/database/memory/interfaces/storage.hpp>
4545
#include <bitcoin/database/primitives/arrayhead.hpp>
4646
#include <bitcoin/database/primitives/arraymap.hpp>
47+
#include <bitcoin/database/primitives/hashhead.hpp>
4748
#include <bitcoin/database/primitives/hashmap.hpp>
48-
#include <bitcoin/database/primitives/head.hpp>
4949
#include <bitcoin/database/primitives/iterator.hpp>
5050
#include <bitcoin/database/primitives/linkage.hpp>
5151
#include <bitcoin/database/primitives/manager.hpp>

include/bitcoin/database/impl/primitives/head.ipp renamed to include/bitcoin/database/impl/primitives/hashhead.ipp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
* You should have received a copy of the GNU Affero General Public License
1717
* along with this program. If not, see <http://www.gnu.org/licenses/>.
1818
*/
19-
#ifndef LIBBITCOIN_DATABASE_PRIMITIVES_HEAD_IPP
20-
#define LIBBITCOIN_DATABASE_PRIMITIVES_HEAD_IPP
19+
#ifndef LIBBITCOIN_DATABASE_PRIMITIVES_HASHHEAD_IPP
20+
#define LIBBITCOIN_DATABASE_PRIMITIVES_HASHHEAD_IPP
2121

2222
#include <algorithm>
2323
#include <bitcoin/system.hpp>
@@ -30,7 +30,7 @@ namespace libbitcoin {
3030
namespace database {
3131

3232
TEMPLATE
33-
CLASS::head(storage& head, const Link& buckets) NOEXCEPT
33+
CLASS::hashhead(storage& head, const Link& buckets) NOEXCEPT
3434
: file_(head), buckets_(buckets)
3535
{
3636
}

include/bitcoin/database/primitives/head.hpp renamed to include/bitcoin/database/primitives/hashhead.hpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
* You should have received a copy of the GNU Affero General Public License
1717
* along with this program. If not, see <http://www.gnu.org/licenses/>.
1818
*/
19-
#ifndef LIBBITCOIN_DATABASE_PRIMITIVES_HEAD_HPP
20-
#define LIBBITCOIN_DATABASE_PRIMITIVES_HEAD_HPP
19+
#ifndef LIBBITCOIN_DATABASE_PRIMITIVES_HASHHEAD_HPP
20+
#define LIBBITCOIN_DATABASE_PRIMITIVES_HASHHEAD_HPP
2121

2222
#include <shared_mutex>
2323
#include <bitcoin/system.hpp>
@@ -27,16 +27,17 @@
2727
namespace libbitcoin {
2828
namespace database {
2929

30+
/// Fixed size hash map header.
3031
template <typename Link, typename Key, bool Hash>
31-
class head
32+
class hashhead
3233
{
3334
public:
34-
DEFAULT_COPY_MOVE_DESTRUCT(head);
35+
DEFAULT_COPY_MOVE_DESTRUCT(hashhead);
3536

3637
using bytes = typename Link::bytes;
3738

38-
/// An array head has zero buckets (and cannot call index()).
39-
head(storage& head, const Link& buckets) NOEXCEPT;
39+
/// A hash head is disabled it if has one or less buckets.
40+
hashhead(storage& head, const Link& buckets) NOEXCEPT;
4041

4142
/// Sizing (thread safe).
4243
size_t size() const NOEXCEPT;
@@ -87,9 +88,9 @@ class head
8788
} // namespace libbitcoin
8889

8990
#define TEMPLATE template <typename Link, typename Key, bool Hash>
90-
#define CLASS head<Link, Key, Hash>
91+
#define CLASS hashhead<Link, Key, Hash>
9192

92-
#include <bitcoin/database/impl/primitives/head.ipp>
93+
#include <bitcoin/database/impl/primitives/hashhead.ipp>
9394

9495
#undef CLASS
9596
#undef TEMPLATE

include/bitcoin/database/primitives/hashmap.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include <bitcoin/system.hpp>
2323
#include <bitcoin/database/define.hpp>
2424
#include <bitcoin/database/memory/memory.hpp>
25-
#include <bitcoin/database/primitives/head.hpp>
25+
#include <bitcoin/database/primitives/hashhead.hpp>
2626
#include <bitcoin/database/primitives/iterator.hpp>
2727
#include <bitcoin/database/primitives/linkage.hpp>
2828
#include <bitcoin/database/primitives/manager.hpp>
@@ -175,7 +175,7 @@ class hashmap
175175
static constexpr auto is_slab = (Size == max_size_t);
176176
static constexpr auto index_size = Link::size + array_count<Key>;
177177

178-
using head = database::head<Link, Key, Hash>;
178+
using head = database::hashhead<Link, Key, Hash>;
179179
using manager = database::manager<Link, Key, Size>;
180180

181181
// Thread safe (index/top/push).

0 commit comments

Comments
 (0)