manager: add status

Add a status field to assist keeping track of manager state.

STARTING - the manager is initializing
RUNNING - the manager event loop is running
STOPPING - the manager is shutting down

Remove the old _shutdown property and make use of _status == (or !=) STOPPING.

Change-Id: I8326cb164aba32f2d64bbf4fa0753932821571ff
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/manager.cpp b/manager.cpp
index 0aa2176..72a95d9 100644
--- a/manager.cpp
+++ b/manager.cpp
@@ -58,12 +58,12 @@
 }
 
 Manager::Manager(sdbusplus::bus::bus&& bus, const char* root) :
-    ServerObject<ManagerIface>(bus, root), _shutdown(false), _root(root),
-    _bus(std::move(bus)), _manager(_bus, root)
+    ServerObject<ManagerIface>(bus, root), _root(root), _bus(std::move(bus)),
+    _manager(_bus, root),
 #ifdef CREATE_ASSOCIATIONS
-    ,
-    _associations(_bus)
+    _associations(_bus),
 #endif
+    _status(ManagerStatus::STARTING)
 {
     for (auto& group : _events)
     {
@@ -97,7 +97,7 @@
 
 void Manager::shutdown() noexcept
 {
-    _shutdown = true;
+    _status = ManagerStatus::STOPPING;
 }
 
 void Manager::run(const char* busname)
@@ -116,8 +116,10 @@
         }
     }
 
+    _status = ManagerStatus::RUNNING;
     _bus.request_name(busname);
-    while (!_shutdown)
+
+    while (_status != ManagerStatus::STOPPING)
     {
         try
         {