FlightGear next
|
A Base class for URI Handlers. More...
#include <urihandler.hxx>
Inherits SGReferenced.
Inherited by flightgear::http::FlightHistoryUriHandler, flightgear::http::JsonUriHandler, flightgear::http::NavdbUriHandler, flightgear::http::PkgUriHandler, flightgear::http::PropertyUriHandler, flightgear::http::RunUriHandler, and flightgear::http::ScreenshotUriHandler.
Public Member Functions | |
URIHandler (const std::string &uri) | |
virtual | ~URIHandler () |
virtual bool | handleRequest (const HTTPRequest &request, HTTPResponse &response, Connection *connection=NULL) |
This method gets called from the httpd if a request has been detected on the connection. | |
virtual bool | handleGetRequest (const HTTPRequest &request, HTTPResponse &response, Connection *connection) |
Convenience method for GET Requests, gets called by handleRequest if not overridden. | |
virtual bool | handlePutRequest (const HTTPRequest &request, HTTPResponse &response, Connection *connection) |
Convenience method for PUT Requests, gets called by handleRequest if not overridden. | |
virtual bool | poll (Connection *connection) |
This method gets called from the httpd if the preceding handleRequest() or poll() method returned false. | |
const std::string & | getUri () const |
Getter for the URI this handler serves. | |
A Base class for URI Handlers.
Provides methods for handling a request and handling subsequent polls. All methods are implemented as noops and should be overridden by deriving classes
Definition at line 64 of file urihandler.hxx.
|
inline |
Definition at line 66 of file urihandler.hxx.
|
inlinevirtual |
Definition at line 67 of file urihandler.hxx.
|
inline |
Getter for the URI this handler serves.
Definition at line 118 of file urihandler.hxx.
|
inlinevirtual |
Convenience method for GET Requests, gets called by handleRequest if not overridden.
request |
response |
connection |
Reimplemented in flightgear::http::PropertyUriHandler, and flightgear::http::ScreenshotUriHandler.
Definition at line 90 of file urihandler.hxx.
|
inlinevirtual |
Convenience method for PUT Requests, gets called by handleRequest if not overridden.
request |
response |
connection |
Definition at line 102 of file urihandler.hxx.
|
inlinevirtual |
This method gets called from the httpd if a request has been detected on the connection.
request | The HTTP Request filled in by the httpd |
response | the HTTP Response to be filled in by the hander |
connection | Connection specific information, can be used to store persistent state |
Reimplemented in flightgear::http::FlightHistoryUriHandler, flightgear::http::JsonUriHandler, flightgear::http::NavdbUriHandler, flightgear::http::PkgUriHandler, and flightgear::http::RunUriHandler.
Definition at line 76 of file urihandler.hxx.
|
inlinevirtual |
This method gets called from the httpd if the preceding handleRequest() or poll() method returned false.
connection |
Reimplemented in flightgear::http::ScreenshotUriHandler.
Definition at line 111 of file urihandler.hxx.