Tasktree: fix FTBFS due to unique_ptrs on forward-declared classes

Some classes have circular dependencies:

* RuntimeIteration depends on RuntimeTask
* RuntimeContainer depends on RuntimeIteration
* RuntimeTask depends on RuntimeContainer
* TaskTreePrivate depends on RuntimeTask
* RuntimeContainer depends on TaskTreePrivate

Although there are a few std::unique_ptr deployed, the code at the
moment does not fully solve the problem: the classes have an inline
destructor, and the dependency has only been forward declared, resulting
in a build error.

Make some destructors out-of-line, and define them (as defaulted) late
enough so that all the graph of classes has been seen, in order to fix
the build.

Change-Id: If150b92154061e915ebac920806717d2288c0638
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
(cherry picked from commit 71e53405a309684e4adcb8669a5f3d04319ad767)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 3fda22bd8a45bfa5877994962af67e2b6b753043)
This commit is contained in:
Giuseppe D'Angelo 2025-01-07 10:42:43 +01:00 committed by Qt Cherry-pick Bot
parent 626d129aa9
commit 724716ea33

View File

@ -1808,8 +1808,8 @@ class TaskTreePrivate
Q_DISABLE_COPY_MOVE(TaskTreePrivate)
public:
TaskTreePrivate(TaskTree *taskTree)
: q(taskTree) {}
explicit TaskTreePrivate(TaskTree *taskTree);
~TaskTreePrivate();
void start();
void stop();
@ -1906,6 +1906,7 @@ class RuntimeIteration
public:
RuntimeIteration(int index, RuntimeContainer *container);
~RuntimeIteration();
std::optional<Loop> loop() const;
void deleteChild(RuntimeTask *node);
@ -1983,6 +1984,12 @@ public:
std::unique_ptr<TaskInterface> m_task = {}; // Owning.
};
RuntimeIteration::~RuntimeIteration() = default;
TaskTreePrivate::TaskTreePrivate(TaskTree *taskTree)
: q(taskTree) {}
TaskTreePrivate::~TaskTreePrivate() = default;
static bool isProgressive(RuntimeContainer *container)
{
RuntimeIteration *iteration = container->m_parentTask->m_parentIteration;