pstore2
hamt_map_fwd.hpp
Go to the documentation of this file.
1 //===- include/pstore/core/hamt_map_fwd.hpp ---------------*- mode: C++ -*-===//
2 //* _ _ __ _ *
3 //* | |__ __ _ _ __ ___ | |_ _ __ ___ __ _ _ __ / _|_ ____| | *
4 //* | '_ \ / _` | '_ ` _ \| __| | '_ ` _ \ / _` | '_ \ | |_\ \ /\ / / _` | *
5 //* | | | | (_| | | | | | | |_ | | | | | | (_| | |_) | | _|\ V V / (_| | *
6 //* |_| |_|\__,_|_| |_| |_|\__| |_| |_| |_|\__,_| .__/ |_| \_/\_/ \__,_| *
7 //* |_| *
8 //===----------------------------------------------------------------------===//
9 //
10 // Part of the pstore project, under the Apache License v2.0 with LLVM Exceptions.
11 // See https://github.com/SNSystems/pstore/blob/master/LICENSE.txt for license
12 // information.
13 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
14 //
15 //===----------------------------------------------------------------------===//
17 
18 #ifndef PSTORE_CORE_HAMT_MAP_FWD_HPP
19 #define PSTORE_CORE_HAMT_MAP_FWD_HPP
20 
21 #include <functional>
22 
23 namespace pstore {
24  namespace index {
25 
29  class index_base {
30  public:
31  virtual ~index_base () = 0;
32  };
33 
38 
39  template <typename Database, typename Container, typename Iterator>
40  class range {
41  public:
42  range (Database & d, Container & c)
43  : db_{d}
44  , c_{c} {}
46  Iterator begin () const { return c_.begin (db_); }
48  Iterator end () const { return c_.end (db_); }
49 
50  private:
51  Database & db_;
52  Container & c_;
53  };
54 
55  template <typename KeyType, typename ValueType, typename Hash = std::hash<KeyType>,
56  typename KeyEqual = std::equal_to<KeyType>>
57  class hamt_map;
58 
59  template <typename KeyType, typename Hash = std::hash<KeyType>,
60  typename KeyEqual = std::equal_to<KeyType>>
61  class hamt_set;
62 
63  } // namespace index
64 } // namespace pstore
65 #endif // PSTORE_CORE_HAMT_MAP_FWD_HPP
This class provides a common base from which each of the real index types derives.
Definition: hamt_map_fwd.hpp:29
auto index(gsl::czstring str, std::size_t pos) -> gsl::czstring
Returns a pointer to the beginning of the pos&#39;th UTF-8 codepoint in the buffer at str or nullptr if e...
Definition: utf.cpp:49
Iterator end() const
Returns an iterator to the end of the container.
Definition: hamt_map_fwd.hpp:48
Definition: hamt_map_fwd.hpp:61
A Hash array mapped trie index type for the pstore.
Definition: hamt_map.hpp:48
The begin() and end() functions for both hamt_map and hamt_set take an extra parameter – the owning ...
Definition: hamt_map_fwd.hpp:40
Iterator begin() const
Returns an iterator to the beginning of the container.
Definition: hamt_map_fwd.hpp:46
Definition: nonpod2.cpp:40