Update example applications fridgeclient & fridgeserver.
authorSatya Prakash Gupta <sp.gupta@samsung.com>
Thu, 18 Jun 2015 11:41:37 +0000 (17:11 +0530)
committerErich Keane <erich.keane@intel.com>
Mon, 22 Jun 2015 20:36:22 +0000 (20:36 +0000)
Update example application to pass OCRepresentation object by reference
instead of by value.

Change-Id: I8c38f656223181e8d4a95bee328fa4c622be92fb
Signed-off-by: Satya Prakash Gupta <sp.gupta@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1349
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Erich Keane <erich.keane@intel.com>
resource/examples/fridgeclient.cpp
resource/examples/fridgeserver.cpp

index c082a61..8a6cfbd 100644 (file)
@@ -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 "<<getId<<" and resource URI is " << resource->uri() << std::endl;
index 45f626b..dbc91ea 100644 (file)
@@ -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!