MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
Loading...
Searching...
No Matches
TSLOGCServiceManager Class Reference

Detailed Description

This class allows multiple OGC services to be accessed via a single server entry point. OGC services should be constructed and added to an instance of this class (although services can be used standalone if desired).

User requests can then be made via the manager, which will re-direct the request to the relevant service based upon the 'service=' section of the request. If a corresponding service type is contained by the manager, it will respond to the request and that response will be returned to the user. If a corresponding service type cannot be found or the service parameter is missing, the manager will respond with an OWS v1.0.0 response indicating as such.

It should be noted that while some OGC Web Services require the 'service=' parameter to be specified for all request types, not all services do. For instance the WMS standard only dictates that the service parameter must be specified for GetCapabilities requests. Therefore the intended use of this class is only for processing 'GetCapabilities' requests. Each service should have its own server entry point, described in its service metadata, for handling all other request types.

Public Member Functions

 TSLOGCServiceManager ()
 
bool addService (TSLOGCService *service)
 
void destroy ()
 
const TSLOGCServiceoperator[] (int index) const
 
TSLOGCMIMEResponseprocessGetRequest (const char *address, const char *request)
 
TSLOGCMIMEResponseprocessGetRequest (const char *address, const char *request, TSLOGCAttributes &attributes)
 
bool removeService (const char *serviceName)
 
int numberOfServices () const
 
void * operator new (size_t size)
 
void * operator new (size_t size, char *filename, int line)
 

Constructor & Destructor Documentation

◆ TSLOGCServiceManager()

TSLOGCServiceManager::TSLOGCServiceManager ( )

Member Function Documentation

◆ addService()

bool TSLOGCServiceManager::addService ( TSLOGCService * service)

Adds a service to the manager. The manager assumes ownership of the service. Only one service of each service type may exist in a manager, therefore if a service with the same name already exists in the manager, this method will return false.

Parameters
serviceThe service instance to add.
Returns
true if the service was successfully added, false otherwise. Reasons for failure include a null service or if a service with the same name already exists in the manager.

◆ destroy()

void TSLOGCServiceManager::destroy ( )

Used to delete instances.

◆ numberOfServices()

int TSLOGCServiceManager::numberOfServices ( ) const

Query the number of services contained in the manager.

◆ operator new() [1/2]

void * TSLOGCServiceManager::operator new ( size_t size)

◆ operator new() [2/2]

void * TSLOGCServiceManager::operator new ( size_t size,
char * filename,
int line )

When included in an MFC application in debug mode, the debug new expects this to be here. Override it and return the same as the normal one. The library must include it when compiled in release mode, since the user's application may be in debug mode.

◆ operator[]()

const TSLOGCService * TSLOGCServiceManager::operator[] ( int index) const

Queries the Nth service the manager contains.

Parameters
indexThe zero-based index of the service to query

Returns the service at the specified index if one exists, null otherwise.

◆ processGetRequest() [1/2]

TSLOGCMIMEResponse * TSLOGCServiceManager::processGetRequest ( const char * address,
const char * request )

Processes an OGC 'GetCapabilities' request, directing it to the relevant contained service if a corresponding one exists.

NOTE: Any URL encoded characters should have been decoded first. E.G. The space character is encoded as %20, it should have been translated back to a space character.

Parameters
addressThe URL through which the service was accessed
requestThe request query string - I.E. The parameters that appear after the '?' part of the address.

With the exception of the case when a null address or request is passed, a TSLOGCMIMEResponse instance will always be returned, although the contents of the response object may denote a service exception. The returned object is owned by the user and should be deleted when finished with.

◆ processGetRequest() [2/2]

TSLOGCMIMEResponse * TSLOGCServiceManager::processGetRequest ( const char * address,
const char * request,
TSLOGCAttributes & attributes )

Reserved for future use.

◆ removeService()

bool TSLOGCServiceManager::removeService ( const char * serviceName)

Removes a service from the manager, deleting it in the process.

Parameters
serviceNameThe name of the service to remove.

If either the serviceName parameter is null or if the a contained service which corresponds to the passed name cannot be found, then false will be returned. Otherwise true will be returned to indicate that the service was successfully remove and thus deleted.