X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=examples%2Frpc%2Frpc.cpp;h=e1e2a64b547dfdf628ba913afb256a4d8f37e217;hb=99d2eda0b32d9fe02b094f236742a58e740c2f50;hp=833a20fe6cb3f63d30733c3ca4549ceb6d739b24;hpb=45bf3bfbb061b87511ece6f50b1aa6c803844a65;p=framework%2Fweb%2Fwrt-commons.git diff --git a/examples/rpc/rpc.cpp b/examples/rpc/rpc.cpp index 833a20f..e1e2a64 100644 --- a/examples/rpc/rpc.cpp +++ b/examples/rpc/rpc.cpp @@ -19,10 +19,11 @@ * @version 1.0 * @brief This file is the implementation file of RPC example */ +#include #include #include #include -#include +#include #include #include #include @@ -40,7 +41,7 @@ class MyThread { private: DPL::UnixSocketRPCClient m_rpcClient; - DPL::ScopedPtr m_rpcConnection; + std::unique_ptr m_rpcConnection; virtual void OnEventReceived(const DPL::AbstractRPCConnectionEvents::AsyncCallEvent &event) { @@ -69,7 +70,7 @@ private: { // Save connection pointer LogInfo("CLIENT: Acquiring new connection"); - m_rpcConnection.Reset(event.GetArg1()); + m_rpcConnection.reset(event.GetArg1()); // Attach listener to new connection LogInfo("CLIENT: Attaching connection event listeners"); @@ -108,7 +109,7 @@ public: int ret = Exec(); // Detach RPC listeners - if (m_rpcConnection.Get()) + if (m_rpcConnection.get()) { LogInfo("CLIENT: Detaching RPC connection events"); m_rpcConnection->DPL::EventSupport::RemoveListener(this); @@ -116,7 +117,7 @@ public: m_rpcConnection->DPL::EventSupport::RemoveListener(this); LogInfo("CLIENT: Resetting connection"); - m_rpcConnection.Reset(); + m_rpcConnection.reset(); } // Detach RPC client listener @@ -146,7 +147,7 @@ class MyApplication { private: DPL::UnixSocketRPCServer m_rpcServer; - DPL::ScopedPtr m_rpcConnection; + std::unique_ptr m_rpcConnection; MyThread m_thread; @@ -184,7 +185,7 @@ private: LogInfo("SERVER: Closing RPC connection on event..."); // Detach RPC connection listeners - if (m_rpcConnection.Get()) + if (m_rpcConnection.get()) { LogInfo("SERVER: Detaching connection events"); m_rpcConnection->DPL::EventSupport::RemoveListener(this); @@ -208,7 +209,7 @@ private: { // Save connection pointer LogInfo("SERVER: Acquiring RPC connection"); - m_rpcConnection.Reset(event.GetArg1()); + m_rpcConnection.reset(event.GetArg1()); // Attach event listeners LogInfo("SERVER: Attaching connection listeners");