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/common/observable_events.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_OBSERVABLE_EVENTS_H_ 29 #define INCLUDE_PERFETTO_TRACING_CORE_OBSERVABLE_EVENTS_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 ObservableEvents; 42 class ObservableEvents_DataSourceInstanceStateChange; 43 } // namespace protos 44 } // namespace perfetto 45 46 namespace perfetto { 47 48 class PERFETTO_EXPORT ObservableEvents { 49 public: 50 class PERFETTO_EXPORT DataSourceInstanceStateChange { 51 public: 52 enum DataSourceInstanceState { 53 DATA_SOURCE_INSTANCE_STATE_STOPPED = 1, 54 DATA_SOURCE_INSTANCE_STATE_STARTED = 2, 55 }; 56 DataSourceInstanceStateChange(); 57 ~DataSourceInstanceStateChange(); 58 DataSourceInstanceStateChange(DataSourceInstanceStateChange&&) noexcept; 59 DataSourceInstanceStateChange& operator=(DataSourceInstanceStateChange&&); 60 DataSourceInstanceStateChange(const DataSourceInstanceStateChange&); 61 DataSourceInstanceStateChange& operator=( 62 const DataSourceInstanceStateChange&); 63 bool operator==(const DataSourceInstanceStateChange&) const; 64 bool operator!=(const DataSourceInstanceStateChange& other) const { 65 return !(*this == other); 66 } 67 68 // Conversion methods from/to the corresponding protobuf types. 69 void FromProto(const perfetto::protos:: 70 ObservableEvents_DataSourceInstanceStateChange&); 71 void ToProto( 72 perfetto::protos::ObservableEvents_DataSourceInstanceStateChange*) 73 const; 74 producer_name()75 const std::string& producer_name() const { return producer_name_; } set_producer_name(const std::string & value)76 void set_producer_name(const std::string& value) { producer_name_ = value; } 77 data_source_name()78 const std::string& data_source_name() const { return data_source_name_; } set_data_source_name(const std::string & value)79 void set_data_source_name(const std::string& value) { 80 data_source_name_ = value; 81 } 82 state()83 DataSourceInstanceState state() const { return state_; } set_state(DataSourceInstanceState value)84 void set_state(DataSourceInstanceState value) { state_ = value; } 85 86 private: 87 std::string producer_name_ = {}; 88 std::string data_source_name_ = {}; 89 DataSourceInstanceState state_ = {}; 90 91 // Allows to preserve unknown protobuf fields for compatibility 92 // with future versions of .proto files. 93 std::string unknown_fields_; 94 }; 95 96 ObservableEvents(); 97 ~ObservableEvents(); 98 ObservableEvents(ObservableEvents&&) noexcept; 99 ObservableEvents& operator=(ObservableEvents&&); 100 ObservableEvents(const ObservableEvents&); 101 ObservableEvents& operator=(const ObservableEvents&); 102 bool operator==(const ObservableEvents&) const; 103 bool operator!=(const ObservableEvents& other) const { 104 return !(*this == other); 105 } 106 107 // Conversion methods from/to the corresponding protobuf types. 108 void FromProto(const perfetto::protos::ObservableEvents&); 109 void ToProto(perfetto::protos::ObservableEvents*) const; 110 instance_state_changes_size()111 int instance_state_changes_size() const { 112 return static_cast<int>(instance_state_changes_.size()); 113 } instance_state_changes()114 const std::vector<DataSourceInstanceStateChange>& instance_state_changes() 115 const { 116 return instance_state_changes_; 117 } mutable_instance_state_changes()118 std::vector<DataSourceInstanceStateChange>* mutable_instance_state_changes() { 119 return &instance_state_changes_; 120 } clear_instance_state_changes()121 void clear_instance_state_changes() { instance_state_changes_.clear(); } add_instance_state_changes()122 DataSourceInstanceStateChange* add_instance_state_changes() { 123 instance_state_changes_.emplace_back(); 124 return &instance_state_changes_.back(); 125 } 126 127 private: 128 std::vector<DataSourceInstanceStateChange> instance_state_changes_; 129 130 // Allows to preserve unknown protobuf fields for compatibility 131 // with future versions of .proto files. 132 std::string unknown_fields_; 133 }; 134 135 } // namespace perfetto 136 137 #endif // INCLUDE_PERFETTO_TRACING_CORE_OBSERVABLE_EVENTS_H_ 138