DSInput: Imply pimpl macros 84/241584/1
authorjeon <jhyuni.kang@samsung.com>
Wed, 8 Jul 2020 05:13:51 +0000 (14:13 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Thu, 20 Aug 2020 09:46:01 +0000 (18:46 +0900)
Change-Id: I4814aa431461b00a56b4249d1be56f20a3efb0d3

src/DSInput/DSInput.cpp
src/DSInput/DSInput.h
src/DSInput/DSInputPrivate.h

index b515294..9a71a11 100644 (file)
@@ -5,7 +5,8 @@ namespace display_server
 {
 
 DSInputPrivate::DSInputPrivate(DSInput * p_ptr)
-       : DSObjectPrivate(p_ptr)
+       : DSObjectPrivate(p_ptr),
+         __p_ptr(p_ptr)
 {
 }
 
@@ -14,7 +15,7 @@ DSInputPrivate::~DSInputPrivate()
 }
 
 DSInput::DSInput()
-       : DSObject(std::make_unique<DSInputPrivate>(this))
+       : DS_INIT_PRIVATE_PTR(DSInput)
 {
 }
 
@@ -22,7 +23,6 @@ DSInput::~DSInput()
 {
 }
 
-
 DSInputDevice::DSInputDevice()
        : __deviceName(nullptr),
          __deviceIdentifier(nullptr),
@@ -30,7 +30,7 @@ DSInputDevice::DSInputDevice()
 {
 }
 
-DSInputDevice::DSInputDevice(string name, string identifier, DSInput::DeviceClass clas)
+DSInputDevice::DSInputDevice(std::string name, std::string identifier, DSInput::DeviceClass clas)
        : __deviceName(name),
          __deviceIdentifier(identifier),
          __deviceClass(clas)
@@ -41,22 +41,22 @@ DSInputDevice::~DSInputDevice()
 {
 }
 
-string DSInputDevice::getName() const
+std::string DSInputDevice::getName() const
 {
        return __deviceName;
 }
 
-void DSInputDevice::setName(string name)
+void DSInputDevice::setName(std::string name)
 {
        __deviceName = name;
 }
 
-string DSInputDevice::getIdentifier() const
+std::string DSInputDevice::getIdentifier() const
 {
        return __deviceIdentifier;
 }
 
-void DSInputDevice::setIdentifier(string identifier)
+void DSInputDevice::setIdentifier(std::string identifier)
 {
        __deviceIdentifier = identifier;
 }
index 725653c..2568878 100644 (file)
@@ -1,11 +1,8 @@
 #ifndef _DSINPUT_H_
 #define _DSINPUT_H_
 
-#include <DSObject.h>
-#include <iostream>
-#include <string>
-
-using namespace std;
+#include "DSCore.h"
+#include "DSObject.h"
 
 namespace display_server
 {
@@ -14,6 +11,7 @@ class DSInputPrivate;
 
 class DSInput : public DSObject
 {
+DS_PIMPL_USE_PRIVATE(DSInput);
 public:
        enum DeviceClass {
                None     = 0,
@@ -23,38 +21,28 @@ public:
        };
 public:
        DSInput();
-       virtual ~DSInput();
-
-private:
-       inline DSInputPrivate *__d_func()
-       {
-               return reinterpret_cast<DSInputPrivate *>(_d_ptr.get());
-       }
-       inline const DSInputPrivate *__d_func() const
-       {
-               return reinterpret_cast<DSInputPrivate *>(_d_ptr.get());
-       }
-       friend class DSInputPrivate;
+       ~DSInput() override;
 };
 
 class DSInputDevice
 {
 public:
        DSInputDevice();
-       DSInputDevice(string name, string identifier, DSInput::DeviceClass clas);
+       DSInputDevice(std::string name, std::string identifier, DSInput::DeviceClass clas);
        ~DSInputDevice();
 
-       string getName() const;
-       void setName(string name);
+       std::string getName() const;
+       void setName(std::string name);
 
-       string getIdentifier() const;
-       void setIdentifier(string identifier);
+       std::string getIdentifier() const;
+       void setIdentifier(std::string identifier);
 
        DSInput::DeviceClass getClass() const;
        void setClass(DSInput::DeviceClass clas);
+
 private:
-       string __deviceName;
-       string __deviceIdentifier;
+       std::string __deviceName;
+       std::string __deviceIdentifier;
        DSInput::DeviceClass __deviceClass;
 
 };
index bacb7fd..bfd7d16 100644 (file)
@@ -8,6 +8,7 @@ namespace display_server
 
 class DSInputPrivate : public DSObjectPrivate
 {
+DS_PIMPL_USE_PUBLIC(DSInput);
 public:
        DSInputPrivate() = delete;
        DSInputPrivate(DSInput *p_ptr);