1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
12 #include <osl/conditn.hxx>
13 #include <osl/mutex.hxx>
14 #include <osl/thread.hxx>
15 #include <rtl/string.hxx>
19 namespace sd
{ struct IBluetoothSocket
; }
28 enum Priority
{ PRIORITY_LOW
= 1, PRIORITY_HIGH
};
29 explicit Transmitter( ::sd::IBluetoothSocket
* aSocket
);
30 virtual ~Transmitter() override
;
31 void addMessage( const OString
& aMessage
, const Priority aPriority
);
32 void notifyFinished();
35 virtual void SAL_CALL
run() override
;
37 ::sd::IBluetoothSocket
* pStreamSocket
;
39 ::osl::Condition mProcessingRequired
;
43 * Used to indicate that we're done and the transmitter loop should exit.
44 * All access must be guarded my `mMutex`.
46 bool mFinishRequested
;
47 /// Queue for low priority messages. All access must be guarded my `mMutex`.
48 std::queue
<OString
> mLowPriority
;
49 /// Queue for high priority messages. All access must be guarded my `mMutex`.
50 std::queue
<OString
> mHighPriority
;
55 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */