summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2016-11-28 14:38:50 +0100
committerSimon Hausmann <simon.hausmann@qt.io>2016-11-29 10:06:10 +0000
commitfd85b14ca803cdda43f8a6437d6d6d7d5560017f (patch)
tree3343555ed660d5f60c8cfe323d8964dc827b32f1 /src
parent066aa32db0b1c49c2b87ebb8920391eecb596c56 (diff)
Pass the factory to QScxmlInvokableService::start()
... instead of the various properties of the factory. This makes the API nicer. Change-Id: I16f3c6382d6cc71500147f8d2dbd35392924b5f0 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/scxml/qscxmlinvokableservice.cpp9
-rw-r--r--src/scxml/qscxmlinvokableservice.h9
-rw-r--r--src/scxml/qscxmlstatemachine.cpp2
3 files changed, 8 insertions, 12 deletions
diff --git a/src/scxml/qscxmlinvokableservice.cpp b/src/scxml/qscxmlinvokableservice.cpp
index 9af6be7..b135e05 100644
--- a/src/scxml/qscxmlinvokableservice.cpp
+++ b/src/scxml/qscxmlinvokableservice.cpp
@@ -236,18 +236,17 @@ QScxmlScxmlService::QScxmlScxmlService(QScxmlStateMachine *stateMachine,
QScxmlStateMachinePrivate::get(stateMachine)->m_parentStateMachine = parentStateMachine;
}
-bool QScxmlScxmlService::start(const QScxmlExecutableContent::InvokeInfo &invokeInfo,
- const QVector<QScxmlExecutableContent::ParameterInfo> &parameters,
- const QVector<QScxmlExecutableContent::StringId> &names)
+bool QScxmlScxmlService::start(const QScxmlInvokableServiceFactory *factory)
{
Q_D(QScxmlScxmlService);
qCDebug(qscxmlLog) << parentStateMachine() << "preparing to start" << d->stateMachine;
bool ok = false;
- auto id = d->calculateId(parentStateMachine(), invokeInfo, &ok);
+ auto id = d->calculateId(parentStateMachine(), factory->invokeInfo(), &ok);
if (!ok)
return false;
- auto data = d->calculateData(parentStateMachine(), parameters, names, &ok);
+ auto data = d->calculateData(parentStateMachine(), factory->parameters(), factory->names(),
+ &ok);
if (!ok)
return false;
diff --git a/src/scxml/qscxmlinvokableservice.h b/src/scxml/qscxmlinvokableservice.h
index 6efc07d..9e317cc 100644
--- a/src/scxml/qscxmlinvokableservice.h
+++ b/src/scxml/qscxmlinvokableservice.h
@@ -48,6 +48,7 @@ QT_BEGIN_NAMESPACE
class QScxmlEvent;
class QScxmlStateMachine;
+class QScxmlInvokableServiceFactory;
class QScxmlInvokableServicePrivate;
class Q_SCXML_EXPORT QScxmlInvokableService : public QObject
{
@@ -63,9 +64,7 @@ public:
QScxmlStateMachine *parentStateMachine() const;
- virtual bool start(const QScxmlExecutableContent::InvokeInfo &invokeInfo,
- const QVector<QScxmlExecutableContent::ParameterInfo> &parameters,
- const QVector<QScxmlExecutableContent::StringId> &names) = 0;
+ virtual bool start(const QScxmlInvokableServiceFactory *factory) = 0;
virtual QString id() const = 0;
virtual QString name() const = 0;
virtual void postEvent(QScxmlEvent *event) = 0;
@@ -106,9 +105,7 @@ public:
QScxmlStateMachine *parentStateMachine,
QObject *parent = nullptr);
- bool start(const QScxmlExecutableContent::InvokeInfo &invokeInfo,
- const QVector<QScxmlExecutableContent::ParameterInfo> &parameters,
- const QVector<QScxmlExecutableContent::StringId> &names) Q_DECL_OVERRIDE;
+ bool start(const QScxmlInvokableServiceFactory *factory) Q_DECL_OVERRIDE;
QString id() const Q_DECL_OVERRIDE;
QString name() const Q_DECL_OVERRIDE;
void postEvent(QScxmlEvent *event) Q_DECL_OVERRIDE;
diff --git a/src/scxml/qscxmlstatemachine.cpp b/src/scxml/qscxmlstatemachine.cpp
index ef5a312..cfa37de 100644
--- a/src/scxml/qscxmlstatemachine.cpp
+++ b/src/scxml/qscxmlstatemachine.cpp
@@ -449,7 +449,7 @@ void QScxmlStateMachinePrivate::addService(int invokingState)
continue; // service failed to start
const QString serviceName = service->name();
m_invokedServices[size_t(id)] = { invokingState, service, serviceName };
- service->start(factory->invokeInfo(), factory->parameters(), factory->names());
+ service->start(factory);
}
emitInvokedServicesChanged();
}