1 //******************************************************************
3 // Copyright 2016 Samsung Electronics All Rights Reserved.
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
11 // http://www.apache.org/licenses/LICENSE-2.0
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
21 #ifndef SM_SCENECOLLECTION_H_
22 #define SM_SCENECOLLECTION_H_
31 class SceneCollectionResource;
34 * @class SceneCollection
36 * @brief SceneCollection class is an interface class to manage SceneCollection resource.
37 * This class provides APIs to create a new Scene instance and retrieve all Scene instances
38 * created before. Besides, it provide APIs for retrieving and updating attribute values
45 typedef std::shared_ptr< SceneCollection > Ptr;
48 SceneCollection(const std::shared_ptr< SceneCollectionResource >&);
49 friend class SceneList;
54 * Adds new Scene instance to SceneCollection resource
56 * @param sceneName A scene's name
58 * @return A shared pointer of Scene instance
60 * @throw RCSInvalidParameterException if scene name is empty
61 * @throw RCSInvalidParameterException if scene name is dupltcated
63 * @note Scene instance is only produced by SceneCollection class
64 * @note Scene's name must unique in one SceneCollection resource
66 Scene::Ptr addNewScene(const std::string& sceneName);
69 * Gets all Scene instances from SceneCollection resource
71 * @return A unordered_map of shared pointers of Scene instances with a Scene's name
73 std::unordered_map< std::string, Scene::Ptr > getScenes() const;
76 * Gets a Scene instance with a specific Scene's name.
78 * @param sceneName A Scene's name
80 * @return A shared pointer of Scene instance
82 * @throws RCSInvalidParameterException
83 * if Scene's name does not exist in SceneCollection resource
85 Scene::Ptr getScene(const std::string& sceneName) const;
88 * Sets a name attribute of SceneCollection resource
90 * @param name A SceneCollection resource's name
92 void setName(const std::string& name);
95 * Gets a name attribute from SceneCollection resource.
97 * @return A SceneCollection resource's name
99 std::string getName() const;
102 * Gets a Id attribute of SceneCollection resource.
104 * @return A SceneCollection resource's Id
107 std::string getId() const;
110 std::shared_ptr< SceneCollectionResource > m_sceneCollectionResource;
113 } /* namespace Service */
114 } /* namespace OIC */
116 #endif /* SM_SCENECOLLECTION_H_ */