OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef MOJO_PUBLIC_BINDINGS_LIB_MESSAGE_QUEUE_H_ | |
6 #define MOJO_PUBLIC_BINDINGS_LIB_MESSAGE_QUEUE_H_ | |
7 | |
8 #include <queue> | |
9 | |
10 #include "mojo/public/system/macros.h" | |
11 | |
12 namespace mojo { | |
13 class Message; | |
viettrungluu
2013/11/06 18:29:34
nit: blank line above?
| |
14 | |
15 class MessageQueue { | |
16 public: | |
17 MessageQueue(); | |
18 ~MessageQueue(); | |
19 | |
20 bool IsEmpty() const; | |
21 Message* Peek() const; | |
viettrungluu
2013/11/06 18:29:34
Should this return a const Message* (or const Mess
| |
22 | |
23 void Push(Message* message); | |
viettrungluu
2013/11/06 18:29:34
It might be good to have a comment indicating that
| |
24 | |
25 void Pop(Message* message); | |
26 void Pop(); | |
27 | |
28 private: | |
29 std::queue<Message*> queue_; | |
viettrungluu
2013/11/06 18:29:34
It's kind of sad that with Message being noncopyab
| |
30 | |
31 MOJO_DISALLOW_COPY_AND_ASSIGN(MessageQueue); | |
32 }; | |
33 | |
34 } // namespace mojo | |
35 | |
36 #endif // MOJO_PUBLIC_BINDINGS_LIB_MESSAGE_QUEUE_H_ | |
OLD | NEW |