cpp-restbed-server.api-header.mustache Maven / Gradle / Ivy
{{>licenseInfo}}
{{#operations}}/*
* {{classname}}.h
*
* {{description}}
*/
#ifndef {{classname}}_H_
#define {{classname}}_H_
{{{defaultInclude}}}
#include
#include
#include
#include
#include
{{#imports}}{{{import}}}
{{/imports}}
{{#apiNamespaceDeclarations}}
namespace {{this}} {
{{/apiNamespaceDeclarations}}
using namespace {{modelNamespace}};
class {{declspec}} {{classname}}: public restbed::Service
{
public:
{{classname}}();
~{{classname}}();
void startService(int const& port);
void stopService();
};
{{#operation}}
///
/// {{summary}}
///
///
/// {{notes}}
///
class {{declspec}} {{classname}}{{vendorExtensions.x-codegen-resource-name}}Resource: public restbed::Resource
{
public:
{{classname}}{{vendorExtensions.x-codegen-resource-name}}Resource();
virtual ~{{classname}}{{vendorExtensions.x-codegen-resource-name}}Resource();
void {{httpMethod}}_method_handler(const std::shared_ptr session);
{{#vendorExtensions.x-codegen-other-methods}}
void {{httpMethod}}_method_handler(const std::shared_ptr session);
{{/vendorExtensions.x-codegen-other-methods}}
void set_handler_{{httpMethod}}(
std::function(
{{#allParams}}{{{dataType}}} const &{{#hasMore}}, {{/hasMore}}{{/allParams}}
)> handler
);
{{#vendorExtensions.x-codegen-other-methods}}
void set_handler_{{httpMethod}}(
std::function(
{{#allParams}}{{{dataType}}} const &{{#hasMore}}, {{/hasMore}}{{/allParams}}
)> handler
);
{{/vendorExtensions.x-codegen-other-methods}}
private:
std::function(
{{#allParams}}{{{dataType}}} const &{{#hasMore}}, {{/hasMore}}{{/allParams}}
)> handler_{{httpMethod}}_;
{{#vendorExtensions.x-codegen-other-methods}}
std::function(
{{#allParams}}{{{dataType}}} const &{{#hasMore}}, {{/hasMore}}{{/allParams}}
)> handler_{{httpMethod}}_;
{{/vendorExtensions.x-codegen-other-methods}}
{{#allParams}}
{{{dataType}}} {{paramName}}{};
{{/allParams}}
};
{{/operation}}
{{#apiNamespaceDeclarations}}
}
{{/apiNamespaceDeclarations}}
#endif /* {{classname}}_H_ */
{{/operations}}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy