Cutelyst  3.5.0
actionrest.h
1 /*
2  * SPDX-FileCopyrightText: (C) 2013-2022 Daniel Nicoletti <dantti12@gmail.com>
3  * SPDX-License-Identifier: BSD-3-Clause
4  */
5 #ifndef ACTIONREST_H
6 #define ACTIONREST_H
7 
8 #include <Cutelyst/cutelyst_global.h>
9 #include <Cutelyst/action.h>
10 #include <Cutelyst/componentfactory.h>
11 
12 namespace Cutelyst {
13 
14 class ActionRESTPrivate;
15 class CUTELYST_PLUGIN_ACTION_REST_EXPORT ActionREST final : public Action
16 {
17  Q_OBJECT
18  Q_DECLARE_PRIVATE(ActionREST)
19 public:
23  explicit ActionREST(QObject *parent = nullptr);
24 
25 protected:
26  bool doExecute(Context *c) override;
27 };
28 
29 class ActionRESTFactory final : public QObject, public ComponentFactory
30 {
31  Q_OBJECT
32  Q_PLUGIN_METADATA(IID "org.cutelyst.ComponentFactory" FILE "metadata.json")
33  Q_INTERFACES(Cutelyst::ComponentFactory)
34 public:
35  virtual Component *createComponent(QObject *parent) override { return new ActionREST(parent); }
36 };
37 
38 }
39 
40 #endif // ACTIONREST_H
The Cutelyst Component base class.
Definition: component.h:25
This class represents a Cutelyst Action.
Definition: action.h:34
The Cutelyst Context.
Definition: context.h:38
Automated REST Method Dispatching.
Definition: actionrest.h:15
virtual Component * createComponent(QObject *parent) override
Definition: actionrest.h:35
The Cutelyst namespace holds all public Cutelyst API.
Definition: Mainpage.dox:7
QObject * parent() const const