alaCarte Maps
Renderer for OpenStreetMap tiles
Job Class Reference

Abstract Class which computes Tiles by a given TileIdentifier. More...

#include <job.hpp>

Public Member Functions

 Job (const shared_ptr< MetaIdentifier > &mid, const shared_ptr< Configuration > &config, const shared_ptr< RequestManager > &manager, const shared_ptr< RenderCanvas > &canvas)
 Creates a new Job and sets the RequestManager. More...
 
void process ()
 Computes a all tiles contained in the MetaIdentifier. More...
 
void deliver ()
 
void addRequest (const shared_ptr< HttpRequest > &req, const shared_ptr< TileIdentifier > &id)
 
bool isEmpty ()
 
const shared_ptr< MetaIdentifier > & getIdentifier ()
 

Private Member Functions

TESTABLE shared_ptr< TilecomputeEmpty ()
 Computes an empty Tile. More...
 
TESTABLE FixedRect computeRect (const shared_ptr< TileIdentifier > &ti)
 Computes an rectangle for the given TileIdentifier. More...
 
TESTABLE FixedRect computeRect (const shared_ptr< MetaIdentifier > &ti)
 Computes an rectangle for the given MetaIdentifier. More...
 
bool initTiles ()
 Inits the internal list of tiles that are part of the MetaTile. More...
 

Private Attributes

shared_ptr< RequestManagermanager
 RequestManager which holds all important components. More...
 
shared_ptr< RenderCanvascanvas
 supplied by worker thread More...
 
shared_ptr< Configurationconfig
 
shared_ptr< MetaIdentifiermid
 
bool empty
 
bool cached
 
std::vector< shared_ptr< Tile > > tiles
 initialized by initTiles More...
 
boost::unordered_map< TileIdentifier, std::list< shared_ptr< HttpRequest > > > requests
 
shared_ptr< Statistic::JobMeasurementmeasurement
 used to generate statistics More...
 

Detailed Description

Abstract Class which computes Tiles by a given TileIdentifier.

Definition at line 41 of file job.hpp.

Constructor & Destructor Documentation

Job::Job ( const shared_ptr< MetaIdentifier > &  mid,
const shared_ptr< Configuration > &  config,
const shared_ptr< RequestManager > &  manager,
const shared_ptr< RenderCanvas > &  canvas 
)

Creates a new Job and sets the RequestManager.

Parameters
configThe Configuration, e.g. for the prerender_level.
managerThe RequestManager which holds all important components.

Definition at line 51 of file job.cpp.

Member Function Documentation

void Job::addRequest ( const shared_ptr< HttpRequest > &  req,
const shared_ptr< TileIdentifier > &  id 
)
inline

Definition at line 51 of file job.hpp.

shared_ptr< Tile > Job::computeEmpty ( )
private

Computes an empty Tile.

Definition at line 113 of file job.cpp.

FixedRect Job::computeRect ( const shared_ptr< TileIdentifier > &  ti)
private

Computes an rectangle for the given TileIdentifier.

Parameters
tiThe TileIdentifier.

Definition at line 68 of file job.cpp.

FixedRect Job::computeRect ( const shared_ptr< MetaIdentifier > &  ti)
private

Computes an rectangle for the given MetaIdentifier.

Parameters
tiThe MetaIdentifier.

Definition at line 90 of file job.cpp.

void Job::deliver ( )

Definition at line 205 of file job.cpp.

const shared_ptr<MetaIdentifier>& Job::getIdentifier ( )
inline

Definition at line 56 of file job.hpp.

bool Job::initTiles ( )
private

Inits the internal list of tiles that are part of the MetaTile.

Returns
true if all contained tiles are in cache

Definition at line 139 of file job.cpp.

bool Job::isEmpty ( )
inline

Definition at line 55 of file job.hpp.

void Job::process ( )

Computes a all tiles contained in the MetaIdentifier.

Definition at line 156 of file job.cpp.

Member Data Documentation

bool Job::cached
private

Definition at line 72 of file job.hpp.

shared_ptr<RenderCanvas> Job::canvas
private

supplied by worker thread

Definition at line 68 of file job.hpp.

shared_ptr<Configuration> Job::config
private

Definition at line 69 of file job.hpp.

bool Job::empty
private

Definition at line 71 of file job.hpp.

shared_ptr<RequestManager> Job::manager
private

RequestManager which holds all important components.

Definition at line 66 of file job.hpp.

shared_ptr<Statistic::JobMeasurement> Job::measurement
private

used to generate statistics

Definition at line 78 of file job.hpp.

shared_ptr<MetaIdentifier> Job::mid
private

Definition at line 70 of file job.hpp.

boost::unordered_map<TileIdentifier, std::list<shared_ptr<HttpRequest> > > Job::requests
private

Definition at line 75 of file job.hpp.

std::vector<shared_ptr<Tile> > Job::tiles
private

initialized by initTiles

Definition at line 74 of file job.hpp.


The documentation for this class was generated from the following files: