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

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

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

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

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

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

/// 
/// {{description}}
/// 
class {{declspec}} {{classname}}
{
public:
    {{classname}}();
    virtual ~{{classname}}();

    void validate();

    /////////////////////////////////////////////
    /// {{classname}} members

    {{#vars}}
    /// 
    /// {{description}}
    /// 
    {{{dataType}}}{{#isContainer}}&{{/isContainer}} {{getter}}(){{^isContainer}} const{{/isContainer}};
    void {{setter}}({{{dataType}}} const{{^isPrimitiveType}}&{{/isPrimitiveType}} value);{{^required}}
    bool {{nameInCamelCase}}IsSet() const;
    void unset{{name}}();{{/required}}
    {{/vars}}

    friend void to_json(nlohmann::json& j, const {{classname}}& o);
    friend void from_json(const nlohmann::json& j, {{classname}}& o);
protected:
    {{#vars}}
    {{{dataType}}} m_{{name}};
    {{^required}}
    bool m_{{name}}IsSet;{{/required}}
    {{/vars}}
};

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy