buffet: Add Manager class This class implements the Manager DBus interface and is responsible for global operations of Buffet. For instance, this class is responsible for initiating device regsitration and accepting state updates to be published to the cloud. BUG=chromium:355387 TEST=buffet_BasicDBusAPI passes. Change-Id: Id38d9698048bd0fa722dc297a957c80e0a488870
diff --git a/buffet/main.cc b/buffet/main.cc index 0b2e493..79843ab 100644 --- a/buffet/main.cc +++ b/buffet/main.cc
@@ -15,6 +15,7 @@ #include <gflags/gflags.h> #include "buffet/dbus_manager.h" +#include "buffet/manager.h" DEFINE_string(logsroot, "/var/log", "Root directory for buffet logs."); @@ -79,8 +80,11 @@ // Initialize the dbus_manager. buffet::DBusManager dbus_manager; dbus_manager.Init(); - - message_loop.Run(); + { + // The Manager needs the dbus_manager to remain in scope for its lifetime. + buffet::Manager manager(&dbus_manager); + message_loop.Run(); + } dbus_manager.Finalize(); return 0;