summaryrefslogtreecommitdiffstats
path: root/presence/fan_enclosure.hpp
diff options
context:
space:
mode:
authorBrad Bishop <bradleyb@fuzziesquirrel.com>2017-07-12 15:57:14 -0400
committerPatrick Williams <patrick@stwcx.xyz>2017-08-02 20:18:19 +0000
commit372b22c3ebcdfa606c95f4b9afac5cfcbb7eaebb (patch)
tree62c25bdd9f4d9ad4772185b0b1026c7aae8f4ef8 /presence/fan_enclosure.hpp
parent76596b2190d82ff00707ff6fb4e751cfff4c8ae8 (diff)
downloadphosphor-fan-presence-372b22c3ebcdfa606c95f4b9afac5cfcbb7eaebb.tar.gz
phosphor-fan-presence-372b22c3ebcdfa606c95f4b9afac5cfcbb7eaebb.zip
presence: Switch to new framework
Switch the main application logic to the output produced by the new parser previously. Remove unused code. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Change-Id: If8b262bd80fd0f0135aeea55e578fb3c7f44339a
Diffstat (limited to 'presence/fan_enclosure.hpp')
-rw-r--r--presence/fan_enclosure.hpp110
1 files changed, 0 insertions, 110 deletions
diff --git a/presence/fan_enclosure.hpp b/presence/fan_enclosure.hpp
deleted file mode 100644
index 30bd235..0000000
--- a/presence/fan_enclosure.hpp
+++ /dev/null
@@ -1,110 +0,0 @@
-#pragma once
-
-#include "fan_properties.hpp"
-#include "sdbusplus.hpp"
-#include "sensor_base.hpp"
-
-
-namespace phosphor
-{
-namespace fan
-{
-namespace presence
-{
-
-/**
- * @brief Specifies the defined presence states of a fan enclosure
- */
-typedef enum presenceState
-{
- NOT_PRESENT,
- PRESENT,
- UNKNOWN
-} presenceState;
-
-/**
- * @class FanEnclosure
- * @brief OpenBMC fan enclosure inventory presence implementation
- * @details Inventory is based on the fan enclosure being present or not. This
- * class represents that fan enclosure and updates its presences status within
- * its inventory object based on the status of all its sensors.
- */
-class FanEnclosure
-{
- using Property = std::string;
- using Value = sdbusplus::message::variant<bool, int64_t, std::string>;
- // Association between property and its value
- using PropertyMap = std::map<Property, Value>;
- using Interface = std::string;
- // Association between interface and the dbus property
- using InterfaceMap = std::map<Interface, PropertyMap>;
- using Object = sdbusplus::message::object_path;
- // Association between object and the interface
- using ObjectMap = std::map<Object, InterfaceMap>;
-
- public:
- FanEnclosure() = delete;
- FanEnclosure(const FanEnclosure&) = delete;
- FanEnclosure(FanEnclosure&&) = default;
- FanEnclosure& operator=(const FanEnclosure&) = delete;
- FanEnclosure& operator=(FanEnclosure&&) = delete;
- ~FanEnclosure() = default;
-
- /**
- * @brief Constructs Fan Enclosure Object
- *
- * @param[in] fanProp - Fan enclosure properties
- * @param[in] initialState - The initial state of the enclosure.
- */
- explicit FanEnclosure(const phosphor::fan::Properties& fanProp,
- presenceState initialState = UNKNOWN) :
- invPath(std::get<0>(fanProp)),
- fanDesc(std::get<1>(fanProp)),
- presState(initialState)
- {
- }
-
- /**
- * @brief Update inventory when the determined presence of this fan
- * enclosure has changed
- */
- void updInventory();
- /**
- * @brief Add a sensor association to this fan enclosure
- *
- * @param[in] sensor - Sensor associated to this fan enclosure
- */
- void addSensor(
- std::unique_ptr<Sensor>&& sensor);
-
- private:
- /** @brief Inventory path for this fan enclosure */
- const std::string invPath;
- /** @brief Description used as 'PrettyName' on inventory object */
- const std::string fanDesc;
- /** @brief List of sensors associated with this fan enclosure */
- std::vector<std::unique_ptr<Sensor>> sensors;
- /** @brief Last known presence state of this fan enclosure */
- presenceState presState;
-
- /**
- * @brief Get the current presence state based on all sensors
- *
- * @return Current presence state determined from all sensors
- */
- presenceState getCurPresState();
-
- /**
- * @brief Construct the inventory object map
- *
- * @param[in] Current presence state
- *
- * @return The inventory object map to update inventory
- */
- ObjectMap getObjectMap(bool curPresState);
-
-};
-
-} // namespace presence
-} // namespace fan
-} // namespace phosphor
OpenPOWER on IntegriCloud