From: coderhyme Date: Thu, 25 Feb 2016 04:15:36 +0000 (-0800) Subject: Updated api description for RCSSeparateResponse. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=586aa4993a002dcd453846102d212086c8c78111;p=contrib%2Fiotivity.git Updated api description for RCSSeparateResponse. Change-Id: I6592491e76a9976b847879a7cd0c05fd2c99fd47 Signed-off-by: coderhyme Reviewed-on: https://gerrit.iotivity.org/gerrit/5189 Tested-by: jenkins-iotivity Reviewed-by: Uze Choi --- diff --git a/service/resource-encapsulation/include/RCSSeparateResponse.h b/service/resource-encapsulation/include/RCSSeparateResponse.h index b23cea5..0d8b7ed 100755 --- a/service/resource-encapsulation/include/RCSSeparateResponse.h +++ b/service/resource-encapsulation/include/RCSSeparateResponse.h @@ -27,14 +27,34 @@ namespace OIC { namespace Service { - class RCSResourceAttributes; - class RCSRequest; - + /** + * This class is to send a delayed response for request handlers of the RCSResourceObject. + * + * @see RCSResourceObject + * @see RCSResourceObject::SetRequestHandler + * @see RCSResourceObject::GetRequestHandler + * @see RCSGetResponse::separate() + * @see RCSSetResponse::separate() + */ class RCSSeparateResponse { public: - explicit RCSSeparateResponse(const RCSRequest&); - explicit RCSSeparateResponse(RCSRequest&&); + /** + * Constructs with a request. + * + * @note The request must be from a request handler which returns separate(). + * + * @see RCSResourceObject::SetRequestHandler + * @see RCSResourceObject::GetRequestHandler + * @see RCSGetResponse::separate() + * @see RCSSetResponse::separate() + */ + explicit RCSSeparateResponse(const RCSRequest& request); + + /** + * @overload + */ + explicit RCSSeparateResponse(RCSRequest&& request); RCSSeparateResponse(const RCSSeparateResponse&) = delete; RCSSeparateResponse& operator=(const RCSSeparateResponse&) = delete; @@ -42,6 +62,15 @@ namespace OIC RCSSeparateResponse(RCSSeparateResponse&&) = default; RCSSeparateResponse& operator=(RCSSeparateResponse&&) =default; + /** + * Sends the response to the client. + * The payload will be composed of properties(including attributes) of + * the resource object of the request. + * + * @throws RCSBadRequestException If the RCSResourceObject which receives the request + * is gone or it is already set. + * @throws RCSPlatformException If the operation failed. + */ void set(); private: diff --git a/service/resource-encapsulation/src/serverBuilder/src/RCSSeparateResponse.cpp b/service/resource-encapsulation/src/serverBuilder/src/RCSSeparateResponse.cpp index 98001e8..69cc22a 100755 --- a/service/resource-encapsulation/src/serverBuilder/src/RCSSeparateResponse.cpp +++ b/service/resource-encapsulation/src/serverBuilder/src/RCSSeparateResponse.cpp @@ -62,7 +62,10 @@ namespace OIC void RCSSeparateResponse::set() { - assert(m_request.getOCRequest()); + if (!m_request.getOCRequest()) + { + throw RCSBadRequestException{ "The state of this object is invalid!" }; + } auto resObj = m_request.getResourceObject().lock(); if (!resObj)