blob: 6aa26ab23b521d7e6dca2d3c5d0a4e08135622ba [file] [log] [blame]
Lalit Maganti3f5705c2018-03-09 12:09:44 +00001/*
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
25 * ./tools/gen_tracing_cpp_headers_from_protos.py
26 */
27
28#include "perfetto/tracing/core/test_config.h"
29
30#include "perfetto/config/test_config.pb.h"
31
32namespace perfetto {
33
34TestConfig::TestConfig() = default;
35TestConfig::~TestConfig() = default;
36TestConfig::TestConfig(const TestConfig&) = default;
37TestConfig& TestConfig::operator=(const TestConfig&) = default;
38TestConfig::TestConfig(TestConfig&&) noexcept = default;
39TestConfig& TestConfig::operator=(TestConfig&&) = default;
40
41void 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 Maganti131b6e52018-03-29 18:29:31 +010046 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 Maganti3f5705c2018-03-09 12:09:44 +000052 static_assert(sizeof(seed_) == sizeof(proto.seed()), "size mismatch");
53 seed_ = static_cast<decltype(seed_)>(proto.seed());
Lalit Maganti8390e5b2018-03-23 10:46:05 +000054
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 Maganti36557d82018-04-11 14:36:17 +010058
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());
Lalit Maganti3f5705c2018-03-09 12:09:44 +000064 unknown_fields_ = proto.unknown_fields();
65}
66
67void TestConfig::ToProto(perfetto::protos::TestConfig* proto) const {
68 proto->Clear();
69
70 static_assert(sizeof(message_count_) == sizeof(proto->message_count()),
71 "size mismatch");
72 proto->set_message_count(
73 static_cast<decltype(proto->message_count())>(message_count_));
74
Lalit Maganti131b6e52018-03-29 18:29:31 +010075 static_assert(sizeof(max_messages_per_second_) ==
76 sizeof(proto->max_messages_per_second()),
77 "size mismatch");
78 proto->set_max_messages_per_second(
79 static_cast<decltype(proto->max_messages_per_second())>(
80 max_messages_per_second_));
81
Lalit Maganti3f5705c2018-03-09 12:09:44 +000082 static_assert(sizeof(seed_) == sizeof(proto->seed()), "size mismatch");
83 proto->set_seed(static_cast<decltype(proto->seed())>(seed_));
Lalit Maganti8390e5b2018-03-23 10:46:05 +000084
85 static_assert(sizeof(message_size_) == sizeof(proto->message_size()),
86 "size mismatch");
87 proto->set_message_size(
88 static_cast<decltype(proto->message_size())>(message_size_));
Lalit Maganti36557d82018-04-11 14:36:17 +010089
90 static_assert(sizeof(send_batch_on_register_) ==
91 sizeof(proto->send_batch_on_register()),
92 "size mismatch");
93 proto->set_send_batch_on_register(
94 static_cast<decltype(proto->send_batch_on_register())>(
95 send_batch_on_register_));
Lalit Maganti3f5705c2018-03-09 12:09:44 +000096 *(proto->mutable_unknown_fields()) = unknown_fields_;
97}
98
99} // namespace perfetto