Line data Source code
1 0 : // 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/Structure/Direction.hpp"
10 :
11 : /// \ingroup DataStructuresGroup
12 : /// \ingroup ComputationalDomainGroup
13 : /// An optimized map with Direction keys
14 : template <size_t Dim, typename T>
15 1 : class DirectionMap
16 : : public FixedHashMap<2 * Dim, Direction<Dim>, T, DirectionHash<Dim>> {
17 : public:
18 0 : using base = FixedHashMap<2 * Dim, Direction<Dim>, T, DirectionHash<Dim>>;
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) {
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) {
32 : p | static_cast<typename DirectionMap<Dim, T>::base&>(t);
33 : }
34 : } // namespace PUP
|