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

cpp-qt5-qhttpengine-server.model-header.mustache Maven / Gradle / Ivy

{{>licenseInfo}}
{{#models}}{{#model}}/*
 * {{classname}}.h
 *
 * {{description}}
 */

#ifndef {{classname}}_H
#define {{classname}}_H

#include 

{{/model}}{{/models}}
{{#imports}}{{{import}}}
{{/imports}}

#include "{{prefix}}Object.h"
#include "{{prefix}}Enum.h"


{{#models}}
{{#model}}
{{#cppNamespaceDeclarations}}
namespace {{this}} {
{{/cppNamespaceDeclarations}}

class {{classname}}: public {{prefix}}{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Enum{{/isEnum}} {
public:
    {{classname}}();
    {{classname}}(QString json);
    ~{{classname}}() override;

    QString asJson () const override;
    QJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}} asJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}}() const override;
    void fromJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}}(QJson{{^isEnum}}Object{{/isEnum}}{{#isEnum}}Value{{/isEnum}} json) override;
    void fromJson(QString jsonString) override;

    {{^isEnum}}{{#vars}}
    {{{dataType}}} {{getter}}() const;
    void {{setter}}(const {{{dataType}}} &{{name}});

    {{/vars}}{{/isEnum}}{{#isEnum}}{{#allowableValues}}
    enum class e{{classname}} {{#enumVars}}{{#-first}}{{^isString}}: int {{/isString}}{{/-first}}{{/enumVars}}{
        INVALID_VALUE_OPENAPI_GENERATED = 0,
    {{#enumVars}}
        {{#enumDescription}}
        /**
        * {{enumDescription}}
        */
        {{/enumDescription}}
        {{{name}}}{{^-last}}, {{/-last}}
    {{/enumVars}}
    };{{/allowableValues}}

    {{classname}}::e{{classname}} getValue() const;
    void setValue(const {{classname}}::e{{classname}}& value);{{/isEnum}}

    virtual bool isSet() const override;
    virtual bool isValid() const override;

private:
    void init();
    {{^isEnum}}{{#vars}}
    {{{dataType}}} {{name}};
    bool m_{{name}}_isSet;
    bool m_{{name}}_isValid;
    {{/vars}}{{/isEnum}}
    {{#isEnum}}e{{classname}} m_value;
    bool m_value_isSet;
    bool m_value_isValid;
    {{/isEnum}}
};

{{#cppNamespaceDeclarations}}
}
{{/cppNamespaceDeclarations}}

Q_DECLARE_METATYPE({{#cppNamespaceDeclarations}}{{this}}::{{/cppNamespaceDeclarations}}{{classname}})

#endif // {{classname}}_H
{{/model}}
{{/models}}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy