diff data/fft/FFTDataServer.cpp @ 152:21792a550ec9 last-cc-copyright

* Move the current DenseThreeDimensionalModel to EditableDenseThreeDimensionalModel (wow!), and make DTDM an abstract base * Move FFTFuzzyAdapter to FFTModel as a new subclass of DTDM
author Chris Cannam
date Mon, 31 Jul 2006 17:05:18 +0000
parents 4b2ea82fd0ed
children 8d92611901d3
line wrap: on
line diff
--- a/data/fft/FFTDataServer.cpp	Mon Jul 31 16:15:45 2006 +0000
+++ b/data/fft/FFTDataServer.cpp	Mon Jul 31 17:05:18 2006 +0000
@@ -112,11 +112,11 @@
     // smaller increment, we can draw the results from it (provided
     // our increment is a multiple of its)
     //
-    // The FFTFuzzyAdapter knows how to interpret these things.  In
+    // The FFTModel knows how to interpret these things.  In
     // both cases we require that the larger one is a power-of-two
     // multiple of the smaller (e.g. even though in principle you can
     // draw the results at increment 256 from those at increment 768
-    // or 1536, the fuzzy adapter doesn't support this).
+    // or 1536, the model doesn't support this).
 
     {
         QMutexLocker locker(&m_serverMapMutex);
@@ -208,6 +208,23 @@
 }
 
 void
+FFTDataServer::claimInstance(FFTDataServer *server)
+{
+    
+    QMutexLocker locker(&m_serverMapMutex);
+
+    for (ServerMap::iterator i = m_servers.begin(); i != m_servers.end(); ++i) {
+        if (i->second.first == server) {
+            ++i->second.second;
+            return;
+        }
+    }
+    
+    std::cerr << "ERROR: FFTDataServer::claimInstance: instance "
+              << server << " unknown!" << std::endl;
+}
+
+void
 FFTDataServer::releaseInstance(FFTDataServer *server)
 {
 #ifdef DEBUG_FFT_SERVER