projects
/
framework
/
web
/
wrt-commons.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Tizen 2.0 Release
[framework/web/wrt-commons.git]
/
examples
/
rpc
/
rpc.cpp
diff --git
a/examples/rpc/rpc.cpp
b/examples/rpc/rpc.cpp
index
833a20f
..
e1e2a64
100644
(file)
--- 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
*/
* @version 1.0
* @brief This file is the implementation file of RPC example
*/
+#include <stddef.h>
#include <dpl/unix_socket_rpc_client.h>
#include <dpl/unix_socket_rpc_server.h>
#include <dpl/unix_socket_rpc_connection.h>
#include <dpl/unix_socket_rpc_client.h>
#include <dpl/unix_socket_rpc_server.h>
#include <dpl/unix_socket_rpc_connection.h>
-#include <
dpl/scoped_ptr.h
>
+#include <
memory
>
#include <dpl/application.h>
#include <dpl/controller.h>
#include <dpl/thread.h>
#include <dpl/application.h>
#include <dpl/controller.h>
#include <dpl/thread.h>
@@
-40,7
+41,7
@@
class MyThread
{
private:
DPL::UnixSocketRPCClient m_rpcClient;
{
private:
DPL::UnixSocketRPCClient m_rpcClient;
-
DPL::ScopedP
tr<DPL::AbstractRPCConnection> m_rpcConnection;
+
std::unique_p
tr<DPL::AbstractRPCConnection> m_rpcConnection;
virtual void OnEventReceived(const DPL::AbstractRPCConnectionEvents::AsyncCallEvent &event)
{
virtual void OnEventReceived(const DPL::AbstractRPCConnectionEvents::AsyncCallEvent &event)
{
@@
-69,7
+70,7
@@
private:
{
// Save connection pointer
LogInfo("CLIENT: Acquiring new connection");
{
// Save connection pointer
LogInfo("CLIENT: Acquiring new connection");
- m_rpcConnection.
R
eset(event.GetArg1());
+ m_rpcConnection.
r
eset(event.GetArg1());
// Attach listener to new connection
LogInfo("CLIENT: Attaching connection event listeners");
// Attach listener to new connection
LogInfo("CLIENT: Attaching connection event listeners");
@@
-108,7
+109,7
@@
public:
int ret = Exec();
// Detach RPC listeners
int ret = Exec();
// Detach RPC listeners
- if (m_rpcConnection.
G
et())
+ if (m_rpcConnection.
g
et())
{
LogInfo("CLIENT: Detaching RPC connection events");
m_rpcConnection->DPL::EventSupport<DPL::AbstractRPCConnectionEvents::AsyncCallEvent>::RemoveListener(this);
{
LogInfo("CLIENT: Detaching RPC connection events");
m_rpcConnection->DPL::EventSupport<DPL::AbstractRPCConnectionEvents::AsyncCallEvent>::RemoveListener(this);
@@
-116,7
+117,7
@@
public:
m_rpcConnection->DPL::EventSupport<DPL::AbstractRPCConnectionEvents::ConnectionBrokenEvent>::RemoveListener(this);
LogInfo("CLIENT: Resetting connection");
m_rpcConnection->DPL::EventSupport<DPL::AbstractRPCConnectionEvents::ConnectionBrokenEvent>::RemoveListener(this);
LogInfo("CLIENT: Resetting connection");
- m_rpcConnection.
R
eset();
+ m_rpcConnection.
r
eset();
}
// Detach RPC client listener
}
// Detach RPC client listener
@@
-146,7
+147,7
@@
class MyApplication
{
private:
DPL::UnixSocketRPCServer m_rpcServer;
{
private:
DPL::UnixSocketRPCServer m_rpcServer;
-
DPL::ScopedP
tr<DPL::AbstractRPCConnection> m_rpcConnection;
+
std::unique_p
tr<DPL::AbstractRPCConnection> m_rpcConnection;
MyThread m_thread;
MyThread m_thread;
@@
-184,7
+185,7
@@
private:
LogInfo("SERVER: Closing RPC connection on event...");
// Detach RPC connection listeners
LogInfo("SERVER: Closing RPC connection on event...");
// Detach RPC connection listeners
- if (m_rpcConnection.
G
et())
+ if (m_rpcConnection.
g
et())
{
LogInfo("SERVER: Detaching connection events");
m_rpcConnection->DPL::EventSupport<DPL::AbstractRPCConnectionEvents::AsyncCallEvent>::RemoveListener(this);
{
LogInfo("SERVER: Detaching connection events");
m_rpcConnection->DPL::EventSupport<DPL::AbstractRPCConnectionEvents::AsyncCallEvent>::RemoveListener(this);
@@
-208,7
+209,7
@@
private:
{
// Save connection pointer
LogInfo("SERVER: Acquiring RPC connection");
{
// Save connection pointer
LogInfo("SERVER: Acquiring RPC connection");
- m_rpcConnection.
R
eset(event.GetArg1());
+ m_rpcConnection.
r
eset(event.GetArg1());
// Attach event listeners
LogInfo("SERVER: Attaching connection listeners");
// Attach event listeners
LogInfo("SERVER: Attaching connection listeners");