clean up using directives and type alias

Most C++ style guides try to avoid using directives in headers and also
suggest using type alias carefully, according to which, this change does
the following clean up:

1. used Enum class to represent Certificate type
2. removed all using directives: e.g. the phosphor logging namespace;
instead, this change uses using declarations
3. removed unnecessary type alias; in existing codes, we only support
strings as types of UnitToRestart, InstallPath, UploadPath, etc; this
change uses std::string directly
4. moved all alias outside any class scope into source files or an
internal namespace
5. renamed types, constants, classes as per OpenBMC style guide
6. fixed all compilation errors and some warnings after the refactoring;
built with both Clang & GCC

Reference:
https://docs.microsoft.com/en-us/cpp/cpp/header-files-cpp?view=msvc-170#what-to-put-in-a-header-file
https://google.github.io/styleguide/cppguide.html#Namespaces

Tested:
Unit tests

Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: I58e026934a4e969f4d8877801c8f3c671990468a
diff --git a/csr.hpp b/csr.hpp
index 2d82739..aa47cf6 100644
--- a/csr.hpp
+++ b/csr.hpp
@@ -1,10 +1,9 @@
 #pragma once
+#include <string>
 #include <xyz/openbmc_project/Certs/CSR/server.hpp>
 
 namespace phosphor::certs
 {
-using CSRRead = sdbusplus::xyz::openbmc_project::Certs::server::CSR;
-using CSRIface = sdbusplus::server::object::object<CSRRead>;
 
 enum class Status
 {
@@ -12,20 +11,24 @@
     FAILURE,
 };
 
-using CertInstallPath = std::string;
+namespace internal
+{
+using CSRInterface = sdbusplus::server::object_t<
+    sdbusplus::xyz::openbmc_project::Certs::server::CSR>;
+}
 
 /** @class CSR
  *  @brief To read CSR certificate
  */
-class CSR : public CSRIface
+class CSR : public internal::CSRInterface
 {
   public:
     CSR() = delete;
     ~CSR() = default;
     CSR(const CSR&) = delete;
     CSR& operator=(const CSR&) = delete;
-    CSR(CSR&&) = default;
-    CSR& operator=(CSR&&) = default;
+    CSR(CSR&&) = delete;
+    CSR& operator=(CSR&&) = delete;
 
     /** @brief Constructor to put object onto bus at a D-Bus path.
      *  @param[in] bus - Bus to attach to.
@@ -33,21 +36,18 @@
      *  @param[in] installPath - Certificate installation path.
      *  @param[in] status - Status of Generate CSR request
      */
-    CSR(sdbusplus::bus::bus& bus, const char* path,
-        CertInstallPath&& installPath, const Status& status);
+    CSR(sdbusplus::bus::bus& bus, const char* path, std::string&& installPath,
+        const Status& status);
     /** @brief Return CSR
      */
     std::string csr() override;
 
   private:
-    /** @brief sdbusplus handler */
-    sdbusplus::bus::bus& bus;
-
     /** @brief object path */
     std::string objectPath;
 
     /** @brief Certificate file installation path **/
-    CertInstallPath certInstallPath;
+    std::string certInstallPath;
 
     /** @brief Status of GenerateCSR request */
     Status csrStatus;