12 #ifndef CALLER_8B0F592E_A1FC_4089_9145_BB3BF453FE5F 13 #define CALLER_8B0F592E_A1FC_4089_9145_BB3BF453FE5F 16 #include "essentials/base.hpp" 17 #include "essentials/exception.hpp" 31 sxe::function<
void()> _method );
35 sxe::function<
void( event_collector& )> _method );
38 template<
typename _event_type >
40 sxe::function<
void(
const _event_type& )> _method )
42 SX_UNUSED_PARAMETER( _event_collector );
44 #if defined( SX_CPP03_BOOST ) || ( defined(_MSC_VER) && _MSC_VER <=1800 ) 47 const _event_type*
specialized_event =
dynamic_cast< const _event_type*
>( &_event );
48 if( specialized_event )
50 _method( specialized_event );
54 throw sxe::exception(
"Invalid event type!" );
61 auto& specialized_event = sxy::adjust_event_type< _event_type >( _event );
62 _method( specialized_event );
69 template<
typename _event_type >
73 #if defined( SX_CPP03_BOOST ) || ( defined(_MSC_VER) && _MSC_VER <=1800 ) 76 const _event_type*
specialized_event =
dynamic_cast< const _event_type*
>( &_event );
77 if( specialized_event )
79 _method( specialized_event, _event_collector );
83 throw sxe::exception(
"Invalid event type!" );
90 auto& specialized_event = sxy::adjust_event_type< _event_type >( _event );
91 _method( specialized_event, _event_collector );
98 template<
typename _event_type1,
typename _event_type2 >
104 #if defined( SX_CPP03_BOOST ) || ( defined(_MSC_VER) && _MSC_VER <=1800 ) 107 const _event_type1*
specialized_event =
dynamic_cast< const _event_type1*
>( &_event );
108 if( specialized_event )
110 _method1( specialized_event, _event_collector );
114 const _event_type2* specialized_event2 =
dynamic_cast< const _event_type2*
>( &_event );
115 if( specialized_event2 )
117 _method2( specialized_event2, _event_collector );
121 throw sxe::exception(
"Invalid event type!" );
130 "Event type 1 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
132 "Event type 2 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
136 case _event_type1::get_event_id():
138 auto& specialized_event = sxy::adjust_event_type< _event_type1 >( _event );
139 _method1( specialized_event, _event_collector );
143 case _event_type2::get_event_id():
145 const auto& specialized_event = sxy::adjust_event_type< _event_type2 >( _event );
146 _method2( specialized_event, _event_collector );
151 SX_ASSERT(
false,
"Invalid event type!" );
159 template<
typename _event_type1,
typename _event_type2,
typename _event_type3 >
165 #if defined( SX_CPP03_BOOST ) || ( defined(_MSC_VER) && _MSC_VER <=1800 ) 168 const _event_type1*
specialized_event =
dynamic_cast< const _event_type1*
>( &_event );
169 if( specialized_event )
171 _method1( specialized_event, _event_collector );
175 const _event_type2* specialized_event2 =
dynamic_cast< const _event_type2*
>( &_event );
176 if( specialized_event2 )
178 _method2( specialized_event2, _event_collector );
182 const _event_type3* specialized_event3 =
dynamic_cast< const _event_type3*
>( &_event );
183 if( specialized_event3 )
185 _method3( specialized_event3, _event_collector );
189 throw sxe::exception(
"Invalid event type!" );
199 "Event type 1 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
201 "Event type 2 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
203 "Event type 3 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
207 case _event_type1::get_event_id():
209 auto& specialized_event = sxy::adjust_event_type< _event_type1 >( _event );
210 _method1( specialized_event, _event_collector );
214 case _event_type2::get_event_id():
216 auto& specialized_event = sxy::adjust_event_type< _event_type2 >( _event );
217 _method2( specialized_event, _event_collector );
221 case _event_type3::get_event_id():
223 auto& specialized_event = sxy::adjust_event_type< _event_type3 >( _event );
224 _method3( specialized_event, _event_collector );
229 SX_ASSERT(
false,
"Invalid event type!" );
237 template<
typename _event_type1,
typename _event_type2,
typename _event_type3,
typename _event_type4 >
244 #if defined( SX_CPP03_BOOST ) || ( defined(_MSC_VER) && _MSC_VER <=1800 ) 247 const _event_type1*
specialized_event =
dynamic_cast< const _event_type1*
>( &_event );
248 if( specialized_event )
250 _method1( specialized_event, _event_collector );
254 const _event_type2* specialized_event2 =
dynamic_cast< const _event_type2*
>( &_event );
255 if( specialized_event2 )
257 _method2( specialized_event2, _event_collector );
261 const _event_type3* specialized_event3 =
dynamic_cast< const _event_type3*
>( &_event );
262 if( specialized_event3 )
264 _method3( specialized_event3, _event_collector );
268 const _event_type4* specialized_event4 =
dynamic_cast< const _event_type4*
>( &_event );
269 if( specialized_event4 )
271 _method4( specialized_event4, _event_collector );
275 throw sxe::exception(
"Invalid event type!" );
286 "Event type 1 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
288 "Event type 2 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
290 "Event type 3 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
292 "Event type 4 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
296 case _event_type1::get_event_id():
298 auto& specialized_event = sxy::adjust_event_type< _event_type1 >( _event );
299 _method1( specialized_event, _event_collector );
303 case _event_type2::get_event_id():
305 auto& specialized_event = sxy::adjust_event_type< _event_type2 >( _event );
306 _method2( specialized_event, _event_collector );
310 case _event_type3::get_event_id():
312 auto& specialized_event = sxy::adjust_event_type< _event_type3 >( _event );
313 _method3( specialized_event, _event_collector );
317 case _event_type4::get_event_id():
319 auto& specialized_event = sxy::adjust_event_type< _event_type4 >( _event );
320 _method4( specialized_event, _event_collector );
325 SX_ASSERT(
false,
"Invalid event type!" );
333 template<
typename _event_type1,
typename _event_type2,
typename _event_type3,
typename _event_type4,
334 typename _event_type5 >
342 #if defined( SX_CPP03_BOOST ) || ( defined(_MSC_VER) && _MSC_VER <=1800 ) 345 const _event_type1*
specialized_event =
dynamic_cast< const _event_type1*
>( &_event );
346 if( specialized_event )
348 _method1( specialized_event, _event_collector );
352 const _event_type2* specialized_event2 =
dynamic_cast< const _event_type2*
>( &_event );
353 if( specialized_event2 )
355 _method2( specialized_event2, _event_collector );
359 const _event_type3* specialized_event3 =
dynamic_cast< const _event_type3*
>( &_event );
360 if( specialized_event3 )
362 _method3( specialized_event3, _event_collector );
366 const _event_type4* specialized_event4 =
dynamic_cast< const _event_type4*
>( &_event );
367 if( specialized_event4 )
369 _method4( specialized_event4, _event_collector );
373 const _event_type5* specialized_event5 =
dynamic_cast< const _event_type5*
>( &_event );
374 if( specialized_event5 )
376 _method5( specialized_event5, _event_collector );
380 throw sxe::exception(
"Invalid event type!" );
392 "Event type 1 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
394 "Event type 2 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
396 "Event type 3 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
398 "Event type 4 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
400 "Event type 5 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
404 case _event_type1::get_event_id():
406 auto& specialized_event = sxy::adjust_event_type< _event_type1 >( _event );
407 _method1( specialized_event, _event_collector );
411 case _event_type2::get_event_id():
413 auto& specialized_event = sxy::adjust_event_type< _event_type2 >( _event );
414 _method2( specialized_event, _event_collector );
418 case _event_type3::get_event_id():
420 auto& specialized_event = sxy::adjust_event_type< _event_type3 >( _event );
421 _method3( specialized_event, _event_collector );
425 case _event_type4::get_event_id():
427 auto& specialized_event = sxy::adjust_event_type< _event_type4 >( _event );
428 _method4( specialized_event, _event_collector );
432 case _event_type5::get_event_id():
434 auto& specialized_event = sxy::adjust_event_type< _event_type5 >( _event );
435 _method5( specialized_event, _event_collector );
440 SX_ASSERT(
false,
"Invalid event type!" );
448 template<
typename _event_type1,
typename _event_type2,
typename _event_type3,
typename _event_type4,
449 typename _event_type5,
typename _event_type6 >
458 #if defined( SX_CPP03_BOOST ) || ( defined(_MSC_VER) && _MSC_VER <=1800 ) 461 const _event_type1*
specialized_event =
dynamic_cast< const _event_type1*
>( &_event );
462 if( specialized_event )
464 _method1( specialized_event, _event_collector );
468 const _event_type2* specialized_event2 =
dynamic_cast< const _event_type2*
>( &_event );
469 if( specialized_event2 )
471 _method2( specialized_event2, _event_collector );
475 const _event_type3* specialized_event3 =
dynamic_cast< const _event_type3*
>( &_event );
476 if( specialized_event3 )
478 _method3( specialized_event3, _event_collector );
482 const _event_type4* specialized_event4 =
dynamic_cast< const _event_type4*
>( &_event );
483 if( specialized_event4 )
485 _method4( specialized_event4, _event_collector );
489 const _event_type5* specialized_event5 =
dynamic_cast< const _event_type5*
>( &_event );
490 if( specialized_event5 )
492 _method5( specialized_event5, _event_collector );
496 const _event_type6* specialized_event6 =
dynamic_cast< const _event_type6*
>( &_event );
497 if( specialized_event6 )
499 _method6( specialized_event6, _event_collector );
503 throw sxe::exception(
"Invalid event type!" );
516 "Event type 1 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
518 "Event type 2 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
520 "Event type 3 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
522 "Event type 4 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
524 "Event type 5 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
526 "Event type 6 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
530 case _event_type1::get_event_id():
532 auto& specialized_event = sxy::adjust_event_type< _event_type1 >( _event );
533 _method1( specialized_event, _event_collector );
537 case _event_type2::get_event_id():
539 auto& specialized_event = sxy::adjust_event_type< _event_type2 >( _event );
540 _method2( specialized_event, _event_collector );
544 case _event_type3::get_event_id():
546 auto& specialized_event = sxy::adjust_event_type< _event_type3 >( _event );
547 _method3( specialized_event, _event_collector );
551 case _event_type4::get_event_id():
553 auto& specialized_event = sxy::adjust_event_type< _event_type4 >( _event );
554 _method4( specialized_event, _event_collector );
558 case _event_type5::get_event_id():
560 auto& specialized_event = sxy::adjust_event_type< _event_type5 >( _event );
561 _method5( specialized_event, _event_collector );
565 case _event_type6::get_event_id():
567 auto& specialized_event = sxy::adjust_event_type< _event_type6 >( _event );
568 _method6( specialized_event, _event_collector );
573 SX_ASSERT(
false,
"Invalid event type!" );
581 template<
typename _event_type1,
typename _event_type2,
typename _event_type3,
typename _event_type4,
582 typename _event_type5,
typename _event_type6,
typename _event_type7 >
592 #if defined( SX_CPP03_BOOST ) || ( defined(_MSC_VER) && _MSC_VER <=1800 ) 595 const _event_type1*
specialized_event =
dynamic_cast< const _event_type1*
>( &_event );
596 if( specialized_event )
598 _method1( specialized_event, _event_collector );
602 const _event_type2* specialized_event2 =
dynamic_cast< const _event_type2*
>( &_event );
603 if( specialized_event2 )
605 _method2( specialized_event2, _event_collector );
609 const _event_type3* specialized_event3 =
dynamic_cast< const _event_type3*
>( &_event );
610 if( specialized_event3 )
612 _method3( specialized_event3, _event_collector );
616 const _event_type4* specialized_event4 =
dynamic_cast< const _event_type4*
>( &_event );
617 if( specialized_event4 )
619 _method4( specialized_event4, _event_collector );
623 const _event_type5* specialized_event5 =
dynamic_cast< const _event_type5*
>( &_event );
624 if( specialized_event5 )
626 _method5( specialized_event5, _event_collector );
630 const _event_type6* specialized_event6 =
dynamic_cast< const _event_type6*
>( &_event );
631 if( specialized_event6 )
633 _method6( specialized_event6, _event_collector );
637 const _event_type7* specialized_event7 =
dynamic_cast< const _event_type7*
>( &_event );
638 if( specialized_event7 )
640 _method7( specialized_event7, _event_collector );
644 throw sxe::exception(
"Invalid event type!" );
658 "Event type 1 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
660 "Event type 2 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
662 "Event type 3 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
664 "Event type 4 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
666 "Event type 5 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
668 "Event type 6 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
670 "Event type 7 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
674 case _event_type1::get_event_id():
676 auto& specialized_event = sxy::adjust_event_type< _event_type1 >( _event );
677 _method1( specialized_event, _event_collector );
681 case _event_type2::get_event_id():
683 auto& specialized_event = sxy::adjust_event_type< _event_type2 >( _event );
684 _method2( specialized_event, _event_collector );
688 case _event_type3::get_event_id():
690 auto& specialized_event = sxy::adjust_event_type< _event_type3 >( _event );
691 _method3( specialized_event, _event_collector );
695 case _event_type4::get_event_id():
697 auto& specialized_event = sxy::adjust_event_type< _event_type4 >( _event );
698 _method4( specialized_event, _event_collector );
702 case _event_type5::get_event_id():
704 auto& specialized_event = sxy::adjust_event_type< _event_type5 >( _event );
705 _method5( specialized_event, _event_collector );
709 case _event_type6::get_event_id():
711 auto& specialized_event = sxy::adjust_event_type< _event_type6 >( _event );
712 _method6( specialized_event, _event_collector );
716 case _event_type7::get_event_id():
718 auto& specialized_event = sxy::adjust_event_type< _event_type7 >( _event );
719 _method7( specialized_event, _event_collector );
724 SX_ASSERT(
false,
"Invalid event type!" );
732 template<
typename _event_type1,
typename _event_type2,
typename _event_type3,
typename _event_type4,
733 typename _event_type5,
typename _event_type6,
typename _event_type7,
typename _event_type8 >
744 #if defined( SX_CPP03_BOOST ) || ( defined(_MSC_VER) && _MSC_VER <=1800 ) 747 const _event_type1*
specialized_event =
dynamic_cast< const _event_type1*
>( &_event );
748 if( specialized_event )
750 _method1( specialized_event, _event_collector );
754 const _event_type2* specialized_event2 =
dynamic_cast< const _event_type2*
>( &_event );
755 if( specialized_event2 )
757 _method2( specialized_event2, _event_collector );
761 const _event_type3* specialized_event3 =
dynamic_cast< const _event_type3*
>( &_event );
762 if( specialized_event3 )
764 _method3( specialized_event3, _event_collector );
768 const _event_type4* specialized_event4 =
dynamic_cast< const _event_type4*
>( &_event );
769 if( specialized_event4 )
771 _method4( specialized_event4, _event_collector );
775 const _event_type5* specialized_event5 =
dynamic_cast< const _event_type5*
>( &_event );
776 if( specialized_event5 )
778 _method5( specialized_event5, _event_collector );
782 const _event_type6* specialized_event6 =
dynamic_cast< const _event_type6*
>( &_event );
783 if( specialized_event6 )
785 _method6( specialized_event6, _event_collector );
789 const _event_type7* specialized_event7 =
dynamic_cast< const _event_type7*
>( &_event );
790 if( specialized_event7 )
792 _method7( specialized_event7, _event_collector );
796 const _event_type8* specialized_event8 =
dynamic_cast< const _event_type8*
>( &_event );
797 if( specialized_event8 )
799 _method8( specialized_event8, _event_collector );
803 throw sxe::exception(
"Invalid event type!" );
818 "Event type 1 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
820 "Event type 2 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
822 "Event type 3 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
824 "Event type 4 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
826 "Event type 5 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
828 "Event type 6 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
830 "Event type 7 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
832 "Event type 8 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
836 case _event_type1::get_event_id():
838 auto& specialized_event = sxy::adjust_event_type< _event_type1 >( _event );
839 _method1( specialized_event, _event_collector );
843 case _event_type2::get_event_id():
845 auto& specialized_event = sxy::adjust_event_type< _event_type2 >( _event );
846 _method2( specialized_event, _event_collector );
850 case _event_type3::get_event_id():
852 auto& specialized_event = sxy::adjust_event_type< _event_type3 >( _event );
853 _method3( specialized_event, _event_collector );
857 case _event_type4::get_event_id():
859 auto& specialized_event = sxy::adjust_event_type< _event_type4 >( _event );
860 _method4( specialized_event, _event_collector );
864 case _event_type5::get_event_id():
866 auto& specialized_event = sxy::adjust_event_type< _event_type5 >( _event );
867 _method5( specialized_event, _event_collector );
871 case _event_type6::get_event_id():
873 auto& specialized_event = sxy::adjust_event_type< _event_type6 >( _event );
874 _method6( specialized_event, _event_collector );
878 case _event_type7::get_event_id():
880 auto& specialized_event = sxy::adjust_event_type< _event_type7 >( _event );
881 _method7( specialized_event, _event_collector );
885 case _event_type8::get_event_id():
887 auto& specialized_event = sxy::adjust_event_type< _event_type8 >( _event );
888 _method8( specialized_event, _event_collector );
893 SX_ASSERT(
false,
"Invalid event type!" );
901 template<
typename _event_type1,
typename _event_type2,
typename _event_type3,
typename _event_type4,
902 typename _event_type5,
typename _event_type6,
typename _event_type7,
typename _event_type8,
typename _event_type9 >
914 #if defined( SX_CPP03_BOOST ) || ( defined(_MSC_VER) && _MSC_VER <=1800 ) 917 const _event_type1*
specialized_event =
dynamic_cast< const _event_type1*
>( &_event );
918 if( specialized_event )
920 _method1( specialized_event, _event_collector );
924 const _event_type2* specialized_event2 =
dynamic_cast< const _event_type2*
>( &_event );
925 if( specialized_event2 )
927 _method2( specialized_event2, _event_collector );
931 const _event_type3* specialized_event3 =
dynamic_cast< const _event_type3*
>( &_event );
932 if( specialized_event3 )
934 _method3( specialized_event3, _event_collector );
938 const _event_type4* specialized_event4 =
dynamic_cast< const _event_type4*
>( &_event );
939 if( specialized_event4 )
941 _method4( specialized_event4, _event_collector );
945 const _event_type5* specialized_event5 =
dynamic_cast< const _event_type5*
>( &_event );
946 if( specialized_event5 )
948 _method5( specialized_event5, _event_collector );
952 const _event_type6* specialized_event6 =
dynamic_cast< const _event_type6*
>( &_event );
953 if( specialized_event6 )
955 _method6( specialized_event6, _event_collector );
959 const _event_type7* specialized_event7 =
dynamic_cast< const _event_type7*
>( &_event );
960 if( specialized_event7 )
962 _method7( specialized_event7, _event_collector );
966 const _event_type8* specialized_event8 =
dynamic_cast< const _event_type8*
>( &_event );
967 if( specialized_event8 )
969 _method8( specialized_event8, _event_collector );
973 const _event_type9* specialized_event9 =
dynamic_cast< const _event_type9*
>( &_event );
974 if( specialized_event9 )
976 _method9( specialized_event9, _event_collector );
980 throw sxe::exception(
"Invalid event type!" );
996 "Event type 1 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
998 "Event type 2 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
1000 "Event type 3 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
1002 "Event type 4 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
1004 "Event type 5 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
1006 "Event type 6 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
1008 "Event type 7 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
1010 "Event type 8 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
1012 "Event type 9 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
1014 switch( _event.
get_id() )
1016 case _event_type1::get_event_id():
1018 auto& specialized_event = sxy::adjust_event_type< _event_type1 >( _event );
1019 _method1( specialized_event, _event_collector );
1023 case _event_type2::get_event_id():
1025 auto& specialized_event = sxy::adjust_event_type< _event_type2 >( _event );
1026 _method2( specialized_event, _event_collector );
1030 case _event_type3::get_event_id():
1032 auto& specialized_event = sxy::adjust_event_type< _event_type3 >( _event );
1033 _method3( specialized_event, _event_collector );
1037 case _event_type4::get_event_id():
1039 auto& specialized_event = sxy::adjust_event_type< _event_type4 >( _event );
1040 _method4( specialized_event, _event_collector );
1044 case _event_type5::get_event_id():
1046 auto& specialized_event = sxy::adjust_event_type< _event_type5 >( _event );
1047 _method5( specialized_event, _event_collector );
1051 case _event_type6::get_event_id():
1053 auto& specialized_event = sxy::adjust_event_type< _event_type6 >( _event );
1054 _method6( specialized_event, _event_collector );
1058 case _event_type7::get_event_id():
1060 auto& specialized_event = sxy::adjust_event_type< _event_type7 >( _event );
1061 _method7( specialized_event, _event_collector );
1065 case _event_type8::get_event_id():
1067 auto& specialized_event = sxy::adjust_event_type< _event_type8 >( _event );
1068 _method8( specialized_event, _event_collector );
1072 case _event_type9::get_event_id():
1074 auto& specialized_event = sxy::adjust_event_type< _event_type9 >( _event );
1075 _method9( specialized_event, _event_collector );
1080 SX_ASSERT(
false,
"Invalid event type!" );
1088 template<
typename _event_type1,
typename _event_type2,
typename _event_type3,
typename _event_type4,
1089 typename _event_type5,
typename _event_type6,
typename _event_type7,
typename _event_type8,
typename _event_type9,
1090 typename _event_type10 >
1103 #if defined( SX_CPP03_BOOST ) || ( defined(_MSC_VER) && _MSC_VER <=1800 ) 1106 const _event_type1*
specialized_event =
dynamic_cast< const _event_type1*
>( &_event );
1107 if( specialized_event )
1109 _method1( specialized_event, _event_collector );
1113 const _event_type2* specialized_event2 =
dynamic_cast< const _event_type2*
>( &_event );
1114 if( specialized_event2 )
1116 _method2( specialized_event2, _event_collector );
1120 const _event_type3* specialized_event3 =
dynamic_cast< const _event_type3*
>( &_event );
1121 if( specialized_event3 )
1123 _method3( specialized_event3, _event_collector );
1127 const _event_type4* specialized_event4 =
dynamic_cast< const _event_type4*
>( &_event );
1128 if( specialized_event4 )
1130 _method4( specialized_event4, _event_collector );
1134 const _event_type5* specialized_event5 =
dynamic_cast< const _event_type5*
>( &_event );
1135 if( specialized_event5 )
1137 _method5( specialized_event5, _event_collector );
1141 const _event_type6* specialized_event6 =
dynamic_cast< const _event_type6*
>( &_event );
1142 if( specialized_event6 )
1144 _method6( specialized_event6, _event_collector );
1148 const _event_type7* specialized_event7 =
dynamic_cast< const _event_type7*
>( &_event );
1149 if( specialized_event7 )
1151 _method7( specialized_event7, _event_collector );
1155 const _event_type8* specialized_event8 =
dynamic_cast< const _event_type8*
>( &_event );
1156 if( specialized_event8 )
1158 _method8( specialized_event8, _event_collector );
1162 const _event_type9* specialized_event9 =
dynamic_cast< const _event_type9*
>( &_event );
1163 if( specialized_event9 )
1165 _method9( specialized_event9, _event_collector );
1169 const _event_type10* specialized_event10 =
dynamic_cast< const _event_type10*
>( &_event );
1170 if( specialized_event10 )
1172 _method10( specialized_event10, _event_collector );
1176 throw sxe::exception(
"Invalid event type!" );
1193 "Event type 1 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
1195 "Event type 2 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
1197 "Event type 3 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
1199 "Event type 4 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
1201 "Event type 5 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
1203 "Event type 6 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
1205 "Event type 7 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
1207 "Event type 8 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
1209 "Event type 9 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
1211 "Event type 10 does not have the method 'get_event_id'. This is mandatory for using the behavior_caller!" );
1214 switch( _event.
get_id() )
1216 case _event_type1::get_event_id():
1218 auto& specialized_event = sxy::adjust_event_type< _event_type1 >( _event );
1219 _method1( specialized_event, _event_collector );
1223 case _event_type2::get_event_id():
1225 auto& specialized_event = sxy::adjust_event_type< _event_type2 >( _event );
1226 _method2( specialized_event, _event_collector );
1230 case _event_type3::get_event_id():
1232 auto& specialized_event = sxy::adjust_event_type< _event_type3 >( _event );
1233 _method3( specialized_event, _event_collector );
1237 case _event_type4::get_event_id():
1239 auto& specialized_event = sxy::adjust_event_type< _event_type4 >( _event );
1240 _method4( specialized_event, _event_collector );
1244 case _event_type5::get_event_id():
1246 auto& specialized_event = sxy::adjust_event_type< _event_type5 >( _event );
1247 _method5( specialized_event, _event_collector );
1251 case _event_type6::get_event_id():
1253 auto& specialized_event = sxy::adjust_event_type< _event_type6 >( _event );
1254 _method6( specialized_event, _event_collector );
1258 case _event_type7::get_event_id():
1260 auto& specialized_event = sxy::adjust_event_type< _event_type7 >( _event );
1261 _method7( specialized_event, _event_collector );
1265 case _event_type8::get_event_id():
1267 auto& specialized_event = sxy::adjust_event_type< _event_type8 >( _event );
1268 _method8( specialized_event, _event_collector );
1272 case _event_type9::get_event_id():
1274 auto& specialized_event = sxy::adjust_event_type< _event_type9 >( _event );
1275 _method9( specialized_event, _event_collector );
1279 case _event_type10::get_event_id():
1281 auto& specialized_event = sxy::adjust_event_type< _event_type10 >( _event );
1282 _method10( specialized_event, _event_collector );
1287 SX_ASSERT(
false,
"Invalid event type!" );
Definition: event_collector.hpp:25
virtual event_id get_id() const =0
Getter of event's ID.
Interface of an event. An event has an ID, a name and a priority (for processing by the async state m...
Definition: event.hpp:28
Definition: algorithm_parameters.hpp:16
Class that inherits event_impl and provides a fixed event ID and priority as well as create methods f...
Definition: specialized_event.hpp:26
void behavior_caller(const sxy::event &_event, sxy::event_collector &_event_collector, sxe::function< void()> _method)
Definition: caller.cpp:18
Definition: caller_helper.hpp:25