pseq: Add getRails() method to device hierarchy

Add a method to get the voltage rails that are being enabled/monitored
by a power sequencer device.

Tested:
* Verified all gtests ran successfully

Change-Id: I04b3e9b0854c110858daf30dbf35dc44ab4ade0e
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
diff --git a/phosphor-power-sequencer/src/power_sequencer_device.hpp b/phosphor-power-sequencer/src/power_sequencer_device.hpp
index 26e7c6a..f6ebb48 100644
--- a/phosphor-power-sequencer/src/power_sequencer_device.hpp
+++ b/phosphor-power-sequencer/src/power_sequencer_device.hpp
@@ -15,6 +15,7 @@
  */
 #pragma once
 
+#include "rail.hpp"
 #include "services.hpp"
 
 #include <cstdint>
@@ -51,6 +52,13 @@
     virtual const std::string& getName() const = 0;
 
     /**
+     * Returns the voltage rails that are enabled and monitored by this device.
+     *
+     * @return voltage rails
+     */
+    virtual const std::vector<std::unique_ptr<Rail>>& getRails() const = 0;
+
+    /**
      * Returns the GPIO values that can be read from the device.
      *
      * The vector indices correspond to the libgpiod line offsets.  For example,
@@ -127,6 +135,7 @@
      * Throws an exception if an error occurs while trying to obtain the status
      * of the rails.
      *
+     * @param services System services like hardware presence and the journal
      * @param powerSupplyError Power supply error that occurred before the pgood
      *                         fault.  Set to the empty string if no power
      *                         supply error occurred.  This error may be the
@@ -139,7 +148,8 @@
      *         device, false otherwise
      */
     virtual bool
-        hasPgoodFault(const std::string& powerSupplyError, std::string& error,
+        hasPgoodFault(Services& services, const std::string& powerSupplyError,
+                      std::string& error,
                       std::map<std::string, std::string>& additionalData) = 0;
 };