Mercurial > hg > svcore
comparison base/MatrixFileCache.h @ 92:4988de098b25
...
author | Chris Cannam |
---|---|
date | Wed, 03 May 2006 16:09:16 +0000 |
parents | c4e163f911dd |
children | 27d726916ab3 |
comparison
equal
deleted
inserted
replaced
91:1dcf41ed3863 | 92:4988de098b25 |
---|---|
16 #ifndef _MATRIX_FILE_CACHE_H_ | 16 #ifndef _MATRIX_FILE_CACHE_H_ |
17 #define _MATRIX_FILE_CACHE_H_ | 17 #define _MATRIX_FILE_CACHE_H_ |
18 | 18 |
19 #include <sys/types.h> | 19 #include <sys/types.h> |
20 #include <QString> | 20 #include <QString> |
21 #include <QMutex> | |
22 #include <map> | |
21 | 23 |
22 // This class is _not_ thread safe. Each instance must only be used | 24 // This class is _not_ thread safe. Each instance must only be used |
23 // within a single thread. You may however have as many instances as | 25 // within a single thread. You may however have as many instances as |
24 // you like referring to the same file in separate threads. | 26 // you like referring to the same file in separate threads. |
25 | 27 |
51 Mode m_mode; | 53 Mode m_mode; |
52 size_t m_width; | 54 size_t m_width; |
53 size_t m_height; | 55 size_t m_height; |
54 size_t m_headerSize; | 56 size_t m_headerSize; |
55 size_t m_autoRegionWidth; | 57 size_t m_autoRegionWidth; |
58 QString m_fileName; | |
56 | 59 |
57 mutable off_t m_off; | 60 mutable off_t m_off; |
58 mutable size_t m_rx; | 61 mutable size_t m_rx; |
59 mutable size_t m_rw; | 62 mutable size_t m_rw; |
60 mutable bool m_userRegion; | 63 mutable bool m_userRegion; |
67 | 70 |
68 bool autoSetRegion(size_t x) const; | 71 bool autoSetRegion(size_t x) const; |
69 bool setRegion(size_t x, size_t width, bool user) const; | 72 bool setRegion(size_t x, size_t width, bool user) const; |
70 | 73 |
71 bool seekTo(size_t x, size_t y) const; | 74 bool seekTo(size_t x, size_t y) const; |
75 | |
76 static std::map<QString, int> m_refcount; | |
77 static QMutex m_refcountMutex; | |
72 }; | 78 }; |
73 | 79 |
74 #endif | 80 #endif |
75 | 81 |