IoTivity C++ SDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OIC::Service::RemoteScene Class Reference

Public Types

typedef std::shared_ptr
< RemoteScene
Ptr
 
typedef std::function< void(RemoteSceneAction::Ptr
action, int eCode) > 
AddNewSceneActionCallback
 Callback definition to be invoked a the response of addNewSceneAction is received. More...
 
typedef std::function< void(const
std::string &sceneName, int
eCode) > 
RemoteSceneExecuteCallback
 Callback definition to be invoked when a response of execute is received. More...
 

Public Member Functions

 ~RemoteScene ()=default
 
void addNewSceneAction (RCSRemoteResourceObject::Ptr targetResource, const RCSResourceAttributes &attrs, AddNewSceneActionCallback cb)
 Requests to add new SceneAction to the Scene on remote side and creates RemoteSceneAction instance corresponding to the created SceneAction. More...
 
void addNewSceneAction (RCSRemoteResourceObject::Ptr targetResource, const std::string &key, const RCSResourceAttributes::Value &value, AddNewSceneActionCallback cb)
 Requests to add new SceneAction to the Scene on remote side and creates RemoteSceneAction instance corresponding to the created SceneAction. More...
 
std::vector
< RemoteSceneAction::Ptr
getRemoteSceneActions () const
 Gets all RemoteSceneAction instances included in the Scene. More...
 
RemoteSceneAction::Ptr getRemoteSceneAction (const RCSRemoteResourceObject::Ptr targetResource) const
 Gets RemoteSceneAction instance by using a certain discovered resource. More...
 
std::string getName () const
 Gets a name attribute of the Scene. More...
 
void execute (RemoteSceneExecuteCallback cb)
 Requests to execute the Scene on remote side. More...
 

Friends

class RemoteSceneCollection
 

Member Typedef Documentation

typedef std::function< void(RemoteSceneAction::Ptr action, int eCode) > OIC::Service::RemoteScene::AddNewSceneActionCallback

Callback definition to be invoked a the response of addNewSceneAction is received.

Parameters
actioncreated RemoteSceneAction instance pointer
eCodethe error code received
Note
Error code '200' stands for success, '400' for bad request, and '500' for internal error.
See Also
addNewSceneAction
typedef std::shared_ptr< RemoteScene > OIC::Service::RemoteScene::Ptr
typedef std::function< void(const std::string &sceneName, int eCode) > OIC::Service::RemoteScene::RemoteSceneExecuteCallback

Callback definition to be invoked when a response of execute is received.

Parameters
sceneNamename of the scene which is executed
eCodethe error code received
Note
Error code '200' stands for success, '400' for bad request, and '500' for internal error.
See Also
execute

Constructor & Destructor Documentation

OIC::Service::RemoteScene::~RemoteScene ( )
default

Member Function Documentation

void OIC::Service::RemoteScene::addNewSceneAction ( RCSRemoteResourceObject::Ptr  targetResource,
const RCSResourceAttributes attrs,
AddNewSceneActionCallback  cb 
)

Requests to add new SceneAction to the Scene on remote side and creates RemoteSceneAction instance corresponding to the created SceneAction.

Parameters
targetResourceA pointer of discovered resource
attrsAttributeS to set when the Scene executed
cbA callback to receive created RemoteSceneAction instance
Exceptions
RCSInvalidParameterExceptionIf parameter is invalid.
PlatformExceptionIf the platform operation failed
Note
RemoteSceneAction instance is only produced by RemoteScene class
See Also
RCSResourceAttributes
void OIC::Service::RemoteScene::addNewSceneAction ( RCSRemoteResourceObject::Ptr  targetResource,
const std::string &  key,
const RCSResourceAttributes::Value value,
AddNewSceneActionCallback  cb 
)

Requests to add new SceneAction to the Scene on remote side and creates RemoteSceneAction instance corresponding to the created SceneAction.

Parameters
targetResourceA pointer of discovered resource
keyA key of an attribute
valueA value to be mapped against the key
cbA callback to receive created RemoteSceneAction instance
Exceptions
RCSInvalidParameterExceptionIf parameter is invalid.
PlatformExceptionIf the platform operation failed
Note
RemoteSceneAction instance is only produced by RemoteScene class
See Also
RCSResourceAttributes::Value
void OIC::Service::RemoteScene::execute ( RemoteSceneExecuteCallback  cb)

Requests to execute the Scene on remote side.

Parameters
cbA callback to receive result of Scene execution
Exceptions
RCSInvalidParameterExceptionIf callback is null
PlatformExceptionIf the platform operation failed
std::string OIC::Service::RemoteScene::getName ( ) const

Gets a name attribute of the Scene.

Returns
A name of the Scene
RemoteSceneAction::Ptr OIC::Service::RemoteScene::getRemoteSceneAction ( const RCSRemoteResourceObject::Ptr  targetResource) const

Gets RemoteSceneAction instance by using a certain discovered resource.

Parameters
targetResourceA pointer of discovered resource
Returns
A shared pointer of RemoteSceneAction instance
Exceptions
RCSInvalidParameterExceptionIf targetResource is invalid
std::vector< RemoteSceneAction::Ptr > OIC::Service::RemoteScene::getRemoteSceneActions ( ) const

Gets all RemoteSceneAction instances included in the Scene.

Returns
A vector of shared pointer of RemoteSceneAction instances

Friends And Related Function Documentation

friend class RemoteSceneCollection
friend

The documentation for this class was generated from the following file: