All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cpp-qt5-qhttpengine-server.apirouter.h.mustache Maven / Gradle / Ivy

There is a newer version: 7.8.0
Show newest version
{{>licenseInfo}}
#ifndef {{prefix}}_APIROUTER_H
#define {{prefix}}_APIROUTER_H

#include 
#include 
#include 
#include 
#include 

#include 
#include 
#include 

{{#apiInfo}}{{#apis}}{{#operations}}#include "{{classname}}Handler.h"
{{/operations}}{{/apis}}{{/apiInfo}}

{{#cppNamespaceDeclarations}}
namespace {{this}} {
{{/cppNamespaceDeclarations}}

class RequestHandler : public  QHttpEngine::QObjectHandler
{
    Q_OBJECT
signals:
    void requestReceived(QHttpEngine::Socket *socket);

protected:
    virtual void process(QHttpEngine::Socket *socket, const QString &path){
        Q_UNUSED(path);
        emit requestReceived(socket);
    }
};

class ApiRouter : public QObject
{
    Q_OBJECT
public:
    ApiRouter();
    virtual ~ApiRouter();

    void setUpRoutes();
    void processRequest(QHttpEngine::Socket *socket);
private:
    QMultiMap> Routes;  
    {{#apiInfo}}{{#apis}}
    {{classname}}Handler *{{classname}}ApiHandler;{{/apis}}{{/apiInfo}} 
};


{{#cppNamespaceDeclarations}}
}
{{/cppNamespaceDeclarations}}

#endif // {{prefix}}_APIROUTER_H




© 2015 - 2024 Weber Informatics LLC | Privacy Policy