dataflow  v1b3
cput_ime.h
1 // Copyright 2010 Google Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); you may not
4 // use this file except in compliance with the License. You may obtain a copy of
5 // the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11 // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12 // License for the specific language governing permissions and limitations under
13 // the License.
14 
15 // This code was generated by google-apis-code-generator 1.5.1
16 // Build date: 2018-10-08 17:45:39 UTC
17 // on: 2020-03-19, 02:23:49 UTC
18 // C++ generator version: 0.1.4
19 
20 // ----------------------------------------------------------------------------
21 // NOTE: This file is generated from Google APIs Discovery Service.
22 // Service:
23 // Dataflow API (dataflow/v1b3)
24 // Generated from:
25 // Version: v1b3
26 // Revision: 302
27 // Generated by:
28 // Tool: google-apis-code-generator 1.5.1
29 // C++: 0.1.4
30 #ifndef GOOGLE_DATAFLOW_API_CPUT_IME_H_
31 #define GOOGLE_DATAFLOW_API_CPUT_IME_H_
32 
33 #include <string>
34 #include "googleapis/base/integral_types.h"
35 #include "googleapis/base/macros.h"
36 #include "googleapis/client/data/jsoncpp_data.h"
37 #include "googleapis/strings/stringpiece.h"
38 
39 namespace Json {
40 class Value;
41 } // namespace Json
42 
43 namespace google_dataflow_api {
44 using namespace googleapis;
45 
51 class CPUTime : public client::JsonCppData {
52  public:
58  static CPUTime* New();
59 
65  explicit CPUTime(const Json::Value& storage);
66 
72  explicit CPUTime(Json::Value* storage);
73 
77  virtual ~CPUTime();
78 
84  const StringPiece GetTypeName() const {
85  return StringPiece("google_dataflow_api::CPUTime");
86  }
87 
93  bool has_rate() const {
94  return Storage().isMember("rate");
95  }
96 
100  void clear_rate() {
101  MutableStorage()->removeMember("rate");
102  }
103 
104 
108  double get_rate() const {
109  const Json::Value& storage = Storage("rate");
110  return client::JsonValueToCppValueHelper<double >(storage);
111  }
112 
121  void set_rate(double value) {
122  client::SetJsonValueFromCppValueHelper<double >(
123  value, MutableStorage("rate"));
124  }
125 
131  bool has_timestamp() const {
132  return Storage().isMember("timestamp");
133  }
134 
139  MutableStorage()->removeMember("timestamp");
140  }
141 
142 
146  const StringPiece get_timestamp() const {
147  const Json::Value& v = Storage("timestamp");
148  if (v == Json::Value::null) return StringPiece("");
149  return StringPiece(v.asCString());
150  }
151 
159  void set_timestamp(const StringPiece& value) {
160  *MutableStorage("timestamp") = value.data();
161  }
162 
168  bool has_total_ms() const {
169  return Storage().isMember("totalMs");
170  }
171 
175  void clear_total_ms() {
176  MutableStorage()->removeMember("totalMs");
177  }
178 
179 
183  uint64 get_total_ms() const {
184  const Json::Value& storage = Storage("totalMs");
185  return client::JsonValueToCppValueHelper<uint64 >(storage);
186  }
187 
196  void set_total_ms(uint64 value) {
197  client::SetJsonValueFromCppValueHelper<uint64 >(
198  value, MutableStorage("totalMs"));
199  }
200 
201  private:
202  void operator=(const CPUTime&);
203 }; // CPUTime
204 } // namespace google_dataflow_api
205 #endif // GOOGLE_DATAFLOW_API_CPUT_IME_H_
void clear_timestamp()
Definition: cput_ime.h:138
void clear_total_ms()
Definition: cput_ime.h:175
Definition: cput_ime.h:51
void clear_rate()
Definition: cput_ime.h:100
bool has_total_ms() const
Definition: cput_ime.h:168
Definition: approximate_progress.h:40
double get_rate() const
Definition: cput_ime.h:108
uint64 get_total_ms() const
Definition: cput_ime.h:183
void set_total_ms(uint64 value)
Definition: cput_ime.h:196
void set_timestamp(const StringPiece &value)
Definition: cput_ime.h:159
const StringPiece GetTypeName() const
Definition: cput_ime.h:84
bool has_rate() const
Definition: cput_ime.h:93
Definition: approximate_progress.cc:42
void set_rate(double value)
Definition: cput_ime.h:121
bool has_timestamp() const
Definition: cput_ime.h:131
const StringPiece get_timestamp() const
Definition: cput_ime.h:146