alaCarte Maps
Renderer for OpenStreetMap tiles
|
#include <request_manager.hpp>
Classes | |
class | RunningQueue |
This file is part of alaCarte. More... | |
Public Member Functions | |
RequestManager (const shared_ptr< Configuration > &config, const shared_ptr< Geodata > &data, const shared_ptr< Renderer > &renderer, const shared_ptr< Cache > &cache, const shared_ptr< StylesheetManager > &ssm) | |
Constructs a new RequestManager with the given parameters. More... | |
~RequestManager () | |
Stops the io_service, joins all Threads and destructs the RequestManager. More... | |
void | stop () |
stops all jobs More... | |
TESTABLE void | enqueue (const shared_ptr< HttpRequest > &r) |
Enqueues the HttpRequest. More... | |
TESTABLE void | enqueue (const shared_ptr< MetaIdentifier > &ti) |
Enqueues the TileIdentifier. More... | |
TESTABLE shared_ptr< Geodata > | getGeodata () const |
Returns the Geodata. More... | |
TESTABLE shared_ptr< StylesheetManager > | getStylesheetManager () const |
Returns the StylesheetManager. More... | |
TESTABLE shared_ptr< Cache > | getCache () const |
Returns the Cache. More... | |
TESTABLE shared_ptr< Renderer > | getRenderer () const |
Returns the Renderer. More... | |
Private Member Functions | |
void | processNextRequest () |
Selects the next Job and runs it process Method. More... | |
bool | nextUserRequest () |
Selects the next Job and runs it process Method. More... | |
bool | nextPreRenderRequest () |
Private Attributes | |
shared_ptr< Geodata > | data |
shared_ptr< Renderer > | renderer |
shared_ptr< Cache > | cache |
shared_ptr< StylesheetManager > | ssm |
shared_ptr< Configuration > | config |
boost::asio::io_service | jobPool |
boost::asio::io_service::work | preventStop |
std::vector< shared_ptr< boost::thread > > | workers |
std::queue< shared_ptr< RenderCanvasFactory > > | factories |
boost::mutex | factoriesMutex |
boost::mutex | userRJMutex |
boost::mutex | preRJMutex |
std::queue< shared_ptr< HttpRequest > > | userRequests |
std::queue< shared_ptr< MetaIdentifier > > | preRenderRequests |
scoped_ptr< RunningQueue > | running |
unsigned int | currentPrerenderingThreads |
std::chrono::system_clock::time_point | prerender_start |
std::chrono::system_clock::time_point | prerender_stop |
Definition at line 42 of file request_manager.hpp.
RequestManager::RequestManager | ( | const shared_ptr< Configuration > & | config, |
const shared_ptr< Geodata > & | data, | ||
const shared_ptr< Renderer > & | renderer, | ||
const shared_ptr< Cache > & | cache, | ||
const shared_ptr< StylesheetManager > & | ssm | ||
) |
Constructs a new RequestManager with the given parameters.
And creates worker Threads.
config | The Configuration, e.g. for the amount of threads. |
data | The Geodata |
renderer | The Renderer |
cache | The Cache |
ssm | The StylesheetManager |
Definition at line 83 of file request_manager.cpp.
RequestManager::~RequestManager | ( | ) |
Stops the io_service, joins all Threads and destructs the RequestManager.
Definition at line 114 of file request_manager.cpp.
void RequestManager::enqueue | ( | const shared_ptr< HttpRequest > & | r | ) |
Enqueues the HttpRequest.
r | The HttpRequest which should be processed. |
Definition at line 138 of file request_manager.cpp.
void RequestManager::enqueue | ( | const shared_ptr< MetaIdentifier > & | ti | ) |
Enqueues the TileIdentifier.
ti | The MetaIdentifier which identifies the Tile which should be renderer. |
Definition at line 157 of file request_manager.cpp.
shared_ptr< Cache > RequestManager::getCache | ( | ) | const |
shared_ptr< Geodata > RequestManager::getGeodata | ( | ) | const |
shared_ptr< Renderer > RequestManager::getRenderer | ( | ) | const |
shared_ptr< StylesheetManager > RequestManager::getStylesheetManager | ( | ) | const |
Returns the StylesheetManager.
Definition at line 314 of file request_manager.cpp.
|
private |
Definition at line 242 of file request_manager.cpp.
|
private |
Selects the next Job and runs it process Method.
Definition at line 180 of file request_manager.cpp.
|
private |
Selects the next Job and runs it process Method.
Definition at line 169 of file request_manager.cpp.
void RequestManager::stop | ( | ) |
stops all jobs
Definition at line 123 of file request_manager.cpp.
|
private |
Definition at line 65 of file request_manager.hpp.
|
private |
Definition at line 67 of file request_manager.hpp.
|
private |
Definition at line 85 of file request_manager.hpp.
|
private |
Definition at line 63 of file request_manager.hpp.
|
private |
Definition at line 73 of file request_manager.hpp.
|
private |
Definition at line 74 of file request_manager.hpp.
|
private |
Definition at line 69 of file request_manager.hpp.
|
private |
Definition at line 87 of file request_manager.hpp.
|
private |
Definition at line 87 of file request_manager.hpp.
|
private |
Definition at line 79 of file request_manager.hpp.
|
private |
Definition at line 77 of file request_manager.hpp.
|
private |
Definition at line 70 of file request_manager.hpp.
|
private |
Definition at line 64 of file request_manager.hpp.
|
private |
Definition at line 82 of file request_manager.hpp.
|
private |
Definition at line 66 of file request_manager.hpp.
|
private |
Definition at line 78 of file request_manager.hpp.
|
private |
Definition at line 76 of file request_manager.hpp.
|
private |
Definition at line 71 of file request_manager.hpp.