diff data/fileio/MatrixFile.h @ 550:107d3f3705c9

* Auto-close write-mode matrix files when all columns written
author Chris Cannam
date Thu, 05 Feb 2009 14:17:11 +0000
parents 3cc4b7cd2aa5
children 60482f13e627
line wrap: on
line diff
--- a/data/fileio/MatrixFile.h	Thu Feb 05 12:53:19 2009 +0000
+++ b/data/fileio/MatrixFile.h	Thu Feb 05 14:17:11 2009 +0000
@@ -67,7 +67,13 @@
     size_t getWidth() const { return m_width; }
     size_t getHeight() const { return m_height; }
     size_t getCellSize() const { return m_cellSize; }
-    
+
+    /**
+     * If this is set true on a write-mode MatrixFile, then the file
+     * will close() itself when all columns have been written.
+     */
+    void setAutoClose(bool a) { m_autoClose = a; }
+
     void close(); // does not decrement ref count; that happens in dtor
 
     bool haveSetColumnAt(size_t x) const;
@@ -85,6 +91,9 @@
     size_t  m_headerSize;
     QString m_fileName;
 
+    ResizeableBitset *m_setColumns; // only in writer
+    bool m_autoClose;
+
     static std::map<QString, int> m_refcount;
     static QMutex m_createMutex;