酷店

AlibcMsgBusHelp.h 4.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. * AlibcMsgBusHelp.h
  3. *
  4. * 阿里百川电商
  5. * 项目名称:阿里巴巴电商 AlibcTradeCommon
  6. * 版本号:3.1.1.93
  7. * 发布时间:2017-03-06
  8. * 开发团队:阿里巴巴百川商业化团队
  9. * 阿里巴巴电商SDK答疑群号:1229144682(阿里旺旺)
  10. * Copyright (c) 2016-2019 阿里巴巴-移动事业群-百川. All rights reserved.
  11. */
  12. #import <Foundation/Foundation.h>
  13. #import <UIKit/UIKit.h>
  14. #ifndef AlibcMsgBusHelp_h
  15. #define AlibcMsgBusHelp_h
  16. /**
  17. Filter和top,是串行通知,通知结束后并发通知普通notify
  18. **/
  19. /**
  20. //所有notify/topNotify的action都是sel:(id)data
  21. //所有notify/topNotify2的action都是sel:(id)data1 data2:(id)data2
  22. //所有notify/topNotify3的action都是sel:(id)data1 data2:(id)data2 data3:(id)data3
  23. //所有Filter的action都是sel:(id)data stop:(BOOL*)bStop
  24. //所有Filter2的action都是sel:(id)data1 data2:(id)data2 stop:(BOOL*)bStop
  25. //所有Filter3的action都是sel:(id)data1 data2:(id)data2 data3:(id)data3 stop:(BOOL*)bStop
  26. */
  27. #define MSGBUS_RECEIVER(eventId, function, dataclass) [self registerEventNotify:eventId action:@selector(function) dataClass:[dataclass class]];
  28. #define MSGBUS_RECEIVER2(eventId, function, dataclass1, dataclass2) [self registerEventNotify:eventId action:@selector(function) dataClass1:[dataclass1 class] dataClass2:[dataclass2 class]];
  29. #define MSGBUS_RECEIVER3(eventId, function, dataclass1, dataclass2, dataclass3) [self registerEventNotify:eventId action:@selector(function) dataClass1:[dataclass1 class] dataClass2:[dataclass2 class] dataClass3:[dataclass3 class]];
  30. #define MSGBUS_TOP_RECEIVER(eventId, function, dataclass) [self registerEventTopNotify:eventId action:@selector(function) dataClass:[dataclass class]];
  31. #define MSGBUS_TOP_RECEIVER2(eventId, function, dataclass1, dataclass2) [self registerEventTopNotify:eventId action:@selector(function) dataClass1:[dataclass1 class] dataClass2:[dataclass2 class]];
  32. #define MSGBUS__TOP_RECEIVER3(eventId, function, dataclass1, dataclass2, dataclass3) [self registerEventTopNotify:eventId action:@selector(function) dataClass1:[dataclass1 class] dataClass2:[dataclass2 class] dataClass3:[dataclass3 class]];
  33. #define MSGBUS_RECEIVER_FILTER(eventId, function, dataclass) [self registerEventFilter:eventId action:@selector(function) dataClass:[dataclass class]];
  34. #define MSGBUS_RECEIVER_FILTER2(eventId, function, dataclass1, dataclass2) [self registerEventFilter:eventId action:@selector(function) dataClass1:[dataclass1 class] dataClass2:[dataclass2 class]];
  35. #define MSGBUS_RECEIVER_FILTER3(eventId, function, dataclass1, dataclass2, dataclass3) [self registerEventFilter:eventId action:@selector(function) dataClass1:[dataclass1 class] dataClass2:[dataclass2 class] dataClass3:[dataclass3 class]];
  36. @protocol AMPMsgBusHelpProtocol <NSObject>
  37. - (void)registerEventFilter:(nonnull NSString *)eventID action:(nonnull SEL)action dataClass:(nonnull Class)dataClass;
  38. - (void)registerEventFilter:(nonnull NSString *)eventID action:(nonnull SEL)action dataClass1:(nonnull Class)dataClass1 dataClass2:(nonnull Class)dataClass2;
  39. - (void)registerEventFilter:(nonnull NSString *)eventID action:(nonnull SEL)action dataClass1:(nonnull Class)dataClass1 dataClass2:(nonnull Class)dataClass2 dataClass3:(nonnull Class)dataClass3;
  40. - (void)registerEventTopNotify:(nonnull NSString *)eventID action:(nonnull SEL)action dataClass:(nonnull Class)dataClass;
  41. - (void)registerEventTopNotify:(nonnull NSString *)eventID action:(nonnull SEL)action dataClass1:(nonnull Class)dataClass1 dataClass2:(nonnull Class)dataClass2;
  42. - (void)registerEventTopNotify:(nonnull NSString *)eventID action:(nonnull SEL)action dataClass1:(nonnull Class)dataClass1 dataClass2:(nonnull Class)dataClass2 dataClass3:(nonnull Class)dataClass3;
  43. - (void)registerEventNotify:(nonnull NSString *)eventID action:(nonnull SEL)action dataClass:(nonnull Class)dataClass;
  44. - (void)registerEventNotify:(nonnull NSString *)eventID action:(nonnull SEL)action dataClass1:(nonnull Class)dataClass1 dataClass2:(nonnull Class)dataClass2;
  45. - (void)registerEventNotify:(nonnull NSString *)eventID action:(nonnull SEL)action dataClass1:(nonnull Class)dataClass1 dataClass2:(nonnull Class)dataClass2 dataClass3:(nonnull Class)dataClass3;
  46. @end
  47. //MSGBUG_FILTER,都是注册在专用线程上.
  48. //MSGBUS_RECEIVER,继承自AMPMsgBusHelp的,都是注册在专用线程上(非并发执行),
  49. @interface AlibcMsgBusHelp : NSObject <AMPMsgBusHelpProtocol>
  50. @end
  51. //继承自AMPMsgBusUIHelp的,都是注册在ui主线程上..
  52. @interface AlibcMsgBusUIHelp : UIViewController <AMPMsgBusHelpProtocol>
  53. @end
  54. #endif