PEL: Const accessors for Private/UserHeader

Change the combined non-const accessor/setter functions for the
PrivateHeader and UserHeader fields to the standard const accessors, and
have separate setters for the fields that need to be modified.

In addition, make the 'get PrivateHeader' and 'get UserHeader' functions
on the PEL class return a const reference.

This allows const enforcement on the PEL class, for things like:

void func(const PEL& pel)
{
    auto id = pel.privateHeader().id();
}

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I840170e72b41e9e2465f716617500269244de6d9
diff --git a/extensions/openpower-pels/private_header.hpp b/extensions/openpower-pels/private_header.hpp
index 9c522a2..7d6a53d 100644
--- a/extensions/openpower-pels/private_header.hpp
+++ b/extensions/openpower-pels/private_header.hpp
@@ -75,9 +75,9 @@
     /**
      * @brief Returns the creation timestamp
      *
-     * @return BCDTime& - the timestamp
+     * @return const BCDTime& - the timestamp
      */
-    BCDTime& createTimestamp()
+    const BCDTime& createTimestamp() const
     {
         return _createTimestamp;
     }
@@ -85,19 +85,29 @@
     /**
      * @brief Returns the commit time timestamp
      *
-     * @return BCDTime& - the timestamp
+     * @return const BCDTime& - the timestamp
      */
-    BCDTime& commitTimestamp()
+    const BCDTime& commitTimestamp() const
     {
         return _commitTimestamp;
     }
 
     /**
+     * @brief Sets the commit timestamp
+     *
+     * @param[in] time - the new timestamp
+     */
+    void setCommitTimestamp(const BCDTime& time)
+    {
+        _commitTimestamp = time;
+    }
+
+    /**
      * @brief Returns the creator ID field
      *
-     * @return uint8_t& - the creator ID
+     * @return uint8_t - the creator ID
      */
-    uint8_t& creatorID()
+    uint8_t creatorID() const
     {
         return _creatorID;
     }
@@ -105,9 +115,9 @@
     /**
      * @brief Returns the log type field
      *
-     * @return uint8_t& - the log type
+     * @return uint8_t - the log type
      */
-    uint8_t& logType()
+    uint8_t logType() const
     {
         return _logType;
     }
@@ -115,27 +125,47 @@
     /**
      * @brief Returns the section count field
      *
-     * @return uint8_t& - the section count
+     * @return uint8_t - the section count
      */
-    uint8_t& sectionCount()
+    uint8_t sectionCount() const
     {
         return _sectionCount;
     }
 
     /**
+     * @brief Sets the section count field
+     *
+     * @param[in] count - the new section count
+     */
+    void setSectionCount(uint8_t count)
+    {
+        _sectionCount = count;
+    }
+
+    /**
      * @brief Returns the OpenBMC log ID field
      *
      * This is the ID the OpenBMC event log that corresponds
      * to this PEL.
      *
-     * @return uint32_t& - the OpenBMC event log ID
+     * @return uint32_t - the OpenBMC event log ID
      */
-    uint32_t& obmcLogID()
+    uint32_t obmcLogID() const
     {
         return _obmcLogID;
     }
 
     /**
+     * @brief Sets the OpenBMC log ID field
+     *
+     * @param[in] id - the new ID
+     */
+    void setOBMCLogID(uint32_t id)
+    {
+        _obmcLogID = id;
+    }
+
+    /**
      * @brief Returns the Creator Version field
      *
      * @return CreatorVersion& - the creator version
@@ -148,19 +178,29 @@
     /**
      * @brief Returns the error log ID field
      *
-     * @return uint32_t& - the error log ID
+     * @return uint32_t - the error log ID
      */
-    uint32_t& id()
+    uint32_t id() const
     {
         return _id;
     }
 
     /**
+     * @brief Sets the ID field
+     *
+     * @param[in] id - the new ID
+     */
+    void setID(uint32_t id)
+    {
+        _id = id;
+    }
+
+    /**
      * @brief Returns the platform log ID field
      *
-     * @return uint32_t& - the platform log ID
+     * @return uint32_t - the platform log ID
      */
-    uint32_t& plid()
+    uint32_t plid() const
     {
         return _plid;
     }