|
ACAV f0ba4b7c9529
Abstract Syntax Tree (AST) visualization tool for C, C++, and Objective-C
|
Qt runner that loads AST from cache and builds ACAV tree. More...
#include <AstExtractorRunner.h>
Public Types | |
| using | AstLoader |
| Function type for loading AST from file. | |
Signals | |
| void | started (const QString &astFilePath) |
| void | progress (const QString &message) |
| void | statsUpdated (const AstExtractionStats &stats) |
| void | finished (AstViewNode *root) |
| void | error (const QString &message) |
| void | logMessage (const LogEntry &entry) |
Public Member Functions | |
| AstExtractorRunner (AstContext *context, FileManager &fileManager, QObject *parent=nullptr) | |
| Construct runner with default AST loader. | |
| AstExtractorRunner (AstContext *context, FileManager &fileManager, AstLoader loader, QObject *parent=nullptr) | |
| Construct runner with custom AST loader (for testing). | |
| AstExtractorRunner (const AstExtractorRunner &)=delete | |
| AstExtractorRunner & | operator= (const AstExtractorRunner &)=delete |
| AstExtractorRunner (AstExtractorRunner &&)=delete | |
| AstExtractorRunner & | operator= (AstExtractorRunner &&)=delete |
| void | run (const QString &astFilePath, const QStringList &tuFilePaths, const QString &compilationDbPath=QString()) |
| Run extraction pipeline and emit lifecycle signals. | |
| void | setCommentExtractionEnabled (bool enabled) |
| Enable or disable comment extraction in AST. | |
| bool | commentExtractionEnabled () const |
Qt runner that loads AST from cache and builds ACAV tree.
This class handles the complete AST extraction pipeline:
Design: This runner executes synchronously (blocking). For async execution, move it to a QThread and use Qt's signal/slot mechanism.
Testing: Inject a custom AstLoader via constructor to mock AST loading.
Definition at line 80 of file AstExtractorRunner.h.
Function type for loading AST from file.
| astFilePath | Path to .ast file |
| errorOut | Output parameter for error message |
| compilationDbPath | Path to compile_commands.json for module resolution |
| sourcePath | Source file path for module mapping extraction |
Definition at line 91 of file AstExtractorRunner.h.
|
explicit |
Construct runner with default AST loader.
Definition at line 41 of file AstExtractorRunner.cpp.
|
explicit |
Construct runner with custom AST loader (for testing).
Definition at line 91 of file AstExtractorRunner.cpp.
|
inline |
Definition at line 128 of file AstExtractorRunner.h.
| void acav::AstExtractorRunner::run | ( | const QString & | astFilePath, |
| const QStringList & | tuFilePaths, | ||
| const QString & | compilationDbPath = QString() ) |
Run extraction pipeline and emit lifecycle signals.
This method is synchronous and will block until extraction completes. For async execution, move this runner to a QThread.
| astFilePath | Path to serialized .ast file |
| tuFilePaths | Paths to register with FileManager |
| compilationDbPath | Path to compilation database (used to determine working directory for loading AST with C++20 module support) |
Signals emitted: started -> progress* -> (finished | error)
Definition at line 103 of file AstExtractorRunner.cpp.
References acav::MemoryProfiler::checkpoint(), and acav::SourceLocation::resetCache().
| void acav::AstExtractorRunner::setCommentExtractionEnabled | ( | bool | enabled | ) |
Enable or disable comment extraction in AST.
Definition at line 99 of file AstExtractorRunner.cpp.