KApplicationScope

Search for usage in LXR

#include <kapplicationscope.h>

Inheritance diagram for KApplicationScope:

Public Types

enum  ErrorCode { NoError, SetFailedError, CacheFillError, StopFailedError }
 

Properties

QString cgroup
 
OptionalQULongLong cpuQuota
 
OptionalQULongLong cpuQuotaPeriod
 
OptionalQULongLong cpuWeight
 
QString description
 
QString desktopFilePath
 
QString desktopName
 
QString id
 
QString instance
 
OptionalQULongLong ioWeight
 
ErrorCode lastError
 
OptionalQULongLong memoryHigh
 
OptionalQULongLong memoryLow
 
OptionalQULongLong memoryMax
 
OptionalQULongLong memoryMin
 
OptionalQULongLong memorySwapMax
 
QString path
 
- Properties inherited from QObject
 objectName
 

Signals

void cgroupChanged (const QString &cgroup)
 
void cpuQuotaChanged (const OptionalQULongLong &quota)
 
void cpuQuotaPeriodChanged (const OptionalQULongLong &period)
 
void cpuWeightChanged (const OptionalQULongLong &weight)
 
void descriptionChanged (const QString &description)
 
void desktopFilePathChanged (const QString &desktopFilePath)
 
void desktopNameChanged (const QString &desktopName)
 
void errorOccurred (KApplicationScope::ErrorCode lastError)
 
void idChanged (const QString &id)
 
void instanceChanged (const QString &instance)
 
void ioWeightChanged (const OptionalQULongLong &weight)
 
void memoryHighChanged (const OptionalQULongLong &memoryHigh)
 
void memoryLowChanged (const OptionalQULongLong &memoryLow)
 
void memoryMaxChanged (const OptionalQULongLong &memoryMax)
 
void memoryMinChanged (const OptionalQULongLong &memoryMin)
 
void memorySwapMaxChanged (const OptionalQULongLong &memorySwapMax)
 
void propertyChanged (const QString &propertyName)
 

Public Slots

void setCpuQuota (const OptionalQULongLong &quota)
 
void setCpuQuotaPeriod (const OptionalQULongLong &period)
 
void setCpuWeight (const OptionalQULongLong &weight)
 
void setIoWeight (const OptionalQULongLong &weight)
 
void setMemoryHigh (const OptionalQULongLong &memoryHigh)
 
void setMemoryLow (const OptionalQULongLong &memoryLow)
 
void setMemoryMax (const OptionalQULongLong &memoryMax)
 
void setMemoryMin (const OptionalQULongLong &memoryMin)
 
void setMemorySwapMax (const OptionalQULongLong &memorySwapMax)
 
void stop ()
 

Public Member Functions

 KApplicationScope (const QString &path, QObject *parent=nullptr)
 
 KApplicationScope (const QString &path, const QString &id, QObject *parent=nullptr)
 
QString cgroup () const
 
OptionalQULongLong cpuQuota () const
 
OptionalQULongLong cpuQuotaPeriod () const
 
OptionalQULongLong cpuWeight () const
 
QString description () const
 
QString desktopFilePath () const
 
QString desktopName () const
 
QString id () const
 
QString instance () const
 
OptionalQULongLong ioWeight () const
 
ErrorCode lastError () const
 
OptionalQULongLong memoryHigh () const
 
OptionalQULongLong memoryLow () const
 
OptionalQULongLong memoryMax () const
 
OptionalQULongLong memoryMin () const
 
OptionalQULongLong memorySwapMax () const
 
QString path () const
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
bool blockSignals (bool block)
 
const QObjectListchildren () const const
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectInfo ()
 
void dumpObjectInfo () const const
 
void dumpObjectTree ()
 
void dumpObjectTree () const const
 
QList< QByteArraydynamicPropertyNames () const const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegExp &regExp, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const const
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
QVariant property (const char *name) const const
 
 Q_CLASSINFO (Name, Value)
 
 Q_DISABLE_COPY (Class)
 
 Q_DISABLE_COPY_MOVE (Class)
 
 Q_DISABLE_MOVE (Class)
 
 Q_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_OBJECT Q_OBJECT
 
 Q_PROPERTY (...)
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SLOT Q_SLOT
 
 Q_SLOTS Q_SLOTS
 
qFindChild (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QRegExp &regExp)
 
QList< T > qFindChildren (const QObject *obj, const QString &name)
 
qobject_cast (QObject *object)
 
qobject_cast (const QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds time, Qt::TimerType timerType)
 
QThreadthread () const const
 

Static Public Member Functions

static KApplicationScopefromPid (uint pid, QObject *parent=nullptr)
 
- Static Public Member Functions inherited from QObject
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 

Additional Inherited Members

- Public Attributes inherited from QObject
typedef QObjectList
 
- Protected Member Functions inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
int receivers (const char *signal) const const
 
QObjectsender () const const
 
int senderSignalIndex () const const
 
virtual void timerEvent (QTimerEvent *event)
 

Detailed Description

A desktop application in a systemd transient scope.

Definition at line 19 of file kapplicationscope.h.

Member Enumeration Documentation

