blob: d1044a0a55c7c233828f51249f34d1f2bdfa9432 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#pragma once
#include "drape_frontend/message.hpp"
#include "drape/pointers.hpp"
#include "base/condition.hpp"
#include "std/list.hpp"
namespace df
{
class MessageQueue
{
public:
~MessageQueue();
/// if queue is empty than return NULL
dp::TransferPointer<Message> PopMessage(unsigned maxTimeWait);
void PushMessage(dp::TransferPointer<Message> message);
void CancelWait();
void ClearQuery();
private:
void WaitMessage(unsigned maxTimeWait);
private:
threads::Condition m_condition;
list<dp::MasterPointer<Message> > m_messages;
};
} // namespace df
|