blob: d58cbcee3859bb6835536fe986a60a19400d8ef8 [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 Maganti3f5705c2018-03-09 12:09:44 +000058 unknown_fields_ = proto.unknown_fields();
59}
60
61void TestConfig::ToProto(perfetto::protos::TestConfig* proto) const {
62 proto->Clear();
63
64 static_assert(sizeof(message_count_) == sizeof(proto->message_count()),
65 "size mismatch");
66 proto->set_message_count(
67 static_cast<decltype(proto->message_count())>(message_count_));
68
Lalit Maganti131b6e52018-03-29 18:29:31 +010069 static_assert(sizeof(max_messages_per_second_) ==
70 sizeof(proto->max_messages_per_second()),
71 "size mismatch");
72 proto->set_max_messages_per_second(
73 static_cast<decltype(proto->max_messages_per_second())>(
74 max_messages_per_second_));
75
Lalit Maganti3f5705c2018-03-09 12:09:44 +000076 static_assert(sizeof(seed_) == sizeof(proto->seed()), "size mismatch");
77 proto->set_seed(static_cast<decltype(proto->seed())>(seed_));
Lalit Maganti8390e5b2018-03-23 10:46:05 +000078
79 static_assert(sizeof(message_size_) == sizeof(proto->message_size()),
80 "size mismatch");
81 proto->set_message_size(
82 static_cast<decltype(proto->message_size())>(message_size_));
Lalit Maganti3f5705c2018-03-09 12:09:44 +000083 *(proto->mutable_unknown_fields()) = unknown_fields_;
84}
85
86} // namespace perfetto