Deskflow 1.24.0.365
Keyboard and mouse sharing utility
Loading...
Searching...
No Matches
IArchDaemon Class Referenceabstract

Interface for architecture dependent daemonizing. More...

#include <IArchDaemon.h>

Inheritance diagram for IArchDaemon:

Public Types

using DaemonFunc = std::function<int()>

Public Member Functions

virtual ~IArchDaemon ()=default
manipulators
virtual int daemonize (DaemonFunc const &func)=0
 Daemonize the process.
virtual QString commandLine () const =0
 Get the command line.

Detailed Description

Interface for architecture dependent daemonizing.

This interface defines the operations required by deskflow for installing uninstalling daeamons and daemonizing a process. Each architecture must implement this interface.

Member Typedef Documentation

◆ DaemonFunc

using IArchDaemon::DaemonFunc = std::function<int()>

Constructor & Destructor Documentation

◆ ~IArchDaemon()

virtual IArchDaemon::~IArchDaemon ( )
virtualdefault

Member Function Documentation

◆ commandLine()

virtual QString IArchDaemon::commandLine ( ) const
pure virtual

Get the command line.

Gets the command line with which the application was started.

Implemented in ArchDaemonNone, and ArchDaemonWindows.

◆ daemonize()

virtual int IArchDaemon::daemonize ( DaemonFunc const & func)
pure virtual

Daemonize the process.

Daemonize. Throw ArchDaemonFailedException on error. name is the name of the daemon. Once daemonized, func is invoked and daemonize returns when and what it does.

Exactly what happens when daemonizing depends on the platform.

  • unix: Detaches from terminal. func gets passed one argument, the name passed to daemonize().
  • win32: Becomes a service. Argument 0 is the name of the service and the rest are the arguments passed to StartService(). func is only called when the service is actually started. func must call ArchMiscWindows::runDaemon() to finally becoming a service. The runFunc function passed to runDaemon() must call ArchMiscWindows::daemonRunning(true) when it enters the main loop (i.e. after initialization) and ArchMiscWindows::daemonRunning(false) when it leaves the main loop. The stopFunc function passed to runDaemon() is called when the daemon must exit the main loop and it must cause runFunc to return. func should return what runDaemon() returns. func or runFunc can call ArchMiscWindows::daemonFailed() to indicate startup failure.

Implemented in ArchDaemonNone, and ArchDaemonWindows.


The documentation for this class was generated from the following file: