blob: dcb1aa3fe429d1c66611de798a2f9dfa9783c844 [file] [log] [blame]
#pragma once
#include <string>
#include <vector>
#include <memory>
#include "config.h"
#include "rpolicy.hpp"
namespace phosphor
{
namespace fan
{
namespace presence
{
using policies = std::vector<std::unique_ptr<RedundancyPolicy>>;
class JsonConfig
{
public:
JsonConfig() = delete;
JsonConfig(const JsonConfig&) = delete;
JsonConfig(JsonConfig&&) = delete;
JsonConfig& operator=(const JsonConfig&) = delete;
JsonConfig& operator=(JsonConfig&&) = delete;
~JsonConfig() = default;
/**
* Constructor
* Parses and populates the fan presence policies from a json file
*
* @param[in] jsonFile - json configuration file
*/
explicit JsonConfig(const std::string& jsonFile);
/**
* @brief Get the json config based fan presence policies
*
* @return - The fan presence policies
*/
static const policies& get();
private:
/* Fan presence policies */
static policies _policies;
};
} // namespace presence
} // namespace fan
} // namespace phosphor