Lalit Maganti | 3f5705c | 2018-03-09 12:09:44 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2017 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | /******************************************************************************* |
| 18 | * AUTOGENERATED - DO NOT EDIT |
| 19 | ******************************************************************************* |
| 20 | * This file has been generated from the protobuf message |
| 21 | * perfetto/config/test_config.proto |
| 22 | * by |
| 23 | * ../../tools/proto_to_cpp/proto_to_cpp.cc. |
| 24 | * If you need to make changes here, change the .proto file and then run |
Hector Dearman | 7e07977 | 2018-11-15 16:08:12 +0000 | [diff] [blame^] | 25 | * ./tools/gen_tracing_cpp_headers_from_protos |
Lalit Maganti | 3f5705c | 2018-03-09 12:09:44 +0000 | [diff] [blame] | 26 | */ |
| 27 | |
| 28 | #include "perfetto/tracing/core/test_config.h" |
| 29 | |
| 30 | #include "perfetto/config/test_config.pb.h" |
| 31 | |
| 32 | namespace perfetto { |
| 33 | |
| 34 | TestConfig::TestConfig() = default; |
| 35 | TestConfig::~TestConfig() = default; |
| 36 | TestConfig::TestConfig(const TestConfig&) = default; |
| 37 | TestConfig& TestConfig::operator=(const TestConfig&) = default; |
| 38 | TestConfig::TestConfig(TestConfig&&) noexcept = default; |
| 39 | TestConfig& TestConfig::operator=(TestConfig&&) = default; |
| 40 | |
| 41 | void TestConfig::FromProto(const perfetto::protos::TestConfig& proto) { |
| 42 | static_assert(sizeof(message_count_) == sizeof(proto.message_count()), |
| 43 | "size mismatch"); |
| 44 | message_count_ = static_cast<decltype(message_count_)>(proto.message_count()); |
| 45 | |
Lalit Maganti | 131b6e5 | 2018-03-29 18:29:31 +0100 | [diff] [blame] | 46 | static_assert(sizeof(max_messages_per_second_) == |
| 47 | sizeof(proto.max_messages_per_second()), |
| 48 | "size mismatch"); |
| 49 | max_messages_per_second_ = static_cast<decltype(max_messages_per_second_)>( |
| 50 | proto.max_messages_per_second()); |
| 51 | |
Lalit Maganti | 3f5705c | 2018-03-09 12:09:44 +0000 | [diff] [blame] | 52 | static_assert(sizeof(seed_) == sizeof(proto.seed()), "size mismatch"); |
| 53 | seed_ = static_cast<decltype(seed_)>(proto.seed()); |
Lalit Maganti | 8390e5b | 2018-03-23 10:46:05 +0000 | [diff] [blame] | 54 | |
| 55 | static_assert(sizeof(message_size_) == sizeof(proto.message_size()), |
| 56 | "size mismatch"); |
| 57 | message_size_ = static_cast<decltype(message_size_)>(proto.message_size()); |
Lalit Maganti | 36557d8 | 2018-04-11 14:36:17 +0100 | [diff] [blame] | 58 | |
| 59 | static_assert( |
| 60 | sizeof(send_batch_on_register_) == sizeof(proto.send_batch_on_register()), |
| 61 | "size mismatch"); |
| 62 | send_batch_on_register_ = static_cast<decltype(send_batch_on_register_)>( |
| 63 | proto.send_batch_on_register()); |
Florian Mayer | 790d085 | 2018-11-13 16:33:26 +0000 | [diff] [blame] | 64 | |
| 65 | dummy_fields_.FromProto(proto.dummy_fields()); |
Lalit Maganti | 3f5705c | 2018-03-09 12:09:44 +0000 | [diff] [blame] | 66 | unknown_fields_ = proto.unknown_fields(); |
| 67 | } |
| 68 | |
| 69 | void TestConfig::ToProto(perfetto::protos::TestConfig* proto) const { |
| 70 | proto->Clear(); |
| 71 | |
| 72 | static_assert(sizeof(message_count_) == sizeof(proto->message_count()), |
| 73 | "size mismatch"); |
| 74 | proto->set_message_count( |
| 75 | static_cast<decltype(proto->message_count())>(message_count_)); |
| 76 | |
Lalit Maganti | 131b6e5 | 2018-03-29 18:29:31 +0100 | [diff] [blame] | 77 | static_assert(sizeof(max_messages_per_second_) == |
| 78 | sizeof(proto->max_messages_per_second()), |
| 79 | "size mismatch"); |
| 80 | proto->set_max_messages_per_second( |
| 81 | static_cast<decltype(proto->max_messages_per_second())>( |
| 82 | max_messages_per_second_)); |
| 83 | |
Lalit Maganti | 3f5705c | 2018-03-09 12:09:44 +0000 | [diff] [blame] | 84 | static_assert(sizeof(seed_) == sizeof(proto->seed()), "size mismatch"); |
| 85 | proto->set_seed(static_cast<decltype(proto->seed())>(seed_)); |
Lalit Maganti | 8390e5b | 2018-03-23 10:46:05 +0000 | [diff] [blame] | 86 | |
| 87 | static_assert(sizeof(message_size_) == sizeof(proto->message_size()), |
| 88 | "size mismatch"); |
| 89 | proto->set_message_size( |
| 90 | static_cast<decltype(proto->message_size())>(message_size_)); |
Lalit Maganti | 36557d8 | 2018-04-11 14:36:17 +0100 | [diff] [blame] | 91 | |
| 92 | static_assert(sizeof(send_batch_on_register_) == |
| 93 | sizeof(proto->send_batch_on_register()), |
| 94 | "size mismatch"); |
| 95 | proto->set_send_batch_on_register( |
| 96 | static_cast<decltype(proto->send_batch_on_register())>( |
| 97 | send_batch_on_register_)); |
Florian Mayer | 790d085 | 2018-11-13 16:33:26 +0000 | [diff] [blame] | 98 | |
| 99 | dummy_fields_.ToProto(proto->mutable_dummy_fields()); |
| 100 | *(proto->mutable_unknown_fields()) = unknown_fields_; |
| 101 | } |
| 102 | |
| 103 | TestConfig::DummyFields::DummyFields() = default; |
| 104 | TestConfig::DummyFields::~DummyFields() = default; |
| 105 | TestConfig::DummyFields::DummyFields(const TestConfig::DummyFields&) = default; |
| 106 | TestConfig::DummyFields& TestConfig::DummyFields::operator=( |
| 107 | const TestConfig::DummyFields&) = default; |
| 108 | TestConfig::DummyFields::DummyFields(TestConfig::DummyFields&&) noexcept = |
| 109 | default; |
| 110 | TestConfig::DummyFields& TestConfig::DummyFields::operator=( |
| 111 | TestConfig::DummyFields&&) = default; |
| 112 | |
| 113 | void TestConfig::DummyFields::FromProto( |
| 114 | const perfetto::protos::TestConfig_DummyFields& proto) { |
| 115 | static_assert(sizeof(field_uint32_) == sizeof(proto.field_uint32()), |
| 116 | "size mismatch"); |
| 117 | field_uint32_ = static_cast<decltype(field_uint32_)>(proto.field_uint32()); |
| 118 | |
| 119 | static_assert(sizeof(field_int32_) == sizeof(proto.field_int32()), |
| 120 | "size mismatch"); |
| 121 | field_int32_ = static_cast<decltype(field_int32_)>(proto.field_int32()); |
| 122 | |
| 123 | static_assert(sizeof(field_uint64_) == sizeof(proto.field_uint64()), |
| 124 | "size mismatch"); |
| 125 | field_uint64_ = static_cast<decltype(field_uint64_)>(proto.field_uint64()); |
| 126 | |
| 127 | static_assert(sizeof(field_int64_) == sizeof(proto.field_int64()), |
| 128 | "size mismatch"); |
| 129 | field_int64_ = static_cast<decltype(field_int64_)>(proto.field_int64()); |
| 130 | |
| 131 | static_assert(sizeof(field_fixed64_) == sizeof(proto.field_fixed64()), |
| 132 | "size mismatch"); |
| 133 | field_fixed64_ = static_cast<decltype(field_fixed64_)>(proto.field_fixed64()); |
| 134 | |
| 135 | static_assert(sizeof(field_sfixed64_) == sizeof(proto.field_sfixed64()), |
| 136 | "size mismatch"); |
| 137 | field_sfixed64_ = |
| 138 | static_cast<decltype(field_sfixed64_)>(proto.field_sfixed64()); |
| 139 | |
| 140 | static_assert(sizeof(field_fixed32_) == sizeof(proto.field_fixed32()), |
| 141 | "size mismatch"); |
| 142 | field_fixed32_ = static_cast<decltype(field_fixed32_)>(proto.field_fixed32()); |
| 143 | |
| 144 | static_assert(sizeof(field_sfixed32_) == sizeof(proto.field_sfixed32()), |
| 145 | "size mismatch"); |
| 146 | field_sfixed32_ = |
| 147 | static_cast<decltype(field_sfixed32_)>(proto.field_sfixed32()); |
| 148 | |
| 149 | static_assert(sizeof(field_double_) == sizeof(proto.field_double()), |
| 150 | "size mismatch"); |
| 151 | field_double_ = static_cast<decltype(field_double_)>(proto.field_double()); |
| 152 | |
| 153 | static_assert(sizeof(field_float_) == sizeof(proto.field_float()), |
| 154 | "size mismatch"); |
| 155 | field_float_ = static_cast<decltype(field_float_)>(proto.field_float()); |
| 156 | |
| 157 | static_assert(sizeof(field_sint64_) == sizeof(proto.field_sint64()), |
| 158 | "size mismatch"); |
| 159 | field_sint64_ = static_cast<decltype(field_sint64_)>(proto.field_sint64()); |
| 160 | |
| 161 | static_assert(sizeof(field_sint32_) == sizeof(proto.field_sint32()), |
| 162 | "size mismatch"); |
| 163 | field_sint32_ = static_cast<decltype(field_sint32_)>(proto.field_sint32()); |
| 164 | |
| 165 | static_assert(sizeof(field_string_) == sizeof(proto.field_string()), |
| 166 | "size mismatch"); |
| 167 | field_string_ = static_cast<decltype(field_string_)>(proto.field_string()); |
| 168 | |
| 169 | static_assert(sizeof(field_bytes_) == sizeof(proto.field_bytes()), |
| 170 | "size mismatch"); |
| 171 | field_bytes_ = static_cast<decltype(field_bytes_)>(proto.field_bytes()); |
| 172 | unknown_fields_ = proto.unknown_fields(); |
| 173 | } |
| 174 | |
| 175 | void TestConfig::DummyFields::ToProto( |
| 176 | perfetto::protos::TestConfig_DummyFields* proto) const { |
| 177 | proto->Clear(); |
| 178 | |
| 179 | static_assert(sizeof(field_uint32_) == sizeof(proto->field_uint32()), |
| 180 | "size mismatch"); |
| 181 | proto->set_field_uint32( |
| 182 | static_cast<decltype(proto->field_uint32())>(field_uint32_)); |
| 183 | |
| 184 | static_assert(sizeof(field_int32_) == sizeof(proto->field_int32()), |
| 185 | "size mismatch"); |
| 186 | proto->set_field_int32( |
| 187 | static_cast<decltype(proto->field_int32())>(field_int32_)); |
| 188 | |
| 189 | static_assert(sizeof(field_uint64_) == sizeof(proto->field_uint64()), |
| 190 | "size mismatch"); |
| 191 | proto->set_field_uint64( |
| 192 | static_cast<decltype(proto->field_uint64())>(field_uint64_)); |
| 193 | |
| 194 | static_assert(sizeof(field_int64_) == sizeof(proto->field_int64()), |
| 195 | "size mismatch"); |
| 196 | proto->set_field_int64( |
| 197 | static_cast<decltype(proto->field_int64())>(field_int64_)); |
| 198 | |
| 199 | static_assert(sizeof(field_fixed64_) == sizeof(proto->field_fixed64()), |
| 200 | "size mismatch"); |
| 201 | proto->set_field_fixed64( |
| 202 | static_cast<decltype(proto->field_fixed64())>(field_fixed64_)); |
| 203 | |
| 204 | static_assert(sizeof(field_sfixed64_) == sizeof(proto->field_sfixed64()), |
| 205 | "size mismatch"); |
| 206 | proto->set_field_sfixed64( |
| 207 | static_cast<decltype(proto->field_sfixed64())>(field_sfixed64_)); |
| 208 | |
| 209 | static_assert(sizeof(field_fixed32_) == sizeof(proto->field_fixed32()), |
| 210 | "size mismatch"); |
| 211 | proto->set_field_fixed32( |
| 212 | static_cast<decltype(proto->field_fixed32())>(field_fixed32_)); |
| 213 | |
| 214 | static_assert(sizeof(field_sfixed32_) == sizeof(proto->field_sfixed32()), |
| 215 | "size mismatch"); |
| 216 | proto->set_field_sfixed32( |
| 217 | static_cast<decltype(proto->field_sfixed32())>(field_sfixed32_)); |
| 218 | |
| 219 | static_assert(sizeof(field_double_) == sizeof(proto->field_double()), |
| 220 | "size mismatch"); |
| 221 | proto->set_field_double( |
| 222 | static_cast<decltype(proto->field_double())>(field_double_)); |
| 223 | |
| 224 | static_assert(sizeof(field_float_) == sizeof(proto->field_float()), |
| 225 | "size mismatch"); |
| 226 | proto->set_field_float( |
| 227 | static_cast<decltype(proto->field_float())>(field_float_)); |
| 228 | |
| 229 | static_assert(sizeof(field_sint64_) == sizeof(proto->field_sint64()), |
| 230 | "size mismatch"); |
| 231 | proto->set_field_sint64( |
| 232 | static_cast<decltype(proto->field_sint64())>(field_sint64_)); |
| 233 | |
| 234 | static_assert(sizeof(field_sint32_) == sizeof(proto->field_sint32()), |
| 235 | "size mismatch"); |
| 236 | proto->set_field_sint32( |
| 237 | static_cast<decltype(proto->field_sint32())>(field_sint32_)); |
| 238 | |
| 239 | static_assert(sizeof(field_string_) == sizeof(proto->field_string()), |
| 240 | "size mismatch"); |
| 241 | proto->set_field_string( |
| 242 | static_cast<decltype(proto->field_string())>(field_string_)); |
| 243 | |
| 244 | static_assert(sizeof(field_bytes_) == sizeof(proto->field_bytes()), |
| 245 | "size mismatch"); |
| 246 | proto->set_field_bytes( |
| 247 | static_cast<decltype(proto->field_bytes())>(field_bytes_)); |
Lalit Maganti | 3f5705c | 2018-03-09 12:09:44 +0000 | [diff] [blame] | 248 | *(proto->mutable_unknown_fields()) = unknown_fields_; |
| 249 | } |
| 250 | |
| 251 | } // namespace perfetto |