Add API doxygen to SceneManager Local-side interface
authorwonny <jw_wonny.cha@samsung.com>
Wed, 2 Mar 2016 13:51:21 +0000 (22:51 +0900)
committerUze Choi <uzchoi@samsung.com>
Thu, 3 Mar 2016 09:24:33 +0000 (09:24 +0000)
- SceneList/SceneCollection/Scene/SceneAction

Change-Id: I555fc6f92ca097cb0c982fd374aa47f31a79d1c1
Signed-off-by: wonny <jw_wonny.cha@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/5307
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
resource/docs/Doxyfile
service/scene-manager/include/Scene.h
service/scene-manager/include/SceneAction.h
service/scene-manager/include/SceneCollection.h
service/scene-manager/include/SceneList.h

index 4ec0ec9..4a56ad0 100644 (file)
@@ -677,7 +677,9 @@ INPUT                  = . \
                          ../../service/things-manager/sdk/inc \
                          ../../service/easy-setup/sdk/common \
                          ../../service/easy-setup/sdk/enrollee/api \
-                         ../../service/resource-directory/include
+                        ../../service/resource-directory/include \
+                        ../../service/scene-manager/include \
+                        
 
 # This tag can be used to specify the character encoding of the source files
 # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
index 92d23ba..bc45fd1 100755 (executable)
@@ -30,9 +30,25 @@ namespace OIC
     namespace Service
     {
         class SceneCollectionResource;
+
+        /**
+         * @class Scene
+         *
+         * @brief Scene class is an interface class to manage scenes provided by SceneCollection
+         * resource. This class provide APIs for creating a new SceneAction instance, retrieving all
+         * SceneAction instances created before. And it provides an API to execute a scene.
+         *
+         */
         class Scene
         {
         public:
+
+            /**
+             * @class InvalidAddMemberRequestException
+             *
+             * @brief If request of adding member is invalid, throw InvalidMemberRequestException.
+             * Adding member is invalid that scene member resource is already registered.
+             */
             class InvalidAddMemberRequestException: public RCSException
             {
             public:
@@ -41,6 +57,12 @@ namespace OIC
             };
 
             typedef std::shared_ptr< Scene > Ptr;
+
+            /**
+             * Typedef for callback of execute APIs
+             *
+             * @see execute
+             */
             typedef std::function< void(int) >  ExecuteCallback;
 
         private:
@@ -49,21 +71,83 @@ namespace OIC
             friend class SceneCollection;
 
         public:
-            SceneAction::Ptr addNewSceneAction(const RCSRemoteResourceObject::Ptr&,
-                    const RCSResourceAttributes&);
-            SceneAction::Ptr addNewSceneAction(const RCSRemoteResourceObject::Ptr&,
-                    const std::string&, const RCSResourceAttributes::Value&);
+            /**
+             * Adds new SceneAction instance to the Scene instance
+             *
+             * @param RCSRemoteResourceObjectPtr        A pointer of discovered resource
+             * @param attr                              A attribute set of key and value
+             *
+             * @return A shared pointer of SceneAction instance
+             *
+             * @throws RCSInvalidParameterException if RCSRemoteResourceObjectPtr is nullptr
+             * @throws InvalidAddMemberRequestException if SceneMember is already registered
+             *
+             * @note SceneAction instance is only produced by Scene class
+             *
+             * @see RCSResourceAttributes
+             */
+            SceneAction::Ptr addNewSceneAction(
+                    const RCSRemoteResourceObject::Ptr& RCSRemoteResourceObjectPtr,
+                    const RCSResourceAttributes& attr);
 
+            /**
+             * Adds new SceneAction instance to the Scene instance
+             *
+             * @param RCSRemoteResourceObjectPtr        A pointer of discovered resource
+             * @param key                               A key of attributes
+             * @param value                             A value to be mapped against the key
+             *
+             * @return A shared pointer of SceneAction instance
+             *
+             * @throws RCSInvalidParameterException if RCSRemoteResourceObjectPtr is nullptr
+             * @throws InvalidAddMemberRequestException
+             *         if scene member resource is already registered
+             *
+             * @note SceneAction instance is only produced by Scene class
+             *
+             * @see RCSResourceAttributes
+             */
+            SceneAction::Ptr addNewSceneAction(
+                    const RCSRemoteResourceObject::Ptr& RCSRemoteResourceObjectPtr,
+                    const std::string& key, const RCSResourceAttributes::Value& value);
+
+            /**
+             * Gets SceneAction using discovered resource
+             *
+             * @param RCSRemoteResourceObjectPtr        A pointer of discovered resource
+             *
+             * @return A shared pointer of SceneAction
+             *
+             * @throws RCSInvalidParameterException
+             * if RCSRemoteResourceObjectPtr is unknown resource
+             */
             SceneAction::Ptr getSceneAction(
-                    const RCSRemoteResourceObject::Ptr&) const;
+                    const RCSRemoteResourceObject::Ptr& RCSRemoteResourceObjectPtr) const;
+
+            /**
+             * Gets all SceneActions include current Scene
+             *
+             * @return A vector of shared pointer of SceneAction instance
+             *
+             */
             std::vector<SceneAction::Ptr> getSceneActions() const ;
 
+            /**
+             * Gets Scene's name provided SceneCollection resource
+             *
+             * @return Scene's name
+             */
             std::string getName() const;
 
             void removeSceneAction(const SceneAction::Ptr&);
             void removeSceneAction(const RCSRemoteResourceObject::Ptr&);
 
-            void execute(ExecuteCallback);
+            /**
+             * Requests executing Scene to SceneCollection resource
+             *
+             * @param cb                        A callback to execute Scene
+             */
+            void execute(ExecuteCallback cb);
 
         private:
             std::string m_name;
index a563a05..bbdcecd 100755 (executable)
@@ -29,6 +29,16 @@ namespace OIC
     namespace Service
     {
         class SceneMemberResource;
+
+        /**
+         * @class SceneAction
+         *
+         * @brief SceneAction class indicates a unit of actions when a scene is executed.
+         * SceneAction instance is initialized with 3 essential parameters: a target resource,
+         * target attribute key, and its target value. And this class also provide APIs to update
+         * a target attribute information if one wants
+         *
+         */
         class SceneAction
         {
         public:
@@ -43,10 +53,39 @@ namespace OIC
             friend class Scene;
 
         public:
-            void setExecutionParameter(const std::string&, RCSResourceAttributes::Value);
-            void setExecutionParameter(const RCSResourceAttributes&);
+            /**
+             * Sets attributes of the SceneMember resource when the Scene is executed
+             *
+             * @param key                   A key of attributes
+             * @param value                 A value to be mapped against the key
+             *
+             * @see RCSResourceAttributes
+             */
+            void setExecutionParameter(const std::string& key, RCSResourceAttributes::Value value);
+
+            /**
+             * Sets attributes of the SceneMember resource when the Scene is executed
+             *
+             * @param attr                  Attributes to set
+             *
+             * @see RCSResourceAttributes
+             */
+            void setExecutionParameter(const RCSResourceAttributes& attr);
 
+            /**
+             * Gets execution parameter of the SceneAction instance
+             *
+             * @return attributes of SceneMember resource
+             *
+             * @see RCSResourceAttributes
+             */
             const RCSResourceAttributes getExecutionParameter();
+
+            /**
+             * Gets remote resource object of SceneMember resource
+             *
+             * @return RCSRemoteResourceObject
+             */
             RCSRemoteResourceObject::Ptr getRemoteResourceObject() const;
 
         private:
index 4a4cf03..fef628c 100755 (executable)
@@ -29,6 +29,16 @@ namespace OIC
     namespace Service
     {
         class SceneCollectionResource;
+
+        /**
+         * @class SceneCollection
+         *
+         * @brief SceneCollection class is an interface class to manage SceneCollection resource.
+         * This class provides APIs to create a new Scene instance and retrieve all Scene instances
+         * created before. Besides, it provide APIs for retrieving and updating attribute values
+         * like name attribute
+         *
+         */
         class SceneCollection
         {
         public:
@@ -39,14 +49,61 @@ namespace OIC
             friend class SceneList;
 
         public:
-            Scene::Ptr addNewScene(const std::string&);
+
+            /**
+             * Adds new Scene instance to SceneCollection resource
+             *
+             * @param sceneName              A scene's name
+             *
+             * @return A shared pointer of Scene instance
+             *
+             * @note Scene instance is only produced by SceneCollection class
+             * @note Scene's name must unique in one SceneCollection resource
+             */
+            Scene::Ptr addNewScene(const std::string& sceneName);
+
+            /**
+             * Gets all Scene instances from SceneCollection resource
+             *
+             * @return A unordered_map of shared pointers of Scene instances with a Scene's name
+             */
             std::unordered_map< std::string, Scene::Ptr > getScenes() const;
-            Scene::Ptr getScene(const std::string&) const;
+
+            /**
+             * Gets a Scene instance with a specific Scene's name.
+             *
+             * @param sceneName             A Scene's name
+             *
+             * @return A shared pointer of Scene instance
+             *
+             * @throws RCSInvalidParameterException
+             * if Scene's name does not exist in SceneCollection resource
+             */
+            Scene::Ptr getScene(const std::string& sceneName) const;
+
 
             void removeScene(Scene::Ptr);
 
-            void setName(const std::string&);
+            /**
+             * Sets a name attribute of SceneCollection resource
+             *
+             * @param name               A SceneCollection resource's name
+             */
+            void setName(const std::string& name);
+
+            /**
+             * Gets a name attribute from SceneCollection resource.
+             *
+             * @return A SceneCollection resource's name
+             */
             std::string getName() const;
+
+            /**
+             * Gets a Id attribute of SceneCollection resource.
+             *
+             * @return A SceneCollection resource's Id
+             *
+             */
             std::string getId() const;
 
         private:
index 56898fe..132ba56 100755 (executable)
@@ -30,18 +30,58 @@ namespace OIC
     namespace Service
     {
         class SceneListResource;
+        /**
+         * @class SceneList
+         *
+         * @brief SceneList class is an interface class to manage SceneList resource. This class
+         * provides APIs for creating a new SceneCollection instance and retrieving the existing
+         * instances as well as for setting/getting a name attribute of SceneList resource.
+         *
+         */
         class SceneList
         {
         private:
             ~SceneList() = default;
 
         public:
+            /**
+             * Gets static instance of SceneList
+             *
+             * @return SceneList instance
+             *
+             */
             static SceneList* getInstance();
+
+            /**
+             * Adds new SceneCollection instance
+             *
+             * @return A shared pointer of SceneCollection instance
+             *
+             * @note SceneCollection instance is only produced by SceneList class
+             */
             SceneCollection::Ptr addNewSceneCollection();
+
+            /**
+             * Gets all SceneCollection instances stored in SceneList resource
+             *
+             * @return A vector of shared pointers of SceneCollection instances
+             */
             std::vector<SceneCollection::Ptr> getSceneCollections() const;
+
             void removeSceneCollection(SceneCollection::Ptr);
 
-            void setName(const std::string&);
+            /**
+             * Sets a name attribute of SceneList resource
+             *
+             * @param sceneListName               A SceneList resource's name
+             */
+            void setName(const std::string& sceneListName);
+
+            /**
+             * Gets a name attribute of SceneList resource
+             *
+             * @return A SceneList resource's name
+             */
             std::string getName() const;
         };
     } /* namespace Service */