PulseAudio Qt Bindings

operation.h
1 /*
2  SPDX-FileCopyrightText: 2014-2015 Harald Sitter <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5 */
6 
7 #ifndef OPERATION_H
8 #define OPERATION_H
9 
10 #include <pulse/operation.h>
11 
12 namespace PulseAudioQt
13 {
14 /**
15  * @brief The PAOperation class
16  * Helps with management of pa_operations. pa_operations need to be expicitly
17  * unref'd after use, so this class is essentially a fancy scoping helper where
18  * destruction of an instance would also unref the held operation (if there is
19  * one).
20  */
22 {
23 public:
24  /**
25  * @brief PAOperation
26  * @param operation operation to manage the scope of
27  */
28  PAOperation(pa_operation *operation = nullptr);
29  ~PAOperation();
30 
31  PAOperation &operator=(pa_operation *operation);
32 
33  /**
34  * @brief operator !
35  * @return whether or not there is an operation pointer
36  */
37  bool operator!();
38 
39  /**
40  * @brief operator bool representing whether there is an operation
41  */
42  operator bool();
43 
44  /**
45  * @brief operator *
46  * @return pointer to internal pa_operation object
47  */
48  pa_operation *&operator*();
49 
50 private:
51  pa_operation *m_operation;
52 };
53 
54 } // PulseAudioQt
55 
56 #endif // OPERATION_H
PAOperation(pa_operation *operation=nullptr)
PAOperation.
Definition: operation.cpp:11
bool operator!()
operator !
Definition: operation.cpp:29
pa_operation *& operator*()
operator *
Definition: operation.cpp:34
The primary namespace of PulseAudioQt.
Definition: card.cpp:16
The PAOperation class Helps with management of pa_operations.
Definition: operation.h:21
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sat Jun 25 2022 06:12:40 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.