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

RemoteSceneList class is an interface class to send a request to SceneList resource on remote side. More...

Public Types

typedef std::unique_ptr
< RemoteSceneList
Ptr
 
typedef std::function< void(RemoteSceneList::Ptr
list, int eCode) > 
CreateInstanceCallback
 Callback definition to be invoked when a response of createInstance is received. More...
 
typedef std::function< void(RemoteSceneCollection::Ptr
collection, int eCode) > 
AddNewSceneCollectionCallback
 Callback definition to be invoked when a response of addNewSceneCollection is received. More...
 
typedef std::function< void(int
eCode) > 
SetNameCallback
 Callback definition to be invoked when a response of setName is received. More...
 

Public Member Functions

 ~RemoteSceneList ()=default
 
void addNewSceneCollection (AddNewSceneCollectionCallback cb)
 Requests to add new SceneCollection resource to the SceneList resource on remote side and creates RemoteSceneCollection instance corresponding to the created SceneCollection resource. More...
 
std::vector
< RemoteSceneCollection::Ptr
getRemoteSceneCollections () const
 Gets all RemoteSceneCollection instances stored in the RemoteSceneList instance. More...
 
void setName (const std::string &name, SetNameCallback cb)
 Request to set a name attribute of the SceneList resource on remote side. More...
 
std::string getName () const
 Gets a name attribute of the SceneList resource. More...
 

Static Public Member Functions

static void createInstance (RCSRemoteResourceObject::Ptr sceneListResource, CreateInstanceCallback cb)
 Creates RemoteSceneList instance with provided RCSRemoteResourceObject of discovered SceneList resource on remote side. More...
 

Detailed Description

RemoteSceneList class is an interface class to send a request to SceneList resource on remote side.

This class provides APIs for adding new SceneCollection resource to the SceneList resource and creating a RemoteSceneCollection instance corresponding to the created SceneCollection resource. This class also supports retrieving the existing instances as well as setting/getting a name attribute of the SceneList resource.

Member Typedef Documentation

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

Parameters
collectionCreated RemoteSceneCollection instance pointer
eCodeThe error code received from the SceneList on remote
Note
Error code '200' stands for success, '400' for bad request, and '500' for internal error.
See Also
addNewSceneCollection
typedef std::function< void(RemoteSceneList::Ptr list, int eCode) > OIC::Service::RemoteSceneList::CreateInstanceCallback

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

Parameters
listCreated RemoteSceneList instance pointer
eCodeThe error code received from the SceneList on remote side
Note
Error code '200' stands for success, '400' for bad request, and '500' for internal error.
See Also
createInstance
typedef std::function< void(int eCode) > OIC::Service::RemoteSceneList::SetNameCallback

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

Parameters
eCodethe error code received from the SceneList on remote
Note
Error code '200' stands for success, '400' for bad request, and '500' for internal error.
See Also
setName

Constructor & Destructor Documentation

OIC::Service::RemoteSceneList::~RemoteSceneList ( )
default

Member Function Documentation

void OIC::Service::RemoteSceneList::addNewSceneCollection ( AddNewSceneCollectionCallback  cb)

Requests to add new SceneCollection resource to the SceneList resource on remote side and creates RemoteSceneCollection instance corresponding to the created SceneCollection resource.

Parameters
cbA callback to receive created RemoteSceneCollection instance
Exceptions
RCSInvalidParameterExceptionIf callback is null.
PlatformExceptionIf the platform operation failed
Note
RemoteSceneCollection instance is only produced by RemoteSceneList class.
static void OIC::Service::RemoteSceneList::createInstance ( RCSRemoteResourceObject::Ptr  sceneListResource,
CreateInstanceCallback  cb 
)
static

Creates RemoteSceneList instance with provided RCSRemoteResourceObject of discovered SceneList resource on remote side.

To create RemoteSceneList instance, discovery of SceneList resource which has 'oic.wk.scenelist' as resource type is required, and the found resource should be provided as parameter. After that, one can acceess existing SceneCollections, Scenes, and SceneActions instances that are already produced at the SceneList resource. Created RemoteSceneList will be delivered to CreateInstanceCallback.

Parameters
sceneListResourceRCSRemoteResourceObject pointer of SceneList
cbA callback to receive the response
Exceptions
RCSInvalidParameterExceptionIf parameter is invalid.
PlatformExceptionIf the platform operation failed
See Also
RCSRemoteResourceObject
std::string OIC::Service::RemoteSceneList::getName ( ) const

Gets a name attribute of the SceneList resource.

Returns
A name of the SceneList resource
std::vector< RemoteSceneCollection::Ptr > OIC::Service::RemoteSceneList::getRemoteSceneCollections ( ) const

Gets all RemoteSceneCollection instances stored in the RemoteSceneList instance.

Returns
A vector of shared pointers of RemoteSceneCollection instances
void OIC::Service::RemoteSceneList::setName ( const std::string &  name,
SetNameCallback  cb 
)

Request to set a name attribute of the SceneList resource on remote side.

Parameters
nameA name of the SceneList
cbA callback to receive the response
Exceptions
RCSInvalidParameterExceptionIf callback is null.
PlatformExceptionIf the platform operation failed

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