MySQL 9.0.0
Source Code Documentation
containers.h
Go to the documentation of this file.
1/* Copyright (c) 2016, 2024, Oracle and/or its affiliates.
2
3This program is free software; you can redistribute it and/or modify it under
4the terms of the GNU General Public License, version 2.0, as published by the
5Free Software Foundation.
6
7This program is designed to work with certain software (including
8but not limited to OpenSSL) that is licensed under separate terms,
9as designated in a particular file or component or in included license
10documentation. The authors of MySQL hereby grant you an additional
11permission to link the program and your derivative works with the
12separately licensed software that they have either included with
13the program or referenced in the documentation.
14
15This program is distributed in the hope that it will be useful, but WITHOUT
16ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0,
18for more details.
19
20You should have received a copy of the GNU General Public License along with
21this program; if not, write to the Free Software Foundation, Inc.,
2251 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24/** @file storage/temptable/include/temptable/containers.h
25TempTable index containers declarations. */
26
27#ifndef TEMPTABLE_CONTAINERS_H
28#define TEMPTABLE_CONTAINERS_H
29
30#include <set> /* std::multiset */
31#include <type_traits> /* std::is_same */
32#include <unordered_set> /* std::unordered_set, std::unordered_multiset */
33
34#include "storage/temptable/include/temptable/allocator.h" /* temptable::Allocator */
35#include "storage/temptable/include/temptable/indexed_cells.h" /* temptable::Indexed_cells */
36
37namespace temptable {
38
39/** The container used by tree unique and non-unique indexes. */
40typedef std::multiset<Indexed_cells, Indexed_cells_less,
41 Allocator<Indexed_cells>>
43
44/** The container used by hash non-unique indexes. */
45typedef std::unordered_multiset<Indexed_cells, Indexed_cells_hash,
49
50/** The container used by hash unique indexes. */
54
55static_assert(
56 std::is_same<Hash_duplicates_container::const_iterator,
57 Hash_unique_container::const_iterator>::value,
58 "Duplicates and unique hash tables must have the same iterator type.");
59
60} /* namespace temptable */
61
62#endif /* TEMPTABLE_CONTAINERS_H */
Custom memory allocator.
Definition: allocator.h:435
Indexed cells comparator (a == b).
Definition: indexed_cells.h:218
Indexed cells hasher.
Definition: indexed_cells.h:207
Indexed cells represent one or more cells that are covered by an index.
Definition: indexed_cells.h:46
TempTable Indexed Cells declaration.
Definition: allocator.h:45
std::multiset< Indexed_cells, Indexed_cells_less, Allocator< Indexed_cells > > Tree_container
The container used by tree unique and non-unique indexes.
Definition: containers.h:42
std::unordered_set< Indexed_cells, Indexed_cells_hash, Indexed_cells_equal_to, Allocator< Indexed_cells > > Hash_unique_container
The container used by hash unique indexes.
Definition: containers.h:53
std::unordered_multiset< Indexed_cells, Indexed_cells_hash, Indexed_cells_equal_to, Allocator< Indexed_cells > > Hash_duplicates_container
The container used by hash non-unique indexes.
Definition: containers.h:48
std::unordered_set< Key, std::hash< Key >, std::equal_to< Key >, ut::allocator< Key > > unordered_set
Definition: ut0new.h:2888
TempTable custom allocator.