Deskflow 1.24.0.365
Keyboard and mouse sharing utility
Loading...
Searching...
No Matches
ArchDaemonNone Class Reference

Dummy implementation of IArchDaemon. More...

#include <ArchDaemonNone.h>

Inheritance diagram for ArchDaemonNone:
Collaboration diagram for ArchDaemonNone:

Public Member Functions

 ArchDaemonNone ()=default
 ~ArchDaemonNone () override=default
int daemonize (DaemonFunc const &func) override
 Daemonize the process.
QString commandLine () const override
 Get the command line.
Public Member Functions inherited from IArchDaemon
virtual ~IArchDaemon ()=default

Additional Inherited Members

Public Types inherited from IArchDaemon
using DaemonFunc = std::function<int()>

Detailed Description

Dummy implementation of IArchDaemon.

This class implements IArchDaemon for a platform that does not have daemons. The query functions return false, and daemonize() simply calls the passed function and returns its result.

Constructor & Destructor Documentation

◆ ArchDaemonNone()

ArchDaemonNone::ArchDaemonNone ( )
default

◆ ~ArchDaemonNone()

ArchDaemonNone::~ArchDaemonNone ( )
overridedefault

Member Function Documentation

◆ commandLine()

QString ArchDaemonNone::commandLine ( ) const
inlineoverridevirtual

Get the command line.

Gets the command line with which the application was started.

Implements IArchDaemon.

◆ daemonize()

int ArchDaemonNone::daemonize ( DaemonFunc const & func)
inlineoverridevirtual

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.

Implements IArchDaemon.


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