Duration.pbobjc.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: google/protobuf/duration.proto
  3. // This CPP symbol can be defined to use imports that match up to the framework
  4. // imports needed when using CocoaPods.
  5. #if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
  6. #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
  7. #endif
  8. #if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
  9. #import <Protobuf/GPBProtocolBuffers.h>
  10. #else
  11. #import "GPBProtocolBuffers.h"
  12. #endif
  13. #if GOOGLE_PROTOBUF_OBJC_GEN_VERSION != 30001
  14. #error This file was generated by a different version of protoc which is incompatible with your Protocol Buffer library sources.
  15. #endif
  16. // @@protoc_insertion_point(imports)
  17. #pragma clang diagnostic push
  18. #pragma clang diagnostic ignored "-Wdeprecated-declarations"
  19. CF_EXTERN_C_BEGIN
  20. NS_ASSUME_NONNULL_BEGIN
  21. #pragma mark - GPBDurationRoot
  22. /**
  23. * Exposes the extension registry for this file.
  24. *
  25. * The base class provides:
  26. * @code
  27. * + (GPBExtensionRegistry *)extensionRegistry;
  28. * @endcode
  29. * which is a @c GPBExtensionRegistry that includes all the extensions defined by
  30. * this file and all files that it depends on.
  31. **/
  32. @interface GPBDurationRoot : GPBRootObject
  33. @end
  34. #pragma mark - GPBDuration
  35. typedef GPB_ENUM(GPBDuration_FieldNumber) {
  36. GPBDuration_FieldNumber_Seconds = 1,
  37. GPBDuration_FieldNumber_Nanos = 2,
  38. };
  39. /**
  40. * A Duration represents a signed, fixed-length span of time represented
  41. * as a count of seconds and fractions of seconds at nanosecond
  42. * resolution. It is independent of any calendar and concepts like "day"
  43. * or "month". It is related to Timestamp in that the difference between
  44. * two Timestamp values is a Duration and it can be added or subtracted
  45. * from a Timestamp. Range is approximately +-10,000 years.
  46. *
  47. * Example 1: Compute Duration from two Timestamps in pseudo code.
  48. *
  49. * Timestamp start = ...;
  50. * Timestamp end = ...;
  51. * Duration duration = ...;
  52. *
  53. * duration.seconds = end.seconds - start.seconds;
  54. * duration.nanos = end.nanos - start.nanos;
  55. *
  56. * if (duration.seconds < 0 && duration.nanos > 0) {
  57. * duration.seconds += 1;
  58. * duration.nanos -= 1000000000;
  59. * } else if (durations.seconds > 0 && duration.nanos < 0) {
  60. * duration.seconds -= 1;
  61. * duration.nanos += 1000000000;
  62. * }
  63. *
  64. * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
  65. *
  66. * Timestamp start = ...;
  67. * Duration duration = ...;
  68. * Timestamp end = ...;
  69. *
  70. * end.seconds = start.seconds + duration.seconds;
  71. * end.nanos = start.nanos + duration.nanos;
  72. *
  73. * if (end.nanos < 0) {
  74. * end.seconds -= 1;
  75. * end.nanos += 1000000000;
  76. * } else if (end.nanos >= 1000000000) {
  77. * end.seconds += 1;
  78. * end.nanos -= 1000000000;
  79. * }
  80. **/
  81. @interface GPBDuration : GPBMessage
  82. /**
  83. * Signed seconds of the span of time. Must be from -315,576,000,000
  84. * to +315,576,000,000 inclusive.
  85. **/
  86. @property(nonatomic, readwrite) int64_t seconds;
  87. /**
  88. * Signed fractions of a second at nanosecond resolution of the span
  89. * of time. Durations less than one second are represented with a 0
  90. * `seconds` field and a positive or negative `nanos` field. For durations
  91. * of one second or more, a non-zero value for the `nanos` field must be
  92. * of the same sign as the `seconds` field. Must be from -999,999,999
  93. * to +999,999,999 inclusive.
  94. **/
  95. @property(nonatomic, readwrite) int32_t nanos;
  96. @end
  97. NS_ASSUME_NONNULL_END
  98. CF_EXTERN_C_END
  99. #pragma clang diagnostic pop
  100. // @@protoc_insertion_point(global_scope)