blob: 29888d6cf1803d003e0acaf803ae5d0716a1c331 [file] [log] [blame]
Thomas Van Lenten30650d82015-05-01 08:57:16 -04001// Generated by the protocol buffer compiler. DO NOT EDIT!
2// source: google/protobuf/duration.proto
3
4#import "GPBProtocolBuffers.h"
5
Thomas Van Lenten79a23c42016-03-17 10:04:21 -04006#if GOOGLE_PROTOBUF_OBJC_GEN_VERSION != 30001
Thomas Van Lenten536059e2015-12-02 14:43:05 -05007#error This file was generated by a different version of protoc which is incompatible with your Protocol Buffer library sources.
Thomas Van Lenten30650d82015-05-01 08:57:16 -04008#endif
9
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -040010// @@protoc_insertion_point(imports)
Thomas Van Lenten30650d82015-05-01 08:57:16 -040011
Thomas Van Lentene664aa62016-04-19 13:13:04 -040012#pragma clang diagnostic push
13#pragma clang diagnostic ignored "-Wdeprecated-declarations"
14
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -040015CF_EXTERN_C_BEGIN
Thomas Van Lenten30650d82015-05-01 08:57:16 -040016
Thomas Van Lenten8c889572015-06-16 16:45:14 -040017NS_ASSUME_NONNULL_BEGIN
Thomas Van Lenten30650d82015-05-01 08:57:16 -040018
19#pragma mark - GPBDurationRoot
20
Thomas Van Lenten36650a02016-03-07 12:07:03 -050021/// 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 Lenten30650d82015-05-01 08:57:16 -040029@interface GPBDurationRoot : GPBRootObject
30@end
31
32#pragma mark - GPBDuration
33
34typedef GPB_ENUM(GPBDuration_FieldNumber) {
35 GPBDuration_FieldNumber_Seconds = 1,
36 GPBDuration_FieldNumber_Nanos = 2,
37};
38
Thomas Van Lenten36650a02016-03-07 12:07:03 -050039/// 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 Lenten30650d82015-05-01 08:57:16 -040079@interface GPBDuration : GPBMessage
80
Thomas Van Lenten36650a02016-03-07 12:07:03 -050081/// Signed seconds of the span of time. Must be from -315,576,000,000
82/// to +315,576,000,000 inclusive.
Thomas Van Lenten30650d82015-05-01 08:57:16 -040083@property(nonatomic, readwrite) int64_t seconds;
84
Thomas Van Lenten36650a02016-03-07 12:07:03 -050085/// 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 Lenten30650d82015-05-01 08:57:16 -040091@property(nonatomic, readwrite) int32_t nanos;
92
93@end
94
Thomas Van Lenten8c889572015-06-16 16:45:14 -040095NS_ASSUME_NONNULL_END
96
Thomas Van Lenten30650d82015-05-01 08:57:16 -040097CF_EXTERN_C_END
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -040098
Thomas Van Lentene664aa62016-04-19 13:13:04 -040099#pragma clang diagnostic pop
100
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400101// @@protoc_insertion_point(global_scope)