![]() |
MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
|
If a plugin wishes to return an error report via the WMS due to an invalid request, invalid configuration or any other error, then one of these classes should be created.
An exception report should be create on the heap via a new operation, it should then be populated with TSLWMSException objects. Finally the throw Exception method should be called on the report which will return the execution to the core of the WMS.
Exceptions should not be thrown in the constructor or destructor of TSLWMSPluginDataSource derived classes as they will not be caught and will cause the service to halt. Exception reports thrown during the getLayers call will form part of the server initialisation error report. Exception reports thrown during processing of a GetMap or GetFeatureInfo request will be returned as the service response.
Before throwing the report all plug-in allocated resources should be freed.
Public Member Functions | |
TSLWMSExceptionReport () | |
TSLWMSExceptionReport (const TSLWMSExceptionReport &rhs) | |
bool | addException (TSLWMSException *exception) |
bool | clearExceptions () |
void | destroy () |
const TSLWMSException * | getExceptionAt (int index) const |
unsigned int | noOfExceptions () const |
void | throwException () |
void * | operator new (size_t size) TSL_NO_THROW |
void * | operator new (size_t size, char *filename, int line) |
TSLWMSExceptionReport::TSLWMSExceptionReport | ( | ) |
Default constructor
TSLWMSExceptionReport::TSLWMSExceptionReport | ( | const TSLWMSExceptionReport & | rhs | ) |
Copy constructor
bool TSLWMSExceptionReport::addException | ( | TSLWMSException * | exception | ) |
Adds an exception to the report. This class assumes ownership of the exception object.
Returns true on success, false otherwise.
bool TSLWMSExceptionReport::clearExceptions | ( | ) |
Clears all contained exceptions.
Returns true on success, false otherwise.
void TSLWMSExceptionReport::destroy | ( | ) |
Use this method to destroy instances of this class. The destructor is private meaning that instances cannot be deleted.
const TSLWMSException * TSLWMSExceptionReport::getExceptionAt | ( | int | index | ) | const |
Queries the nth contained exception.
If the index passed is negative or our of range then null is returned.
unsigned int TSLWMSExceptionReport::noOfExceptions | ( | ) | const |
Queries the number of contained exception objects.
void * TSLWMSExceptionReport::operator new | ( | size_t | size | ) |
void * TSLWMSExceptionReport::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.
void TSLWMSExceptionReport::throwException | ( | ) |
Throw the exception. This will return control of the execution to the WMS service and should only be called from within a service's plug-in's getLayers, getMap or getFeatureInfo methods.