Deskflow 1.22.0.197
Keyboard and mouse sharing utility
|
Interface for architecture dependent daemonizing. More...
#include <IArchDaemon.h>
Public Types | |
using | DaemonFunc = std::function<int(int, const char **)> |
Public Member Functions | |
manipulators | |
virtual void | installDaemon (const char *name, const char *description, const char *pathname, const char *commandLine, const char *dependencies)=0 |
Install daemon. | |
virtual void | uninstallDaemon (const char *name)=0 |
Uninstall daemon. | |
virtual void | installDaemon ()=0 |
Install daemon. | |
virtual void | uninstallDaemon ()=0 |
Uninstall daemon. | |
virtual int | daemonize (const char *name, DaemonFunc const &func)=0 |
Daemonize the process. | |
virtual bool | canInstallDaemon (const char *name)=0 |
Check if user has permission to install the daemon. | |
virtual bool | isDaemonInstalled (const char *name)=0 |
Check if the daemon is installed. | |
virtual std::string | commandLine () const =0 |
Get the command line. | |
Public Member Functions inherited from IInterface | |
virtual | ~IInterface ()=default |
Interface destructor does nothing. |
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.
using IArchDaemon::DaemonFunc = std::function<int(int, const char **)> |
|
pure virtual |
Check if user has permission to install the daemon.
Returns true iff the caller has permission to install or uninstall the daemon. Note that even if this method returns true it's possible that installing/uninstalling the service may still fail. This method ignores whether or not the service is already installed.
Implemented in ArchDaemonNone, and ArchDaemonWindows.
|
pure virtual |
Get the command line.
Gets the command line with which the application was started.
Implemented in ArchDaemonNone, and ArchDaemonWindows.
|
pure virtual |
Daemonize the process.
Daemonize. Throw XArchDaemonFailed 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.
func
gets passed one argument, the name passed to daemonize(). 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, ArchDaemonUnix, and ArchDaemonWindows.
|
pure virtual |
|
pure virtual |
Install daemon.
Install a daemon. name
is the name of the daemon passed to the system and description
is a short human readable description of the daemon. pathname
is the path to the daemon executable. commandLine
should not include the name of program as the first argument. If allUsers
is true then the daemon will be installed to start at boot time, otherwise it will be installed to start when the current user logs in. If dependencies
is not nullptr then it's a concatenation of NUL terminated other daemon names followed by a NUL; the daemon will be configured to startup after the listed daemons. Throws an XArchDaemon
exception on failure.
Implemented in ArchDaemonNone, and ArchDaemonWindows.
|
pure virtual |
Check if the daemon is installed.
Returns true iff the daemon is installed.
Implemented in ArchDaemonNone, and ArchDaemonWindows.
|
pure virtual |
Uninstall daemon.
Uninstalls the default daemon.
Implemented in ArchDaemonNone, and ArchDaemonWindows.
|
pure virtual |
Uninstall daemon.
Uninstall a daemon. Throws an XArchDaemon
on failure.
Implemented in ArchDaemonNone, and ArchDaemonWindows.