Updated api description for RCSSeparateResponse.
authorcoderhyme <jhyo.kim@samsung.com>
Thu, 25 Feb 2016 04:15:36 +0000 (20:15 -0800)
committerUze Choi <uzchoi@samsung.com>
Fri, 26 Feb 2016 01:14:37 +0000 (01:14 +0000)
Change-Id: I6592491e76a9976b847879a7cd0c05fd2c99fd47
Signed-off-by: coderhyme <jhyo.kim@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/5189
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
service/resource-encapsulation/include/RCSSeparateResponse.h
service/resource-encapsulation/src/serverBuilder/src/RCSSeparateResponse.cpp

index b23cea5..0d8b7ed 100755 (executable)
@@ -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:
index 98001e8..69cc22a 100755 (executable)
@@ -62,7 +62,10 @@ namespace OIC
 \r
         void RCSSeparateResponse::set()\r
         {\r
-            assert(m_request.getOCRequest());\r
+            if (!m_request.getOCRequest())\r
+            {\r
+                throw RCSBadRequestException{ "The state of this object is invalid!" };\r
+            }\r
 \r
             auto resObj = m_request.getResourceObject().lock();\r
             if (!resObj)\r