|
CuteHMI - Data Acquisition (CuteHMI.DataAcquisition.0)
|
1 #ifndef H_EXTENSIONS_CUTEHMI_DATAACQUISITION_0_INCLUDE_CUTEHMI_DATAACQUISITION_INTERNAL_DBSERVICEABLEMIXIN_HPP
2 #define H_EXTENSIONS_CUTEHMI_DATAACQUISITION_0_INCLUDE_CUTEHMI_DATAACQUISITION_INTERNAL_DBSERVICEABLEMIXIN_HPP
4 #include <cutehmi/services/Serviceable.hpp>
6 #include <cutehmi/shareddatabase/Database.hpp>
12 namespace dataacquisition {
15 template <
class DERIVED>
24 const DERIVED & derived()
const;
29 template <
typename DERIVED>
34 if (derived().schema()) {
38 emit derived().databaseConnected();
45 emit derived().broke();
53 state->
addTransition(& derived(), & DERIVED::databaseConnected, target);
58 template <
typename DERIVED>
63 if (!derived().schema()) {
65 emit derived().broke();
67 derived().schema()->validate();
74 state->
addTransition(& derived(), & DERIVED::schemaValidated, target);
79 template <
typename DERIVED>
82 return static_cast<const DERIVED &
>(*this);
85 template <
typename DERIVED>
86 DERIVED & DbServiceableMixin<DERIVED>::derived()
88 return static_cast<DERIVED &
>(*this);
static bool IsConnected(const QString &connectionName)
QString translate(const char *context, const char *sourceText, const char *disambiguation, int n)
QState * createValidatingSchemaSate(QState *parent, services::Serviceable::ServiceStatuses *statuses=nullptr, QState *target=nullptr)
Definition: DbServiceableMixin.hpp:59
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QHash::iterator insert(const Key &key, const T &value)
void addTransition(QAbstractTransition *transition)
QState * createWaitingForDatabaseConnectedSate(QState *parent, services::Serviceable::ServiceStatuses *statuses=nullptr, QState *target=nullptr)
Definition: DbServiceableMixin.hpp:30
Definition: DbServiceableMixin.hpp:16
#define CUTEHMI_CRITICAL(EXPR)