CuteHMI - Services (CuteHMI.Services.2)
Serviceable.hpp
1 #ifndef H_EXTENSIONS_CUTEHMI_SERVICES_2_INCLUDE_CUTEHMI_SERVICES_SERVICEABLE_HPP
2 #define H_EXTENSIONS_CUTEHMI_SERVICES_2_INCLUDE_CUTEHMI_SERVICES_SERVICEABLE_HPP
3 
4 #include "internal/common.hpp"
5 
6 #include <QObject>
7 #include <QState>
8 #include <QSignalTransition>
9 
10 namespace cutehmi {
11 namespace services {
12 
29 class CUTEHMI_SERVICES_API Serviceable
30 {
31  public:
33 
34  Serviceable() = default;
35 
43  virtual std::unique_ptr<ServiceStatuses> configureStarted(QState * active, const QState * idling, const QState * yielding) = 0;
44 
50  virtual std::unique_ptr<ServiceStatuses> configureStarting(QState * starting) = 0;
51 
57  virtual std::unique_ptr<ServiceStatuses> configureStopping(QState * stopping) = 0;
58 
64  virtual std::unique_ptr<ServiceStatuses> configureBroken(QState * broken) = 0;
65 
71  virtual std::unique_ptr<ServiceStatuses> configureRepairing(QState * repairing) = 0;
72 
78  virtual std::unique_ptr<ServiceStatuses> configureEvacuating(QState * evacuating) = 0;
79 
85  virtual std::unique_ptr<QAbstractTransition> transitionToStarted() const = 0;
86 
92  virtual std::unique_ptr<QAbstractTransition> transitionToStopped() const = 0;
93 
99  virtual std::unique_ptr<QAbstractTransition> transitionToBroken() const = 0;
100 
106  virtual std::unique_ptr<QAbstractTransition> transitionToYielding() const = 0;
107 
113  virtual std::unique_ptr<QAbstractTransition> transitionToIdling() const = 0;
114 
115  protected:
116  virtual ~Serviceable() = default;
117 
118  Serviceable(const Serviceable & other) = default;
119 
120  Serviceable & operator =(const Serviceable & other) = default;
121 };
122 
123 }
124 }
125 
126 Q_DECLARE_METATYPE(cutehmi::services::Serviceable *)
127 
128 #endif
129 
130 //(c)C: Copyright © 2019-2020, Michał Policht <michal@policht.pl>. All rights reserved.
131 //(c)C: This file is a part of CuteHMI.
132 //(c)C: CuteHMI is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
133 //(c)C: CuteHMI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
134 //(c)C: You should have received a copy of the GNU Lesser General Public License along with CuteHMI. If not, see <https://www.gnu.org/licenses/>.
QState
cutehmi
cutehmi::services::Serviceable
Serviceable interface.
Definition: Serviceable.hpp:29
cutehmi::services::Serviceable::ServiceStatuses
QHash< QState *, QString > ServiceStatuses
Definition: Serviceable.hpp:32
QHash
std::unique_ptr