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