libnick 2025.9.1
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 () noexcept
 Constructs a SuspendInhibitor.
 
 SuspendInhibitor (const SuspendInhibitor &other) noexcept
 Constructs a SuspendInhibitor via copy.
 
 SuspendInhibitor (SuspendInhibitor &&other) noexcept
 Constructs a SuspendInhibitor via move.
 
 ~SuspendInhibitor () noexcept
 Destructs a SuspendInhibitor.
 
bool isInhibiting () const noexcept
 Gets whether or not the system is being inhibited from suspending.
 
bool inhibit () noexcept
 Inhibits the system from suspending.
 
bool uninhibit () noexcept
 Uninhibits the system from suspending.
 
SuspendInhibitoroperator= (const SuspendInhibitor &other) noexcept
 Assigns a SuspendInhibitor via copy.
 
SuspendInhibitoroperator= (SuspendInhibitor &&other) noexcept
 Assigns a SuspendInhibitor via move.
 

Detailed Description

An object to prevent the system from suspending.

Constructor & Destructor Documentation

◆ SuspendInhibitor() [1/3]

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

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 & other)
noexcept

Constructs a SuspendInhibitor via copy.

Parameters
otherThe object to copy

◆ SuspendInhibitor() [3/3]

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

Constructs a SuspendInhibitor via move.

Parameters
otherThe object to move

◆ ~SuspendInhibitor()

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

Destructs a SuspendInhibitor.

If the system is being inhibited, it will uninhibit.

Member Function Documentation

◆ inhibit()

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

Inhibits the system from suspending.

Returns
True if successful, else false

◆ isInhibiting()

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

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 & other)
noexcept

Assigns a SuspendInhibitor via copy.

Parameters
otherThe object to copy
Returns
this

◆ operator=() [2/2]

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

Assigns a SuspendInhibitor via move.

Parameters
otherThe object to move
Returns
this

◆ uninhibit()

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

Uninhibits the system from suspending.

Returns
True if successful, else false

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