| #ifndef THIRD_PARTY_MILOTIC_EXTERNAL_CC_TLBMC_CONFIGS_PROTO_CONFIG_PARSER_H_ |
| #define THIRD_PARTY_MILOTIC_EXTERNAL_CC_TLBMC_CONFIGS_PROTO_CONFIG_PARSER_H_ |
| |
| #include <stdbool.h> |
| |
| #include <memory> |
| #include <string> |
| |
| #include "absl/strings/string_view.h" |
| #include "gpio_config.pb.h" |
| #include "software_metrics_config.pb.h" |
| |
| namespace milotic_tlbmc { |
| |
| struct ProtoConfigData { |
| SoftwareMetricsConfig software_metrics_configs; |
| GpioConfigs gpio_configs; |
| }; |
| |
| class ProtoConfigParser { |
| public: |
| static std::unique_ptr<ProtoConfigParser> Create( |
| absl::string_view config_path); |
| |
| void LoadProtoConfigs(); |
| SoftwareMetricsConfig GetSoftwareMetricsConfig() const; |
| GpioConfigs GetGpioConfigs() const; |
| |
| explicit ProtoConfigParser(absl::string_view config_path) |
| : config_path_(config_path) {} |
| ProtoConfigParser() = default; |
| |
| private: |
| std::string config_path_; |
| ProtoConfigData data_store_; |
| }; |
| |
| } // namespace milotic_tlbmc |
| |
| #endif // THIRD_PARTY_MILOTIC_EXTERNAL_CC_TLBMC_CONFIGS_PROTO_CONFIG_PARSER_H_ |