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

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

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

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

{{{defaultInclude}}}
#include 
#include 
#include 
#include 

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

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

using namespace {{modelNamespace}};

class {{declspec}} {{classname}} {
public:
    {{classname}}(Pistache::Address addr);
    virtual ~{{classname}}() {};
    void init(size_t thr);
    void start();
    void shutdown();

    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 httpEndpoint;
    Pistache::Rest::Router router;

    {{#operation}}

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

};

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

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

{{/operations}}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy