add doxygen comments for scene manager remote apis, and change interface name of...
authorjyong2.kim <jyong2.kim@samsung.com>
Thu, 3 Mar 2016 05:43:23 +0000 (14:43 +0900)
committerUze Choi <uzchoi@samsung.com>
Sun, 6 Mar 2016 05:30:29 +0000 (05:30 +0000)
- add doxygen comments for scene manager remote apis
- remove unsupported apis(apis for collection, scene, action remove)
- change api name in RemoteSceneAction
 (setExecutionParameter-> resetExecutionParameter)

Change-Id: I74fae9164a5a081cc17cefd59b8d2b2713dbb27a
Signed-off-by: Minji Park <minjii.park@samsung.com>
Signed-off-by: jyong2.kim <jyong2.kim@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/5319
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
service/scene-manager/include/RemoteScene.h
service/scene-manager/include/RemoteSceneAction.h
service/scene-manager/include/RemoteSceneCollection.h
service/scene-manager/include/RemoteSceneList.h
service/scene-manager/src/RemoteScene.cpp
service/scene-manager/src/RemoteSceneAction.cpp
service/scene-manager/src/RemoteSceneCollection.cpp
service/scene-manager/src/RemoteSceneList.cpp
service/scene-manager/unittests/RemoteSceneActionTest.cpp

index 95b2e2f119cadb01aa8655ea89fbccb2ca3288af..32aa8c17b293b2666127d846a9d57646c9d72039 100644 (file)
@@ -36,43 +36,124 @@ namespace OIC
         class SceneCollectionResourceRequestor;
         class SceneMemberResourceRequestor;
 
+        /*
+        * @class RemoteScene
+        *
+        * @brief RemoteScene class is an interface class to send a request to a Scene provided by
+        * SceneCollection resource on remote side. This class provides APIs for adding new
+        * SceneAction to the Scene and creating a new SceneAction instance, retrieving all
+        * SceneAction instances created before. And it also provides an API to execute a Scene
+        * on remote side.
+        */
         class RemoteScene
         {
             public:
                 typedef std::shared_ptr< RemoteScene > Ptr;
 
-                typedef std::function< void(RemoteSceneAction::Ptr, int eCode) >
+                /**
+                * Callback definition to be invoked a the response of addNewSceneAction is
+                * received.
+                *
+                * @param action created RemoteSceneAction instance pointer
+                * @param eCode the error code received
+                *
+                * @note Error code '200' stands for success, '400' for bad request,
+                * and '500' for internal error.
+                *
+                * @see addNewSceneAction
+                */
+                typedef std::function< void(RemoteSceneAction::Ptr action, int eCode) >
                     AddNewSceneActionCallback;
 
-                typedef std::function< void(const int eCode) >
-                    RemoveSceneActionCallback;
-
+                /**
+                * Callback definition to be invoked when a response of execute is
+                * received.
+                *
+                * @param sceneName name of the scene which is executed
+                * @param eCode the error code received
+                *
+                * @note Error code '200' stands for success, '400' for bad request,
+                * and '500' for internal error.
+                *
+                * @see execute
+                */
                 typedef std::function< void(const std::string &sceneName, int eCode) >
                     RemoteSceneExecuteCallback;
 
             public:
                 ~RemoteScene() = default;
 
+                /**
+                * Requests to add new SceneAction to the Scene on remote side and
+                * creates RemoteSceneAction instance corresponding to the created SceneAction.
+                *
+                * @param targetResource A pointer of discovered resource
+                * @param attrs AttributeS to set when the Scene executed
+                * @param cb A callback to receive created RemoteSceneAction instance
+                *
+                * @throws RCSInvalidParameterException If parameter is invalid.
+                *
+                * @note RemoteSceneAction instance is only produced by RemoteScene class
+                *
+                * @see RCSResourceAttributes
+                */
                 void addNewSceneAction(RCSRemoteResourceObject::Ptr targetResource,
-                                       const RCSResourceAttributes &,
-                                       AddNewSceneActionCallback);
+                    const RCSResourceAttributes &attrs, AddNewSceneActionCallback cb);
+
+                /**
+                * Requests to add new SceneAction to the Scene on remote side and
+                * creates RemoteSceneAction instance corresponding to the created SceneAction.
+                *
+                * @param targetResource A pointer of discovered resource
+                * @param key A key of an attribute
+                * @param value A value to be mapped against the key
+                * @param cb A callback to receive created RemoteSceneAction instance
+                *
+                * @throws RCSInvalidParameterException If parameter is invalid.
+                *
+                * @note RemoteSceneAction instance is only produced by RemoteScene class
+                *
+                * @see RCSResourceAttributes::Value
+                */
                 void addNewSceneAction(RCSRemoteResourceObject::Ptr targetResource,
                                        const std::string &key,
-                                       const RCSResourceAttributes::Value &,
-                                       AddNewSceneActionCallback);
-
-                void removeSceneAction(RemoteSceneAction::Ptr remoteSceneAction,
-                                       RemoveSceneActionCallback);
-                void removeSceneAction(RCSRemoteResourceObject::Ptr targetResource,
-                                       RemoveSceneActionCallback);
-
+                                       const RCSResourceAttributes::Value &value,
+                                       AddNewSceneActionCallback cb);
+
+                /**
+                * Gets all RemoteSceneAction instances included in the Scene.
+                *
+                * @return A vector of shared pointer of RemoteSceneAction instances
+                */
                 std::vector< RemoteSceneAction::Ptr > getRemoteSceneActions() const;
+
+                /**
+                * Gets RemoteSceneAction instance by using a certain discovered resource.
+                *
+                * @param targetResource A pointer of discovered resource
+                *
+                * @return A shared pointer of RemoteSceneAction instance
+                *
+                * @throws RCSInvalidParameterException If targetResource is invalid
+                */
                 RemoteSceneAction::Ptr getRemoteSceneAction(
                     const RCSRemoteResourceObject::Ptr targetResource) const;
 
+                /**
+                * Gets a name attribute of the Scene.
+                *
+                * @return A name of the Scene
+                */
                 std::string getName() const;
 
-                void execute(RemoteSceneExecuteCallback);
+                /**
+                * Requests to execute the Scene on remote side.
+                *
+                * @param cb A callback to receive result of Scene execution
+                *
+                * @throws RCSInvalidParameterException If callback is null
+                */
+                void execute(RemoteSceneExecuteCallback cb);
 
             private:
                 RemoteScene(
@@ -106,5 +187,4 @@ namespace OIC
     }
 }
 
-#endif /* SM_REMOTE_SCENE_H_ */
-
+#endif /* SM_REMOTE_SCENE_H_ */
\ No newline at end of file
index 8372cbb514999f5f6ba9b267d4d1999523f455d6..993943d23bfa13e86d3d51a333dacbe8cb370379 100644 (file)
@@ -34,23 +34,78 @@ namespace OIC
 
         class SceneMemberResourceRequestor;
 
+        /*
+        * @class RemoteSceneAction
+        *
+        * @brief RemoteSceneAction class indicates a unit of actions when a scene is executed.
+        * RemoteSceneAction instance is initialized with 3 essential parameters:
+        * a target resource, target attribute key, and its target value.
+        * And this class also provides APIs to update a target attribute information if one wants.
+        * Note that, adding a new RemoteSceneAction is done by sending a CoAP request to update a
+        * SceneMember resource's attribute.
+        */
         class RemoteSceneAction
         {
             public:
                 typedef std::shared_ptr< RemoteSceneAction > Ptr;
 
-                typedef std::function< void(int eCode) > setExecutionParameterCallback;
+                /**
+                * Callback definition to be invoked when a response of resetExecutionParameter is
+                * received.
+                *
+                * @param eCode the error code received on a remote-side scene resource server
+                *
+                * @note Error code '200' stands for success, '400' for bad request,
+                * and '500' for internal error.
+                *
+                * @see resetExecutionParameter
+                */
+                typedef std::function< void(int eCode) > ResetExecutionParameterCallback;
 
             public:
                 ~RemoteSceneAction() = default;
 
-                void setExecutionParameter(const std::string &key,
-                    const RCSResourceAttributes::Value &value, setExecutionParameterCallback);
-                void setExecutionParameter(
-                    const RCSResourceAttributes &attr, setExecutionParameterCallback);
-
+                /**
+                * Requests to reset the RemoteSceneAction parameters like
+                * a target attribute key and its value.
+                *
+                * @param key key of attribute
+                * @param value value to be mapped against the key
+                * @param cb A callback to receive the response
+                *
+                * @throws RCSInvalidParameterException If parameter is invalid.
+                *
+                * @see RCSResourceAttributes::Value
+                */
+                void resetExecutionParameter(const std::string &key,
+                    const RCSResourceAttributes::Value &value, ResetExecutionParameterCallback cb);
+
+                /**
+                * Requests to reset the RemoteSceneAction parameters like
+                * a target attribute key and its value.
+                *
+                * @param attr Attributes to set
+                * @param cb A callback to receive the response
+                *
+                * @throws RCSInvalidParameterException If parameter is invalid.
+                *
+                * @see RCSResourceAttributes
+                */
+                void resetExecutionParameter(
+                    const RCSResourceAttributes &attr, ResetExecutionParameterCallback cb);
+
+                /**
+                * Returns an execution parameter of the SceneAction.
+                *
+                * @return RCSResourceAttributes
+                */
                 RCSResourceAttributes getExecutionParameter() const;
 
+                /**
+                * Returns a target remote resource object of the RemoteSceneAction instance
+                *
+                * @return pointer of RCSRemoteResourceObject
+                */
                 RCSRemoteResourceObject::Ptr getRemoteResourceObject() const;
 
             private:
@@ -61,7 +116,7 @@ namespace OIC
                                   const std::string &key, const RCSResourceAttributes::Value &);
 
                 void onExecutionParameterSet(int, const RCSResourceAttributes &,
-                    const setExecutionParameterCallback &);
+                    const ResetExecutionParameterCallback &);
 
             private:
                 std::string m_sceneName;
index b0f86ba373f2aa6985c7ca185343c1cee5147f4a..d7b0e2fe875cd2649eb27286595aa5d817881951 100644 (file)
@@ -37,30 +37,106 @@ namespace OIC
 
         class SceneCollectionResourceRequestor;
 
