Welcome to mirror list, hosted at ThFree Co, Russian Federation.

threads_commutator.cpp « drape_frontend - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 961abf0347532a752a1bd36f959f629770026d70 (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/base_renderer.hpp"

#include "base/assert.hpp"

namespace df
{

void ThreadsCommutator::RegisterThread(ThreadName name, BaseRenderer * acceptor)
{
  VERIFY(m_acceptors.insert(make_pair(name, acceptor)).second, ());
}

void ThreadsCommutator::PostMessage(ThreadName name, drape_ptr<Message> && message, MessagePriority priority)
{
  TAcceptorsMap::iterator it = m_acceptors.find(name);
  ASSERT(it != m_acceptors.end(), ());
  if (it != m_acceptors.end() && it->second->CanReceiveMessages())
    it->second->PostMessage(move(message), priority);
}

} // namespace df