summaryrefslogtreecommitdiff
path: root/src/propagation.h
blob: 0bcb435bc48de292d6c2bc4e3e82f044f850f331 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#pragma once

#include "cuboid.h"
#include "concepts.h"

namespace concepts {

template <typename BUFFER>
concept CuboidConstructible = std::constructible_from<BUFFER, Cuboid>;

template <typename BUFFER>
concept PopulationAccess = Arithmetic<typename BUFFER::value_t>
	                      && requires(BUFFER& b) {
	{ b.get(unsigned{}, stage::pre_collision())  } -> std::same_as<typename BUFFER::value_t*>;
	{ b.get(unsigned{}, stage::post_collision()) } -> std::same_as<typename BUFFER::value_t*>;
};

template <typename BUFFER>
concept Propagatable = requires(BUFFER& b) {
	b.stream();
};

template <typename BUFFER>
concept PropagatablePopulationBuffer = CuboidConstructible<BUFFER>
	                                  && PopulationAccess<BUFFER>
                                    && Propagatable<BUFFER>;

}