Home | History | Annotate | Download | only in core
      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/power/android_power_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_ANDROID_POWER_CONFIG_H_
     29 #define INCLUDE_PERFETTO_TRACING_CORE_ANDROID_POWER_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 AndroidPowerConfig;
     42 }
     43 }  // namespace perfetto
     44 
     45 namespace perfetto {
     46 
     47 class PERFETTO_EXPORT AndroidPowerConfig {
     48  public:
     49   enum BatteryCounters {
     50     BATTERY_COUNTER_UNSPECIFIED = 0,
     51     BATTERY_COUNTER_CHARGE = 1,
     52     BATTERY_COUNTER_CAPACITY_PERCENT = 2,
     53     BATTERY_COUNTER_CURRENT = 3,
     54     BATTERY_COUNTER_CURRENT_AVG = 4,
     55   };
     56   AndroidPowerConfig();
     57   ~AndroidPowerConfig();
     58   AndroidPowerConfig(AndroidPowerConfig&&) noexcept;
     59   AndroidPowerConfig& operator=(AndroidPowerConfig&&);
     60   AndroidPowerConfig(const AndroidPowerConfig&);
     61   AndroidPowerConfig& operator=(const AndroidPowerConfig&);
     62   bool operator==(const AndroidPowerConfig&) const;
     63   bool operator!=(const AndroidPowerConfig& other) const {
     64     return !(*this == other);
     65   }
     66 
     67   // Conversion methods from/to the corresponding protobuf types.
     68   void FromProto(const perfetto::protos::AndroidPowerConfig&);
     69   void ToProto(perfetto::protos::AndroidPowerConfig*) const;
     70 
     71   uint32_t battery_poll_ms() const { return battery_poll_ms_; }
     72   void set_battery_poll_ms(uint32_t value) { battery_poll_ms_ = value; }
     73 
     74   int battery_counters_size() const {
     75     return static_cast<int>(battery_counters_.size());
     76   }
     77   const std::vector<BatteryCounters>& battery_counters() const {
     78     return battery_counters_;
     79   }
     80   std::vector<BatteryCounters>* mutable_battery_counters() {
     81     return &battery_counters_;
     82   }
     83   void clear_battery_counters() { battery_counters_.clear(); }
     84   BatteryCounters* add_battery_counters() {
     85     battery_counters_.emplace_back();
     86     return &battery_counters_.back();
     87   }
     88 
     89   bool collect_power_rails() const { return collect_power_rails_; }
     90   void set_collect_power_rails(bool value) { collect_power_rails_ = value; }
     91 
     92  private:
     93   uint32_t battery_poll_ms_ = {};
     94   std::vector<BatteryCounters> battery_counters_;
     95   bool collect_power_rails_ = {};
     96 
     97   // Allows to preserve unknown protobuf fields for compatibility
     98   // with future versions of .proto files.
     99   std::string unknown_fields_;
    100 };
    101 
    102 }  // namespace perfetto
    103 
    104 #endif  // INCLUDE_PERFETTO_TRACING_CORE_ANDROID_POWER_CONFIG_H_
    105