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

RemoteSceneCollection class is an interface class to send a request to SceneCollection resource on remote side. More...

Public Types

typedef std::shared_ptr
< RemoteSceneCollection
Ptr
 
typedef std::function< void(RemoteScene::Ptr
scene, int eCode) > 
AddNewSceneCallback
 Callback definition to be invoked when a response of addNewScene 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

 ~RemoteSceneCollection ()=default
 
void addNewScene (const std::string &name, AddNewSceneCallback cb)
 Requests to add new Scene to the SceneCollection resource on remote side and creates RemoteScene instance corresponding to the created Scene. More...
 
std::unordered_map
< std::string,
RemoteScene::Ptr
getRemoteScenes () const
 Gets all RemoteScene instances from RemoteSceneCollection instance. More...
 
RemoteScene::Ptr getRemoteScene (const std::string &sceneName) const
 Gets RemoteScene instance with a specific Scene name. More...
 
void setName (const std::string &name, SetNameCallback cb)
 Request to set a name attribute of the SceneCollection resource on remote side. More...
 
std::string getName () const
 Gets a name attribute of the SceneCollection resource. More...
 
std::string getId () const
 Gets an id attribute of the SceneCollection resource. More...
 

Friends

class RemoteSceneList
 

Detailed Description

RemoteSceneCollection class is an interface class to send a request to SceneCollection resource on remote side.

This class provides APIs for adding new Scene to the SceneCollection resource and creating a new RemoteSceneCollection instance corresponding to the created SceneCollection resource. This class also supports retrieving all Scene instances created before. Besides, it provides APIs for retrieving and updating attribute values of the SceneCollection resource like name attribute.

Member Typedef Documentation

typedef std::function< void(RemoteScene::Ptr scene, int eCode) > OIC::Service::RemoteSceneCollection::AddNewSceneCallback

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

Parameters
scenecreated RemoteScene instance pointer
eCodethe error code received from the SceneCollection on remote
Note
Error code '200' stands for success, '400' for bad request, and '500' for internal error.
See Also
addNewScene
typedef std::function< void(int eCode) > OIC::Service::RemoteSceneCollection::SetNameCallback

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

Parameters
eCodethe error code received from the SceneCollection 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::RemoteSceneCollection::~RemoteSceneCollection ( )
default

Member Function Documentation

void OIC::Service::RemoteSceneCollection::addNewScene ( const std::string &  name,
AddNewSceneCallback  cb 
)

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

Parameters
nameA name of Scene to add
cbA callback to receive created RemoteScene instance
Exceptions
RCSInvalidParameterExceptionIf parameter is invalid
PlatformExceptionIf the platform operation failed
Note
RemoteScene instance is only produced by RemoteSceneCollection class.
Name of Scene must be unique in one SceneCollection
std::string OIC::Service::RemoteSceneCollection::getId ( ) const

Gets an id attribute of the SceneCollection resource.

Returns
an id of the SceneCollection resource
std::string OIC::Service::RemoteSceneCollection::getName ( ) const

Gets a name attribute of the SceneCollection resource.

Returns
A name of the SceneCollection
RemoteScene::Ptr OIC::Service::RemoteSceneCollection::getRemoteScene ( const std::string &  sceneName) const

Gets RemoteScene instance with a specific Scene name.

Parameters
sceneNamename of the Scene to get
Returns
A shared pointer of RemoteScene instance
Exceptions
RCSInvalidParameterExceptionIf sceneName is invalid
std::unordered_map< std::string, RemoteScene::Ptr > OIC::Service::RemoteSceneCollection::getRemoteScenes ( ) const

Gets all RemoteScene instances from RemoteSceneCollection instance.

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

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

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

Friends And Related Function Documentation

friend class RemoteSceneList
friend

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