|
ACAV f0ba4b7c9529
Abstract Syntax Tree (AST) visualization tool for C, C++, and Objective-C
|
Parallel runner specifically for query-dependencies tool. More...
#include <QueryDependenciesParallelRunner.h>
Signals | |
| void | dependenciesReady (const QJsonObject &dependencies) |
| Emitted when all processes complete successfully. | |
| void | dependenciesReadyWithErrors (const QJsonObject &dependencies, const QStringList &errorMessages) |
| Emitted when processes complete with some errors. | |
| Signals inherited from acav::ParallelProcessRunner | |
| void | error (const QString &errorMessage) |
| Emitted when an error occurs that prevents execution. | |
| void | progress (const QString &message) |
| Emitted with progress updates (e.g., "Completed 3/8 chunks"). | |
| void | chunkCompleted (int chunkIndex, int totalChunks) |
| Emitted when a single chunk completes successfully. | |
| void | chunkFailed (int chunkIndex, const QString &errorMessage) |
| Emitted when a single chunk fails. | |
| void | logMessage (const LogEntry &entry) |
| Emitted when a chunk process produces log output. | |
Public Member Functions | |
| QueryDependenciesParallelRunner (QObject *parent=nullptr) | |
| void | run (const QString &compilationDatabasePath, const QString &outputFilePath, const QString &queryDependenciesBinary=QString()) |
| Run query-dependencies in parallel. | |
| void | setClangResourceDir (const QString &dir) |
| Set the Clang resource directory. | |
| Public Member Functions inherited from acav::ParallelProcessRunner | |
| ParallelProcessRunner (QObject *parent=nullptr) | |
| bool | isRunning () const |
| Check if any process is currently running. | |
| void | setParallelCount (int count) |
| Set number of parallel processes (0 = auto-detect from CPU cores). | |
| int | getParallelCount () const |
| Get current parallel count setting. | |
| void | cancel () |
| Cancel all running processes. | |
Protected Member Functions | |
| QStringList | prepareProcessArguments (int chunkIndex, const QStringList &chunkData, const QString &tempOutputPath) override |
| Build command-line arguments for query-dependencies. | |
| bool | mergeResults (const QStringList &tempOutputPaths, const QString &finalOutputPath, QString &errorMessage) override |
| Merge JSON dependency files. | |
| void | onAllCompleted (int successCount, int failureCount, int totalCount) override |
| Handle completion and emit domain-specific signals. | |
| Protected Member Functions inherited from acav::ParallelProcessRunner | |
| virtual std::vector< QStringList > | chunkInputData (const QStringList &inputData, int chunkCount) const |
| Divide input data into chunks for parallel processing. | |
| QString | getTempOutputPath (int chunkIndex) const |
| Get path to temporary output file for a chunk. | |
| void | runParallel (const QString &programPath, const QStringList &inputData, const QString &finalOutputPath) |
| Start parallel execution. | |
Additional Inherited Members | |
| Protected Attributes inherited from acav::ParallelProcessRunner | |
| QString | finalOutputPath_ |
| Final output file path. | |
| QStringList | errorMessages_ |
| Aggregated error messages. | |
| QTemporaryDir | tempDir_ |
| Temporary directory for chunk outputs. | |
| QElapsedTimer | elapsed_ |
Parallel runner specifically for query-dependencies tool.
This class extends ParallelProcessRunner to handle query-dependencies-specific logic:
Usage: QueryDependenciesParallelRunner runner; connect(&runner, &QueryDependenciesParallelRunner::dependenciesReady, this, &MyClass::onDependenciesReady); runner.run("/path/to/compile_commands.json", "/path/to/output.json");
Definition at line 46 of file QueryDependenciesParallelRunner.h.
|
explicit |
Definition at line 36 of file QueryDependenciesParallelRunner.cpp.
|
overrideprotectedvirtual |
Merge JSON dependency files.
Implements acav::ParallelProcessRunner.
Definition at line 96 of file QueryDependenciesParallelRunner.cpp.
References mergeResults().
Referenced by mergeResults().
|
overrideprotectedvirtual |
Handle completion and emit domain-specific signals.
Reimplemented from acav::ParallelProcessRunner.
Definition at line 185 of file QueryDependenciesParallelRunner.cpp.
References dependenciesReady(), dependenciesReadyWithErrors(), acav::ParallelProcessRunner::error(), acav::ParallelProcessRunner::errorMessages_, acav::ParallelProcessRunner::finalOutputPath_, acav::ParallelProcessRunner::onAllCompleted(), onAllCompleted(), and acav::ParallelProcessRunner::progress().
Referenced by onAllCompleted().
|
overrideprotectedvirtual |
Build command-line arguments for query-dependencies.
Implements acav::ParallelProcessRunner.
Definition at line 74 of file QueryDependenciesParallelRunner.cpp.
References prepareProcessArguments().
Referenced by prepareProcessArguments().
| void acav::QueryDependenciesParallelRunner::run | ( | const QString & | compilationDatabasePath, |
| const QString & | outputFilePath, | ||
| const QString & | queryDependenciesBinary = QString() ) |
Run query-dependencies in parallel.
| compilationDatabasePath | Path to compile_commands.json |
| outputFilePath | Path where final dependencies.json should be written |
| queryDependenciesBinary | Path to query-dependencies executable (optional) |
Definition at line 39 of file QueryDependenciesParallelRunner.cpp.
References acav::ParallelProcessRunner::error(), run(), and acav::ParallelProcessRunner::runParallel().
Referenced by run().
|
inline |
Set the Clang resource directory.
| dir | Path to clang resource dir (lib/clang/<ver>) |
Definition at line 63 of file QueryDependenciesParallelRunner.h.