ClearSilver::FastCGIApplication Class Reference

Encapsulation of a FastCGI application. More...

#include <FastCGIApplication.h>

Inheritance diagram for ClearSilver::FastCGIApplication:

ClearSilver::TraceObject List of all members.

Public Types

Pointer types
typedef boost::shared_ptr<
FastCGIApplication
Ptr

Public Member Functions

virtual void operator() ()
 FastCGI application entry point.
CGIApplication::Ptr cgi () const
 Access the contained CGIApplication object.
HDF hdf ()
 Access the contained HDF object.
Constructors and assignment operators
 FastCGIApplication ()
 Default constructor.
 FastCGIApplication (CGIApplication::Ptr)
 Construct from a CGIApplication object.
 FastCGIApplication (CGIApplication::Ptr, const HDF &)
 Constructor.
 FastCGIApplication (const FastCGIApplication &)
 Copy constructor.
virtual ~FastCGIApplication () throw ()
 Destructor.
FastCGIApplicationoperator= (const FastCGIApplication &)
 Assignment operator.
void swap (FastCGIApplication &) throw ()
 Swap contents with another object.

Static Public Member Functions

static bool & debug ()
 Access the debug flag.

Detailed Description

Encapsulation of a FastCGI application.

The class provides a template for constructing FastCGI applications. The function call method (operator()) provides the underlying FastCGI application logic, while the contained CGIApplication object provides the per-request logic. If the FastCGI object is constructed with an HDF dataset, that dataset is retained from one request to the next.

By providing the core of an algorithm with suitable hooks for derived classes, this class was inspired by the Template Method pattern described in the following reference.

The primary difference between this class and the canonical Template Method pattern is that here the entire algorithm may be replaced in derived classes, whereas in the pattern only certain elements within the algorithm can be and the core algorithmic structure remains constant. In this case it is expected that the core algorithm provided by the FastCGIApplication class will be suitable as the majority of the application logic is actually encapsulated within the contained CGIApplication class rather than within the FastCGIApplication method itself. The behavior can be changed, however, if it that assumption proves inadequate in certain situations.

Definition at line 93 of file FastCGIApplication.h.


Member Function Documentation

bool & ClearSilver::FastCGIApplication::debug  )  [static]
 

Access the debug flag.

If the debug flag is true, syslog(3) messages with priority LOG_DEBUG will be logged.

Definition at line 159 of file FastCGIApplication.cc.

void ClearSilver::FastCGIApplication::operator()  )  [virtual]
 

FastCGI application entry point.

This method is the main entry point for FastCGI applications. Although it can be overridden in derived classes, essentially it executes the following application logic.

 CGI cgi (hdf_);             // replace CGI environment in application
 *cgi_ = cgi;
 (*cgi_)();            // execute CGI application

In addition, by default all exceptions thrown by the CGI application are caught and recorded in the system log.

Definition at line 113 of file FastCGIApplication.cc.

References cgi().


The documentation for this class was generated from the following files:
Generated on Tue May 16 14:50:54 2006 for ClearSilver C++ Library by  doxygen 1.4.5