Collage  1.0.1
Object-Oriented C++ Network Library
queueSlave.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_QUEUESLAVE_H
23 #define CO_QUEUESLAVE_H
24 
25 #include <co/api.h>
26 #include <co/object.h> // base class
27 #include <co/types.h>
28 
29 namespace co
30 {
31 namespace detail { class QueueSlave; }
32 
39 class QueueSlave : public Object
40 {
41 public:
57  CO_API QueueSlave( const uint32_t prefetchMark = LB_UNDEFINED_UINT32,
58  const uint32_t prefetchAmount = LB_UNDEFINED_UINT32 );
59 
61  virtual CO_API ~QueueSlave();
62 
74  CO_API ObjectICommand pop( const uint32_t timeout = LB_TIMEOUT_INDEFINITE );
75 
76 private:
77  detail::QueueSlave* const _impl;
78 
79  CO_API virtual void attach( const UUID& id, const uint32_t instanceID );
80 
81  virtual ChangeType getChangeType() const { return STATIC; }
82  virtual void getInstanceData( co::DataOStream& ) { LBDONTCALL }
83  virtual void applyInstanceData( co::DataIStream& is );
84 };
85 
86 } // co
87 
88 #endif // CO_QUEUESLAVE_H
non-versioned, unbuffered, static object.
Definition: object.h:52
The consumer end of a distributed queue.
Definition: queueSlave.h:39
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
virtual CO_API ~QueueSlave()
Destruct this queue consumer.
A distributed object.
Definition: object.h:45
A std::ostream-like interface for object serialization.
Definition: dataOStream.h:46
An input command specialization for objects.
CO_API QueueSlave(const uint32_t prefetchMark=LB_UNDEFINED_UINT32, const uint32_t prefetchAmount=LB_UNDEFINED_UINT32)
Construct a new queue consumer.
CO_API ObjectICommand pop(const uint32_t timeout=LB_TIMEOUT_INDEFINITE)
Dequeue an item.