Line data Source code
1 :
2 : /* Copyright (c) 2012, Daniel Nachbaur <danielnachbaur@gmail.com>
3 : *
4 : * This file is part of Collage <https://github.com/Eyescale/Collage>
5 : *
6 : * This library is free software; you can redistribute it and/or modify it under
7 : * the terms of the GNU Lesser General Public License version 2.1 as published
8 : * by the Free Software Foundation.
9 : *
10 : * This library is distributed in the hope that it will be useful, but WITHOUT
11 : * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 : * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13 : * details.
14 : *
15 : * You should have received a copy of the GNU Lesser General Public License
16 : * along with this library; if not, write to the Free Software Foundation, Inc.,
17 : * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 : */
19 :
20 : #include "queueItem.h"
21 :
22 : #include "queueMaster.h"
23 :
24 : namespace co
25 : {
26 : namespace detail
27 : {
28 : class QueueItem
29 : {
30 : public:
31 4 : explicit QueueItem(co::QueueMaster& queueMaster_)
32 4 : : queueMaster(queueMaster_)
33 : {
34 4 : }
35 :
36 0 : QueueItem(const QueueItem& rhs)
37 0 : : queueMaster(rhs.queueMaster)
38 : {
39 0 : }
40 :
41 : co::QueueMaster& queueMaster;
42 : };
43 : }
44 :
45 4 : QueueItem::QueueItem(QueueMaster& master)
46 : : DataOStream()
47 4 : , _impl(new detail::QueueItem(master))
48 : {
49 4 : enableSave();
50 4 : _enable();
51 4 : }
52 :
53 0 : QueueItem::QueueItem(const QueueItem& rhs)
54 : : DataOStream()
55 0 : , _impl(new detail::QueueItem(*rhs._impl))
56 : {
57 0 : enableSave();
58 0 : _enable();
59 0 : }
60 :
61 8 : QueueItem::~QueueItem()
62 : {
63 4 : _impl->queueMaster._addItem(*this);
64 4 : disable();
65 4 : delete _impl;
66 4 : }
67 63 : }
|