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

cpp-pistache-server.model-struct-header.mustache Maven / Gradle / Ivy

The newest version!
{{>licenseInfo}}
{{#models}}{{#model}}/*
 * {{classname}}.h
 *
 * {{description}}
 */

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

{{{defaultInclude}}}
{{#imports}}{{{this}}}
{{/imports}}
#include 
{{#hasOptional}}#include {{/hasOptional}}

{{#modelNamespaceDeclarations}}
namespace {{this}} {
{{/modelNamespaceDeclarations}}

struct {{classname}}
{
    {{#vars}}
    {{^required}}Pistache::Optional<{{/required}}{{{dataType}}}{{^required}}>{{/required}} {{name}};
    {{/vars}}

    bool operator==(const {{classname}}& other) const;
    bool operator!=(const {{classname}}& other) const;

    nlohmann::json to_json() const;
    static {{classname}} from_json(const nlohmann::json& j);
};

void to_json(nlohmann::json& j, const {{classname}}& o);
void from_json(const nlohmann::json& j, {{classname}}& o);

{{#modelNamespaceDeclarations}}
} // {{this}}
{{/modelNamespaceDeclarations}}

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy