AusweisApp2
WorkflowController.h
gehe zur Dokumentation dieser Datei
1 
7 #pragma once
8 
9 #include "states/StateBuilder.h"
10 
11 #include <QScopedPointer>
12 #include <QSharedPointer>
13 #include <QStateMachine>
14 
15 namespace governikus
16 {
17 
19  : public QObject
20 {
21  Q_OBJECT
22 
23  protected:
24  QStateMachine mStateMachine;
25  const QSharedPointer<WorkflowContext> mContext;
26 
27  public:
28  explicit WorkflowController(const QSharedPointer<WorkflowContext>& pContext);
29 
30  void run();
31 
32  [[nodiscard]] Action getAction() const
33  {
34  return mContext->getAction();
35  }
36 
37 
38  [[nodiscard]] QSharedPointer<WorkflowContext> getContext() const
39  {
40  return mContext;
41  }
42 
43 
44  template<typename T>
46  {
47  auto state = StateBuilder::createState<T>(mContext);
48  mStateMachine.addState(state);
49  return state;
50  }
51 
52  Q_SIGNALS:
53  void fireComplete();
54 
55 };
56 
57 } // namespace governikus
Definition: WorkflowController.h:20
WorkflowController(const QSharedPointer< WorkflowContext > &pContext)
Definition: WorkflowController.cpp:15
QStateMachine mStateMachine
Definition: WorkflowController.h:24
Action getAction() const
Definition: WorkflowController.h:32
const QSharedPointer< WorkflowContext > mContext
Definition: WorkflowController.h:25
T * addState()
Definition: WorkflowController.h:45
QSharedPointer< WorkflowContext > getContext() const
Definition: WorkflowController.h:38
void run()
Definition: WorkflowController.cpp:23
#define T(v)
Definition: http_parser.cpp:237
state
Definition: http_parser.cpp:280
Implementation of GeneralAuthenticate response APDUs.
Definition: CommandApdu.h:16