From: jeon Date: Wed, 8 Jul 2020 05:13:51 +0000 (+0900) Subject: DSInput: Imply pimpl macros X-Git-Tag: accepted/tizen/unified/20200820.213435~291 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F84%2F241584%2F1;p=platform%2Fcore%2Fuifw%2Flibds.git DSInput: Imply pimpl macros Change-Id: I4814aa431461b00a56b4249d1be56f20a3efb0d3 --- diff --git a/src/DSInput/DSInput.cpp b/src/DSInput/DSInput.cpp index b515294..9a71a11 100644 --- a/src/DSInput/DSInput.cpp +++ b/src/DSInput/DSInput.cpp @@ -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(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; } diff --git a/src/DSInput/DSInput.h b/src/DSInput/DSInput.h index 725653c..2568878 100644 --- a/src/DSInput/DSInput.h +++ b/src/DSInput/DSInput.h @@ -1,11 +1,8 @@ #ifndef _DSINPUT_H_ #define _DSINPUT_H_ -#include -#include -#include - -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(_d_ptr.get()); - } - inline const DSInputPrivate *__d_func() const - { - return reinterpret_cast(_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; }; diff --git a/src/DSInput/DSInputPrivate.h b/src/DSInput/DSInputPrivate.h index bacb7fd..bfd7d16 100644 --- a/src/DSInput/DSInputPrivate.h +++ b/src/DSInput/DSInputPrivate.h @@ -8,6 +8,7 @@ namespace display_server class DSInputPrivate : public DSObjectPrivate { +DS_PIMPL_USE_PUBLIC(DSInput); public: DSInputPrivate() = delete; DSInputPrivate(DSInput *p_ptr);