From: Satya Prakash Gupta Date: Thu, 18 Jun 2015 11:41:37 +0000 (+0530) Subject: Update example applications fridgeclient & fridgeserver. X-Git-Tag: 1.2.0+RC1~1569 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e6186e165c74d66ec05c4e37da3971f5252e3085;p=platform%2Fupstream%2Fiotivity.git 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 --- 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!