The types of errors that can occur.

Enumerator
NoError 

Default value.

No error has occurred

SetFailedError 

A property set operation failed.

CacheFillError 

Initial loading of property values failed.

StopFailedError 

Error during stop() operation.

Definition at line 145 of file kapplicationscope.h.

Property Documentation

QString KApplicationScope::cgroup
read

file path of the control group in /sys/fs/cgroup cgroup() cgroupChanged()

Definition at line 41 of file kapplicationscope.h.

OptionalQULongLong KApplicationScope::cpuQuota
readwrite

cpu quota for cpu controller, in microseconds per second (1000000 means 100%).

Can be unset cpuQuota(), setCpuQuota() cpuQuotaChanged()

Definition at line 83 of file kapplicationscope.h.

OptionalQULongLong KApplicationScope::cpuQuotaPeriod
readwrite

duration in micoseconds over which the CPU time quota is measured.

(default when unset is 100ms) cpuQuotaPeriod(), setCpuQuotaPeriod() cpuQuotaPeriodChanged()

Definition at line 90 of file kapplicationscope.h.

OptionalQULongLong KApplicationScope::cpuWeight
readwrite

cpu time weight.

Between 1 and 10000. Defaults to 100. cpuQuotaPeriod(), setCpuQuotaPeriod() cpuQuotaPeriodChanged()

Definition at line 97 of file kapplicationscope.h.

QString KApplicationScope::description
read

the systemd unit description.

Read-only. description() descriptionChanged()

Definition at line 48 of file kapplicationscope.h.

QString KApplicationScope::desktopFilePath
read

the application .desktop file if available.

Read-only. desktopFilePath() desktopFilePathChanged()

Definition at line 62 of file kapplicationscope.h.

QString KApplicationScope::desktopName
read

the .desktop application name.

Read-only. desktopName() desktopNameChanged()

Definition at line 55 of file kapplicationscope.h.

QString KApplicationScope::id
read

the systemd unit id.

Read-only. Will be set asynchronously if not specified in constructor. id() idChanged()

Definition at line 34 of file kapplicationscope.h.

QString KApplicationScope::instance
read

the app instance random identifier.

Can be empty if this is a singleton application. instance() instanceChanged()

Definition at line 69 of file kapplicationscope.h.

OptionalQULongLong KApplicationScope::ioWeight
readwrite

Overall block I/O weight.

Between 1 and 10000. Defaults to 100. ioWeight(), setIoWeight() ioWeightChanged()

Definition at line 104 of file kapplicationscope.h.

KApplicationScope::ErrorCode KApplicationScope::lastError
read

code of the last error that occurred (NoError if none) lastError() errorOccurred()

Definition at line 76 of file kapplicationscope.h.

OptionalQULongLong KApplicationScope::memoryHigh
readwrite

throttling limit on memory usage (in bytes) of all executed processes within the application.

memoryHigh(), setMemoryHigh() memoryHighChanged()

Definition at line 118 of file kapplicationscope.h.

OptionalQULongLong KApplicationScope::memoryLow
readwrite

best-effort memory usage protection (in bytes) of all executed processes within the application.

memoryLow(), setMemoryLow() memoryLowChanged()

Definition at line 111 of file kapplicationscope.h.

OptionalQULongLong KApplicationScope::memoryMax
readwrite

absolute limit on memory usage (in bytes) of all executed processes within the application.

memoryMax(), setMemoryMax() memoryMaxChanged()

Definition at line 132 of file kapplicationscope.h.

OptionalQULongLong KApplicationScope::memoryMin
readwrite

memory usage protection (in bytes) of all executed processes within the application.

memoryMin(), setMemoryMin() memoryMinChanged()

Definition at line 125 of file kapplicationscope.h.

OptionalQULongLong KApplicationScope::memorySwapMax
readwrite

absolute limit on swap usage (in bytes) of all executed processes within the application.

memorySwapMax(), setMemorySwapMax() memorySwapMaxChanged()

Definition at line 139 of file kapplicationscope.h.

QString KApplicationScope::path
read

the dbus path of the application.

Same as constructor parameter. Read-only, constant path()

Definition at line 27 of file kapplicationscope.h.

Constructor & Destructor Documentation

KApplicationScope::KApplicationScope ( const QString path,
QObject parent = nullptr 
)
explicit

Use when only path is known.

Incurs an extra DBus call to get unit id.

Parameters
pathdbus path of the application
parentparent QObject

Definition at line 84 of file kapplicationscope.cpp.

KApplicationScope::KApplicationScope ( const QString path,
const QString id,
QObject parent = nullptr 
)
explicit

Use when unit id is known in advance (such as when using KApplicationScopeLister)

Parameters
pathdbus path of the application
idsystemd unit id
parentparent QObject

Definition at line 78 of file kapplicationscope.cpp.

Member Function Documentation

void KApplicationScope::cgroupChanged ( const QString cgroup)
signal

emitted when cgroup has been loaded asynchronously

Parameters
cgroupthe filesystem cgroup path
void KApplicationScope::cpuQuotaChanged ( const OptionalQULongLong &  quota)
signal

emitted when the cpu quota has changed