+        /**
+        * @class RemoteSceneCollection
+        *
+        * @brief RemoteSceneCollection class is an interface class to send a request to
+        * SceneCollection resource on remote side. This class provides APIs for adding new Scene
+        * to the SceneCollection resource and creating a new RemoteSceneCollection instance
+        * corresponding to the created SceneCollection resource. This class also supports
+        * retrieving all Scene instances created before. Besides, it provides APIs for retrieving
+        * and updating attribute values of the SceneCollection resource like name attribute.
+        */
         class RemoteSceneCollection
         {
             public:
                 typedef std::shared_ptr< RemoteSceneCollection > Ptr;
 
-                typedef std::function< void(RemoteScene::Ptr, int eCode) >
+                /**
+                * Callback definition to be invoked when a response of addNewScene is
+                * received.
+                *
+                * @param scene created RemoteScene instance pointer
+                * @param eCode the error code received from the SceneCollection on remote
+                *
+                * @note Error code '200' stands for success, '400' for bad request,
+                * and '500' for internal error.
+                *
+                * @see addNewScene
+                */
+                typedef std::function< void(RemoteScene::Ptr scene, int eCode) >
                     AddNewSceneCallback;
 
-                typedef std::function< void(int eCode) > RemoveSceneCallback;
-
+                /**
+                * Callback definition to be invoked when a response of setName is
+                * received.
+                *
+                * @param eCode the error code received from the SceneCollection on remote
+                *
+                * @note Error code '200' stands for success, '400' for bad request,
+                * and '500' for internal error.
+                *
+                * @see setName
+                */
                 typedef std::function< void(int eCode) > SetNameCallback;
 
             public:
                 ~RemoteSceneCollection() = default;
 
-                void addNewScene(const std::string &name, AddNewSceneCallback);
-                void removeScene(RemoteScene::Ptr, RemoveSceneCallback);
-
+                /**
+                * Requests to add new Scene to the SceneCollection resource on remote side
+                * and creates RemoteScene instance corresponding to the created Scene.
+                *
+                * @param name A name of Scene to add
+                * @param cb A callback to receive created RemoteScene instance
+                *
+                * @throws RCSInvalidParameterException If parameter is invalid
+                *
+                * @note RemoteScene instance is only produced by RemoteSceneCollection class.
+                * @note Name of Scene must be unique in one SceneCollection
+                */
+                void addNewScene(const std::string &name, AddNewSceneCallback cb);
+
+                /**
+                * Gets all RemoteScene instances from RemoteSceneCollection instance.
+                *
+                * @return A unordered_map of shared pointers of RemoteScene instances
+                */
                 std::unordered_map< std::string, RemoteScene::Ptr > getRemoteScenes() const;
+
+                /**
+                * Gets RemoteScene instance with a specific Scene name.
+                *
+                * @param sceneName name of the Scene to get
+                *
+                * @return A shared pointer of RemoteScene instance
+                *
+                * @throws RCSInvalidParameterException If sceneName is invalid
+                */
                 RemoteScene::Ptr getRemoteScene(const std::string &sceneName) const;
 
-                void setName(const std::string &name, SetNameCallback);
+                /**
+                * Request to set a name attribute of the SceneCollection resource on remote side.
+                *
+                * @param name A name of the SceneCollection
+                * @param cb A callback to receive the response
+                *
+                * @throws RCSInvalidParameterException If callback is null
+                */
+                void setName(const std::string &name, SetNameCallback cb);
+
+                /**
+                * Gets a name attribute of the SceneCollection resource
+                *
+                * @return A name of the SceneCollection
+                */
                 std::string getName() const;
 
+                /**
+                * Gets an id attribute of the SceneCollection resource.
+                *
+                * @return an id of the SceneCollection resource
+                */
                 std::string getId() const;
 
             private:
@@ -76,7 +152,7 @@ namespace OIC
                 RemoteScene::Ptr createRemoteScene(const std::string &);
 
                 void onSceneAddedRemoved(int, const std::string &name, int,
-                                         const AddNewSceneCallback &, const RemoveSceneCallback &);
+                                         const AddNewSceneCallback &);
 
                 void onNameSet(int, const std::string &, const SetNameCallback &);
 
@@ -94,5 +170,4 @@ namespace OIC
     }
 }
 
-#endif /* SM_REMOTE_SCENECOLLECTION_H_ */
-
+#endif /* SM_REMOTE_SCENECOLLECTION_H_ */
\ No newline at end of file
index d02ce334b48f7c62e8e33e6827bead8a5c72f160..183c144dc2ed759a2ff60619035108d463eda780 100644 (file)
@@ -33,35 +33,125 @@ namespace OIC
 {
     namespace Service
     {
-
         class SceneListResourceRequestor;
 
+        /**
+        * @class RemoteSceneList
+        *
+        * @brief RemoteSceneList class is an interface class to send a request to
+        * SceneList resource on remote side. This class provides APIs for adding
+        * new SceneCollection resource to the SceneList resource and
+        * creating a RemoteSceneCollection instance corresponding to the
+        * created SceneCollection resource. This class also supports retrieving the existing
+        * instances as well as setting/getting a name attribute of the SceneList resource.
+        */
         class RemoteSceneList
-            : public std::enable_shared_from_this< RemoteSceneList >
         {
             public:
                 typedef std::unique_ptr< RemoteSceneList > Ptr;
 
-                typedef std::function< void(RemoteSceneList::Ptr, int eCode) >
+                /**
+                * Callback definition to be invoked when a response of createInstance is
+                * received.
+                *
+                * @param list Created RemoteSceneList instance pointer
+                * @param eCode The error code received from the SceneList on remote side
+                *
+                * @note Error code '200' stands for success, '400' for bad request,
+                * and '500' for internal error.
+                *
+                * @see createInstance
+                */
+                typedef std::function< void(RemoteSceneList::Ptr list, int eCode) >
                     CreateInstanceCallback;
 
-                typedef std::function< void(RemoteSceneCollection::Ptr, int eCode) >
+                /**
+                * Callback definition to be invoked when a response of addNewSceneCollection is
+                * received.
+                *
+                * @param collection Created RemoteSceneCollection instance pointer
+                * @param eCode The error code received from the SceneList on remote
+                *
+                * @note Error code '200' stands for success, '400' for bad request,
+                * and '500' for internal error.
+                *
+                * @see addNewSceneCollection
+                */
+                typedef std::function< void(RemoteSceneCollection::Ptr collection, int eCode) >
                     AddNewSceneCollectionCallback;
 
+                /**
+                * Callback definition to be invoked when a response of setName is
+                * received.
+                *
+                * @param eCode the error code received from the SceneList on remote
+                *
+                * @note Error code '200' stands for success, '400' for bad request,
+                * and '500' for internal error.
+                *
+                * @see setName
+                */
                 typedef std::function< void(int eCode) > SetNameCallback;
 
             public:
                 ~RemoteSceneList() = default;
 
+                /**
+                * Creates RemoteSceneList instance with provided RCSRemoteResourceObject of
+                * discovered SceneList resource on remote side.
+                *
+                * To create RemoteSceneList instance, discovery of SceneList resource
+                * which has 'oic.wk.scenelist' as resource type is required,
+                * and the found resource should be provided as parameter.
+                * After that, one can acceess existing SceneCollections, Scenes, and SceneActions
+                * instances that are already produced at the SceneList resource.
+                * Created RemoteSceneList will be delivered to CreateInstanceCallback.
+                *
+                * @param sceneListResource RCSRemoteResourceObject pointer of SceneList
+                * @param cb A callback to receive the response
+                *
+                * @throws RCSInvalidParameterException If parameter is invalid.
+                *
+                * @see RCSRemoteResourceObject
+                */
                 static void createInstance(
-                    RCSRemoteResourceObject::Ptr sceneListResource, CreateInstanceCallback);
-
-                void addNewSceneCollection(AddNewSceneCollectionCallback);
-                void removeSceneCollection(RemoteSceneCollection::Ptr);
-
+                    RCSRemoteResourceObject::Ptr sceneListResource, CreateInstanceCallback cb);
+
+                /**
+                * Requests to add new SceneCollection resource to the SceneList resource on remote
+                * side and creates RemoteSceneCollection instance corresponding to the created
+                * SceneCollection resource.
+                *
+                * @param cb A callback to receive created RemoteSceneCollection instance
+                *
+                * @throws RCSInvalidParameterException If callback is null.
+                *
+                * @note RemoteSceneCollection instance is only produced by RemoteSceneList class.
+                */
+                void addNewSceneCollection(AddNewSceneCollectionCallback cb);
+
+                /**
+                * Gets all RemoteSceneCollection instances stored in the RemoteSceneList instance.
+                *
+                * @return A vector of shared pointers of RemoteSceneCollection instances
+                */
                 std::vector< RemoteSceneCollection::Ptr > getRemoteSceneCollections() const;
 
-                void setName(const std::string &name, SetNameCallback);
+                /**
+                * Request to set a name attribute of the SceneList resource on remote side.
+                *
+                * @param name A name of the SceneList
+                * @param cb A callback to receive the response
+                *
+                * @throws RCSInvalidParameterException If callback is null.
+                */
+                void setName(const std::string &name, SetNameCallback cb);
+
+                /**
+                * Gets a name attribute of the SceneList resource.
+                *
+                * @return A name of the SceneList resource
+                */
                 std::string getName() const;
 
             private:
@@ -77,7 +167,7 @@ namespace OIC
                     const std::string &link, const std::string &id, const std::string &name);
 
                 std::shared_ptr< SceneListResourceRequestor > getListResourceRequestor() const;
-                
+
                 std::vector<std::pair<RCSResourceAttributes, std::vector<RCSResourceAttributes>>>
                     parseSceneListFromAttributes(const RCSResourceAttributes &);
 
@@ -95,11 +185,10 @@ namespace OIC
                 std::vector< RemoteSceneCollection::Ptr > m_remoteSceneCollections;
                 mutable std::mutex m_nameLock;
                 mutable std::mutex m_collectionLock;
-                std::shared_ptr< SceneListResourceRequestor > m_requestorPtr;
+                std::shared_ptr< SceneListResourceRequestor > m_requestor;
         };
 
     }
 }
 
-#endif /* SM_REMOTE_SCENELIST_H_ */
-
+#endif /* SM_REMOTE_SCENELIST_H_ */
\ No newline at end of file
index d5230b4f7deb789e2e2e82ed31c28a0f5a3b1022..5956d8b6a09d48ce32c07dc5660975152b7a2dc8 100644 (file)
@@ -48,10 +48,7 @@ namespace OIC
             {
                 throw RCSInvalidParameterException("RCSRemoteResoureObject value is null");
             }
-            if (attrs.empty())
-            {
-                throw RCSInvalidParameterException("RCSResourceAttributes is empty");
-            }
+
             if (!clientCB)
             {
                 throw RCSInvalidParameterException{ "addNewSceneAction : Callback is NULL" };
@@ -70,36 +67,12 @@ namespace OIC
             const std::string &key, const RCSResourceAttributes::Value &value,
             AddNewSceneActionCallback clientCB)
         {
-            if (targetResource == nullptr)
-            {
-                throw RCSInvalidParameterException("RCSRemoteResoureObject value is null");
-            }
-            if (key.empty())
-            {
-                throw RCSInvalidParameterException("Scene action key value is empty");
-            }
-            if (!clientCB)
-            {
-                throw RCSInvalidParameterException{ "addNewSceneAction : Callback is NULL" };
-            }
-
             RCSResourceAttributes attrs;
             attrs[key] = RCSResourceAttributes::Value(value);
 
             addNewSceneAction(targetResource, attrs, clientCB);
         }
 
-        void RemoteScene::removeSceneAction(RemoteSceneAction::Ptr, RemoveSceneActionCallback)
-        {
-
-        }
-
-        void RemoteScene::removeSceneAction(RCSRemoteResourceObject::Ptr /* rargetResource*/,
-                                            RemoveSceneActionCallback)
-        {
-
-        }
-
         std::vector< RemoteSceneAction::Ptr > RemoteScene::getRemoteSceneActions() const
         {
             std::lock_guard< std::mutex > actionlock(m_sceneActionLock);
@@ -157,7 +130,7 @@ namespace OIC
         {
             SceneMemberResourceRequestor::Ptr memRequestor
                 = m_requestor->getSceneMemberResourceRequestor(targetHref);
-            
+
             if (memRequestor == nullptr)
             {
                 return nullptr;
@@ -179,7 +152,7 @@ namespace OIC
             const std::string &key, const RCSResourceAttributes::Value &value)
         {
             std::string targetHref = target->getAddress() + target->getUri();
-            
+
             SceneMemberResourceRequestor::Ptr foundMemberRequestor
                 = m_requestor->getSceneMemberResourceRequestor(targetHref);
 
@@ -208,7 +181,7 @@ namespace OIC
                 if (newAction)
                     result = SCENE_RESPONSE_SUCCESS;
             }
-            
+
             clientCB(newAction, result);
         }
 
index 8c7b5be15c1f3e9e1fdcfb0615d47b4fd9570e66..314ad16de6ff338b751fa4e68c92b34dfb010d9d 100644 (file)
@@ -47,35 +47,22 @@ namespace OIC
             m_attributes[key] = value;
         }
 
