diff options
author | Andrzej J. R. Hunt <andrzej@ahunt.org> | 2012-07-13 17:34:49 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2012-08-06 10:22:56 +0100 |
commit | 05e4f2ac050f3d14f2e388fd3b33dcb8548182b8 (patch) | |
tree | ff745003ad75c47b984da452310f90c9a71750a0 /sd/source/ui/remotecontrol/Transmitter.hxx | |
parent | 01234d6aa88fed2f88b6080eabeeae5d391ebdbf (diff) |
Transmitter for queuing of messages (Client->Server), fixed protocol.
Change-Id: I Idcf6cf33b75dde2f921bec6c64e394e91994aba0
Diffstat (limited to 'sd/source/ui/remotecontrol/Transmitter.hxx')
-rw-r--r-- | sd/source/ui/remotecontrol/Transmitter.hxx | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/sd/source/ui/remotecontrol/Transmitter.hxx b/sd/source/ui/remotecontrol/Transmitter.hxx new file mode 100644 index 000000000000..38f05342e6e6 --- /dev/null +++ b/sd/source/ui/remotecontrol/Transmitter.hxx @@ -0,0 +1,47 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +#ifndef _SD_IMPRESSREMOTE_TRANSMITTER_HXX +#define _SD_IMPRESSREMOTE_TRANSMITTER_HXX + +#include <osl/conditn.hxx> +#include <osl/mutex.hxx> +#include <osl/socket.hxx> +#include <salhelper/thread.hxx> +#include <rtl/string.hxx> + +#include <queue> + +namespace sd +{ + +class Transmitter +: public salhelper::Thread +{ +public: + enum Priority { LOW = 1, HIGH }; + Transmitter( osl::StreamSocket &aSocket ); + ~Transmitter(); + void addMessage( rtl::OString aMessage, Priority aPriority ); + +private: + void execute(); + + osl::StreamSocket mStreamSocket; + + osl::Condition mQueuesNotEmpty; + + osl::Mutex mQueueMutex; + + std::queue<rtl::OString> mLowPriority; + std::queue<rtl::OString> mHighPriority; +}; + +} +#endif // _SD_IMPRESSREMOTE_TRANSMITTER_HXX +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file |