Parameters
quotathe new quota value
void KApplicationScope::cpuQuotaPeriodChanged ( const OptionalQULongLong &  period)
signal

emitted when the cpu quota period has changed

Parameters
periodthe new period value
void KApplicationScope::cpuWeightChanged ( const OptionalQULongLong &  weight)
signal

emitted when the cpu weight has changed

Parameters
weightthe new weight value
void KApplicationScope::descriptionChanged ( const QString description)
signal

emitted when description has been loaded asynchronously

Parameters
descriptionthe systemd unit desciption
void KApplicationScope::desktopFilePathChanged ( const QString desktopFilePath)
signal

emitted when .desktop file path has been loaded asynchronously

Parameters
descriptionthe .desktop file path
void KApplicationScope::desktopNameChanged ( const QString desktopName)
signal

emitted when .desktop name has been loaded asynchronously

Parameters
descriptionthe .desktop application name
void KApplicationScope::errorOccurred ( KApplicationScope::ErrorCode  lastError)
signal

emitted when there is an error setting or getting a value

Parameters
lastErrorthe error code
KApplicationScope * KApplicationScope::fromPid ( uint  pid,
QObject parent = nullptr 
)
static

Use when only PID is known.

Parameters
pidprocess ID
parentparent QObject
Returns
a new KApplicationScope, or null in case of failure (such as if process is not managed by systemd)

Definition at line 236 of file kapplicationscope.cpp.

void KApplicationScope::idChanged ( const QString id)
signal

emitted after loading when id is not known at constructor time

Parameters
idthe systemd unit id
void KApplicationScope::instanceChanged ( const QString instance)
signal

emitted when the instance random identifier has been loaded asynchronously

Parameters
descriptionthe instance random identifier
void KApplicationScope::ioWeightChanged ( const OptionalQULongLong &  weight)
signal

emitted when the io weight has changed

Parameters
weightthe new weight value
void KApplicationScope::memoryHighChanged ( const OptionalQULongLong &  memoryHigh)
signal

emitted when memoryHigh has changed

Parameters
memoryHighthe new memoryHigh value
void KApplicationScope::memoryLowChanged ( const OptionalQULongLong &  memoryLow)
signal

emitted when memoryLow has changed

Parameters
memoryLowthe new memoryLow value
void KApplicationScope::memoryMaxChanged ( const OptionalQULongLong &  memoryMax)
signal

emitted when memoryMax has changed

Parameters
memoryMaxthe new memoryMax value
void KApplicationScope::memoryMinChanged ( const OptionalQULongLong &  memoryMin)
signal

emitted when memoryMin has changed

Parameters
memoryMinthe new memoryMin value
void KApplicationScope::memorySwapMaxChanged ( const OptionalQULongLong &  memorySwapMax)
signal

emitted when memorySwapMax has changed

Parameters
memorySwapMaxthe new memorySwapMax value
void KApplicationScope::propertyChanged ( const QString propertyName)
signal

emitted when any cgroup resource property has changed

Parameters
propertyNamethe systemd name of the property
void KApplicationScope::setCpuQuota ( const OptionalQULongLong &  quota)
slot

set cpuQuota

Parameters
quotavalue to set

Definition at line 174 of file kapplicationscope.cpp.

void KApplicationScope::setCpuQuotaPeriod ( const OptionalQULongLong &  period)
slot

set cpuQuotaPeriod

Parameters
periodvalue to set

Definition at line 179 of file kapplicationscope.cpp.

void KApplicationScope::setCpuWeight ( const OptionalQULongLong &  weight)
slot

set cpuWeight

Parameters
weightvalue to set

Definition at line 184 of file kapplicationscope.cpp.

void KApplicationScope::setIoWeight ( const OptionalQULongLong &  weight)
slot

set ioWeight

Parameters
weightvalue to set

Definition at line 189 of file kapplicationscope.cpp.

void KApplicationScope::setMemoryHigh ( const OptionalQULongLong &  memoryHigh)
slot

set memoryHigh

Parameters
memoryHighvalue to set

Definition at line 199 of file kapplicationscope.cpp.

void KApplicationScope::setMemoryLow ( const OptionalQULongLong &  memoryLow)
slot

set memoryLow

Parameters
memoryLowvalue to set

Definition at line 194 of file kapplicationscope.cpp.

void KApplicationScope::setMemoryMax ( const OptionalQULongLong &  memoryMax)
slot

set memoryMax

Parameters
memoryMaxvalue to set

Definition at line 209 of file kapplicationscope.cpp.

void KApplicationScope::setMemoryMin ( const OptionalQULongLong &  memoryMin)
slot

set memoryMin

Parameters
memoryMinvalue to set

Definition at line 204 of file kapplicationscope.cpp.

void KApplicationScope::setMemorySwapMax ( const OptionalQULongLong &  memorySwapMax)
slot

set memorySwapMax

Parameters
memorySwapMaxvalue to set

Definition at line 214 of file kapplicationscope.cpp.

void KApplicationScope::stop ( )
slot

Stops the application.

Definition at line 219 of file kapplicationscope.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Sep 27 2021 23:06:09 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.