summaryrefslogtreecommitdiffstats
path: root/Source/cmQtAutoGeneratorMocUic.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmQtAutoGeneratorMocUic.h')
-rw-r--r--Source/cmQtAutoGeneratorMocUic.h45
1 files changed, 27 insertions, 18 deletions
diff --git a/Source/cmQtAutoGeneratorMocUic.h b/Source/cmQtAutoGeneratorMocUic.h
index c22df29..27d73a7 100644
--- a/Source/cmQtAutoGeneratorMocUic.h
+++ b/Source/cmQtAutoGeneratorMocUic.h
@@ -8,6 +8,7 @@
#include "cmQtAutoGen.h"
#include "cmQtAutoGenerator.h"
#include "cmUVHandlePtr.h"
+#include "cmUVSignalHackRAII.h" // IWYU pragma: keep
#include "cm_uv.h"
#include "cmsys/RegularExpression.hxx"
@@ -20,6 +21,7 @@
#include <set>
#include <string>
#include <thread>
+#include <unordered_set>
#include <utility>
#include <vector>
@@ -133,7 +135,7 @@ public:
std::string CompFileAbs;
std::string PredefsFileRel;
std::string PredefsFileAbs;
- std::set<std::string> SkipList;
+ std::unordered_set<std::string> SkipList;
std::vector<std::string> IncludePaths;
std::vector<std::string> Includes;
std::vector<std::string> Definitions;
@@ -164,7 +166,7 @@ public:
bool Enabled = false;
bool SettingsChanged = false;
std::string Executable;
- std::set<std::string> SkipList;
+ std::unordered_set<std::string> SkipList;
std::vector<std::string> TargetOptions;
std::map<std::string, std::vector<std::string>> Options;
std::vector<std::string> SearchPaths;
@@ -186,15 +188,8 @@ public:
virtual void Process(WorkerT& wrk) = 0;
};
- /// @brief Deleter for classes derived from Job
- ///
- struct JobDeleterT
- {
- void operator()(JobT* job);
- };
-
// Job management types
- typedef std::unique_ptr<JobT, JobDeleterT> JobHandleT;
+ typedef std::unique_ptr<JobT> JobHandleT;
typedef std::deque<JobHandleT> JobQueueT;
/// @brief Parse source job
@@ -321,22 +316,22 @@ public:
const UicSettingsT& Uic() const { return Gen_->Uic(); }
// -- Log info
- void LogInfo(GeneratorT genType, std::string const& message) const;
+ void LogInfo(GenT genType, std::string const& message) const;
// -- Log warning
- void LogWarning(GeneratorT genType, std::string const& message) const;
- void LogFileWarning(GeneratorT genType, std::string const& filename,
+ void LogWarning(GenT genType, std::string const& message) const;
+ void LogFileWarning(GenT genType, std::string const& filename,
std::string const& message) const;
// -- Log error
- void LogError(GeneratorT genType, std::string const& message) const;
- void LogFileError(GeneratorT genType, std::string const& filename,
+ void LogError(GenT genType, std::string const& message) const;
+ void LogFileError(GenT genType, std::string const& filename,
std::string const& message) const;
- void LogCommandError(GeneratorT genType, std::string const& message,
+ void LogCommandError(GenT genType, std::string const& message,
std::vector<std::string> const& command,
std::string const& output) const;
// -- External processes
/// @brief Verbose logging version
- bool RunProcess(GeneratorT genType, ProcessResultT& result,
+ bool RunProcess(GenT genType, ProcessResultT& result,
std::vector<std::string> const& command);
private:
@@ -393,6 +388,12 @@ public:
void ParallelMocAutoUpdated();
private:
+ // -- Utility accessors
+ Logger& Log() { return Logger_; }
+ FileSystem& FileSys() { return FileSys_; }
+ // -- libuv loop accessors
+ uv_loop_t* UVLoop() { return UVLoop_.get(); }
+ cm::uv_async_ptr& UVRequest() { return UVRequest_; }
// -- Abstract processing interface
bool Init(cmMakefile* makefile) override;
bool Process() override;
@@ -413,11 +414,19 @@ private:
void MocGenerateCompilation();
private:
+ // -- Utility
+ Logger Logger_;
+ FileSystem FileSys_;
// -- Settings
BaseSettingsT Base_;
MocSettingsT Moc_;
UicSettingsT Uic_;
- // -- Progress
+ // -- libuv loop
+#ifdef CMAKE_UV_SIGNAL_HACK
+ std::unique_ptr<cmUVSignalHackRAII> UVHackRAII_;
+#endif
+ std::unique_ptr<uv_loop_t> UVLoop_;
+ cm::uv_async_ptr UVRequest_;
StageT Stage_ = StageT::SETTINGS_READ;
// -- Job queues
std::mutex JobsMutex_;