Rok4Server  0.25.4
 All Classes Files Functions Variables Enumerations Enumerator Pages
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
Rok4Server Class Reference

Handle the main program (event loop) and links. More...

#include <Rok4Server.h>

Collaboration diagram for Rok4Server:
Collaboration graph

Public Member Functions

ServicesConfgetServicesConf ()
std::map< std::string, Layer * > & getLayerList ()
std::map< std::string,
TileMatrixSet * > & 
getTmsList ()
std::map< std::string, Style * > & getStyleList ()
std::map< std::string,
std::vector< std::string > > & 
getWmsCapaFrag ()
std::vector< std::string > & getWmtsCapaFrag ()
DataSource * getTile (Request *request)
 Process a GetTile request.
DataStream * WMTSGetCapabilities (Request *request)
 Process a GetCapabilities WMTS request.
void run (sig_atomic_t signal_pending=0)
 Start server's thread.
void initFCGI ()
 Initialize the FastCGI Socket.
void killFCGI ()
 Destroy the FastCGI Socket.
int getFCGISocket ()
 Get the internal FastCGI socket representation, usefull for configuration reloading.
void setFCGISocket (int sockFCGI)
 Set the internal FastCGI socket representation.
void terminate ()
 Ask for server shutdown.
bool isRunning ()
 Return the server state.
bool isWMTSSupported ()
 to know if the server responde to WMTS request
bool isWMSSupported ()
 to know if the server responde to WMS request
 Rok4Server (int nbThread, ServicesConf &servicesConf, std::map< std::string, Layer * > &layerList, std::map< std::string, TileMatrixSet * > &tmsList, std::map< std::string, Style * > &styleList, std::string socket, int backlog, bool supportWMTS=true, bool supportWMS=true)
 Construction du serveur.
virtual ~Rok4Server ()
 Default destructor.

Private Member Functions

int GetDecimalPlaces (double number)
 Give the number of decimal places.
void buildWMS111Capabilities ()
 Build the invariant fragments of the WMS GetCapabilities 1.1.1.
void buildWMS130Capabilities ()
 Build the invariant fragments of the WMS GetCapabilities.
void buildWMTSCapabilities ()
 Build the invariant fragments of the WMTS GetCapabilities.
bool hasParam (std::map< std::string, std::string > &option, std::string paramName)
 Test if the request contain a specific parameter.
std::string getParam (std::map< std::string, std::string > &option, std::string paramName)
 Fetch a specific parameter value in the request.
DataStream * getMap (Request *request)
 Process a GetMap request.
DataStream * WMSGetCapabilities (Request *request)
 Process a GetCapabilities WMS request.
void processWMS (Request *request, FCGX_Request &fcgxRequest)
void processWMTS (Request *request, FCGX_Request &fcgxRequest)
void processRequest (Request *request, FCGX_Request &fcgxRequest)

Static Private Member Functions

static void * thread_loop (void *arg)
 Main event loop executed by each thread, listening to user request.

Private Attributes

std::vector< pthread_t > threads
 Threads liste.
ResponseSender S
 FCGI stream connector.
bool supportWMTS
 Define whether WMTS request should be honored.
bool supportWMS
 Define whether WMS request should be honored.
volatile bool running
 Define whether the server is running.
std::string socket
 Listening socket address (empty if lauched in managed mode)
int backlog
 Socket listen queue depth.
int sock
 Socket identifier.
ServicesConf servicesConf
 Global services configuration.
std::map< std::string, Layer * > layerList
 Available layers list.
std::map< std::string,
TileMatrixSet * > 
tmsList
 Available TileMatrixSet list.
std::map< std::string, Style * > styleList
 Available styles list.
std::map< std::string,
std::vector< std::string > > 
wmsCapaFrag
 Invariant GetCapabilities fragments ready to be concatained with request informations.
std::vector< std::string > wmtsCapaFrag
 Invariant GetCapabilities fragments ready to be concatained with request informations.
DataSource * notFoundError
 Error response in case data tiel is not found (http 404)

Detailed Description

Handle the main program (event loop) and links.

Author
Institut national de l'information géographique et forestière

The Rok4 Server stores services configuration. It also define the event loop to handle the FCGI request

Member Function Documentation

void Rok4Server::buildWMS111Capabilities ( )
private

Build the invariant fragments of the WMS GetCapabilities 1.1.1.

Tag a remplacer par le nom du serveur

Tag à remplacer par le chemin complet avant le ?.

