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

Scene class is an interface class to manage scenes provided by SceneCollection resource. More...

Public Types

typedef std::shared_ptr< ScenePtr
 
typedef std::function< void(int) > ExecuteCallback
 Typedef for callback of execute APIs. More...
 

Public Member Functions

SceneAction::Ptr addNewSceneAction (const RCSRemoteResourceObject::Ptr &pRCSRemoteResourceObject, std::string key, RCSResourceAttributes::Value value)
 Adds new SceneAction instance to the Scene instance. More...
 
SceneAction::Ptr addNewSceneAction (const RCSRemoteResourceObject::Ptr &pRCSRemoteResourceObject, RCSResourceAttributes attr)
 Adds new SceneAction instance to the Scene instance. More...
 
SceneAction::Ptr getSceneAction (const RCSRemoteResourceObject::Ptr &pRCSRemoteResourceObject) const
 Gets SceneAction using discovered resource. More...
 
std::vector< SceneAction::PtrgetSceneActions () const
 Gets all SceneActions include current Scene. More...
 
std::string getName () const
 Gets Scene's name provided SceneCollection resource. More...
 
void execute (ExecuteCallback cb)
 Requests executing Scene to SceneCollection resource. More...
 

Friends

class SceneCollection
 

Detailed Description

Scene class is an interface class to manage scenes provided by SceneCollection resource.

This class provide APIs for creating a new SceneAction instance, retrieving all SceneAction instances created before. And it provides an API to execute a scene.

Member Typedef Documentation

typedef std::function< void(int) > OIC::Service::Scene::ExecuteCallback

Typedef for callback of execute APIs.

See Also
execute
typedef std::shared_ptr< Scene > OIC::Service::Scene::Ptr

Member Function Documentation

SceneAction::Ptr OIC::Service::Scene::addNewSceneAction ( const RCSRemoteResourceObject::Ptr pRCSRemoteResourceObject,
std::string  key,
RCSResourceAttributes::Value  value 
)

Adds new SceneAction instance to the Scene instance.

Parameters
pRCSRemoteResourceObjectA pointer of discovered resource
keyA key of attributes
valueA value to be mapped against the key
Returns
A shared pointer of SceneAction instance
Exceptions
RCSInvalidParameterExceptionif pRCSRemoteResourceObject is nullptr
RCSBadRequestExceptionif scene member resource is already registered
Note
SceneAction instance is only produced by Scene class
See Also
RCSResourceAttributes
SceneAction::Ptr OIC::Service::Scene::addNewSceneAction ( const RCSRemoteResourceObject::Ptr pRCSRemoteResourceObject,
RCSResourceAttributes  attr 
)

Adds new SceneAction instance to the Scene instance.

Parameters
pRCSRemoteResourceObjectA pointer of discovered resource
attrA attribute set of key and value
Returns
A shared pointer of SceneAction instance
Exceptions
RCSInvalidParameterExceptionif pRCSRemoteResourceObject is nullptr
RCSBadRequestExceptionif SceneMember is already registered
Note
SceneAction instance is only produced by Scene class
See Also
RCSResourceAttributes
void OIC::Service::Scene::execute ( ExecuteCallback  cb)

Requests executing Scene to SceneCollection resource.

Parameters
cbA callback to execute Scene
std::string OIC::Service::Scene::getName ( ) const

Gets Scene's name provided SceneCollection resource.

Returns
Scene's name
SceneAction::Ptr OIC::Service::Scene::getSceneAction ( const RCSRemoteResourceObject::Ptr pRCSRemoteResourceObject) const

Gets SceneAction using discovered resource.

Parameters
pRCSRemoteResourceObjectA pointer of discovered resource
Returns
A shared pointer of SceneAction
Exceptions
RCSInvalidParameterExceptionif pRCSRemoteResourceObject is unknown resource
std::vector<SceneAction::Ptr> OIC::Service::Scene::getSceneActions ( ) const

Gets all SceneActions include current Scene.

Returns
A vector of shared pointer of SceneAction instance

Friends And Related Function Documentation

friend class SceneCollection
friend

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