../../service/things-manager/sdk/inc \
../../service/easy-setup/sdk/common \
../../service/easy-setup/sdk/enrollee/api \
- ../../service/resource-directory/include
+ ../../service/resource-directory/include \
+ ../../service/scene-manager/include \
+
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
namespace Service
{
class SceneCollectionResource;
+
+ /**
+ * @class Scene
+ *
+ * @brief 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.
+ *
+ */
class Scene
{
public:
+
+ /**
+ * @class InvalidAddMemberRequestException
+ *
+ * @brief If request of adding member is invalid, throw InvalidMemberRequestException.
+ * Adding member is invalid that scene member resource is already registered.
+ */
class InvalidAddMemberRequestException: public RCSException
{
public:
};
typedef std::shared_ptr< Scene > Ptr;
+
+ /**
+ * Typedef for callback of execute APIs
+ *
+ * @see execute
+ */
typedef std::function< void(int) > ExecuteCallback;
private:
friend class SceneCollection;
public:
- SceneAction::Ptr addNewSceneAction(const RCSRemoteResourceObject::Ptr&,
- const RCSResourceAttributes&);
- SceneAction::Ptr addNewSceneAction(const RCSRemoteResourceObject::Ptr&,
- const std::string&, const RCSResourceAttributes::Value&);
+ /**
+ * Adds new SceneAction instance to the Scene instance
+ *
+ * @param RCSRemoteResourceObjectPtr A pointer of discovered resource
+ * @param attr A attribute set of key and value
+ *
+ * @return A shared pointer of SceneAction instance
+ *
+ * @throws RCSInvalidParameterException if RCSRemoteResourceObjectPtr is nullptr
+ * @throws InvalidAddMemberRequestException if SceneMember is already registered
+ *
+ * @note SceneAction instance is only produced by Scene class
+ *
+ * @see RCSResourceAttributes
+ */
+ SceneAction::Ptr addNewSceneAction(
+ const RCSRemoteResourceObject::Ptr& RCSRemoteResourceObjectPtr,
+ const RCSResourceAttributes& attr);
+ /**
+ * Adds new SceneAction instance to the Scene instance
+ *
+ * @param RCSRemoteResourceObjectPtr A pointer of discovered resource
+ * @param key A key of attributes
+ * @param value A value to be mapped against the key
+ *
+ * @return A shared pointer of SceneAction instance
+ *
+ * @throws RCSInvalidParameterException if RCSRemoteResourceObjectPtr is nullptr
+ * @throws InvalidAddMemberRequestException
+ * if scene member resource is already registered
+ *
+ * @note SceneAction instance is only produced by Scene class
+ *
+ * @see RCSResourceAttributes
+ */
+ SceneAction::Ptr addNewSceneAction(
+ const RCSRemoteResourceObject::Ptr& RCSRemoteResourceObjectPtr,
+ const std::string& key, const RCSResourceAttributes::Value& value);
+
+ /**
+ * Gets SceneAction using discovered resource
+ *
+ * @param RCSRemoteResourceObjectPtr A pointer of discovered resource
+ *
+ * @return A shared pointer of SceneAction
+ *
+ * @throws RCSInvalidParameterException
+ * if RCSRemoteResourceObjectPtr is unknown resource
+ */
SceneAction::Ptr getSceneAction(
- const RCSRemoteResourceObject::Ptr&) const;
+ const RCSRemoteResourceObject::Ptr& RCSRemoteResourceObjectPtr) const;
+
+ /**
+ * Gets all SceneActions include current Scene
+ *
+ * @return A vector of shared pointer of SceneAction instance
+ *
+ */
std::vector<SceneAction::Ptr> getSceneActions() const ;
+ /**
+ * Gets Scene's name provided SceneCollection resource
+ *
+ * @return Scene's name
+ */
std::string getName() const;
void removeSceneAction(const SceneAction::Ptr&);
void removeSceneAction(const RCSRemoteResourceObject::Ptr&);
- void execute(ExecuteCallback);
+ /**
+ * Requests executing Scene to SceneCollection resource
+ *
+ * @param cb A callback to execute Scene
+ */
+ void execute(ExecuteCallback cb);
private:
std::string m_name;
namespace Service
{
class SceneMemberResource;
+
+ /**
+ * @class SceneAction
+ *
+ * @brief SceneAction class indicates a unit of actions when a scene is executed.
+ * SceneAction instance is initialized with 3 essential parameters: a target resource,
+ * target attribute key, and its target value. And this class also provide APIs to update
+ * a target attribute information if one wants
+ *
+ */
class SceneAction
{
public:
friend class Scene;
public:
- void setExecutionParameter(const std::string&, RCSResourceAttributes::Value);
- void setExecutionParameter(const RCSResourceAttributes&);
+ /**
+ * Sets attributes of the SceneMember resource when the Scene is executed
+ *
+ * @param key A key of attributes
+ * @param value A value to be mapped against the key
+ *
+ * @see RCSResourceAttributes
+ */
+ void setExecutionParameter(const std::string& key, RCSResourceAttributes::Value value);
+
+ /**
+ * Sets attributes of the SceneMember resource when the Scene is executed
+ *
+ * @param attr Attributes to set
+ *
+ * @see RCSResourceAttributes
+ */
+ void setExecutionParameter(const RCSResourceAttributes& attr);
+ /**
+ * Gets execution parameter of the SceneAction instance
+ *
+ * @return attributes of SceneMember resource
+ *
+ * @see RCSResourceAttributes
+ */
const RCSResourceAttributes getExecutionParameter();
+
+ /**
+ * Gets remote resource object of SceneMember resource
+ *
+ * @return RCSRemoteResourceObject
+ */
RCSRemoteResourceObject::Ptr getRemoteResourceObject() const;
private:
namespace Service
{
class SceneCollectionResource;
+
+ /**
+ * @class SceneCollection
+ *
+ * @brief SceneCollection class is an interface class to manage SceneCollection resource.
+ * This class provides APIs to create a new Scene instance and retrieve all Scene instances
+ * created before. Besides, it provide APIs for retrieving and updating attribute values
+ * like name attribute
+ *
+ */
class SceneCollection
{
public:
friend class SceneList;
public:
- Scene::Ptr addNewScene(const std::string&);
+
+ /**
+ * Adds new Scene instance to SceneCollection resource
+ *
+ * @param sceneName A scene's name
+ *
+ * @return A shared pointer of Scene instance
+ *
+ * @note Scene instance is only produced by SceneCollection class
+ * @note Scene's name must unique in one SceneCollection resource
+ */
+ Scene::Ptr addNewScene(const std::string& sceneName);
+
+ /**
+ * Gets all Scene instances from SceneCollection resource
+ *
+ * @return A unordered_map of shared pointers of Scene instances with a Scene's name
+ */
std::unordered_map< std::string, Scene::Ptr > getScenes() const;
- Scene::Ptr getScene(const std::string&) const;
+
+ /**
+ * Gets a Scene instance with a specific Scene's name.
+ *
+ * @param sceneName A Scene's name
+ *
+ * @return A shared pointer of Scene instance
+ *
+ * @throws RCSInvalidParameterException
+ * if Scene's name does not exist in SceneCollection resource
+ */
+ Scene::Ptr getScene(const std::string& sceneName) const;
+
void removeScene(Scene::Ptr);
- void setName(const std::string&);
+ /**
+ * Sets a name attribute of SceneCollection resource
+ *
+ * @param name A SceneCollection resource's name
+ */
+ void setName(const std::string& name);
+
+ /**
+ * Gets a name attribute from SceneCollection resource.
+ *
+ * @return A SceneCollection resource's name
+ */
std::string getName() const;
+
+ /**
+ * Gets a Id attribute of SceneCollection resource.
+ *
+ * @return A SceneCollection resource's Id
+ *
+ */
std::string getId() const;
private:
namespace Service
{
class SceneListResource;
+ /**
+ * @class SceneList
+ *
+ * @brief SceneList class is an interface class to manage SceneList resource. This class
+ * provides APIs for creating a new SceneCollection instance and retrieving the existing
+ * instances as well as for setting/getting a name attribute of SceneList resource.
+ *
+ */
class SceneList
{
private:
~SceneList() = default;
public:
+ /**
+ * Gets static instance of SceneList
+ *
+ * @return SceneList instance
+ *
+ */
static SceneList* getInstance();
+
+ /**
+ * Adds new SceneCollection instance
+ *
+ * @return A shared pointer of SceneCollection instance
+ *
+ * @note SceneCollection instance is only produced by SceneList class
+ */
SceneCollection::Ptr addNewSceneCollection();
+
+ /**
+ * Gets all SceneCollection instances stored in SceneList resource
+ *
+ * @return A vector of shared pointers of SceneCollection instances
+ */
std::vector<SceneCollection::Ptr> getSceneCollections() const;
+
void removeSceneCollection(SceneCollection::Ptr);
- void setName(const std::string&);
+ /**
+ * Sets a name attribute of SceneList resource
+ *
+ * @param sceneListName A SceneList resource's name
+ */
+ void setName(const std::string& sceneListName);
+
+ /**
+ * Gets a name attribute of SceneList resource
+ *
+ * @return A SceneList resource's name
+ */
std::string getName() const;
};
} /* namespace Service */