comparison data/fileio/MatrixFile.h @ 929:59e7fe1b1003 warnfix_no_size_t

Unsigned removals and warning fixes in data/
author Chris Cannam
date Tue, 17 Jun 2014 14:33:42 +0100
parents 60482f13e627
children aa588c391d1a
comparison
equal deleted inserted replaced
928:6a94bb528e9d 929:59e7fe1b1003
56 * persisting until all readers are complete. 56 * persisting until all readers are complete.
57 * 57 *
58 * MatrixFile has no built-in cache and is not thread-safe. Use a 58 * MatrixFile has no built-in cache and is not thread-safe. Use a
59 * separate MatrixFile in each thread. 59 * separate MatrixFile in each thread.
60 */ 60 */
61 MatrixFile(QString fileBase, Mode mode, size_t cellSize, 61 MatrixFile(QString fileBase, Mode mode, int cellSize,
62 size_t width, size_t height); 62 int width, int height);
63 virtual ~MatrixFile(); 63 virtual ~MatrixFile();
64 64
65 Mode getMode() const { return m_mode; } 65 Mode getMode() const { return m_mode; }
66 66
67 size_t getWidth() const { return m_width; } 67 int getWidth() const { return m_width; }
68 size_t getHeight() const { return m_height; } 68 int getHeight() const { return m_height; }
69 size_t getCellSize() const { return m_cellSize; } 69 int getCellSize() const { return m_cellSize; }
70 70
71 /** 71 /**
72 * If this is set true on a write-mode MatrixFile, then the file 72 * If this is set true on a write-mode MatrixFile, then the file
73 * will close() itself when all columns have been written. 73 * will close() itself when all columns have been written.
74 */ 74 */
75 void setAutoClose(bool a) { m_autoClose = a; } 75 void setAutoClose(bool a) { m_autoClose = a; }
76 76
77 void close(); // does not decrement ref count; that happens in dtor 77 void close(); // does not decrement ref count; that happens in dtor
78 78
79 bool haveSetColumnAt(size_t x) const; 79 bool haveSetColumnAt(int x) const;
80 void getColumnAt(size_t x, void *data); // may throw FileReadFailed 80 void getColumnAt(int x, void *data); // may throw FileReadFailed
81 void setColumnAt(size_t x, const void *data); 81 void setColumnAt(int x, const void *data);
82 82
83 protected: 83 protected:
84 int m_fd; 84 int m_fd;
85 Mode m_mode; 85 Mode m_mode;
86 int m_flags; 86 int m_flags;
87 mode_t m_fmode; 87 mode_t m_fmode;
88 size_t m_cellSize; 88 int m_cellSize;
89 size_t m_width; 89 int m_width;
90 size_t m_height; 90 int m_height;
91 size_t m_headerSize; 91 int m_headerSize;
92 QString m_fileName; 92 QString m_fileName;
93 93
94 ResizeableBitset *m_setColumns; // only in writer 94 ResizeableBitset *m_setColumns; // only in writer
95 bool m_autoClose; 95 bool m_autoClose;
96 96
100 100
101 static std::map<QString, int> m_refcount; 101 static std::map<QString, int> m_refcount;
102 static QMutex m_createMutex; 102 static QMutex m_createMutex;
103 103
104 void initialise(); 104 void initialise();
105 bool seekTo(size_t x) const; 105 bool seekTo(int col) const;
106 }; 106 };
107 107
108 #endif 108 #endif
109 109