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

cpp-pistache-server.api-header.mustache Maven / Gradle / Ivy

There is a newer version: 7.9.0
Show newest version
{{>licenseInfo}}
{{#operations}}/*
 * {{classname}}.h
 *
 * {{description}}
 */

#ifndef {{classname}}_H_
#define {{classname}}_H_

{{{defaultInclude}}}
#include 
#include 
#include 
#include 
{{^hasModelImport}}#include {{/hasModelImport}}

{{#imports}}{{{import}}}
{{/imports}}

{{#apiNamespaceDeclarations}}
namespace {{this}} {
{{/apiNamespaceDeclarations}}

{{#hasModelImport}}
using namespace {{modelNamespace}};{{/hasModelImport}}

class {{declspec}} {{classname}} {
public:
    {{classname}}(std::shared_ptr);
    virtual ~{{classname}}() {}
    void init();

    const std::string base = "{{basePathWithoutHost}}";

private:
    void setupRoutes();

    {{#operation}}
    void {{operationIdSnakeCase}}_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
    {{/operation}}
    void {{classnameSnakeLowerCase}}_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);

    std::shared_ptr router;
    {{#operation}}

    /// 
    /// {{summary}}
    /// 
    /// 
    /// {{notes}}
    /// 
    {{#vendorExtensions.x-codegen-pistache-is-parsing-supported}}
    {{#allParams}}
    /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}
    {{/allParams}}
    virtual void {{operationIdSnakeCase}}({{#allParams}}const {{{dataType}}} &{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}Pistache::Http::ResponseWriter &response) = 0;
    {{/vendorExtensions.x-codegen-pistache-is-parsing-supported}}
    {{^vendorExtensions.x-codegen-pistache-is-parsing-supported}}
    virtual void {{operationIdSnakeCase}}(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter &response) = 0;
    {{/vendorExtensions.x-codegen-pistache-is-parsing-supported}}
    {{/operation}}

};

{{#apiNamespaceDeclarations}}
}
{{/apiNamespaceDeclarations}}

#endif /* {{classname}}_H_ */

{{/operations}}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy