Updated api description for RCSRepresentation.
authorcoderhyme <jhyo.kim@samsung.com>
Fri, 26 Feb 2016 06:50:49 +0000 (22:50 -0800)
committerUze Choi <uzchoi@samsung.com>
Sat, 27 Feb 2016 05:10:45 +0000 (05:10 +0000)
Change-Id: I68570997978e83d60f0c0ccd66274aac52ee5989
Signed-off-by: coderhyme <jhyo.kim@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/5217
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Tested-by: Uze Choi <uzchoi@samsung.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Hun-je Yeon <hunje.yeon@samsung.com>
service/resource-encapsulation/include/RCSRepresentation.h
service/resource-encapsulation/src/common/primitiveResource/src/RCSRepresentation.cpp

index 894c8ba..bd17166 100644 (file)
@@ -33,10 +33,15 @@ namespace OIC
     namespace Service
     {
 
+        /**
+         * This class describes a resource representation.
+         *
+         * @see RCSResourceObject
+         * @see RCRemoteResourceObject
+         */
         class RCSRepresentation
         {
         public:
-
             RCSRepresentation();
 
             explicit RCSRepresentation(const std::string& uri);
@@ -49,43 +54,108 @@ namespace OIC
                     const std::vector< std::string >& resourceTypes,
                     const RCSResourceAttributes& attrs);
 
+            /**
+             * Returns the uri.
+             */
             std::string getUri() const;
 
-            void setUri(const std::string& uri);
-            void setUri(std::string&& uri);
+            /**
+             * Sets the uri of this representation.
+             */
+            void setUri(std::string uri);
 
+            /**
+             * Returns all interfaces added.
+             */
             const std::vector< std::string >& getInterfaces() const;
 
-            void addInterface(const std::string& interface);
-            void addInterface(std::string&& interface);
+            /**
+             * Adds an interface.
+             *
+             * @param interface an interface to add
+             */
+            void addInterface(std::string interface);
 
+            /**
+             * Removes all interfaces added.
+             */
             void clearInterfaces();
 
+            /**
+             * Returns all resource types added.
+             */
             const std::vector< std::string >& getResourceTypes() const;
 
-            void addResourceType(const std::string& resourceType);
-            void addResourceType(std::string&& resourceType);
 
+            /**
+             * Adds a resource type.
+             */
+            void addResourceType(std::string resourceType);
+
+            /**
+             * Removes all resource types.
+             */
             void clearResourceTypes();
 
+            /**
+             * Returns attributes set in this representation.
+             */
             const RCSResourceAttributes& getAttributes() const;
+
+            /**
+             * @overload
+             */
             RCSResourceAttributes& getAttributes();
 
+            /**
+             * Overwrite attributes.
+             *
+             * @param attrs new attributes.
+             */
             void setAttributes(const RCSResourceAttributes& attrs);
+
+            /**
+             * @overload
+             */
             void setAttributes(RCSResourceAttributes&& attrs);
 
+            /**
+             * Returns children of this representation.
+             */
             const std::vector< RCSRepresentation >& getChildren() const;
 
-            void addChild(const RCSRepresentation&);
-            void addChild(RCSRepresentation&&);
-
-            void setChildren(const std::vector< RCSRepresentation >&);
-            void setChildren(std::vector< RCSRepresentation >&&);
-
+            /**
+             * Adds a child to this representation.
+             *
+             * @param child a representation to be attached
+             */
+            void addChild(RCSRepresentation child);
+
+            /**
+             * Sets children of this representation.
+             *
+             * @param children new children
+             */
+            void setChildren(std::vector< RCSRepresentation > children);
+
+            /**
+             * Removse all children
+             */
             void clearChildren();
 
+            /**
+             * Converts OCRepresentation into RCSRepresentation.
+             *
+             * @see toOCRepresentation
+             */
             static RCSRepresentation fromOCRepresentation(const OC::OCRepresentation&);
 
+
+            /**
+             * Converts RCSRepresentation into OCRepresentation.
+             *
+             * @see fromOCRepresentation
+             */
             static OC::OCRepresentation toOCRepresentation(const RCSRepresentation&);
             static OC::OCRepresentation toOCRepresentation(RCSRepresentation&&);
 
index eb36858..79db0bd 100644 (file)
@@ -69,12 +69,7 @@ namespace OIC
             return m_uri;
         }
 
-        void RCSRepresentation::setUri(const std::string& uri)
-        {
-            m_uri = uri;
-        }
-
-        void RCSRepresentation::setUri(std::string&& uri)
+        void RCSRepresentation::setUri(std::string uri)
         {
             m_uri = std::move(uri);
         }
@@ -84,12 +79,7 @@ namespace OIC
             return m_interfaces;
         }
 
-        void RCSRepresentation::addInterface(const std::string& interface)
-        {
-            m_interfaces.push_back(interface);
-        }
-
-        void RCSRepresentation::addInterface(std::string&& interface)
+        void RCSRepresentation::addInterface(std::string interface)
         {
             m_interfaces.push_back(std::move(interface));
         }
@@ -104,12 +94,7 @@ namespace OIC
             return m_resourceTypes;
         }
 
-        void RCSRepresentation::addResourceType(const std::string& resourceType)
-        {
-            m_resourceTypes.push_back(resourceType);
-        }
-
-        void RCSRepresentation::addResourceType(std::string&& resourceType)
+        void RCSRepresentation::addResourceType(std::string resourceType)
         {
             m_resourceTypes.push_back(std::move(resourceType));
         }
@@ -139,22 +124,12 @@ namespace OIC
             m_attributes = std::move(attrs);
         }
 
-        void RCSRepresentation::addChild(const RCSRepresentation& child)
-        {
-            m_children.push_back(child);
-        }
-
-        void RCSRepresentation::addChild(RCSRepresentation&& child)
+        void RCSRepresentation::addChild(RCSRepresentation child)
         {
             m_children.push_back(std::move(child));
         }
 
-        void RCSRepresentation::setChildren(const std::vector< RCSRepresentation >& children)
-        {
-            m_children = children;
-        }
-
-        void RCSRepresentation::setChildren(std::vector< RCSRepresentation >&& children)
+        void RCSRepresentation::setChildren(std::vector< RCSRepresentation > children)
         {
             m_children = std::move(children);
         }