Collage  1.0.1
Object-Oriented C++ Network Library
queueMaster.h
1 
2 /* Copyright (c) 2011-2013, Stefan Eilemann <eile@eyescale.ch>
3  * 2011, Carsten Rohn <carsten.rohn@rtt.ag>
4  * 2011-2012, Daniel Nachbaur <danielnachbaur@gmail.com>
5  *
6  * This file is part of Collage <https://github.com/Eyescale/Collage>
7  *
8  * This library is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU Lesser General Public License version 2.1 as published
10  * by the Free Software Foundation.
11  *
12  * This library is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
15  * details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with this library; if not, write to the Free Software Foundation, Inc.,
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20  */
21 
22 #ifndef CO_QUEUEMASTER_H
23 #define CO_QUEUEMASTER_H
24 
25 #include <co/object.h> // base class
26 #include <co/types.h>
27 
28 namespace co
29 {
30 namespace detail { class QueueMaster; }
31 
39 class QueueMaster : public Object
40 {
41 public:
43  CO_API QueueMaster();
44 
46  virtual CO_API ~QueueMaster();
47 
58  CO_API QueueItem push();
59 
61  CO_API void clear();
62 
63 private:
64  detail::QueueMaster* const _impl;
65 
66  CO_API virtual void attach( const UUID& id, const uint32_t instanceID );
67 
68  virtual ChangeType getChangeType() const { return STATIC; }
69  virtual void getInstanceData( co::DataOStream& os );
70  virtual void applyInstanceData( co::DataIStream& ) { LBDONTCALL }
71 
72  friend class QueueItem;
73  void _addItem( QueueItem& item );
74 };
75 
76 } // co
77 
78 #endif // CO_QUEUEMASTER_H
non-versioned, unbuffered, static object.
Definition: object.h:52
CO_API void clear()
Remove all enqueued items.
virtual CO_API ~QueueMaster()
Destruct this queue master.
CO_API QueueMaster()
Construct a new queue master.
ChangeType
Object change handling characteristics, see Programming Guide.
Definition: object.h:49
A std::istream-like input data stream for binary data.
Definition: dataIStream.h:40
A distributed object.
Definition: object.h:45
CO_API QueueItem push()
Enqueue a new queue item.
A std::ostream-like interface for object serialization.
Definition: dataOStream.h:46
The item of the distributed queue holding the data.
Definition: queueItem.h:37
The producer end of a distributed queue.
Definition: queueMaster.h:39