Mercurial > hg > vamp-plugin-load-checker
comparison plugincandidates.h @ 6:61dbb18f2369
Logging, timeouts
author | Chris Cannam |
---|---|
date | Wed, 13 Apr 2016 18:41:49 +0100 |
parents | 74064d6f5e07 |
children |
comparison
equal
deleted
inserted
replaced
5:74064d6f5e07 | 6:61dbb18f2369 |
---|---|
44 * Requires C++11 and the Qt5 QtCore library. | 44 * Requires C++11 and the Qt5 QtCore library. |
45 */ | 45 */ |
46 class PluginCandidates | 46 class PluginCandidates |
47 { | 47 { |
48 typedef std::vector<std::string> stringlist; | 48 typedef std::vector<std::string> stringlist; |
49 | 49 |
50 public: | 50 public: |
51 /** Construct a PluginCandidates scanner that uses the given | 51 /** Construct a PluginCandidates scanner that uses the given |
52 * executable as its load check helper. | 52 * executable as its load check helper. |
53 */ | 53 */ |
54 PluginCandidates(std::string helperExecutableName); | 54 PluginCandidates(std::string helperExecutableName); |
55 | |
56 struct LogCallback { | |
57 virtual void log(std::string) = 0; | |
58 }; | |
59 | |
60 /** Set a callback to be called for log output. | |
61 */ | |
62 void setLogCallback(LogCallback *cb); | |
55 | 63 |
56 /** Scan the libraries found in the given plugin path (i.e. list | 64 /** Scan the libraries found in the given plugin path (i.e. list |
57 * of plugin directories), checking that the given descriptor | 65 * of plugin directories), checking that the given descriptor |
58 * symbol can be looked up in each. Store the results | 66 * symbol can be looked up in each. Store the results |
59 * internally, associated with the given (arbitrary) tag, for | 67 * internally, associated with the given (arbitrary) tag, for |
83 | 91 |
84 private: | 92 private: |
85 std::string m_helper; | 93 std::string m_helper; |
86 std::map<std::string, stringlist> m_candidates; | 94 std::map<std::string, stringlist> m_candidates; |
87 std::map<std::string, std::vector<FailureRec> > m_failures; | 95 std::map<std::string, std::vector<FailureRec> > m_failures; |
96 LogCallback *m_logCallback; | |
88 | 97 |
89 stringlist getLibrariesInPath(stringlist path); | 98 stringlist getLibrariesInPath(stringlist path); |
90 stringlist runHelper(stringlist libraries, std::string descriptor); | 99 stringlist runHelper(stringlist libraries, std::string descriptor); |
91 void recordResult(std::string tag, stringlist results); | 100 void recordResult(std::string tag, stringlist results); |
101 void log(std::string); | |
92 }; | 102 }; |
93 | 103 |
94 #endif | 104 #endif |