LibreOffice Module sd (master) 1
Transmitter.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 */
9
10#pragma once
11
12#include <osl/conditn.hxx>
13#include <osl/mutex.hxx>
14#include <osl/thread.hxx>
15#include <rtl/string.hxx>
16
17#include <queue>
18
19namespace sd { struct IBluetoothSocket; }
20
21namespace sd
22{
23
25: public osl::Thread
26{
27public:
29 explicit Transmitter( ::sd::IBluetoothSocket* aSocket );
30 virtual ~Transmitter() override;
31 void addMessage( const OString& aMessage, const Priority aPriority );
32 void notifyFinished();
33
34private:
35 virtual void SAL_CALL run() override;
36
38
39 ::osl::Condition mProcessingRequired;
40
41 ::osl::Mutex mMutex;
48 std::queue<OString> mLowPriority;
50 std::queue<OString> mHighPriority;
51};
52
53}
54
55/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Transmitter(::sd::IBluetoothSocket *aSocket)
Definition: Transmitter.cxx:16
::osl::Condition mProcessingRequired
Definition: Transmitter.hxx:39
bool mFinishRequested
Used to indicate that we're done and the transmitter loop should exit.
Definition: Transmitter.hxx:46
virtual ~Transmitter() override
Definition: Transmitter.cxx:64
void notifyFinished()
Definition: Transmitter.cxx:57
std::queue< OString > mHighPriority
Queue for high priority messages. All access must be guarded my mMutex.
Definition: Transmitter.hxx:50
::sd::IBluetoothSocket * pStreamSocket
Definition: Transmitter.hxx:37
std::queue< OString > mLowPriority
Queue for low priority messages. All access must be guarded my mMutex.
Definition: Transmitter.hxx:48
virtual void SAL_CALL run() override
Definition: Transmitter.cxx:22
void addMessage(const OString &aMessage, const Priority aPriority)
Definition: Transmitter.cxx:68
::osl::Mutex mMutex
Definition: Transmitter.hxx:41
Interface for bluetooth data io.