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_REMOTE_SCENEACTION_H_
22 #define SM_REMOTE_SCENEACTION_H_
28 #include "RCSRemoteResourceObject.h"
35 class SceneMemberResourceRequestor;
37 class RemoteSceneAction
40 typedef std::shared_ptr< RemoteSceneAction > Ptr;
42 typedef std::function< void(int eCode) > UpdateCallback;
45 ~RemoteSceneAction() = default;
47 void setExecutionParameter(const std::string &key,
48 const RCSResourceAttributes::Value &value, UpdateCallback);
49 void setExecutionParameter(const RCSResourceAttributes &attr, UpdateCallback);
51 RCSResourceAttributes getExecutionParameter() const;
53 RCSRemoteResourceObject::Ptr getRemoteResourceObject() const;
56 RemoteSceneAction(std::shared_ptr< SceneMemberResourceRequestor >,
57 const std::string &sceneName, const RCSResourceAttributes &);
58 RemoteSceneAction(std::shared_ptr< SceneMemberResourceRequestor >,
59 const std::string &sceneName,
60 const std::string &key, const RCSResourceAttributes::Value &);
62 void onUpdated(int, const RCSResourceAttributes &, const UpdateCallback &);
65 std::string m_sceneName;
66 std::mutex m_attributeLock;
67 RCSResourceAttributes m_attributes;
68 std::shared_ptr< SceneMemberResourceRequestor > m_requestor;
70 friend class RemoteScene;
76 #endif /* SM_REMOTE_SCENEACTION_H_ */