changeset 878:a2689db084f4 tonioni

Add a callback for no models as well (so we know something has completed and can e.g. delete the handler)
author Chris Cannam
date Wed, 29 Jan 2014 17:32:08 +0000
parents b109b88bfa85
children d81c16e47e22
files transform/ModelTransformerFactory.cpp transform/ModelTransformerFactory.h
diffstat 2 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/transform/ModelTransformerFactory.cpp	Wed Jan 29 15:58:15 2014 +0000
+++ b/transform/ModelTransformerFactory.cpp	Wed Jan 29 17:32:08 2014 +0000
@@ -280,6 +280,8 @@
         if (transformer->willHaveAdditionalOutputModels()) {
             vector<Model *> mm = transformer->detachAdditionalOutputModels();
             m_handlers[transformer]->moreModelsAvailable(mm);
+        } else {
+            m_handlers[transformer]->noMoreModelsAvailable();
         }
         m_handlers.erase(transformer);
     }
--- a/transform/ModelTransformerFactory.h	Wed Jan 29 15:58:15 2014 +0000
+++ b/transform/ModelTransformerFactory.h	Wed Jan 29 17:32:08 2014 +0000
@@ -73,7 +73,11 @@
 
     class AdditionalModelHandler {
     public:
+        virtual ~AdditionalModelHandler() { }
+
+        // Exactly one of these functions will be called
         virtual void moreModelsAvailable(std::vector<Model *> models) = 0;
+        virtual void noMoreModelsAvailable() = 0;
     };
     
     /**