Equalizer  2.1.0
Parallel Rendering Framework
commandQueue.h
1 
2 /* Copyright (c) 2007-2015, Stefan Eilemann <eile@equalizergraphics.com>
3  * Daniel Nachbaur <danielnachbaur@gmail.com>
4  *
5  * This library is free software; you can redistribute it and/or modify it under
6  * the terms of the GNU Lesser General Public License version 2.1 as published
7  * by the Free Software Foundation.
8  *
9  * This library is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12  * details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with this library; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #ifndef EQ_COMMANDQUEUE_H
20 #define EQ_COMMANDQUEUE_H
21 
22 #include <co/commandQueue.h> // base class
23 #include <eq/types.h>
24 #include <eq/windowSystem.h> // enum
25 
26 namespace eq
27 {
33 class CommandQueue : public co::CommandQueue
34 {
35 public:
36  explicit CommandQueue(const size_t maxSize);
37  virtual ~CommandQueue();
38 
40  virtual void push(const co::ICommand& command);
41 
43  virtual void pushFront(const co::ICommand& command);
44 
46  virtual co::ICommand pop(const uint32_t timeout = LB_TIMEOUT_INDEFINITE);
47 
49  virtual co::ICommands popAll(
50  const uint32_t timeout = LB_TIMEOUT_INDEFINITE);
51 
53  virtual co::ICommand tryPop();
54 
56  int64_t resetWaitTime()
57  {
58  const int64_t time = _waitTime;
59  _waitTime = 0;
60  return time;
61  }
62 
63  void setMessagePump(MessagePump* p) { _messagePump = p; }
64  MessagePump* getMessagePump() { return _messagePump; }
65  virtual void pump();
66 
67 private:
68  MessagePump* _messagePump;
69 
71  int64_t _waitTime;
72 };
73 }
74 
75 #endif // EQ_COMMANDQUEUE_H
virtual co::ICommand tryPop()
virtual void pushFront(const co::ICommand &command)
virtual co::ICommand pop(const uint32_t timeout=LB_TIMEOUT_INDEFINITE)
virtual co::ICommands popAll(const uint32_t timeout=LB_TIMEOUT_INDEFINITE)
int64_t resetWaitTime()
Definition: commandQueue.h:56
An interface to process system messages or events.
Definition: messagePump.h:27
The Equalizer client library.
Definition: eq/agl/types.h:23
virtual void push(const co::ICommand &command)
virtual void pump()