Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site











SourceForge.net Logo

Title

 

class SkylarkApp : protected SkylarkConfig

SkylarkApp class represents the web application and allows adjusting of various aspects of application by overriding virtual methods and changing Skylark configuration, which should be only done in SkylarkApp constructor.

 

Public Method List

 

virtual void SigUsr1()

Invoked when application recieves SIGUSR1 signal. Default implementation is empty.

 


 

virtual void NotFound(Http& http)

Overriding this method can change the response in case that there no handler was found to handle the request. Default implementation is empty.

 


 

virtual void SqlError(Http& http, const SqlExc& e)

Overriding this method can change the response in case that there was SQL error in handler. Default implementation is empty.

 


 

virtual void InternalError(Http& http, const Exc& e)

Overriding this method can change the response in case that there was internal error in handler. Default implementation is empty.

 


 

virtual void Unauthorized(Http& http, const AuthExc& e)

Overriding this method can change the response in case that unauthorized request was detected. Default implementation is empty.

 


 

virtual void BadRequest(Http& http, const BadRequestExc& e)

Overriding this method can change the response in case that invalid request was detected. Default implementation is empty.

 


 

virtual void TemplateError(Http& http, const TemplateErrorExc& e)

Overriding this method can change the response in case that there is a bug in witz template. Default implementation calls InternalError with empty Exc.

 


 

virtual void WorkThread()

This method represents the main work thread body. It should be override to add any application specific initialization of thread, most importantly creating the per-thread database session (as stack object) and establishing connection to database. When all initialization work is done, it should call RunThread method to start actual handling of requests.

 


 

void RunThread()

This method should be called from WorkThread as it represents the loop used to process Http requests.

 


 

void Run()

This method should be called from APP_MAIN to start Skylark application. There can be only one SkylarkApp in single binary.

 


 

void Quit()

Quits the Skylark application (can be called from another thread).

 


 

static SkylarkApp& TheApp()

Returns a reference to the Skylark application running.

 


 

static const SkylarkConfig& Config()

Returns a reference of Skylark application configuration. Note that configuration parameters should be changed in the code only in application constructor.

 

Last edit by cxl on 05/26/2013. Do you want to contribute?. T++