blob: e352ec35109adbb5297a290f49024df0d4e8ae66 [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
46 static_assert(sizeof(seed_) == sizeof(proto.seed()), "size mismatch");
47 seed_ = static_cast<decltype(seed_)>(proto.seed());
Lalit Maganti8390e5b2018-03-23 10:46:05 +000048
49 static_assert(sizeof(message_size_) == sizeof(proto.message_size()),
50 "size mismatch");
51 message_size_ = static_cast<decltype(message_size_)>(proto.message_size());
Lalit Maganti3f5705c2018-03-09 12:09:44 +000052 unknown_fields_ = proto.unknown_fields();
53}
54
55void TestConfig::ToProto(perfetto::protos::TestConfig* proto) const {
56 proto->Clear();
57
58 static_assert(sizeof(message_count_) == sizeof(proto->message_count()),
59 "size mismatch");
60 proto->set_message_count(
61 static_cast<decltype(proto->message_count())>(message_count_));
62
63 static_assert(sizeof(seed_) == sizeof(proto->seed()), "size mismatch");
64 proto->set_seed(static_cast<decltype(proto->seed())>(seed_));
Lalit Maganti8390e5b2018-03-23 10:46:05 +000065
66 static_assert(sizeof(message_size_) == sizeof(proto->message_size()),
67 "size mismatch");
68 proto->set_message_size(
69 static_cast<decltype(proto->message_size())>(message_size_));
Lalit Maganti3f5705c2018-03-09 12:09:44 +000070 *(proto->mutable_unknown_fields()) = unknown_fields_;
71}
72
73} // namespace perfetto