hfunc.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #pragma once
  2. #include "actor.h"
  3. #include "executor_thread.h"
  4. #include <util/system/defaults.h>
  5. #define HFunc(TEvType, HandleFunc) \
  6. case TEvType::EventType: { \
  7. typename TEvType::TPtr* x = reinterpret_cast<typename TEvType::TPtr*>(&ev); \
  8. HandleFunc(*x, ctx); \
  9. break; \
  10. }
  11. #define hFunc(TEvType, HandleFunc) \
  12. case TEvType::EventType: { \
  13. typename TEvType::TPtr* x = reinterpret_cast<typename TEvType::TPtr*>(&ev); \
  14. HandleFunc(*x); \
  15. break; \
  16. }
  17. #define HFuncTraced(TEvType, HandleFunc) \
  18. case TEvType::EventType: { \
  19. TRACE_EVENT_TYPE(Y_STRINGIZE(TEvType)); \
  20. TEvType::TPtr* x = reinterpret_cast<TEvType::TPtr*>(&ev); \
  21. HandleFunc(*x, ctx); \
  22. break; \
  23. }
  24. #define hFuncTraced(TEvType, HandleFunc) \
  25. case TEvType::EventType: { \
  26. TRACE_EVENT_TYPE(Y_STRINGIZE(TEvType)); \
  27. typename TEvType::TPtr* x = reinterpret_cast<typename TEvType::TPtr*>(&ev); \
  28. HandleFunc(*x); \
  29. break; \
  30. }
  31. #define HTemplFunc(TEvType, HandleFunc) \
  32. case TEvType::EventType: { \
  33. typename TEvType::TPtr* x = reinterpret_cast<typename TEvType::TPtr*>(&ev); \
  34. HandleFunc(*x, ctx); \
  35. break; \
  36. }
  37. #define hTemplFunc(TEvType, HandleFunc) \
  38. case TEvType::EventType: { \
  39. typename TEvType::TPtr* x = reinterpret_cast<typename TEvType::TPtr*>(&ev); \
  40. HandleFunc(*x); \
  41. break; \
  42. }
  43. #define SFunc(TEvType, HandleFunc) \
  44. case TEvType::EventType: \
  45. HandleFunc(ctx); \
  46. break;
  47. #define sFunc(TEvType, HandleFunc) \
  48. case TEvType::EventType: \
  49. HandleFunc(); \
  50. break;
  51. #define CFunc(TEventType, HandleFunc) \
  52. case TEventType: \
  53. HandleFunc(ctx); \
  54. break;
  55. #define cFunc(TEventType, HandleFunc) \
  56. case TEventType: \
  57. HandleFunc(); \
  58. break;
  59. #define FFunc(TEventType, HandleFunc) \
  60. case TEventType: \
  61. HandleFunc(ev, ctx); \
  62. break;
  63. #define fFunc(TEventType, HandleFunc) \
  64. case TEventType: \
  65. HandleFunc(ev); \
  66. break;
  67. #define IgnoreFunc(TEvType) \
  68. case TEvType::EventType: \
  69. break;