reload: encapsulate each engine generation more

This commit is contained in:
outfoxxed 2024-03-13 22:53:05 -07:00
parent 211f454de9
commit 1687ff3614
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E
7 changed files with 125 additions and 79 deletions

23
src/core/generation.hpp Normal file
View file

@ -0,0 +1,23 @@
#pragma once
#include <qobject.h>
#include <qtclasshelpermacros.h>
#include "shell.hpp"
#include "singleton.hpp"
class EngineGeneration {
public:
explicit EngineGeneration();
~EngineGeneration();
Q_DISABLE_COPY_MOVE(EngineGeneration);
// assumes root has been initialized, consumes old generation
void onReload(EngineGeneration* old);
static EngineGeneration* findObjectGeneration(QObject* object);
QQmlEngine engine;
ShellRoot* root = nullptr;
SingletonRegistry singletonRegistry;
};