* ResourceResponse.
*/
-#ifndef __OCRESOURCERESPONSE_H
-#define __OCRESOURCERESPONSE_H
+#ifndef OC_RESOURCERESPONSE_H_
+#define OC_RESOURCERESPONSE_H_
#include "OCApi.h"
#include <IServerWrapper.h>
m_headerOptions{},
m_interface{},
m_representation{},
- m_requestHandle{nullptr},
+ m_requestHandle{0},
m_resourceHandle{nullptr},
m_responseResult{}
{
}
+#if defined(_MSC_VER) && (_MSC_VER < 1900)
+ OCResourceResponse(OCResourceResponse&& o):
+ m_newResourceUri(std::move(o.m_newResourceUri)),
+ m_errorCode(o.m_errorCode),
+ m_headerOptions(std::move(o.m_headerOptions)),
+ m_interface(std::move(o.m_interface)),
+ m_representation(std::move(o.m_representation)),
+ m_requestHandle(std::move(o.m_requestHandle)),
+ m_resourceHandle(std::move(o.m_resourceHandle)),
+ m_responseResult(std::move(o.m_responseResult))
+ {
+ }
+ OCResourceResponse& operator=(OCResourceResponse&& o)
+ {
+ m_newResourceUri = std::move(o.m_newResourceUri);
+ m_errorCode = o.m_errorCode;
+ m_headerOptions = std::move(o.m_headerOptions);
+ m_interface = std::move(o.m_interface);
+ m_representation = std::move(o.m_representation);
+ m_requestHandle = std::move(o.m_requestHandle);
+ m_resourceHandle = std::move(o.m_resourceHandle);
+ m_responseResult = std::move(o.m_responseResult);
+ }
+#else
OCResourceResponse(OCResourceResponse&&) = default;
OCResourceResponse& operator=(OCResourceResponse&&) = default;
+#endif
virtual ~OCResourceResponse(void) {}
/**
* @param rep reference to the resource's representation
* @param interface specifies the interface
*/
- void setResourceRepresentation(OCRepresentation& rep, std::string interface) {
- m_interface = interface;
+ void setResourceRepresentation(OCRepresentation& rep, std::string iface) {
+ m_interface = iface;
m_representation = rep;
}
* @param rep rvalue reference to the resource's representation
* @param interface specifies the interface
*/
- void setResourceRepresentation(OCRepresentation&& rep, std::string interface) {
- setResourceRepresentation(rep, interface);
+ void setResourceRepresentation(OCRepresentation&& rep, std::string iface) {
+ setResourceRepresentation(rep, iface);
}
/**
private:
friend class InProcServerWrapper;
- std::string getPayload() const
+ OCRepPayload* getPayload() const
{
MessageContainer inf;
OCRepresentation first(m_representation);
}
- return inf.getJSONRepresentation(OCInfoFormat::ExcludeOC);
+ return inf.getPayload();
}
public:
/**
* Get error code
*/
- int getErrorCode() const;
+ int getErrorCode() const
+ {
+ return m_errorCode;
+ }
/**
* Get the Response Representation
*
* @return OCEntityHandler result value
*/
- const OCEntityHandlerResult getResponseResult() const
+ OCEntityHandlerResult getResponseResult() const
{
return m_responseResult;
}
} // namespace OC
-#endif //__OCRESOURCERESPONSE_H
-
+#endif // OC_RESOURCERESPONSE_H_