bios: Implement BIOSIntegerAttribute

Implement BIOSIntegerAttribute, most of the code is copied from
bios/bios_parser.cpp.

Implement SetAttrValueOnDbus and constructEntry for integer attribute

Signed-off-by: John Wang <wangzqbj@inspur.com>
Change-Id: I57d5b5dbcb74f9a404f5133426208f4c6851dea2
diff --git a/libpldmresponder/bios_integer_attribute.hpp b/libpldmresponder/bios_integer_attribute.hpp
new file mode 100644
index 0000000..83fa53d
--- /dev/null
+++ b/libpldmresponder/bios_integer_attribute.hpp
@@ -0,0 +1,63 @@
+#pragma once
+
+#include "bios_attribute.hpp"
+
+class TestBIOSIntegerAttribute;
+
+namespace pldm
+{
+namespace responder
+{
+namespace bios
+{
+
+/** @class BIOSIntegerAttribute
+ *  @brief Associate integer entry(attr table and attribute value table) and
+ *         dbus attribute
+ */
+class BIOSIntegerAttribute : public BIOSAttribute
+{
+  public:
+    friend class ::TestBIOSIntegerAttribute;
+
+    /** @brief Construct a bios integer attribute
+     *  @param[in] entry - Json Object
+     *  @param[in] dbusHandler - Dbus Handler
+     */
+    BIOSIntegerAttribute(const Json& entry, DBusHandler* const dbusHandler);
+
+    /** @brief Set Attribute value On Dbus according to the attribute value
+     *         entry
+     *  @param[in] attrValueEntry - The attribute value entry
+     *  @param[in] attrEntry - The attribute entry corresponding to the
+     *                         attribute value entry
+     *  @param[in] stringTable - The string table
+     */
+    void
+        setAttrValueOnDbus(const pldm_bios_attr_val_table_entry* attrValueEntry,
+                           const pldm_bios_attr_table_entry* attrEntry,
+                           const BIOSStringTable& stringTable) override;
+
+    /** @brief Construct corresponding entries at the end of the attribute table
+     *         and attribute value tables
+     *  @param[in] stringTable - The string Table
+     *  @param[in,out] attrTable - The attribute table
+     *  @param[in,out] attrValueTable - The attribute value table
+     */
+    void constructEntry(const BIOSStringTable& stringTable, Table& attrTable,
+                        Table& attrValueTable) override;
+
+  private:
+    /** @brief Integer field from json */
+    table::attribute::IntegerField integerInfo;
+
+    /** @brief Get pldm value from dbus propertyValue */
+    uint64_t getAttrValue(PropertyValue value);
+
+    /** @brief Get value on dbus */
+    uint64_t getAttrValue();
+};
+
+} // namespace bios
+} // namespace responder
+} // namespace pldm
\ No newline at end of file