SceneManager init Code
[platform/upstream/iotivity.git] / service / scene-manager / src / SceneCollection.h
1 //******************************************************************
2 //
3 // Copyright 2016 Samsung Electronics All Rights Reserved.
4 //
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
6 //
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
10 //
11 //      http://www.apache.org/licenses/LICENSE-2.0
12 //
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.
18 //
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
20
21 #ifndef SM_SCENECOLLECTION_H_
22 #define SM_SCENECOLLECTION_H_
23
24 #include <functional>
25 #include <memory>
26
27 #include "RCSResourceObject.h"
28 #include "RCSRemoteResourceObject.h"
29 #include "SceneMemberObject.h"
30 #include "Scene.h"
31
32 namespace OIC
33 {
34     namespace Service
35     {
36         class Scene;
37         class SceneCollection
38         {
39         public:
40             typedef std::shared_ptr< SceneCollection > Ptr;
41
42         public:
43             SceneCollection();
44
45             void setName(const std::string&);
46             std::string getName() const;
47
48             std::string getUri() const;
49             std::string getId() const;
50
51             Scene::Ptr addScene(const std::string&);
52             const std::vector< Scene::Ptr >& getSceneList();
53             bool removeScene(const Scene::Ptr&);
54
55             SceneMemberObject::Ptr addSceneMember(const RCSRemoteResourceObject::Ptr&);
56             const  std::vector< SceneMemberObject::Ptr >& getSceneMemberList();
57             bool removeSceneMember(SceneMemberObject::Ptr);
58
59         private:
60             RCSSetResponse setRequestHandler(const RCSRequest&, RCSResourceAttributes&);
61             RCSSetResponse createSceneRequestHandler(const RCSRequest&, RCSResourceAttributes&);
62             RCSSetResponse executeSceneRequestHandler(const RCSRequest&, RCSResourceAttributes&);
63             RCSSetResponse createSceneMemberRequestHandler(const RCSRequest&,
64                     RCSResourceAttributes&);
65
66         private:
67             std::string m_Id;
68             std::string m_Uri;
69
70             std::vector< Scene::Ptr > m_SceneList;
71             std::vector< SceneMemberObject::Ptr > m_SceneMemberObjectList;
72
73             RCSResourceObject::Ptr m_sceneCollectionResourcePtr;
74         };
75     } /* namespace Service */
76 } /* namespace OIC */
77
78 #endif /* SM_SCENECOLLECTION_H_ */
79