dodo
0.0.1
A C++ library to create containerized Linux services
|
Go to the documentation of this file.
23 #ifndef common_application_hpp
24 #define common_application_hpp
124 virtual int run() {
return 0; }
char ** envp
Environment variables.
bool hasStopRequest() const
Return true when the main thread got a SIGTERM or SIGQUIT.
Start parameters for the Application.
HostType detectHostType()
Detect the HostType of the host the Application is running on.
HostType hosttype_
The HostType, detected once in the Application constructor.
HostType getHostType() const
Return the HostType the Application is running on.
static void signal_handler(int signal)
Signal handler called by the OS.
static Application * application_
Singleton Application object.
@ GenericVM
An indeterminate virtual machine.
@ Docker
Docker container.
void onSignal(int signal)
Called by signal_handler.
Logger * logger_
The Logger.
@ BareMetal
Bare metal deployment.
static std::string getHostTypeAsString(HostType ht)
Convert a HostType to a human readable string.
char ** argv
Argument array.
virtual ~Application()
Destructor.
Common and utility interfaces.
std::string config_file_
The configuration file name.
Red tape wrapper class for applications, from command line to services.
bool has_stop_request_
True when the Application main pid got a signal to stop (SIGTERM).
Application(const StartParameters ¶m)
Construct an Application instance.
virtual int run()
Override.
void installSignalHandlers()
Install the signal handlers.
std::string config
Configuration file.
HostType
The type of host the Application is running on.