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_SCENEACTION_H_
22 #define SM_SCENEACTION_H_
24 #include "RCSRemoteResourceObject.h"
25 #include "RCSResourceAttributes.h"
32 class SceneMemberResource;
37 * @brief SceneAction class indicates a unit of actions when a scene is executed.
38 * SceneAction instance is initialized with 3 essential parameters: a target resource,
39 * target attribute key, and its target value. And this class also provide APIs to update
40 * a target attribute information if one wants
46 typedef std::shared_ptr< SceneAction > Ptr;
49 SceneAction(const std::shared_ptr< SceneMemberResource >,
50 const std::string&, const RCSResourceAttributes&);
51 SceneAction(const std::shared_ptr< SceneMemberResource >,
52 const std::string&, const std::string&,
53 const RCSResourceAttributes::Value&);
58 * Sets the SceneAction parameters like a target attribute key and its value
59 * It replaces existing execution parameter
61 * @param key A key of attributes
62 * @param value A value to be mapped against the key
64 * @see RCSResourceAttributes
66 void resetExecutionParameter(const std::string& key, RCSResourceAttributes::Value value);
69 * Sets the SceneAction parameters like a target attribute key and its value
70 * It replaces existing execution parameter
72 * @param attr Attributes to set
74 * @see RCSResourceAttributes
76 void resetExecutionParameter(const RCSResourceAttributes& attr);
79 * Gets execution parameter of the SceneAction instance
81 * @return attributes of SceneMember resource
83 * @see RCSResourceAttributes
85 RCSResourceAttributes getExecutionParameter() const;
88 * Gets remote resource object
90 * @return RCSRemoteResourceObject
92 RCSRemoteResourceObject::Ptr getRemoteResourceObject() const;
95 RCSRemoteResourceObject::Ptr m_pRemoteResourceObject;
96 std::string m_sceneName;
97 std::shared_ptr< SceneMemberResource > m_sceneMemberResource;
99 } /* namespace Service */
100 } /* namespace OIC */
102 #endif /* SM_SCENEACTION_H_ */