MeVisLab Toolbox Reference
macos::StartupItem Class Reference

Startup daemon support. More...

#include <macStartupItem.h>

Public Types

enum  ServiceType { ServiceTypeSystemDaemon = 0 , ServiceTypeAllUsersAgent , ServiceTypeCurrentUserAgent }
 Type of startup service. More...
 

Static Public Member Functions

static bool create (ServiceType type, const std::string &serviceId, const std::list< std::string > &arguments, const std::string &userName=std::string())
 Create new startup daemon/agent config file. More...
 
static bool remove (ServiceType type, const std::string &serviceId)
 Remove existing startup daemon/agent config file. More...
 
static bool load (ServiceType type, const std::string &serviceId)
 Load startup daemon/agent config. More...
 
static bool unload (ServiceType type, const std::string &serviceId)
 Unload startup daemon/agent config. More...
 

Static Public Attributes

static const std::string CurrentUser
 

Detailed Description

Startup daemon support.

Definition at line 27 of file macStartupItem.h.

Member Enumeration Documentation

◆ ServiceType

Type of startup service.

A "daemon" is, by definition, a system-wide service of which there is one instance for all clients. An "agent" is a service that runs on a per-user basis. Daemons should not attempt to display UI or interact directly with a user's login session. Any and all work that involves interacting with a user should be done through agents.

Enumerator
ServiceTypeSystemDaemon 

System-wide daemon provided by the administrator.

ServiceTypeAllUsersAgent 

Per-user agent provided by the administrator for all users.

ServiceTypeCurrentUserAgent 

Per-user agent provided by the current user.

Definition at line 38 of file macStartupItem.h.

Member Function Documentation

◆ create()

static bool macos::StartupItem::create ( ServiceType  type,
const std::string &  serviceId,
const std::list< std::string > &  arguments,
const std::string &  userName = std::string() 
)
static

Create new startup daemon/agent config file.

Use StartupItem::CurrentUser string for userName argument to write the current user's login name into the config file

◆ load()

static bool macos::StartupItem::load ( ServiceType  type,
const std::string &  serviceId 
)
static

Load startup daemon/agent config.

Jobs that are not on-demand will be started as soon as possible.

◆ remove()

static bool macos::StartupItem::remove ( ServiceType  type,
const std::string &  serviceId 
)
static

Remove existing startup daemon/agent config file.

◆ unload()

static bool macos::StartupItem::unload ( ServiceType  type,
const std::string &  serviceId 
)
static

Unload startup daemon/agent config.

This will also stop the job if it is running.

Member Data Documentation

◆ CurrentUser

const std::string macos::StartupItem::CurrentUser
static

Definition at line 44 of file macStartupItem.h.


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