-        void RemoteSceneAction::setExecutionParameter(const std::string &key,
+        void RemoteSceneAction::resetExecutionParameter(const std::string &key,
                                        const RCSResourceAttributes::Value &value,
-                                       setExecutionParameterCallback clientCB)
+                                       ResetExecutionParameterCallback clientCB)
         {
-            if (key.empty())
-            {
-                throw RCSInvalidParameterException("Scene action key value is empty");
-            }
-            if (!clientCB)
-            {
-                throw RCSInvalidParameterException{ "setExecutionParameter : Callback is NULL" };
-            }
-
             RCSResourceAttributes attr;
             attr[key] = RCSResourceAttributes::Value(value);
 
-            setExecutionParameter(attr, std::move(clientCB));
+            resetExecutionParameter(attr, std::move(clientCB));
         }
 
-        void RemoteSceneAction::setExecutionParameter(const RCSResourceAttributes &attr,
-            setExecutionParameterCallback clientCB)
+        void RemoteSceneAction::resetExecutionParameter(const RCSResourceAttributes &attr,
+            ResetExecutionParameterCallback clientCB)
         {
-            if (attr.empty())
-            {
-                throw RCSInvalidParameterException("RCSResourceAttributes is empty");
-            }
             if (!clientCB)
             {
-                throw RCSInvalidParameterException{ "setExecutionParameter : Callback is NULL" };
+                throw RCSInvalidParameterException{ "resetExecutionParameter : Callback is NULL" };
             }
 
             SceneMemberResourceRequestor::InternalAddSceneActionCallback internalCB
@@ -98,7 +85,7 @@ namespace OIC
         }
 
         void RemoteSceneAction::onExecutionParameterSet(int eCode, const RCSResourceAttributes &attr,
-            const setExecutionParameterCallback &clientCB)
+            const ResetExecutionParameterCallback &clientCB)
         {
             int result = SCENE_CLIENT_BADREQUEST;
             if (eCode == SCENE_RESPONSE_SUCCESS)
@@ -110,6 +97,5 @@ namespace OIC
 
             clientCB(result);
         }
-
     }
-}
\ No newline at end of file
+}
index 0bb51b21456fefa5878c206fee4cff7eb1639907..f0ffd051dfc196ac9593ef99625c1b3fbeb8b586 100644 (file)
@@ -55,17 +55,11 @@ namespace OIC
             SceneCollectionResourceRequestor::InternalSceneRequestCallback internalCB
                 = std::bind(&RemoteSceneCollection::onSceneAddedRemoved, this,
                             std::placeholders::_1, std::placeholders::_2,
-                            std::placeholders::_3, std::move(clientCB), nullptr);
+                            std::placeholders::_3, std::move(clientCB));
 
             m_requestor->requestSceneCreation(name, internalCB);
         }
 
-        void RemoteSceneCollection::removeScene(RemoteScene::Ptr,
-                                                RemoveSceneCallback /* clientCB */)
-        {
-
-        }
-
         std::unordered_map< std::string, RemoteScene::Ptr >
             RemoteSceneCollection::getRemoteScenes() const
         {
@@ -147,7 +141,7 @@ namespace OIC
                             SCENE_CONNECTIVITY,
                             targetLinkAttrs.at(SCENE_KEY_RT).get< std::vector< std::string > >(),
                             targetLinkAttrs.at(SCENE_KEY_IF).get< std::vector< std::string > >());
-                            
+
                         std::string mappingInfoKey
                             = mappingInfo.at(SCENE_KEY_MEMBERPROPERTY).get< std::string >();
                         RCSResourceAttributes::Value mappingInfoValue