Tag à remplacer par la déclaration de DTD, tinyXMl ne gère pas les DTD. #HackDeLaMortQuiTue par Thibbo

Here is the call graph for this function:

Here is the caller graph for this function:

void Rok4Server::buildWMS130Capabilities ( )
private

Build the invariant fragments of the WMS GetCapabilities.

Tag a remplacer par le nom du serveur

Tag à remplacer par le chemin complet avant le ?.

Here is the call graph for this function:

Here is the caller graph for this function:

void Rok4Server::buildWMTSCapabilities ( )
private

Build the invariant fragments of the WMTS GetCapabilities.

Tag à remplacer par le chemin complet avant le ?.

Here is the call graph for this function:

Here is the caller graph for this function:

int Rok4Server::GetDecimalPlaces ( double  number)
private

Give the number of decimal places.

Parameters
[in]arga double
Returns
int value

Here is the caller graph for this function:

int Rok4Server::getFCGISocket ( )
inline

Get the internal FastCGI socket representation, usefull for configuration reloading.

Returns
the internal FastCGI socket representation

Here is the caller graph for this function:

std::map<std::string, Layer*>& Rok4Server::getLayerList ( )
inline

Return the layers list

Here is the caller graph for this function:

DataStream * Rok4Server::getMap ( Request request)
private

Process a GetMap request.

Parameters
[in]requestrequest representation
Returns
requested image or an error message

Here is the call graph for this function:

Here is the caller graph for this function:

std::string Rok4Server::getParam ( std::map< std::string, std::string > &  option,
std::string  paramName 
)
private

Fetch a specific parameter value in the request.

Parameters
[in]optionparameter list
[in]paramNameparameter name
Returns
parameter value or "" if not availlable

Here is the caller graph for this function:

ServicesConf& Rok4Server::getServicesConf ( )
inline

Return the services configurations

Here is the caller graph for this function:

std::map<std::string, Style*>& Rok4Server::getStyleList ( )
inline

Return the styles list

Here is the caller graph for this function:

DataSource * Rok4Server::getTile ( Request request)

Process a GetTile request.

Parameters
[in]requestrequest representation
Returns
requested image or an error message

Here is the call graph for this function:

Here is the caller graph for this function:

std::map<std::string, TileMatrixSet*>& Rok4Server::getTmsList ( )
inline

Return the TileMatrixSets list

Here is the caller graph for this function:

std::map<std::string,std::vector<std::string> >& Rok4Server::getWmsCapaFrag ( )
inline

Return WMS GetCapabilities fragments

std::vector<std::string>& Rok4Server::getWmtsCapaFrag ( )
inline

Return WMTS GetCapabilities fragments

bool Rok4Server::hasParam ( std::map< std::string, std::string > &  option,
std::string  paramName 
)
private

Test if the request contain a specific parameter.

Parameters
[in]optionparameter list
[in]paramNameparameter to test
Returns
true if present
bool Rok4Server::isRunning ( )
inline

Return the server state.

Returns
true if running

Here is the caller graph for this function:

void Rok4Server::processRequest ( Request request,
FCGX_Request &  fcgxRequest 
)
private

Route WMS and WMTS request

Here is the call graph for this function:

Here is the caller graph for this function:

void Rok4Server::processWMS ( Request request,
FCGX_Request &  fcgxRequest 
)
private

Process WMS request

Here is the call graph for this function:

Here is the caller graph for this function:

void Rok4Server::processWMTS ( Request request,
FCGX_Request &  fcgxRequest 
)
private

Process WMTS request

Here is the call graph for this function:

Here is the caller graph for this function:

void Rok4Server::setFCGISocket ( int  sockFCGI)
inline

Set the internal FastCGI socket representation.

Useful for configuration reloading

Parameters
sockFCGIthe internal FastCGI socket representation

Here is the caller graph for this function:

void * Rok4Server::thread_loop ( void *  arg)
staticprivate

Main event loop executed by each thread, listening to user request.

Parameters
[in]argpointer to the Rok4Server instance
Returns
true if present

Here is the call graph for this function:

Here is the caller graph for this function:

DataStream * Rok4Server::WMSGetCapabilities ( Request request)
private

Process a GetCapabilities WMS request.

Parameters
[in]requestrequest representation
Returns
response stream

Here is the call graph for this function:

Here is the caller graph for this function:

DataStream * Rok4Server::WMTSGetCapabilities ( Request request)

Process a GetCapabilities WMTS request.

Parameters
[in]requestrequest representation
Returns
response stream

Here is the call graph for this function:

Here is the caller graph for this function:


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