libSDL2pp
C++ bindings/wrapper for SDL2
|
SDL2pp::AudioDevice lock. More...
#include <SDL2pp/AudioDevice.hh>
Public Member Functions | |
LockHandle () | |
Create no-op lock. | |
~LockHandle () | |
Destructor. | |
LockHandle (LockHandle &&other) noexcept | |
Move constructor. | |
LockHandle & | operator= (LockHandle &&other) noexcept |
Move assignment operator. | |
LockHandle (const LockHandle &other) | |
Copy constructor. | |
LockHandle & | operator= (const LockHandle &other) |
Assignment operator. | |
Friends | |
class | AudioDevice |
SDL2pp::AudioDevice lock.
Audio devices may be locked, which means that audio callback will not be called in a locked state, allowing to change data it accesses in a thread-safe way.
This class represents the lock and controls its lifetime as the lock is released as soon as LockHandle is destroyed.
Usage example:
SDL2pp::AudioDevice::LockHandle::LockHandle | ( | ) |
Create no-op lock.
This may be initialized with real lock later via move assignment
SDL2pp::AudioDevice::LockHandle::~LockHandle | ( | ) |
|
noexcept |
Move constructor.
[in] | other | SDL2pp::AudioDevice::LockHandle to move data from |
SDL2pp::AudioDevice::LockHandle::LockHandle | ( | const LockHandle & | other | ) |
Copy constructor.
[in] | other | SDL2pp::AudioDevice::LockHandle to copy data from |
AudioDevice::LockHandle & SDL2pp::AudioDevice::LockHandle::operator= | ( | const LockHandle & | other | ) |
Assignment operator.
[in] | other | SDL2pp::AudioDevice::LockHandle to copy data from |
|
noexcept |
Move assignment operator.
[in] | other | SDL2pp::AudioDevice::LockHandle to move data from |