Imported Upstream version 0.9.1
[platform/upstream/iotivity.git] / service / things-manager / sdk / src / ThingsDiagnostics.h
index dda9362..a144470 100644 (file)
 //
 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 
-/// @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,