Hobrasoft httpd server
Embedded HTTP server for Qt and C++
controllerexample.h
Go to the documentation of this file.
1 
7 #ifndef _Httpd_ControllerExample_H_
8 #define _Httpd_ControllerExample_H_
9 
10 #include <QObject>
11 #include "abstractcontroller.h"
12 
13 
14 namespace Example {
15 class Item;
16 
17 namespace Httpd {
18 
23  Q_OBJECT
24  public:
26 
27  protected:
28 
29  virtual bool exists (const QString& id) const;
30 
31  virtual void serviceList (HobrasoftHttpd::HttpRequest *request, HobrasoftHttpd::HttpResponse *response);
32  virtual void serviceEvents (HobrasoftHttpd::HttpRequest *request, HobrasoftHttpd::HttpResponse *response);
33  virtual void serviceIdEvents (HobrasoftHttpd::HttpRequest *request, HobrasoftHttpd::HttpResponse *response, const QString& id);
34  virtual void serviceIdGet (HobrasoftHttpd::HttpRequest *request, HobrasoftHttpd::HttpResponse *response, const QString& id);
35 
36  private slots:
40  void sendUpdate(const Item *);
41 
42 };
43 
44 }
45 }
46 
47 #endif
AbstractController(HobrasoftHttpd::HttpConnection *parent)
Constructor.
virtual bool exists(const QString &id) const
Check existence of th ID.
HttpResponse * response()
Returns new instance of HttpResponse class.
Namespace for Example.
Definition: application.h:11
Processes requests with path /example.
Abstract class for processing unified HTTP requests to server&#39;s API.
Response to HTTP request - headers, cookies and body.
Definition: httpresponse.h:30
One data item in the example.
Definition: item.h:20
Processes HTTP request, parses headers, body and files sent by HTTP protocol.
Definition: httprequest.h:23
One single connection to http server.
void sendUpdate(const Item *)
Sends data of the item to the event stream.