diff plugincandidates.h @ 6:61dbb18f2369

Logging, timeouts
author Chris Cannam
date Wed, 13 Apr 2016 18:41:49 +0100
parents 74064d6f5e07
children
line wrap: on
line diff
--- a/plugincandidates.h	Wed Apr 13 12:06:26 2016 +0100
+++ b/plugincandidates.h	Wed Apr 13 18:41:49 2016 +0100
@@ -46,13 +46,21 @@
 class PluginCandidates
 {
     typedef std::vector<std::string> stringlist;
-    
+
 public:
     /** Construct a PluginCandidates scanner that uses the given
      *  executable as its load check helper.
      */
     PluginCandidates(std::string helperExecutableName);
 
+    struct LogCallback {
+        virtual void log(std::string) = 0;
+    };
+    
+    /** Set a callback to be called for log output.
+     */
+    void setLogCallback(LogCallback *cb);
+
     /** Scan the libraries found in the given plugin path (i.e. list
      *  of plugin directories), checking that the given descriptor
      *  symbol can be looked up in each. Store the results
@@ -85,10 +93,12 @@
     std::string m_helper;
     std::map<std::string, stringlist> m_candidates;
     std::map<std::string, std::vector<FailureRec> > m_failures;
+    LogCallback *m_logCallback;
 
     stringlist getLibrariesInPath(stringlist path);
     stringlist runHelper(stringlist libraries, std::string descriptor);
     void recordResult(std::string tag, stringlist results);
+    void log(std::string);
 };
 
 #endif