blob: c20f8f51802337fd469489b36b55b7043ee9093d [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());
48 unknown_fields_ = proto.unknown_fields();
49}
50
51void TestConfig::ToProto(perfetto::protos::TestConfig* proto) const {
52 proto->Clear();
53
54 static_assert(sizeof(message_count_) == sizeof(proto->message_count()),
55 "size mismatch");
56 proto->set_message_count(
57 static_cast<decltype(proto->message_count())>(message_count_));
58
59 static_assert(sizeof(seed_) == sizeof(proto->seed()), "size mismatch");
60 proto->set_seed(static_cast<decltype(proto->seed())>(seed_));
61 *(proto->mutable_unknown_fields()) = unknown_fields_;
62}
63
64} // namespace perfetto