APDPBGeneratedMessage.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. //
  2. // APDPBGeneratedMessage.h
  3. // DynamicPB
  4. //
  5. // Created by cuinacai on 15/12/19.
  6. // Copyright © 2015年 cuinacai. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import "APPBGeneratedMessage.h"
  10. typedef enum {
  11. PBFieldOptional = 0,
  12. PBFieldRequired = 1 ,
  13. PBFieldRepeated = 2
  14. } PBFieldLabel;
  15. typedef enum {
  16. //Type=2
  17. PBFieldTypeString = 0,
  18. PBFieldTypeBytes,
  19. PBFieldTypeMessage,
  20. //Type=0
  21. PBFieldTypeBOOL,
  22. PBFieldTypeEnum,
  23. PBFieldTypeInt32,
  24. PBFieldTypeInt64,
  25. PBFieldTypeUInt32,
  26. PBFieldTypeUInt64,
  27. //Type=5
  28. PBFieldTypeFloat32,
  29. PBFieldTypeFixed32,
  30. PBFieldTypeSFixed32,
  31. //Type=1
  32. PBFieldTypeFloat64,
  33. PBFieldTypeFixed64,
  34. PBFieldTypeSFixed64,
  35. } PBFieldType;
  36. typedef struct {
  37. Byte fieldNumber;
  38. Byte fieldLabel;//PBFieldLabel
  39. Byte fieldType;//PBFieldType
  40. BOOL packed;//
  41. __unsafe_unretained NSString *fieldName;
  42. __unsafe_unretained NSString *fieldClassName;
  43. union {
  44. SInt32 _enump;
  45. SInt32 _int32p;
  46. SInt64 _int64p;
  47. UInt32 _uint32p;
  48. UInt64 _uint64p;
  49. BOOL _boolp;
  50. Float32 _float32p;
  51. Float64 _float64p;
  52. }baseTypeInitValue;
  53. __unsafe_unretained NSString *stringInitValue;
  54. } PBMsgFieldInfo;
  55. typedef struct {
  56. PBMsgFieldInfo *fieldInfo;
  57. int count;
  58. } PBMsgFieldInfos;
  59. @interface APDPBGeneratedMessage : APPBGeneratedMessage<GeneratedMessageProtocol>
  60. /**
  61. 业务切不可调用修改
  62. @return pb描述文件
  63. */
  64. +(PBMsgFieldInfos*)_fieldInfos;
  65. @end