mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2025-07-29 02:15:09 -04:00
feat: Add basic task flow run and edit (#212)
This commit is contained in:
29
TaskFlow/core/FlowRegistry.hpp
Normal file
29
TaskFlow/core/FlowRegistry.hpp
Normal file
@ -0,0 +1,29 @@
|
||||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
#include <QHash>
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
|
||||
namespace QodeAssist::TaskFlow {
|
||||
|
||||
class Flow;
|
||||
class FlowManager;
|
||||
|
||||
class FlowRegistry : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
using FlowCreator = std::function<Flow *(FlowManager *flowManager)>;
|
||||
|
||||
explicit FlowRegistry(QObject *parent = nullptr);
|
||||
|
||||
void registerFlow(const QString &flowType, FlowCreator creator);
|
||||
Flow *createFlow(const QString &flowType, FlowManager *flowManager = nullptr) const;
|
||||
QStringList getAvailableTypes() const;
|
||||
|
||||
private:
|
||||
QHash<QString, FlowCreator> m_flowCreators;
|
||||
};
|
||||
|
||||
} // namespace QodeAssist::TaskFlow
|
Reference in New Issue
Block a user