Equalizer  1.9.0
Parallel Rendering Framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
commandQueue.h
1 
2 /* Copyright (c) 2007-2013, Stefan Eilemann <eile@equalizergraphics.com>
3  * 2012, 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 <eq/types.h>
23 #include <eq/windowSystem.h> // enum
24 #include <co/commandQueue.h> // base class
25 
26 namespace eq
27 {
33  class CommandQueue : public co::CommandQueue
34  {
35  public:
36  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 =
47  LB_TIMEOUT_INDEFINITE );
48 
50  virtual co::ICommands popAll( const uint32_t timeout =
51  LB_TIMEOUT_INDEFINITE );
52 
54  virtual co::ICommand tryPop();
55 
57  int64_t resetWaitTime()
58  { const int64_t time = _waitTime; _waitTime = 0; return time; }
59 
60  void setMessagePump( MessagePump* p ) { _messagePump = p; }
61  MessagePump* getMessagePump() { return _messagePump; }
62  virtual void pump();
63 
64  private:
65  MessagePump* _messagePump;
66 
68  int64_t _waitTime;
69  };
70 }
71 
72 #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:57
An interface to process system messages or events.
Definition: messagePump.h:27
virtual void push(const co::ICommand &command)
virtual void pump()