1#ifndef H_EXTENSIONS_CUTEHMI_SERVICES_3_INCLUDE_CUTEHMI_SERVICES_SERVICEGROUP_HPP
2#define H_EXTENSIONS_CUTEHMI_SERVICES_3_INCLUDE_CUTEHMI_SERVICES_SERVICEGROUP_HPP
4#include "internal/common.hpp"
7#include "Serviceable.hpp"
8#include "ServiceGroupRule.hpp"
11#include <cutehmi/workarounds/qt5compatibility/qsizetype.hpp>
15#include <QQmlListProperty>
48 Q_PROPERTY(
int startedCount READ startedCount NOTIFY startedCountChanged)
50 Q_PROPERTY(
int startingCount READ startingCount NOTIFY startingCountChanged)
52 Q_PROPERTY(
int stoppingCount READ stoppingCount NOTIFY stoppingCountChanged)
54 Q_PROPERTY(
int stoppedCount READ stoppedCount NOTIFY stoppedCountChanged)
56 Q_PROPERTY(
int brokenCount READ brokenCount NOTIFY brokenCountChanged)
58 Q_PROPERTY(
int repairingCount READ repairingCount NOTIFY repairingCountChanged)
60 Q_PROPERTY(
int evacuatingCount READ evacuatingCount NOTIFY evacuatingCountChanged)
62 Q_PROPERTY(
int interruptedCount READ interruptedCount NOTIFY interruptedCountChanged)
64 Q_PROPERTY(
int activeCount READ activeCount NOTIFY activeCountChanged)
66 Q_PROPERTY(
int yieldingCount READ yieldingCount NOTIFY yieldingCountChanged)
68 Q_PROPERTY(
int idlingCount READ idlingCount NOTIFY idlingCountChanged)
73 Q_CLASSINFO(
"DefaultProperty",
"services")
75 static
void PostConditionCheckEvent(
QStateMachine * stateMachine);
81 int startedCount() const;
83 int startingCount() const;
85 int stoppingCount() const;
87 int stoppedCount() const;
89 int brokenCount() const;
91 int repairingCount() const;
93 int evacuatingCount() const;
95 int interruptedCount() const;
97 int activeCount() const;
99 int yieldingCount() const;
101 int idlingCount() const;
107 Q_INVOKABLE
void clearRules();
113 Q_INVOKABLE
void clearServices();
115 void configureStarting(
QState * starting, AssignStatusFunction assignStatus) override;
117 void configureStarted(
QState * active, const
QState * idling, const
QState * yielding, AssignStatusFunction assignStatus) override;
119 void configureStopping(
QState * stopping, AssignStatusFunction assignStatus) override;
121 void configureBroken(
QState * broken, AssignStatusFunction assignStatus) override;
123 void configureRepairing(
QState * repairing, AssignStatusFunction assignStatus) override;
125 void configureEvacuating(
QState * evacuating, AssignStatusFunction assignStatus) override;
137 void classBegin() override;
139 void componentComplete() override;
142 void postConditionCheckEvent() const;
145 void startedCountChanged();
147 void startingCountChanged();
149 void stoppingCountChanged();
151 void stoppedCountChanged();
153 void brokenCountChanged();
155 void repairingCountChanged();
157 void evacuatingCountChanged();
159 void interruptedCountChanged();
161 void activeCountChanged();
163 void yieldingCountChanged();
165 void idlingCountChanged();
174 void setStartedCount(
int count);
176 void setStartingCount(
int count);
178 void setStoppingCount(
int count);
180 void setStoppedCount(
int count);
182 void setBrokenCount(
int count);
184 void setRepairingCount(
int count);
186 void setEvacuatingCount(
int count);
188 void setInterruptedCount(
int count);
190 void setActiveCount(
int count);
192 void setYieldingCount(
int count);
194 void setIdlingCount(
int count);
204 Q_SIGNAL
void groupBroken();
206 Q_SIGNAL
void groupStarted();
208 Q_SIGNAL
void groupStopped();
211 void handleCounters();
214 struct ConnectionData {
230 static QString & DefaultStatus();
254 static ConnectionData * CreateConnectionDataEntry(ServiceConnectionsContainer & serviceConnections,
AbstractService * service);
256 static void DeleteConnectionDataEntry(ServiceConnectionsContainer & serviceConnections,
AbstractService * service);
260 void configureStateInterface();
262 void configureStoppingOrEvacuating(
QState * state, AssignStatusFunction assignStatus);
264 void configureStartingOrRepairing(
QState * state, AssignStatusFunction assignStatus);
267 RulesContainer rules;
269 ServicesContainer services;
271 ServiceConnectionsContainer serviceConnections;
279 int interruptedCount;
299 qmlBeingParsed(false)
Abstract service.
Definition: AbstractService.hpp:49
Service group.
Definition: ServiceGroup.hpp:37
EventType
Definition: ServiceGroup.hpp:43
Service group rule.
Definition: ServiceGroupRule.hpp:26
Serviceable interface.
Definition: Serviceable.hpp:33
Definition: ServiceStateInterface.hpp:24