From e6186e165c74d66ec05c4e37da3971f5252e3085 Mon Sep 17 00:00:00 2001 From: Satya Prakash Gupta Date: Thu, 18 Jun 2015 17:11:37 +0530 Subject: [PATCH] Update example applications fridgeclient & fridgeserver. Update example application to pass OCRepresentation object by reference instead of by value. Change-Id: I8c38f656223181e8d4a95bee328fa4c622be92fb Signed-off-by: Satya Prakash Gupta Reviewed-on: https://gerrit.iotivity.org/gerrit/1349 Tested-by: jenkins-iotivity Reviewed-by: Erich Keane --- resource/examples/fridgeclient.cpp | 2 +- resource/examples/fridgeserver.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/resource/examples/fridgeclient.cpp b/resource/examples/fridgeclient.cpp index c082a61..8a6cfbd 100644 --- a/resource/examples/fridgeclient.cpp +++ b/resource/examples/fridgeclient.cpp @@ -176,7 +176,7 @@ class ClientFridge // however be a better fit to wrap each call in an object so a fuller context (and additional // requests) can be easily made inside of a simple context void getResponse(const std::string& resourceName, const HeaderOptions& headerOptions, - const OCRepresentation rep, const int eCode, OCResource::Ptr resource, int getId) + const OCRepresentation& rep, const int eCode, OCResource::Ptr resource, int getId) { std::cout << "Got a response from get from the " << resourceName << std::endl; std::cout << "Get ID is "<uri() << std::endl; diff --git a/resource/examples/fridgeserver.cpp b/resource/examples/fridgeserver.cpp index 45f626b..dbc91ea 100644 --- a/resource/examples/fridgeserver.cpp +++ b/resource/examples/fridgeserver.cpp @@ -281,7 +281,7 @@ class LightResource : public Resource return m_rep; } - void put(OCRepresentation rep) + void put(const OCRepresentation& rep) { rep.getValue("on", m_isOn); } @@ -376,7 +376,7 @@ class DoorResource : public Resource return m_rep; } - void put(OCRepresentation rep) + void put(const OCRepresentation& rep) { rep.getValue("open", m_isOpen); // Note, we won't let the user change the door side! -- 2.7.4