DirectionMap.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <pup.h>
7 
8 #include "DataStructures/FixedHashMap.hpp"
9 #include "Domain/Direction.hpp"
10 
11 /// \ingroup DataStructuresGroup
12 /// \ingroup ComputationalDomainGroup
13 /// An optimized map with Direction keys
14 template <size_t Dim, typename T>
16  : public FixedHashMap<2 * Dim, Direction<Dim>, T, DirectionHash<Dim>> {
17  public:
19  using base::base;
20 };
21 
22 namespace PUP {
23 template <size_t Dim, typename T>
24 // NOLINTNEXTLINE(google-runtime-references)
25 void pup(PUP::er& p, DirectionMap<Dim, T>& t) noexcept {
26  pup(p, static_cast<typename DirectionMap<Dim, T>::base&>(t));
27 }
28 
29 template <size_t Dim, typename T>
30 // NOLINTNEXTLINE(google-runtime-references)
31 void operator|(PUP::er& p, DirectionMap<Dim, T>& t) noexcept {
32  p | static_cast<typename DirectionMap<Dim, T>::base&>(t);
33 }
34 } // namespace PUP
Defines class template Direction.
Definition: Strahlkorper.hpp:14
A hash table with a compile-time specified maximum size and ability to efficiently handle perfect has...
Definition: FixedHashMap.hpp:81
An optimized map with Direction keys.
Definition: DirectionMap.hpp:15
Provides a perfect hash if the size of the hash table is 2 * Dim. To take advantage of this...
Definition: Direction.hpp:205