Add OCC present count detection and watch

Add a Presence child class of Error to handle detecting the number of
OCCs available. Add an instance of this Presence class if the Device
detects that it is the master OCC, since the number of present OCCs is
only reported by the master OCC. When a change to the number of OCCs
reported is detected, compare with the number of OCCs determined to be
active by the Manager, and if there is a mismatch, follow the usual
error path (reset OCC, etc).

Partially resolves openbmc/openbmc#2285
See https://gerrit.openbmc-project.xyz/#/c/7843/

Change-Id: Idbaca52b307992d9b01fe15439ab746ef6d64397
Signed-off-by: Edward A. James <eajames@us.ibm.com>
diff --git a/occ_errors.hpp b/occ_errors.hpp
index e3820d1..070e72c 100644
--- a/occ_errors.hpp
+++ b/occ_errors.hpp
@@ -61,15 +61,6 @@
         /** @brief event source wrapped in unique_ptr */
         EventSourcePtr eventSource;
 
-        /** Error file */
-        const fs::path file;
-
-        /** @brief Optional function to call on error scenario */
-        std::function<void()> callBack;
-
-        /** @brief File descriptor to watch for errors */
-        int fd = -1;
-
         /** @brief Current state of error watching */
         bool watching = false;
 
@@ -79,13 +70,6 @@
         /** @brief Opens the file and populates fd */
         void openFile();
 
-        /** @brief Reads file data
-         *
-         *  @return data read. Since its a /sysfs entry,
-         *          it would be a string
-         */
-        std::string readFile(int) const;
-
         /** @brief Callback handler when the FD has some activity on it
          *
          *  @param[in] es       - Populated event source
@@ -103,7 +87,24 @@
          *         and makes a callback to error handler if the
          *         content denotes an error condition
          */
-        void analyzeEvent();
+        virtual void analyzeEvent();
+
+    protected:
+        /** @brief File descriptor to watch for errors */
+        int fd = -1;
+
+        /** Error file */
+        const fs::path file;
+
+        /** @brief Optional function to call on error scenario */
+        std::function<void()> callBack;
+
+        /** @brief Reads file data
+         *
+         *  @return data read. Since its a /sysfs entry,
+         *          it would be a string
+         */
+        std::string readFile(int) const;
 };
 
 } // namespace occ