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_SCENEMEMBER_RESOURCE_REQUESTOR_H_
22 #define SM_SCENEMEMBER_RESOURCE_REQUESTOR_H_
24 #include "SceneCommons.h"
25 #include "RCSRemoteResourceObject.h"
32 class SceneMemberResourceRequestor
33 : public std::enable_shared_from_this< SceneMemberResourceRequestor >
36 typedef std::shared_ptr< SceneMemberResourceRequestor > Ptr;
37 typedef std::weak_ptr< SceneMemberResourceRequestor > wPtr;
39 typedef std::function < void(int eCode) > InternalAddSceneActionCallback;
42 SceneMemberResourceRequestor(RCSRemoteResourceObject::Ptr memberResource,
43 const std::string &id);
44 ~SceneMemberResourceRequestor() = default;
46 void requestSceneActionCreation(const std::string &sceneName,
47 const RCSResourceAttributes &attr,
48 InternalAddSceneActionCallback);
50 void requestGet(const std::string &, RCSRemoteResourceObject::GetCallback);
52 void setRemoteResourceObject(RCSRemoteResourceObject::Ptr);
54 RCSRemoteResourceObject::Ptr getRemoteResourceObject() const;
57 static void onSceneActionCreated(
58 const RCSResourceAttributes &, int eCode,
59 const std::string &sceneName, const RCSResourceAttributes &requestedAttrs,
60 const InternalAddSceneActionCallback &, SceneMemberResourceRequestor::wPtr);
62 void onSceneActionCreated_impl(
63 const RCSResourceAttributes &, int eCode,
64 const std::string &sceneName, const RCSResourceAttributes &requestedAttrs,
65 const InternalAddSceneActionCallback &);
69 RCSRemoteResourceObject::Ptr m_remoteResource;
70 RCSRemoteResourceObject::Ptr m_sceneMemberResource;
76 #endif /* SM_SCENEMEMBER_RESOURCE_REQUESTOR_H_ */