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/inode_file/inode_file_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_INODE_FILE_CONFIG_H_
     29 #define INCLUDE_PERFETTO_TRACING_CORE_INODE_FILE_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 InodeFileConfig;
     42 class InodeFileConfig_MountPointMappingEntry;
     43 }  // namespace protos
     44 }  // namespace perfetto
     45 
     46 namespace perfetto {
     47 
     48 class PERFETTO_EXPORT InodeFileConfig {
     49  public:
     50   class PERFETTO_EXPORT MountPointMappingEntry {
     51    public:
     52     MountPointMappingEntry();
     53     ~MountPointMappingEntry();
     54     MountPointMappingEntry(MountPointMappingEntry&&) noexcept;
     55     MountPointMappingEntry& operator=(MountPointMappingEntry&&);
     56     MountPointMappingEntry(const MountPointMappingEntry&);
     57     MountPointMappingEntry& operator=(const MountPointMappingEntry&);
     58     bool operator==(const MountPointMappingEntry&) const;
     59     bool operator!=(const MountPointMappingEntry& other) const {
     60       return !(*this == other);
     61     }
     62 
     63     // Conversion methods from/to the corresponding protobuf types.
     64     void FromProto(
     65         const perfetto::protos::InodeFileConfig_MountPointMappingEntry&);
     66     void ToProto(
     67         perfetto::protos::InodeFileConfig_MountPointMappingEntry*) const;
     68 
     69     const std::string& mountpoint() const { return mountpoint_; }
     70     void set_mountpoint(const std::string& value) { mountpoint_ = value; }
     71 
     72     int scan_roots_size() const { return static_cast<int>(scan_roots_.size()); }
     73     const std::vector<std::string>& scan_roots() const { return scan_roots_; }
     74     std::vector<std::string>* mutable_scan_roots() { return &scan_roots_; }
     75     void clear_scan_roots() { scan_roots_.clear(); }
     76     std::string* add_scan_roots() {
     77       scan_roots_.emplace_back();
     78       return &scan_roots_.back();
     79     }
     80 
     81    private:
     82     std::string mountpoint_ = {};
     83     std::vector<std::string> scan_roots_;
     84 
     85     // Allows to preserve unknown protobuf fields for compatibility
     86     // with future versions of .proto files.
     87     std::string unknown_fields_;
     88   };
     89 
     90   InodeFileConfig();
     91   ~InodeFileConfig();
     92   InodeFileConfig(InodeFileConfig&&) noexcept;
     93   InodeFileConfig& operator=(InodeFileConfig&&);
     94   InodeFileConfig(const InodeFileConfig&);
     95   InodeFileConfig& operator=(const InodeFileConfig&);
     96   bool operator==(const InodeFileConfig&) const;
     97   bool operator!=(const InodeFileConfig& other) const {
     98     return !(*this == other);
     99   }
    100 
    101   // Conversion methods from/to the corresponding protobuf types.
    102   void FromProto(const perfetto::protos::InodeFileConfig&);
    103   void ToProto(perfetto::protos::InodeFileConfig*) const;
    104 
    105   uint32_t scan_interval_ms() const { return scan_interval_ms_; }
    106   void set_scan_interval_ms(uint32_t value) { scan_interval_ms_ = value; }
    107 
    108   uint32_t scan_delay_ms() const { return scan_delay_ms_; }
    109   void set_scan_delay_ms(uint32_t value) { scan_delay_ms_ = value; }
    110 
    111   uint32_t scan_batch_size() const { return scan_batch_size_; }
    112   void set_scan_batch_size(uint32_t value) { scan_batch_size_ = value; }
    113 
    114   bool do_not_scan() const { return do_not_scan_; }
    115   void set_do_not_scan(bool value) { do_not_scan_ = value; }
    116 
    117   int scan_mount_points_size() const {
    118     return static_cast<int>(scan_mount_points_.size());
    119   }
    120   const std::vector<std::string>& scan_mount_points() const {
    121     return scan_mount_points_;
    122   }
    123   std::vector<std::string>* mutable_scan_mount_points() {
    124     return &scan_mount_points_;
    125   }
    126   void clear_scan_mount_points() { scan_mount_points_.clear(); }
    127   std::string* add_scan_mount_points() {
    128     scan_mount_points_.emplace_back();
    129     return &scan_mount_points_.back();
    130   }
    131 
    132   int mount_point_mapping_size() const {
    133     return static_cast<int>(mount_point_mapping_.size());
    134   }
    135   const std::vector<MountPointMappingEntry>& mount_point_mapping() const {
    136     return mount_point_mapping_;
    137   }
    138   std::vector<MountPointMappingEntry>* mutable_mount_point_mapping() {
    139     return &mount_point_mapping_;
    140   }
    141   void clear_mount_point_mapping() { mount_point_mapping_.clear(); }
    142   MountPointMappingEntry* add_mount_point_mapping() {
    143     mount_point_mapping_.emplace_back();
    144     return &mount_point_mapping_.back();
    145   }
    146 
    147  private:
    148   uint32_t scan_interval_ms_ = {};
    149   uint32_t scan_delay_ms_ = {};
    150   uint32_t scan_batch_size_ = {};
    151   bool do_not_scan_ = {};
    152   std::vector<std::string> scan_mount_points_;
    153   std::vector<MountPointMappingEntry> mount_point_mapping_;
    154 
    155   // Allows to preserve unknown protobuf fields for compatibility
    156   // with future versions of .proto files.
    157   std::string unknown_fields_;
    158 };
    159 
    160 }  // namespace perfetto
    161 
    162 #endif  // INCLUDE_PERFETTO_TRACING_CORE_INODE_FILE_CONFIG_H_
    163