141 inline
event<T0, T1, T2, T3>& operator=(const
event<T0, T1, T2, T3>& x) noexcept;
142 inline
event<T0, T1, T2, T3>& operator=(
event<T0, T1, T2, T3>&& x) noexcept;
144 inline
event<T0, T1, T2, T3>& operator+=(
event<T0, T1, T2, T3> x);
146 inline const
char* file_annotation() const;
147 inline
int line_annotation() const;
149 inline
event<T0, T1, T2, T3>& __instantiate(tamerpriv::abstract_rendezvous& r, uintptr_t rid, const
char* file =
nullptr,
int line = 0);
150 inline tamerpriv::simple_event* __get_simple() const;
151 inline tamerpriv::simple_event* __release_simple();
154 tamerpriv::simple_event* se_;
155 std::tuple<T0*, T1*, T2*, T3*> sv_;
168template <typename T0, typename T1, typename T2>
169class
event<T0, T1, T2,
void> {
public:
170 typedef std::tuple<T0, T1, T2> results_tuple_type;
172 inline event()
noexcept;
173 inline event(T0& x0, T1& x1, T2& x2)
noexcept;
174 inline event(results_tuple_type& xs)
noexcept;
177 : se_(x.se_), sv_(x.sv_) {
178 tamerpriv::simple_event::use(se_);
182 : se_(x.se_), sv_(x.sv_) {
187 tamerpriv::simple_event::unuse(se_);
190 explicit operator bool()
const {
195 return !se_ || se_->empty();
199 inline void trigger(T0 v0, T1 v1, T2 v2);
201 inline void unblock()
noexcept;
202 template <
size_t I>
inline void set_result(
typename std::tuple_element<I, results_tuple_type>::type vi);
210 tamerpriv::simple_event::use(x.se_);
211 tamerpriv::simple_event::unuse(se_);
218 tamerpriv::simple_event* se = se_;
227 inline const char* file_annotation()
const;
228 inline int line_annotation()
const;
230 event<T0, T1, T2>& __instantiate(tamerpriv::abstract_rendezvous& r, uintptr_t rid,
const char* file =
nullptr,
int line = 0) {
231 TAMER_DEBUG_ASSERT(!se_);
232 se_ =
new tamerpriv::simple_event(r, rid, file, line);
235 tamerpriv::simple_event* __get_simple()
const {
238 tamerpriv::simple_event* __release_simple() {
239 tamerpriv::simple_event* se = se_;
245 tamerpriv::simple_event* se_;
246 std::tuple<T0*, T1*, T2*> sv_;
250template <
typename T0,
typename T1>
251class event<T0, T1, void, void> {
public:
252 typedef std::tuple<T0, T1> results_tuple_type;
254 inline event() noexcept;
255 inline
event(T0& x0, T1& x1) noexcept;
256 inline
event(results_tuple_type& xs) noexcept;
259 : se_(x.se_), sv_(x.sv_) {
260 tamerpriv::simple_event::use(se_);
264 : se_(x.se_), sv_(x.sv_) {
269 tamerpriv::simple_event::unuse(se_);
272 explicit operator bool()
const {
277 return !se_ || se_->empty();
281 inline void trigger(T0 v0, T1 v1);
283 inline void unblock() noexcept;
284 template <
size_t I> inline
void set_result(typename std::tuple_element<I, results_tuple_type>::type vi);
291 event<T0, T1>& operator=(const
event<T0, T1>& x) noexcept {
292 tamerpriv::simple_event::use(x.se_);
293 tamerpriv::simple_event::unuse(se_);
300 tamerpriv::simple_event* se = se_;
309 inline const char* file_annotation()
const;
310 inline int line_annotation()
const;
312 event<T0, T1>& __instantiate(tamerpriv::abstract_rendezvous& r, uintptr_t rid,
const char* file =
nullptr,
int line = 0) {
313 TAMER_DEBUG_ASSERT(!se_);
314 se_ =
new tamerpriv::simple_event(r, rid, file, line);
317 tamerpriv::simple_event* __get_simple()
const {
320 tamerpriv::simple_event* __release_simple() {
321 tamerpriv::simple_event* se = se_;
327 tamerpriv::simple_event* se_;
328 std::tuple<T0*, T1*> sv_;
332template <
typename T0>
333class event<T0, void, void, void> {
public:
334 typedef std::tuple<T0> results_tuple_type;
336 inline event() noexcept;
337 inline
event(T0& x0) noexcept;
338 inline
event(results_tuple_type& xs) noexcept;
341 : se_(x.se_), s0_(x.s0_) {
342 tamerpriv::simple_event::use(se_);
345 event(event<T0>&& x) noexcept
346 : se_(x.se_), s0_(x.s0_) {
350#if TAMER_HAVE_PREEVENT
351 template <
typename R>
inline event(preevent<R, T0>&& x);
354 inline event(
const event<>& x, results_tuple_type& xs);
355 inline event(event<>&& x, results_tuple_type& xs)
noexcept;
358 tamerpriv::simple_event::unuse(se_);
361 explicit operator bool()
const {
366 return !se_ || se_->empty();
372 inline void unblock() noexcept;
373 template <
size_t I = 0> inline
void set_result(typename std::tuple_element<I, results_tuple_type>::type vi);
375 inline T0& result() const noexcept;
376 inline T0* result_pointer() const noexcept;
383 event<T0>& operator=(const
event<T0>& x) noexcept {
384 tamerpriv::simple_event::use(x.se_);
385 tamerpriv::simple_event::unuse(se_);
391 event<T0>&
operator=(event<T0>&& x)
noexcept {
392 tamerpriv::simple_event* se = se_;
399#if TAMER_HAVE_PREEVENT
400 template <
typename R> event<T0>&
operator=(preevent<R, T0>&& x) {
401 return *
this = event<T0>(std::move(x));
405 inline event<T0>& operator+=(event<T0> x);
407 inline const char* file_annotation()
const;
408 inline int line_annotation()
const;
410 event<T0>& __instantiate(tamerpriv::abstract_rendezvous& r, uintptr_t rid,
const char* file =
nullptr,
int line = 0) {
411 TAMER_DEBUG_ASSERT(!se_);
412 se_ =
new tamerpriv::simple_event(r, rid, file, line);
415 tamerpriv::simple_event* __get_simple()
const {
418 tamerpriv::simple_event* __release_simple() {
419 tamerpriv::simple_event* se = se_;
424 static inline event<T0> __make(tamerpriv::simple_event* se, T0* s0) {
425 return event<T0>(take_marker(), se, s0);
429 tamerpriv::simple_event* se_;
432 struct take_marker { };
433 inline event(
const take_marker&, tamerpriv::simple_event* se, T0* s0)
440class event<void, void, void, void> {
public:
441 typedef std::tuple<> results_tuple_type;
443 inline event() noexcept;
444 inline
event(results_tuple_type& xs) noexcept;
448 tamerpriv::simple_event::use(se_);
451 event(event<>&& x) noexcept
456#if TAMER_HAVE_PREEVENT
457 template <
typename R>
inline event(preevent<R>&& x);
461 tamerpriv::simple_event::unuse(se_);
464 explicit operator bool()
const {
469 return !se_ || se_->empty();
473 inline
void trigger() noexcept;
474 inline
void tuple_trigger(const results_tuple_type& vs) noexcept;
475 inline
void unblock() noexcept;
478 tamerpriv::simple_event::use(e.__get_simple());
479 tamerpriv::simple_event::at_trigger(se_, e.__get_simple());
482 tamerpriv::simple_event::at_trigger(se_, e.__release_simple());
492 event<>&
operator=(
const event<>& x)
noexcept {
493 tamerpriv::simple_event::use(x.se_);
494 tamerpriv::simple_event::unuse(se_);
499 event<>&
operator=(event<>&& x)
noexcept {
500 tamerpriv::simple_event* se = se_;
506#if TAMER_HAVE_PREEVENT
507 template <
typename R> event<>&
operator=(preevent<R>&& x) {
508 return *
this = event<>(std::move(x));
512 inline event<>& operator+=(event<> x);
514 inline const char* file_annotation()
const;
515 inline int line_annotation()
const;
517 event<>& __instantiate(tamerpriv::abstract_rendezvous& r, uintptr_t rid,
const char* file =
nullptr,
int line = 0) {
518 TAMER_DEBUG_ASSERT(!se_);
519 se_ =
new tamerpriv::simple_event(r, rid, file, line);
522 tamerpriv::simple_event* __get_simple()
const {
525 tamerpriv::simple_event* __release_simple() {
526 tamerpriv::simple_event* se = se_;
531 static inline event<> __make(tamerpriv::simple_event* se) {
532 return event<>(take_marker(), se);
536 mutable tamerpriv::simple_event* se_;
538 struct take_marker { };
539 inline event(
const take_marker&, tamerpriv::simple_event* se)
543 friend class tamerpriv::simple_event;
548#if TAMER_HAVE_PREEVENT
549template <
typename R,
typename T0>
552 typedef std::tuple<T0> results_tuple_type;
554 inline constexpr preevent(R& r, T0& x0,
const char* file =
nullptr,
int line = 0) noexcept;
555 inline preevent(preevent<R, T0>&& x) noexcept;
557 explicit operator
bool()
const {
564 inline void operator()(T0 v0) {
566 *s0_ = std::move(v0);
570 inline void trigger(T0 v0) {
573 inline void tuple_trigger(
const results_tuple_type& vs) {
574 operator()(std::get<0>(vs));
576 inline void unblock() noexcept {
580 inline T0& result() const noexcept {
584 inline T0* result_pointer() const noexcept {
592 const char* file_annotation_;
593 int line_annotation_;
596 preevent(
const preevent<R, T0>& x)
noexcept;
597 template <
typename TT0,
typename TT1,
typename TT2,
typename TT3>
602class preevent<R, void> {
604 typedef std::tuple<> results_tuple_type;
606 inline constexpr preevent(R& r,
const char* file =
nullptr,
int line = 0) noexcept;
607 inline preevent(preevent<R>&& x) noexcept;
609 explicit operator
bool()
const {
616 inline void operator()() {
619 inline void trigger() {
622 inline void tuple_trigger(
const results_tuple_type&) {
625 inline void unblock() noexcept {
632 const char* file_annotation_;
633 int line_annotation_;
636 preevent(
const preevent<R>& x)
noexcept;
637 template <
typename TT0,
typename TT1,
typename TT2,
typename TT3>
646template <
typename T0,
typename T1,
typename T2,
typename T3>
648 : se_(
nullptr), sv_(
nullptr,
nullptr,
nullptr,
nullptr) {
657template <
typename T0,
typename T1,
typename T2,
typename T3>
659 : se_(
nullptr), sv_(&x0, &x1, &x2, &x3) {
665template <
typename T0,
typename T1,
typename T2,
typename T3>
667 : se_(
nullptr), sv_(&std::get<0>(xs), &std::get<1>(xs), &std::get<2>(xs), &std::get<3>(xs)) {
673template <
typename T0,
typename T1,
typename T2,
typename T3>
675 : se_(x.se_), sv_(x.sv_) {
676 tamerpriv::simple_event::use(se_);
682template <
typename T0,
typename T1,
typename T2,
typename T3>
684 : se_(x.se_), sv_(x.sv_) {
692template <
typename T0,
typename T1,
typename T2,
typename T3>
694 tamerpriv::simple_event::unuse(se_);
699template <
typename T0,
typename T1,
typename T2,
typename T3>
706template <
typename T0,
typename T1,
typename T2,
typename T3>
708 return !se_ || se_->empty();
719template <
typename T0,
typename T1,
typename T2,
typename T3>
722 *std::get<0>(sv_) = std::move(v0);
723 *std::get<1>(sv_) = std::move(v1);
724 *std::get<2>(sv_) = std::move(v2);
725 *std::get<3>(sv_) = std::move(v3);
726 se_->simple_trigger(
true);
741template <
typename T0,
typename T1,
typename T2,
typename T3>
753template <
typename T0,
typename T1,
typename T2,
typename T3>
755 operator()(std::get<0>(vs), std::get<1>(vs), std::get<2>(vs), std::get<3>(vs));
764template <
typename T0,
typename T1,
typename T2,
typename T3>
766 tamerpriv::simple_event::simple_trigger(se_,
false);
770template <
typename T0,
typename T1,
typename T2,
typename T3>
772inline void event<T0, T1, T2, T3>::set_result(
typename std::tuple_element<I, results_tuple_type>::type vi) {
774 *std::get<I>(sv_) = std::move(vi);
784template <
typename T0,
typename T1,
typename T2,
typename T3>
786 tamerpriv::simple_event::use(e.__get_simple());
787 tamerpriv::simple_event::at_trigger(se_, e.__get_simple());
791template <
typename T0,
typename T1,
typename T2,
typename T3>
793 tamerpriv::simple_event::at_trigger(se_, e.__release_simple());
804template <
typename T0,
typename T1,
typename T2,
typename T3>
806 tamerpriv::simple_event::use(se_);
813template <
typename T0,
typename T1,
typename T2,
typename T3>
815 tamerpriv::simple_event::use(x.se_);
816 tamerpriv::simple_event::unuse(se_);
825template <
typename T0,
typename T1,
typename T2,
typename T3>
827 tamerpriv::simple_event* se = se_;
838template <
typename T0,
typename T1,
typename T2,
typename T3>
839event<T0, T1, T2, T3>& event<T0, T1, T2, T3>::__instantiate(tamerpriv::abstract_rendezvous& r, uintptr_t rid,
const char* file,
int line) {
840 TAMER_DEBUG_ASSERT(!se_);
841 se_ =
new tamerpriv::simple_event(r, rid, file, line);
849template <
typename T0,
typename T1,
typename T2,
typename T3>
850inline tamerpriv::simple_event* event<T0, T1, T2, T3>::__get_simple()
const {
858template <
typename T0,
typename T1,
typename T2,
typename T3>
860 tamerpriv::simple_event* se = se_;
868template <
typename T0,
typename T1,
typename T2>
870 : se_(
nullptr), sv_(
nullptr,
nullptr,
nullptr) {
873template <
typename T0,
typename T1,
typename T2>
875 : se_(
nullptr), sv_(&x0, &x1, &x2) {
878template <
typename T0,
typename T1,
typename T2>
880 : se_(
nullptr), sv_(&std::get<0>(xs), &std::get<1>(xs), &std::get<2>(xs)) {
883template <
typename T0,
typename T1,
typename T2>
886 *std::get<0>(sv_) = std::move(v0);
887 *std::get<1>(sv_) = std::move(v1);
888 *std::get<2>(sv_) = std::move(v2);
889 se_->simple_trigger(
true);
894template <
typename T0,
typename T1,
typename T2>
899template <
typename T0,
typename T1,
typename T2>
901 operator()(std::get<0>(vs), std::get<1>(vs), std::get<2>(vs));
904template <
typename T0,
typename T1,
typename T2>
906 tamerpriv::simple_event::simple_trigger(se_,
false);
910template <
typename T0,
typename T1,
typename T2>
914 *std::get<I>(sv_) = std::move(vi);
919template <
typename T0,
typename T1>
921 : se_(
nullptr), sv_(
nullptr,
nullptr) {
924template <
typename T0,
typename T1>
926 : se_(
nullptr), sv_(&x0, &x1) {
929template <
typename T0,
typename T1>
931 : se_(
nullptr), sv_(&std::get<0>(xs), &std::get<1>(xs)) {
934template <
typename T0,
typename T1>
937 *std::get<0>(sv_) = std::move(v0);
938 *std::get<1>(sv_) = std::move(v1);
939 se_->simple_trigger(
true);
944template <
typename T0,
typename T1>
949template <
typename T0,
typename T1>
954template <
typename T0,
typename T1>
956 tamerpriv::simple_event::simple_trigger(se_,
false);
960template <
typename T0,
typename T1>
964 *std::get<I>(sv_) = std::move(vi);
969template <
typename T0>
971 : se_(
nullptr), s0_(0) {
974template <
typename T0>
976 : se_(
nullptr), s0_(&x0) {
979template <
typename T0>
981 : se_(
nullptr), s0_(&std::get<0>(xs)) {
984template <
typename T0>
987 *s0_ = std::move(v0);
988 se_->simple_trigger(
true);
993template <
typename T0>
998template <
typename T0>
1003template <
typename T0>
1005 tamerpriv::simple_event::simple_trigger(se_,
false);
1009template <
typename T0>
1013 *s0_ = std::move(vi);
1027 tamerpriv::simple_event::simple_trigger(se_,
false);
1048template <
typename T0>
1055template <
typename T0>
1057 return se_ && *se_ ? s0_ : 0;
1061#if TAMER_HAVE_PREEVENT
1062template <
typename R,
typename T0>
1063inline constexpr preevent<R, T0>::preevent(R& r, T0& x0,
const char* file,
int line) noexcept
1064 : r_(&((
void) file, (
void) line, r)), s0_(&x0) TAMER_IFTRACE(, file_annotation_(file), line_annotation_(line)) {
1069template <
typename R,
typename T0>
1070inline preevent<R, T0>::preevent(preevent<R, T0>&& x) noexcept
1071 : r_(x.r_), s0_(x.s0_) TAMER_IFTRACE(, file_annotation_(x.file_annotation_), line_annotation_(x.line_annotation_)) {
1075template <
typename R>
1076inline constexpr preevent<R>::preevent(R& r,
const char* file,
int line) noexcept
1077 : r_(&((
void) file, (
void) line, r)) TAMER_IFTRACE(, file_annotation_(file), line_annotation_(line)) {
1080template <
typename R>
1081inline preevent<R>::preevent(preevent<R>&& x) noexcept
1082 : r_(x.r_) TAMER_IFTRACE(, file_annotation_(x.file_annotation_), line_annotation_(x.line_annotation_)) {
1086# undef TAMER_PREEVENT_CTOR
1114template <
typename R,
typename I,
typename T0,
typename T1,
typename T2,
typename T3>
1117 return event<T0, T1, T2, T3>(x0, x1, x2, x3).__instantiate(
static_cast<R&
>(r),
static_cast<R&
>(r).make_rid(eid));
1120template <
typename R,
typename I,
typename T0,
typename T1,
typename T2,
typename T3>
1123 return event<T0, T1, T2, T3>(xs).__instantiate(
static_cast<R&
>(r),
static_cast<R&
>(r).make_rid(eid));
1126template <
typename R,
typename T0,
typename T1,
typename T2,
typename T3>
1132template <
typename R,
typename T0,
typename T1,
typename T2,
typename T3>
1138template <
typename R,
typename I,
typename T0,
typename T1,
typename T2>
1141 return event<T0, T1, T2>(x0, x1, x2).__instantiate(
static_cast<R&
>(r),
static_cast<R&
>(r).make_rid(eid));
1144template <
typename R,
typename T0,
typename T1,
typename T2>
1150template <
typename R,
typename I,
typename T0,
typename T1>
1153 return event<T0, T1>(x0, x1).__instantiate(
static_cast<R&
>(r),
static_cast<R&
>(r).make_rid(eid));
1156template <
typename R,
typename T0,
typename T1>
1159 return event<T0, T1>(x0, x1).__instantiate(
static_cast<R&
>(r), 0);
1162template <
typename R,
typename I,
typename T0>
1165 return event<T0>(x0).__instantiate(
static_cast<R&
>(r),
static_cast<R&
>(r).make_rid(eid));
1168#if !TAMER_HAVE_PREEVENT || !TAMER_PREFER_PREEVENT
1169template <
typename R,
typename T0>
1172 return event<T0>(x0).__instantiate(
static_cast<R&
>(r), 0);
1175template <
typename R,
typename T0>
1176inline preevent<R, T0>
make_event(zero_argument_rendezvous_tag<R>& r, T0& x0)
1178 return preevent<R, T0>(
static_cast<R&
>(r), x0);
1182#if TAMER_HAVE_PREEVENT
1183template <
typename R,
typename T0>
1184inline preevent<R, T0> make_preevent(zero_argument_rendezvous_tag<R>& r, T0& x0)
1186 return preevent<R, T0>(
static_cast<R&
>(r), x0);
1190template <
typename R,
typename I>
1193 return event<>().__instantiate(
static_cast<R&
>(r),
static_cast<R&
>(r).make_rid(eid));
1196#if !TAMER_HAVE_PREEVENT || !TAMER_PREFER_PREEVENT
1197template <
typename R>
1200 return event<>().__instantiate(
static_cast<R&
>(r), 0);
1203template <
typename R>
1204inline preevent<R>
make_event(zero_argument_rendezvous_tag<R>& r)
1206 return preevent<R>(
static_cast<R&
>(r));
1210#if TAMER_HAVE_PREEVENT
1211template <
typename R>
1212inline preevent<R> make_preevent(zero_argument_rendezvous_tag<R>& r)
1214 return preevent<R>(
static_cast<R&
>(r));
1222template <
typename I>
template <
typename T0,
typename T1,
typename T2,
typename T3>
1228template <
typename I>
template <
typename T0,
typename T1,
typename T2,
typename T3>
1234template <
typename T0,
typename T1,
typename T2,
typename T3>
1240template <
typename T0,
typename T1,
typename T2,
typename T3>
1246template <
typename I>
template <
typename T0,
typename T1,
typename T2>
1247inline event<T0, T1, T2> rendezvous<I>::make_event(
const I& eid, T0& x0, T1& x1, T2& x2)
1252template <
typename I>
template <
typename T0,
typename T1,
typename T2>
1253inline event<T0, T1, T2> simple_rendezvous<I>::make_event(I eid, T0& x0, T1& x1, T2& x2)
1258template <
typename T0,
typename T1,
typename T2>
1264template <
typename T0,
typename T1,
typename T2>
1270template <
typename I>
template <
typename T0,
typename T1>
1271inline event<T0, T1> rendezvous<I>::make_event(
const I& eid, T0& x0, T1& x1)
1276template <
typename I>
template <
typename T0,
typename T1>
1277inline event<T0, T1> simple_rendezvous<I>::make_event(I eid, T0& x0, T1& x1)
1282template <
typename T0,
typename T1>
1283inline event<T0, T1> rendezvous<>::make_event(T0& x0, T1& x1)
1288template <
typename T0,
typename T1>
1289inline event<T0, T1> gather_rendezvous::make_event(T0& x0, T1& x1)
1294template <
typename I>
template <
typename T0>
1295inline event<T0> rendezvous<I>::make_event(
const I& eid, T0& x0)
1300template <
typename I>
template <
typename T0>
1301inline event<T0> simple_rendezvous<I>::make_event(I eid, T0& x0)
1306#if !TAMER_HAVE_PREEVENT || !TAMER_PREFER_PREEVENT
1307template <
typename T0>
1308inline event<T0> rendezvous<>::make_event(T0& x0) {
1312template <
typename T0>
1313inline event<T0> gather_rendezvous::make_event(T0& x0) {
1317template <
typename T0>
1318inline preevent<rendezvous<>, T0> rendezvous<>::make_event(T0& x0) {
1319 return tamer::make_preevent(*
this, x0);
1322template <
typename T0>
1323inline preevent<gather_rendezvous, T0> gather_rendezvous::make_event(T0& x0) {
1324 return tamer::make_preevent(*
this, x0);
1328#if TAMER_HAVE_PREEVENT
1329template <
typename T0>
1330inline preevent<rendezvous<>, T0> rendezvous<>::make_preevent(T0& x0)
1332 return preevent<rendezvous<>, T0>(*
this, x0);
1335template <
typename T0>
1336inline preevent<gather_rendezvous, T0> gather_rendezvous::make_preevent(T0& x0)
1338 return preevent<gather_rendezvous, T0>(*
this, x0);
1342template <
typename I>
1343inline event<> rendezvous<I>::make_event(
const I& eid)
1348template <
typename I>
1349inline event<> simple_rendezvous<I>::make_event(I eid)
1354#if !TAMER_HAVE_PREEVENT || !TAMER_PREFER_PREEVENT
1355inline event<> rendezvous<>::make_event() {
1359inline event<> gather_rendezvous::make_event() {
1363inline preevent<rendezvous<> > rendezvous<>::make_event() {
1364 return tamer::make_preevent(*
this);
1367inline preevent<gather_rendezvous> gather_rendezvous::make_event() {
1368 return tamer::make_preevent(*
this);
1372#if TAMER_HAVE_PREEVENT
1373inline preevent<rendezvous<> > rendezvous<>::make_preevent() {
1374 return preevent<rendezvous<> >(*this);
1377inline preevent<gather_rendezvous> gather_rendezvous::make_preevent() {
1378 return preevent<gather_rendezvous>(*
this);
1384template <
typename R,
typename I,
typename T0,
typename T1,
typename T2,
typename T3>
1385inline event<T0, T1, T2, T3> make_annotated_event(
const char *file,
int line, one_argument_rendezvous_tag<R>& r,
const I& eid, T0& x0, T1& x1, T2& x2, T3& x3)
1387 return event<T0, T1, T2, T3>(x0, x1, x2, x3).__instantiate(
static_cast<R&
>(r),
static_cast<R&
>(r).make_rid(eid), file, line);
1390template <
typename R,
typename I,
typename T0,
typename T1,
typename T2,
typename T3>
1391inline event<T0, T1, T2, T3> make_annotated_event(
const char *file,
int line, one_argument_rendezvous_tag<R>& r,
const I& eid,
typename event<T0, T1, T2, T3>::results_tuple_type& xs)
1393 return event<T0, T1, T2, T3>(xs).__instantiate(
static_cast<R&
>(r),
static_cast<R&
>(r).make_rid(eid), file, line);
1396template <
typename R,
typename T0,
typename T1,
typename T2,
typename T3>
1402template <
typename R,
typename T0,
typename T1,
typename T2,
typename T3>
1408template <
typename R,
typename I,
typename T0,
typename T1,
typename T2>
1411 return event<T0, T1, T2>(x0, x1, x2).__instantiate(
static_cast<R&
>(r),
static_cast<R&
>(r).make_rid(eid), file, line);
1414template <
typename R,
typename I,
typename T0,
typename T1,
typename T2>
1417 return event<T0, T1, T2>(xs).__instantiate(
static_cast<R&
>(r),
static_cast<R&
>(r).make_rid(eid), file, line);
1420template <
typename R,
typename T0,
typename T1,
typename T2>
1423 return event<T0, T1, T2>(x0, x1, x2).__instantiate(
static_cast<R&
>(r), 0, file, line);
1426template <
typename R,
typename T0,
typename T1,
typename T2>
1432template <
typename R,
typename I,
typename T0,
typename T1>
1435 return event<T0, T1>(x0, x1).__instantiate(
static_cast<R&
>(r),
static_cast<R&
>(r).make_rid(eid), file, line);
1438template <
typename R,
typename I,
typename T0,
typename T1>
1441 return event<T0, T1>(xs).__instantiate(
static_cast<R&
>(r),
static_cast<R&
>(r).make_rid(eid), file, line);
1444template <
typename R,
typename T0,
typename T1>
1447 return event<T0, T1>(x0, x1).__instantiate(
static_cast<R&
>(r), 0, file, line);
1450template <
typename R,
typename T0,
typename T1>
1453 return event<T0, T1>(xs).__instantiate(
static_cast<R&
>(r), 0, file, line);
1456template <
typename R,
typename I,
typename T0>
1459 return event<T0>(x0).__instantiate(
static_cast<R&
>(r),
static_cast<R&
>(r).make_rid(eid), file, line);
1462template <
typename R,
typename I,
typename T0>
1465 return event<T0>(xs).__instantiate(
static_cast<R&
>(r),
static_cast<R&
>(r).make_rid(eid), file, line);
1468#if !TAMER_HAVE_PREEVENT || !TAMER_PREFER_PREEVENT
1469template <
typename R,
typename T0>
1472 return event<T0>(x0).__instantiate(
static_cast<R&
>(r), 0, file, line);
1475template <
typename R,
typename T0>
1478 return event<T0>(xs).__instantiate(
static_cast<R&
>(r), 0, file, line);
1481template <
typename R,
typename T0>
1482inline preevent<R, T0>
make_annotated_event(
const char *file,
int line, zero_argument_rendezvous_tag<R>& r, T0& x0)
1484 return preevent<R, T0>(
static_cast<R&
>(r), x0, file, line);
1487template <
typename R,
typename T0>
1488inline preevent<T0>
make_annotated_event(
const char *file,
int line, zero_argument_rendezvous_tag<R>& r, std::tuple<T0>& xs)
1490 return preevent<R, T0>(
static_cast<R&
>(r), xs, file, line);
1494#if TAMER_HAVE_PREEVENT
1495template <
typename R,
typename T0>
1496inline preevent<R, T0> make_annotated_preevent(
const char *file,
int line, zero_argument_rendezvous_tag<R>& r, T0& x0)
1498 return preevent<R, T0>(
static_cast<R&
>(r), x0, file, line);
1501template <
typename R,
typename T0>
1502inline preevent<R, T0> make_annotated_preevent(
const char *file,
int line, zero_argument_rendezvous_tag<R>& r, std::tuple<T0>& xs)
1504 return preevent<R, T0>(
static_cast<R&
>(r), xs, file, line);
1508template <
typename R,
typename I>
1511 return event<>().__instantiate(
static_cast<R&
>(r),
static_cast<R&
>(r).make_rid(eid), file, line);
1514template <
typename R,
typename I>
1517 return event<>(xs).__instantiate(
static_cast<R&
>(r),
static_cast<R&
>(r).make_rid(eid), file, line);
1520#if !TAMER_HAVE_PREEVENT || !TAMER_PREFER_PREEVENT
1521template <
typename R>
1524 return event<>().__instantiate(
static_cast<R&
>(r), 0, file, line);
1527template <
typename R>
1530 return event<>(xs).__instantiate(
static_cast<R&
>(r), 0, file, line);
1533template <
typename R>
1534inline preevent<R>
make_annotated_event(
const char *file,
int line, zero_argument_rendezvous_tag<R>& r)
1536 return preevent<R>(
static_cast<R&
>(r), file, line);
1539template <
typename R>
1543 return preevent<R>(
static_cast<R&
>(r), file, line);
1547#if TAMER_HAVE_PREEVENT
1548template <
typename R>
1549inline preevent<R> make_annotated_preevent(
const char *file,
int line, zero_argument_rendezvous_tag<R>& r)
1551 return preevent<R>(
static_cast<R&
>(r), file, line);
1554template <
typename R>
1558 return preevent<R>(
static_cast<R&
>(r), file, line);
1562namespace tamerpriv {
1563template <
typename T0,
typename T1,
typename T2,
typename T3>
1564inline event<T0, T1, T2, T3> distribute_rendezvous<T0, T1, T2, T3>::make_event() {
1565 return tamer::TAMER_MAKE_FN_ANNOTATED_EVENT(*
this, vs_);
1570template <
typename T0,
typename T1,
typename T2>
1572 tamerpriv::simple_event::use(e.__get_simple());
1573 tamerpriv::simple_event::at_trigger(se_, e.__get_simple());
1576template <
typename T0,
typename T1>
1578 tamerpriv::simple_event::use(e.__get_simple());
1579 tamerpriv::simple_event::at_trigger(se_, e.__get_simple());
1582template <
typename T0>
1584 tamerpriv::simple_event::use(e.__get_simple());
1585 tamerpriv::simple_event::at_trigger(se_, e.__get_simple());
1588template <
typename T0,
typename T1,
typename T2>
1590 tamerpriv::simple_event::at_trigger(se_, e.__release_simple());
1593template <
typename T0,
typename T1>
1595 tamerpriv::simple_event::at_trigger(se_, e.__release_simple());
1598template <
typename T0>
1600 tamerpriv::simple_event::at_trigger(se_, e.__release_simple());
1603template <
typename T0,
typename T1,
typename T2>
1605 tamerpriv::simple_event::use(se_);
1609template <
typename T0,
typename T1>
1611 tamerpriv::simple_event::use(se_);
1615template <
typename T0>
1617 tamerpriv::simple_event::use(se_);
1621#if TAMER_HAVE_PREEVENT
1622template <
typename T0>
template <
typename R>
1624 : se_(x.r_ ? new tamerpriv::simple_event(*x.r_, 0, TAMER_IFTRACE_ELSE(x.file_annotation_, 0), TAMER_IFTRACE_ELSE(x.line_annotation_, 0)) : 0), s0_(x.s0_) {
1628template <
typename R>
1629inline event<>::event(preevent<R>&& x)
1630 : se_(x.r_ ? new tamerpriv::simple_event(*x.r_, 0, TAMER_IFTRACE_ELSE(x.file_annotation_, 0), TAMER_IFTRACE_ELSE(x.line_annotation_, 0)) : 0) {
1635template <
typename T0>
1636inline event<T0>::event(
const event<>& x, results_tuple_type& vs)
1637 : se_(x.__get_simple()), s0_(&std::get<0>(vs)) {
1638 tamerpriv::simple_event::use(se_);
1641template <
typename T0>
1642inline event<T0>::event(event<>&& x, results_tuple_type& vs) noexcept
1643 : se_(x.__release_simple()), s0_(&std::get<0>(vs)) {
1646template <
typename T0,
typename T1,
typename T2,
typename T3>
1647inline event<T0, T1, T2, T3>& event<T0, T1, T2, T3>::operator+=(event<T0, T1, T2, T3> x) {
1648 typedef tamerpriv::distribute_rendezvous<T0, T1, T2, T3> rendezvous_type;
1649 rendezvous_type::make(*
this, std::move(x));
1653template <
typename T0,
typename T1,
typename T2>
1654inline event<T0, T1, T2>& event<T0, T1, T2>::operator+=(event<T0, T1, T2> x) {
1655 typedef tamerpriv::distribute_rendezvous<T0, T1, T2> rendezvous_type;
1656 rendezvous_type::make(*
this, std::move(x));
1660template <
typename T0,
typename T1>
1661inline event<T0, T1>& event<T0, T1>::operator+=(event<T0, T1> x) {
1662 typedef tamerpriv::distribute_rendezvous<T0, T1> rendezvous_type;
1663 rendezvous_type::make(*
this, std::move(x));
1667template <
typename T0>
1668inline event<T0>& event<T0>::operator+=(event<T0> x) {
1669 typedef tamerpriv::distribute_rendezvous<T0> rendezvous_type;
1670 rendezvous_type::make(*
this, std::move(x));
1674inline event<>& event<>::operator+=(event<> x) {
1675 typedef tamerpriv::distribute_rendezvous<> rendezvous_type;
1676 rendezvous_type::make(*
this, std::move(x));
1680template <
typename T0,
typename T1>
1681inline event<T0, T1>
operator+(event<T0, T1> a, event<T0, T1> b) {
1685template <
typename T0,
typename T1,
typename T2,
typename T3>
1686inline const char* event<T0, T1, T2, T3>::file_annotation()
const {
1687 return se_ ? se_->file_annotation() : 0;
1690template <
typename T0,
typename T1,
typename T2>
1691inline const char* event<T0, T1, T2>::file_annotation()
const {
1692 return se_ ? se_->file_annotation() : 0;
1695template <
typename T0,
typename T1>
1696inline const char* event<T0, T1>::file_annotation()
const {
1697 return se_ ? se_->file_annotation() : 0;
1700template <
typename T0>
1701inline const char* event<T0>::file_annotation()
const {
1702 return se_ ? se_->file_annotation() : 0;
1705inline const char* event<>::file_annotation()
const {
1706 return se_ ? se_->file_annotation() : 0;
1709template <
typename T0,
typename T1,
typename T2,
typename T3>
1710inline int event<T0, T1, T2, T3>::line_annotation()
const {
1711 return se_ ? se_->line_annotation() : 0;
1714template <
typename T0,
typename T1,
typename T2>
1715inline int event<T0, T1, T2>::line_annotation()
const {
1716 return se_ ? se_->line_annotation() : 0;
1719template <
typename T0,
typename T1>
1720inline int event<T0, T1>::line_annotation()
const {
1721 return se_ ? se_->line_annotation() : 0;
1724template <
typename T0>
1725inline int event<T0>::line_annotation()
const {
1726 return se_ ? se_->line_annotation() : 0;
1729inline int event<>::line_annotation()
const {
1730 return se_ ? se_->line_annotation() : 0;