Use foward declaration instead of including header in header
authorSangyoon Jang <jeremy.jang@samsung.com>
Tue, 10 Apr 2018 06:36:11 +0000 (15:36 +0900)
committerSangyoon Jang <jeremy.jang@samsung.com>
Tue, 10 Apr 2018 06:46:57 +0000 (15:46 +0900)
Reduce compilation(header) dependencies.

Change-Id: Ib6927e81243bb6622177a8d618170d214dfa8845
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
src/capmgr.cc
src/capmgr.h
src/iotivity.h

index d5b8e617240e18b019d5916d0897927ab8b8abf7..65587a5d856d9a07242fa818b31049d632b829c4 100644 (file)
 
 #include "src/utils/logging.h"
 
+// iotivity headers should be included before boost headers...
+// this makes compilation warning. (redefinition)
+#include "src/iotivity.h"
+#include "src/capability_manager.h"
+#include "src/dbus_service.h"
+#include "src/package_event_listener.h"
+
 namespace {
 
 gboolean SignalHandler(GIOChannel* channel, GIOCondition cond,
index ab8eb58571adf3f82e25839fbdac4a2be9e474aa..2744928ce612b2f8d92458c3df70b83f0744c07d 100644 (file)
@@ -9,15 +9,13 @@
 
 #include <memory>
 
-// iotivity headers should be included before boost headers...
-// this makes compilation warning. (redefinition)
-#include "src/iotivity.h"
-#include "src/capability_manager.h"
-#include "src/dbus_service.h"
-#include "src/package_event_listener.h"
-
 namespace capmgr {
 
+class CapabilityManager;
+class DBusService;
+class Iotivity;
+class PackageEventListener;
+
 class Capmgr {
  public:
   Capmgr();
index a430d01c2db88c6669eda24f68869d7ad32b4c90..9104506689efd26dc7302d70206dc159877edc5d 100644 (file)
 #include <map>
 #include <memory>
 
-#include "src/capability_manager.h"
-
 namespace capmgr {
 
+class CapabilityManager;
+
 class Iotivity {
  public:
   Iotivity(CapabilityManager* capmgr);
   ~Iotivity();
+
   void RegisterResource();
   void FindResource(const std::string& addr);
   void ExchangeCapabilities();