File indexing completed on 2024-07-14 04:37:32

0001 /*
0002     SPDX-FileCopyrightText: 2014-2015 Harald Sitter <sitter@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 #include "operation.h"
0008 
0009 namespace PulseAudioQt
0010 {
0011 PAOperation::PAOperation(pa_operation *operation)
0012     : m_operation(operation)
0013 {
0014 }
0015 
0016 PAOperation::~PAOperation()
0017 {
0018     if (m_operation) {
0019         pa_operation_unref(m_operation);
0020     }
0021 }
0022 
0023 PAOperation &PAOperation::operator=(pa_operation *operation)
0024 {
0025     m_operation = operation;
0026     return *this;
0027 }
0028 
0029 bool PAOperation::operator!()
0030 {
0031     return !m_operation;
0032 }
0033 
0034 pa_operation *&PAOperation::operator*()
0035 {
0036     return m_operation;
0037 }
0038 
0039 PAOperation::operator bool()
0040 {
0041     return m_operation;
0042 }
0043 
0044 } // PulseAudioQt