blob: 640b5f46f14052a91d26bfe7ffd021b8a8444295 (
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
|
#include "drape_frontend/threads_commutator.hpp"
#include "drape_frontend/message_acceptor.hpp"
#include "base/assert.hpp"
namespace df
{
void ThreadsCommutator::RegisterThread(ThreadName name, MessageAcceptor * acceptor)
{
VERIFY(m_acceptors.insert(make_pair(name, acceptor)).second, ());
}
void ThreadsCommutator::PostMessage(ThreadName name, dp::TransferPointer<Message> message)
{
acceptors_map_t::iterator it = m_acceptors.find(name);
ASSERT(it != m_acceptors.end(), ());
if (it != m_acceptors.end())
it->second->PostMessage(message);
}
} // namespace df
|