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>
// 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;
return m_rep;
}
- void put(OCRepresentation rep)
+ void put(const OCRepresentation& rep)
{
rep.getValue("on", m_isOn);
}
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!