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