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

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

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

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

{{{defaultInclude}}}
#include "ModelBase.h"

{{#imports}}{{{this}}}
{{/imports}}

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

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

    /////////////////////////////////////////////
    /// ModelBase overrides

    void validate() override;

    nlohmann::json toJson() const override;
    void fromJson(nlohmann::json& json) override;

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

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

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