forked from organicmaps/organicmaps
review fix
This commit is contained in:
parent
0a8333ddef
commit
604376fb17
14 changed files with 63 additions and 174 deletions
|
@ -1,8 +1,7 @@
|
|||
#include "backend_renderer.hpp"
|
||||
|
||||
#include "threads_commutator.hpp"
|
||||
#include "update_coverage_message.hpp"
|
||||
#include "resize_message.hpp"
|
||||
#include "message_subclasses.hpp"
|
||||
#include "impl/backend_renderer_impl.hpp"
|
||||
|
||||
#include "../std/bind.hpp"
|
||||
|
|
|
@ -14,11 +14,7 @@ SOURCES += \
|
|||
message.cpp \
|
||||
threads_commutator.cpp \
|
||||
message_acceptor.cpp \
|
||||
drop_tile_message.cpp \
|
||||
impl/backend_renderer_impl.cpp \
|
||||
update_coverage_message.cpp \
|
||||
resize_message.cpp \
|
||||
task_finish_message.cpp \
|
||||
read_mwm_task.cpp
|
||||
|
||||
HEADERS += \
|
||||
|
@ -31,10 +27,6 @@ HEADERS += \
|
|||
message.hpp \
|
||||
threads_commutator.hpp \
|
||||
message_acceptor.hpp \
|
||||
drop_tile_message.hpp \
|
||||
impl/backend_renderer_impl.hpp \
|
||||
update_coverage_message.hpp \
|
||||
resize_message.hpp \
|
||||
task_finish_message.hpp \
|
||||
read_mwm_task.hpp \
|
||||
drop_coverage_message.hpp
|
||||
message_subclasses.hpp
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include "message.hpp"
|
||||
|
||||
namespace df
|
||||
{
|
||||
class DropCoverageMessage : public Message
|
||||
{
|
||||
public:
|
||||
DropCoverageMessage()
|
||||
{
|
||||
SetType(DropCoverage);
|
||||
}
|
||||
};
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
#include "drop_tile_message.hpp"
|
||||
|
||||
namespace df
|
||||
{
|
||||
DropTileMessage::DropTileMessage(const TileKey & tileKey)
|
||||
: m_tileKey(tileKey)
|
||||
{
|
||||
SetType(DropTile);
|
||||
}
|
||||
|
||||
const TileKey & DropTileMessage::GetKey() const
|
||||
{
|
||||
return m_tileKey;
|
||||
}
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include "message.hpp"
|
||||
#include "tile_info.hpp"
|
||||
|
||||
namespace df
|
||||
{
|
||||
class DropTileMessage : public Message
|
||||
{
|
||||
public:
|
||||
DropTileMessage(const TileKey & tileKey);
|
||||
|
||||
const TileKey & GetKey() const;
|
||||
|
||||
private:
|
||||
TileKey m_tileKey;
|
||||
};
|
||||
}
|
|
@ -7,11 +7,7 @@
|
|||
#include "read_mwm_task.hpp"
|
||||
|
||||
#include "message.hpp"
|
||||
#include "update_coverage_message.hpp"
|
||||
#include "resize_message.hpp"
|
||||
#include "task_finish_message.hpp"
|
||||
#include "drop_tile_message.hpp"
|
||||
#include "drop_coverage_message.hpp"
|
||||
#include "message_subclasses.hpp"
|
||||
|
||||
#include "../geometry/screenbase.hpp"
|
||||
|
||||
|
|
59
drape_frontend/message_subclasses.hpp
Normal file
59
drape_frontend/message_subclasses.hpp
Normal file
|
@ -0,0 +1,59 @@
|
|||
#pragma once
|
||||
|
||||
#include "message.hpp"
|
||||
#include "tile_info.hpp"
|
||||
|
||||
#include "../geometry/rect2d.hpp"
|
||||
#include "../geometry/screenbase.hpp"
|
||||
|
||||
namespace threads { class IRoutine; }
|
||||
|
||||
namespace df
|
||||
{
|
||||
class DropCoverageMessage : public Message
|
||||
{
|
||||
public:
|
||||
DropCoverageMessage() { SetType(DropCoverage); }
|
||||
};
|
||||
|
||||
class DropTileMessage : public Message
|
||||
{
|
||||
public:
|
||||
DropTileMessage(const TileKey & tileKey) : m_tileKey(tileKey) {}
|
||||
const TileKey & GetKey() const { return m_tileKey; }
|
||||
|
||||
private:
|
||||
TileKey m_tileKey;
|
||||
};
|
||||
|
||||
class ResizeMessage : public Message
|
||||
{
|
||||
public:
|
||||
ResizeMessage(int x, int y, int w, int h) : m_rect(x, y, x + w, y + h) {}
|
||||
ResizeMessage(m2::RectI const & rect) : m_rect(rect) {}
|
||||
const m2::RectI & GetRect() const { return m_rect; }
|
||||
|
||||
private:
|
||||
m2::RectI m_rect;
|
||||
};
|
||||
|
||||
class TaskFinishMessage : public Message
|
||||
{
|
||||
public:
|
||||
TaskFinishMessage(threads::IRoutine * routine) : m_routine(routine) {}
|
||||
threads::IRoutine * GetRoutine() const { return m_routine; }
|
||||
|
||||
private:
|
||||
threads::IRoutine * m_routine;
|
||||
};
|
||||
|
||||
class UpdateCoverageMessage : public Message
|
||||
{
|
||||
public:
|
||||
UpdateCoverageMessage(ScreenBase const & screen) : m_screen(screen) {}
|
||||
const ScreenBase & GetScreen() const { return m_screen; }
|
||||
|
||||
private:
|
||||
ScreenBase m_screen;
|
||||
};
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
#include "resize_message.hpp"
|
||||
|
||||
namespace df
|
||||
{
|
||||
ResizeMessage::ResizeMessage(int x, int y, int w, int h)
|
||||
: m_rect(x, y, x + w, y + h)
|
||||
{
|
||||
SetType(Resize);
|
||||
}
|
||||
|
||||
ResizeMessage::ResizeMessage(m2::RectI const & rect)
|
||||
: m_rect(rect)
|
||||
{
|
||||
SetType(Resize);
|
||||
}
|
||||
|
||||
const m2::RectI & ResizeMessage::GetRect() const
|
||||
{
|
||||
return m_rect;
|
||||
}
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include "message.hpp"
|
||||
|
||||
#include "../geometry/rect2d.hpp"
|
||||
|
||||
namespace df
|
||||
{
|
||||
class ResizeMessage : public Message
|
||||
{
|
||||
public:
|
||||
ResizeMessage(int x, int y, int w, int h);
|
||||
ResizeMessage(m2::RectI const & rect);
|
||||
|
||||
const m2::RectI & GetRect() const;
|
||||
|
||||
private:
|
||||
m2::RectI m_rect;
|
||||
};
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
#include "task_finish_message.hpp"
|
||||
|
||||
namespace df
|
||||
{
|
||||
TaskFinishMessage::TaskFinishMessage(threads::IRoutine * routine)
|
||||
: m_routine(routine)
|
||||
{
|
||||
SetType(TaskFinish);
|
||||
}
|
||||
|
||||
threads::IRoutine * TaskFinishMessage::GetRoutine() const
|
||||
{
|
||||
return m_routine;
|
||||
}
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include "message.hpp"
|
||||
|
||||
namespace threads { class IRoutine; }
|
||||
|
||||
namespace df
|
||||
{
|
||||
class TaskFinishMessage : public Message
|
||||
{
|
||||
public:
|
||||
TaskFinishMessage(threads::IRoutine * routine);
|
||||
|
||||
threads::IRoutine * GetRoutine() const;
|
||||
|
||||
private:
|
||||
threads::IRoutine * m_routine;
|
||||
};
|
||||
}
|
|
@ -8,8 +8,7 @@ namespace df
|
|||
{
|
||||
void ThreadsCommutator::RegisterThread(ThreadName name, MessageAcceptor * acceptor)
|
||||
{
|
||||
ASSERT(m_acceptors.find(name) == m_acceptors.end(), ());
|
||||
m_acceptors[name] = acceptor;
|
||||
VERIFY(m_acceptors.insert(make_pair(name, acceptor)).second, ());
|
||||
}
|
||||
|
||||
void ThreadsCommutator::PostMessage(ThreadName name, Message * message)
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
#include "update_coverage_message.hpp"
|
||||
|
||||
namespace df
|
||||
{
|
||||
UpdateCoverageMessage::UpdateCoverageMessage(ScreenBase const & screen)
|
||||
: m_screen(screen)
|
||||
{
|
||||
SetType(UpdateCoverage);
|
||||
}
|
||||
|
||||
const ScreenBase & UpdateCoverageMessage::GetScreen() const
|
||||
{
|
||||
return m_screen;
|
||||
}
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include "message.hpp"
|
||||
#include "../geometry/screenbase.hpp"
|
||||
|
||||
namespace df
|
||||
{
|
||||
class UpdateCoverageMessage : public Message
|
||||
{
|
||||
public:
|
||||
UpdateCoverageMessage(ScreenBase const & screen);
|
||||
|
||||
const ScreenBase & GetScreen() const;
|
||||
|
||||
private:
|
||||
ScreenBase m_screen;
|
||||
};
|
||||
}
|
Loading…
Add table
Reference in a new issue