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 25 * ./tools/gen_tracing_cpp_headers_from_protos 26 */ 27 28 #ifndef INCLUDE_PERFETTO_TRACING_CORE_TEST_CONFIG_H_ 29 #define INCLUDE_PERFETTO_TRACING_CORE_TEST_CONFIG_H_ 30 31 #include <stdint.h> 32 #include <string> 33 #include <type_traits> 34 #include <vector> 35 36 #include "perfetto/base/export.h" 37 38 // Forward declarations for protobuf types. 39 namespace perfetto { 40 namespace protos { 41 class TestConfig; 42 class TestConfig_DummyFields; 43 } // namespace protos 44 } // namespace perfetto 45 46 namespace perfetto { 47 48 class PERFETTO_EXPORT TestConfig { 49 public: 50 class PERFETTO_EXPORT DummyFields { 51 public: 52 DummyFields(); 53 ~DummyFields(); 54 DummyFields(DummyFields&&) noexcept; 55 DummyFields& operator=(DummyFields&&); 56 DummyFields(const DummyFields&); 57 DummyFields& operator=(const DummyFields&); 58 bool operator==(const DummyFields&) const; 59 bool operator!=(const DummyFields& other) const { 60 return !(*this == other); 61 } 62 63 // Conversion methods from/to the corresponding protobuf types. 64 void FromProto(const perfetto::protos::TestConfig_DummyFields&); 65 void ToProto(perfetto::protos::TestConfig_DummyFields*) const; 66 67 uint32_t field_uint32() const { return field_uint32_; } 68 void set_field_uint32(uint32_t value) { field_uint32_ = value; } 69 70 int32_t field_int32() const { return field_int32_; } 71 void set_field_int32(int32_t value) { field_int32_ = value; } 72 73 uint64_t field_uint64() const { return field_uint64_; } 74 void set_field_uint64(uint64_t value) { field_uint64_ = value; } 75 76 int64_t field_int64() const { return field_int64_; } 77 void set_field_int64(int64_t value) { field_int64_ = value; } 78 79 uint64_t field_fixed64() const { return field_fixed64_; } 80 void set_field_fixed64(uint64_t value) { field_fixed64_ = value; } 81 82 int64_t field_sfixed64() const { return field_sfixed64_; } 83 void set_field_sfixed64(int64_t value) { field_sfixed64_ = value; } 84 85 uint32_t field_fixed32() const { return field_fixed32_; } 86 void set_field_fixed32(uint32_t value) { field_fixed32_ = value; } 87 88 int32_t field_sfixed32() const { return field_sfixed32_; } 89 void set_field_sfixed32(int32_t value) { field_sfixed32_ = value; } 90 91 double field_double() const { return field_double_; } 92 void set_field_double(double value) { field_double_ = value; } 93 94 float field_float() const { return field_float_; } 95 void set_field_float(float value) { field_float_ = value; } 96 97 int64_t field_sint64() const { return field_sint64_; } 98 void set_field_sint64(int64_t value) { field_sint64_ = value; } 99 100 int32_t field_sint32() const { return field_sint32_; } 101 void set_field_sint32(int32_t value) { field_sint32_ = value; } 102 103 const std::string& field_string() const { return field_string_; } 104 void set_field_string(const std::string& value) { field_string_ = value; } 105 106 const std::string& field_bytes() const { return field_bytes_; } 107 void set_field_bytes(const std::string& value) { field_bytes_ = value; } 108 void set_field_bytes(const void* p, size_t s) { 109 field_bytes_.assign(reinterpret_cast<const char*>(p), s); 110 } 111 112 private: 113 uint32_t field_uint32_ = {}; 114 int32_t field_int32_ = {}; 115 uint64_t field_uint64_ = {}; 116 int64_t field_int64_ = {}; 117 uint64_t field_fixed64_ = {}; 118 int64_t field_sfixed64_ = {}; 119 uint32_t field_fixed32_ = {}; 120 int32_t field_sfixed32_ = {}; 121 double field_double_ = {}; 122 float field_float_ = {}; 123 int64_t field_sint64_ = {}; 124 int32_t field_sint32_ = {}; 125 std::string field_string_ = {}; 126 std::string field_bytes_ = {}; 127 128 // Allows to preserve unknown protobuf fields for compatibility 129 // with future versions of .proto files. 130 std::string unknown_fields_; 131 }; 132 133 TestConfig(); 134 ~TestConfig(); 135 TestConfig(TestConfig&&) noexcept; 136 TestConfig& operator=(TestConfig&&); 137 TestConfig(const TestConfig&); 138 TestConfig& operator=(const TestConfig&); 139 bool operator==(const TestConfig&) const; 140 bool operator!=(const TestConfig& other) const { return !(*this == other); } 141 142 // Conversion methods from/to the corresponding protobuf types. 143 void FromProto(const perfetto::protos::TestConfig&); 144 void ToProto(perfetto::protos::TestConfig*) const; 145 146 uint32_t message_count() const { return message_count_; } 147 void set_message_count(uint32_t value) { message_count_ = value; } 148 149 uint32_t max_messages_per_second() const { return max_messages_per_second_; } 150 void set_max_messages_per_second(uint32_t value) { 151 max_messages_per_second_ = value; 152 } 153 154 uint32_t seed() const { return seed_; } 155 void set_seed(uint32_t value) { seed_ = value; } 156 157 uint32_t message_size() const { return message_size_; } 158 void set_message_size(uint32_t value) { message_size_ = value; } 159 160 bool send_batch_on_register() const { return send_batch_on_register_; } 161 void set_send_batch_on_register(bool value) { 162 send_batch_on_register_ = value; 163 } 164 165 const DummyFields& dummy_fields() const { return dummy_fields_; } 166 DummyFields* mutable_dummy_fields() { return &dummy_fields_; } 167 168 private: 169 uint32_t message_count_ = {}; 170 uint32_t max_messages_per_second_ = {}; 171 uint32_t seed_ = {}; 172 uint32_t message_size_ = {}; 173 bool send_batch_on_register_ = {}; 174 DummyFields dummy_fields_ = {}; 175 176 // Allows to preserve unknown protobuf fields for compatibility 177 // with future versions of .proto files. 178 std::string unknown_fields_; 179 }; 180 181 } // namespace perfetto 182 183 #endif // INCLUDE_PERFETTO_TRACING_CORE_TEST_CONFIG_H_ 184