libnick 2024.12.0
A cross-platform base for native Nickvision applications.
Loading...
Searching...
No Matches
Nickvision::System::SuspendInhibitor Class Reference

An object to prevent the system from suspending. More...

#include <suspendinhibitor.h>

Public Member Functions

 SuspendInhibitor ()
 Constructs a SuspendInhibitor.
 
 SuspendInhibitor (const SuspendInhibitor &inhibitor)
 Copies a SuspendInhibitor object.
 
 SuspendInhibitor (SuspendInhibitor &&inhibitor) noexcept
 Moves a SuspendInhibitor object.
 
 ~SuspendInhibitor ()
 Destructs a SuspendInhibitor.
 
bool isInhibiting () const
 Gets whether or not the system is being inhibited from suspending.
 
bool inhibit ()
 Inhibits the system from suspending.
 
bool uninhibit ()
 Uninhibits the system from suspending.
 
SuspendInhibitoroperator= (const SuspendInhibitor &inhibitor)
 Copies a SuspendInhibitor object.
 
SuspendInhibitoroperator= (SuspendInhibitor &&inhibitor) noexcept
 Moves a SuspendInhibitor object.
 

Detailed Description

An object to prevent the system from suspending.

Constructor & Destructor Documentation

◆ SuspendInhibitor() [1/3]

Nickvision::System::SuspendInhibitor::SuspendInhibitor ( )

Constructs a SuspendInhibitor.

This will not inhibit the system from suspending until the inhibit() function is called.

◆ SuspendInhibitor() [2/3]

Nickvision::System::SuspendInhibitor::SuspendInhibitor ( const SuspendInhibitor & inhibitor)

Copies a SuspendInhibitor object.

Parameters
inhibitorThe object to move

◆ SuspendInhibitor() [3/3]

Nickvision::System::SuspendInhibitor::SuspendInhibitor ( SuspendInhibitor && inhibitor)
noexcept

Moves a SuspendInhibitor object.

Parameters
inhibitorThe object to move

◆ ~SuspendInhibitor()

Nickvision::System::SuspendInhibitor::~SuspendInhibitor ( )

Destructs a SuspendInhibitor.

If the system is being inhibited, it will uninhibit.

Member Function Documentation

◆ inhibit()

bool Nickvision::System::SuspendInhibitor::inhibit ( )

Inhibits the system from suspending.

Returns
True if successful, else false

◆ isInhibiting()

bool Nickvision::System::SuspendInhibitor::isInhibiting ( ) const

Gets whether or not the system is being inhibited from suspending.

Returns
True if inhibiting, else false

◆ operator=() [1/2]

SuspendInhibitor & Nickvision::System::SuspendInhibitor::operator= ( const SuspendInhibitor & inhibitor)

Copies a SuspendInhibitor object.

Parameters
inhibitorThe SuspendInhibitor to copy
Returns
this

◆ operator=() [2/2]

SuspendInhibitor & Nickvision::System::SuspendInhibitor::operator= ( SuspendInhibitor && inhibitor)
noexcept

Moves a SuspendInhibitor object.

Parameters
inhibitorThe SuspendInhibitor to move
Returns
this

◆ uninhibit()

bool Nickvision::System::SuspendInhibitor::uninhibit ( )

Uninhibits the system from suspending.

Returns
True if successful, else false

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