UTILLib 2.0
Common C++ library with utilities.
Loading...
Searching...
No Matches
isuperviseapplication.h File Reference

Interface against a task that supervise that an executable is running. More...

#include <algorithm>
#include <atomic>
#include <string>
#include <string_view>
#include <vector>
Include dependency graph for isuperviseapplication.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  util::supervise::ISuperviseApplication
 Supervise an executable application. More...

Namespaces

namespace  util
 Main namespace for the util library.
namespace  util::xml
 The xml namespace is used for XML related classes and functions.

Enumerations

enum class  util::supervise::ApplicationState : uint8_t { Stopped = 0 , Running = 1 , Failing = 2 , Ready = 3 }
 The supervisor state. More...
enum class  util::supervise::ApplicationStartup : uint8_t { Manual = 0 , Once = 1 , Automatic = 2 }
 Defines the type of startup for tha tas. More...
enum class  util::supervise::ApplicationPriority : uint8_t {
  Realtime , High , AboveNormal , Normal ,
  BelowNormal , Idle
}
 Defines the priority uses when it is running. More...

Detailed Description

Interface against a task that start, supervise and stop an executable. It belongs to a Supervise Master which is a list of applications that should be supervised.

Enumeration Type Documentation

◆ ApplicationPriority

enum class util::supervise::ApplicationPriority : uint8_t
strong

Defines the priority the application uses when it is running. Background task should use Idle priority or High priority. GUI task should use Normal priority. Realtime should not be used as this may hang the computer.

Enumerator
Realtime 

Realtime task. Avoid to use this priority.

High 

High priority.

AboveNormal 

Above normal. Questionable usage.

Normal 

Typical GUI applications uses this priority.

BelowNormal 

Below normal. Questionable usage.

Idle 

Typical for most background task. Recommended usage.

◆ ApplicationStartup

enum class util::supervise::ApplicationStartup : uint8_t
strong

The startup mode is set to each application and defines how it start, stop and being supervised.

In the Manual mode, the application is started when it is taken in-service by a remote application. If it is taken out-of-service, it stops. If it exit before it is taken out-of-service, the state is set to ApplicationState::Ready.

In the Once mode, the application only run once at startup. It is very similar to the Manual mode but it is set to in-service at startup.

In the Automatic mode, the application is started at startup and then checked that it is running. If the application stops, it will be restarted. Note that the restart is delayed 2-10 seconds. If number of restarts reach a maximum limit, it will stop restarting and a critical log event will be generated.

Enumerator
Manual 

Manual start and stop of the application.

Once 

Starts only one time.

Automatic 

Starts and restarts if stopped.

◆ ApplicationState

enum class util::supervise::ApplicationState : uint8_t
strong
Enumerator
Stopped 

Application is (manually) stopped.

Running 

Application is running.

Failing 

Application is failing (not running).

Ready 

Application is ready (not running).