From b3da820814b4157fc1b24aff06c19aca749ad731 Mon Sep 17 00:00:00 2001 From: Davin McCall Date: Wed, 30 Dec 2015 00:08:39 +0000 Subject: [PATCH] Move service event types into service-constants.h --- service-constants.h | 12 ++++++++++-- service-listener.h | 10 ++-------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/service-constants.h b/service-constants.h index e0b8a90..0836106 100644 --- a/service-constants.h +++ b/service-constants.h @@ -9,8 +9,6 @@ enum class ServiceState { STOPPING // service script is stopping and will stop. }; - - /* Service types */ enum class ServiceType { DUMMY, // dummy service, used to detect cyclice dependencies @@ -21,4 +19,14 @@ enum class ServiceType { INTERNAL // internal service, runs no external process }; +/* Service events */ +enum class ServiceEvent { + STARTED, // Service was started (reached STARTED state) + STOPPED, // Service was stopped (reached STOPPED state) + FAILEDSTART, // Service failed to start (possibly due to dependency failing) + STARTCANCELLED, // Service was set to be started but a stop was requested + STOPCANCELLED // Service was set to be stopped but a start was requested +}; + + #endif diff --git a/service-listener.h b/service-listener.h index b443602..82fc354 100644 --- a/service-listener.h +++ b/service-listener.h @@ -1,15 +1,9 @@ #ifndef SERVICE_LISTENER_H #define SERVICE_LISTENER_H -class ServiceRecord; +#include -enum class ServiceEvent { - STARTED, // Service was started (reached STARTED state) - STOPPED, // Service was stopped (reached STOPPED state) - FAILEDSTART, // Service failed to start (possibly due to dependency failing) - STARTCANCELLED, // Service was set to be started but a stop was requested - STOPCANCELLED // Service was set to be stopped but a start was requested -}; +class ServiceRecord; // Interface for listening to services class ServiceListener -- 2.25.1