X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=service%2Fthings-manager%2Fsdk%2Fsrc%2FThingsDiagnostics.h;h=a14447072daf79eaaaad41815ca92a66bfffbdfd;hb=935fdb9b67b6c10d007e652e9e2e028fd6ccfe09;hp=dda93621c2658ca56f04b85a99c6089f4654c517;hpb=00b3660e45c56cb3db35dc2596a054f801b5591a;p=platform%2Fupstream%2Fiotivity.git diff --git a/service/things-manager/sdk/src/ThingsDiagnostics.h b/service/things-manager/sdk/src/ThingsDiagnostics.h index dda9362..a144470 100644 --- a/service/things-manager/sdk/src/ThingsDiagnostics.h +++ b/service/things-manager/sdk/src/ThingsDiagnostics.h @@ -18,10 +18,12 @@ // //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -/// @file ThingsDiagnostics.h - -/// @brief This file contains the declaration of classes and its members related to -/// ThingsDiagnostics. +/** + * @file + * + * This file contains the declaration of classes and its members related to + * ThingsDiagnostics. + */ #ifndef __OC_THINGSDIAGNOSTICS__ #define __OC_THINGSDIAGNOSTICS__ @@ -37,7 +39,6 @@ using namespace OC; namespace OIC { - /// Declearation of Diagnostics Callback funtion type typedef std::function< void(const HeaderOptions& headerOptions, const OCRepresentation& rep, const int eCode) @@ -56,11 +57,7 @@ namespace OIC { public: DiagnosticsRequestEntry(std::string ID, DiagnosticsCallback callback, - std::shared_ptr< OCResource > resource, std::string updateVal) : - m_ID(ID), m_callback(callback), m_resource(resource), m_updateVal(updateVal) - { - } - ; + std::shared_ptr< OCResource > resource, std::string updateVal); // Diagnostics Name (used in key value in std::map structure) // e.g., reboot and factoryset @@ -88,27 +85,14 @@ namespace OIC class DiagnosticsUnitInfo { public: - DiagnosticsUnitInfo(std::string name, std::string description, std::string uri, - std::string attribute) : - m_name(name), m_description(description), m_uri(uri), m_attribute(attribute) - { - } - ; - std::string m_name; - std::string m_description; - std::string m_uri; std::string m_attribute; + std::string m_uri; - // If a developer wants to know a list of diagnostics names, gives it in JSON format. - std::string getJSON() - { - std::string res; - - res = "{\"name\":\"" + m_name + "\",\"description\":\"" + m_description + "\"}"; + DiagnosticsUnitInfo(std::string name, std::string attribute, std::string uri); - return res; - } + // If a developer wants to know a list of configuration names, gives it in JSON format. + std::string getJSON(); }; #define NUMDIAGUNIT 3 @@ -121,39 +105,18 @@ namespace OIC /** * Constructor for ThingsDiagnostics. Constructs a new ThingsDiagnostics */ - ThingsDiagnostics(void) - { - DiagnosticsUnitInfo unit[] = - { - { "reboot", "reboot", "/oic/diag/0/reboot", "value" }, - { "value", - "Collecting any device statistics", - "/oic/diag/0/startCollection", "value" }, - { "factoryreset", "restore all configuration values to default values", - "/oic/diag/0/factoryReset", "value" } }; - - for (int i = 0; i < NUMDIAGUNIT; i++) - DiagnosticsUnitTable.push_back(unit[i]); - } - ; + ThingsDiagnostics(void); /** * Virtual destructor */ - ~ThingsDiagnostics(void) - { - } - ; + ~ThingsDiagnostics(void); static ThingsDiagnostics *thingsDiagnosticsInstance; static ThingsDiagnostics* getInstance(); void deleteInstance(); - void setGroupManager(GroupManager *groupmanager) - { - g_groupmanager = groupmanager; - } - ; + void setGroupManager(GroupManager *groupmanager); /** * API to make things reboot @@ -199,6 +162,8 @@ namespace OIC void onExecuteForGroupAction(const HeaderOptions& headerOptions, const OCRepresentation& rep, const int eCode, std::string conf); + void onDeleteGroupAction(const HeaderOptions& headerOptions, + const OCRepresentation& rep, const int eCode, std::string conf); void onGetChildInfoForUpdate(const HeaderOptions& headerOptions, const OCRepresentation& rep, const int eCode, std::string conf); void onCreateActionSet(const HeaderOptions& headerOptions, const OCRepresentation& rep,