@@ -178,7 +172,7 @@ namespace OIC
 
         void RemoteSceneCollection::onSceneAddedRemoved(int reqType,
             const std::string &name, int eCode,
-            const AddNewSceneCallback &addCB, const RemoveSceneCallback &)
+            const AddNewSceneCallback &addCB)
         {
             switch (reqType)
             {
index 9778ed74a460cedbbca762d0cc303e6e6978297f..8a7a9e71ad027bb2790e626a86776b41442679de 100644 (file)
@@ -35,7 +35,7 @@ namespace OIC
     {
 
         RemoteSceneList::RemoteSceneList(SceneListResourceRequestor::Ptr requestor)
-            : m_requestorPtr{ requestor }
+            : m_requestor{ requestor }
         {
 
         }
@@ -83,12 +83,7 @@ namespace OIC
                 std::placeholders::_1, std::placeholders::_2, std::placeholders::_3,
                 std::placeholders::_4, std::move(clientCB));
 
-            m_requestorPtr->requestSceneCollectionCreation("", internalCB);
-        }
-
-        void RemoteSceneList::removeSceneCollection(RemoteSceneCollection::Ptr)
-        {
-
+            m_requestor->requestSceneCollectionCreation("", internalCB);
         }
 
         std::vector< RemoteSceneCollection::Ptr >
@@ -109,7 +104,7 @@ namespace OIC
                 = std::bind(&RemoteSceneList::onNameSet, this,
                 std::placeholders::_1, name, std::move(clientCB));
 
-            m_requestorPtr->requestSetName(name, internalCB);
+            m_requestor->requestSetName(name, internalCB);
         }
 
         std::string RemoteSceneList::getName() const
@@ -158,7 +153,7 @@ namespace OIC
 
                     RemoteSceneCollection::Ptr newCollection
                         = newList->createRemoteSceneCollection(
-                                    host + collection.at("uri").get< std::string >(),
+                                    host + collection.at(SCENE_KEY_URI).get< std::string >(),
                                     collection.at(SCENE_KEY_ID).get< std::string >(),
                                     collection.at(SCENE_KEY_NAME).get< std::string >());
 
@@ -192,7 +187,7 @@ namespace OIC
 
                 RemoteSceneCollection::Ptr newCollection(
                     new RemoteSceneCollection(pRequestor, id, name));
-                
+
                 {
                     std::lock_guard< std::mutex > collectionlock(m_collectionLock);
                     m_remoteSceneCollections.push_back(newCollection);
@@ -209,7 +204,7 @@ namespace OIC
 
         SceneListResourceRequestor::Ptr RemoteSceneList::getListResourceRequestor() const
         {
-            return m_requestorPtr;
+            return m_requestor;
         }
 
         std::vector<std::pair<RCSResourceAttributes, std::vector<RCSResourceAttributes>>>
@@ -276,7 +271,7 @@ namespace OIC
                 m_name = name;
                 result = SCENE_RESPONSE_SUCCESS;
             }
-            
+
             clientCB(result);
         }
 
index 9a65e1ba696e83c50c51050262205b02b88a3555..ac86fa9d593c4d8acf4392f35b8b2ac1118b5ab0 100644 (file)
@@ -1,6 +1,6 @@
 //******************************************************************
 //
-// Copyright 2015 Samsung Electronics All Rights Reserved.
+// Copyright 2016 Samsung Electronics All Rights Reserved.
 //
 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 //
@@ -205,11 +205,11 @@ TEST_F(RemoteSceneActionTest, updateSceneAction)
 
     waitForCallback();
 
-    pSceneAction->setExecutionParameter(
+    pSceneAction->resetExecutionParameter(
         KEY, RCSResourceAttributes::Value("on"), std::bind(
         &RemoteSceneActionTest::onActionUpdated, this, placeholders::_1));
 
     waitForCallback();
 
     ASSERT_EQ("on", pSceneAction->getExecutionParameter().at(KEY).get< string >());
-}
+}
\ No newline at end of file