@@ -33,6 +33,8 @@ class actor_chain {
33
33
public:
34
34
// / Types of the actors that are registered in the chain
35
35
using actor_list_type = dtuple<actors_t ...>;
36
+ // Tuple of actor states
37
+ using state_tuple = dtuple<typename actors_t ::state...>;
36
38
// Type of states tuple that is used in the propagator
37
39
using state = dtuple<typename actors_t ::state &...>;
38
40
@@ -52,8 +54,7 @@ class actor_chain {
52
54
return m_actors;
53
55
}
54
56
55
- // / @returns a tuple of default constructible actor states and a
56
- // / corresponding tuple of references
57
+ // / @returns a tuple of default constructible actor states
57
58
DETRAY_HOST_DEVICE
58
59
static constexpr auto make_actor_states () {
59
60
// Only possible if each state is default initializable
@@ -66,10 +67,10 @@ class actor_chain {
66
67
}
67
68
68
69
// / @returns a tuple of reference for every state in the tuple @param t
69
- DETRAY_HOST_DEVICE static constexpr state make_ref_tuple (
70
+ DETRAY_HOST_DEVICE static constexpr state setup_actor_states (
70
71
dtuple<typename actors_t ::state...> &t) {
71
- return make_ref_tuple (t,
72
- std::make_index_sequence<sizeof ...(actors_t )>{});
72
+ return setup_actor_states (
73
+ t, std::make_index_sequence<sizeof ...(actors_t )>{});
73
74
}
74
75
75
76
private:
@@ -110,7 +111,7 @@ class actor_chain {
110
111
111
112
// / @returns a tuple of reference for every state in the tuple @param t
112
113
template <std::size_t ... indices>
113
- DETRAY_HOST_DEVICE static constexpr state make_ref_tuple (
114
+ DETRAY_HOST_DEVICE static constexpr state setup_actor_states (
114
115
dtuple<typename actors_t ::state...> &t,
115
116
std::index_sequence<indices...> /* ids*/ ) {
116
117
return detray::tie (detail::get<indices>(t)...);
@@ -125,6 +126,7 @@ template <>
125
126
class actor_chain <> {
126
127
127
128
public:
129
+ using state_tuple = dtuple<>;
128
130
// / Empty states replaces a real actor states container
129
131
struct state {};
130
132
@@ -137,6 +139,12 @@ class actor_chain<> {
137
139
propagator_state_t & /* p_state*/ ) const {
138
140
/* Do nothing*/
139
141
}
142
+
143
+ // / @returns an empty state
144
+ DETRAY_HOST_DEVICE static constexpr state setup_actor_states (
145
+ const state_tuple &) {
146
+ return {};
147
+ }
140
148
};
141
149
142
150
} // namespace detray
0 commit comments