author | zecke <zecke> | 2002-10-19 00:08:35 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-10-19 00:08:35 (UTC) |
commit | 549472ef07703ef27dc5f58a37e8f16c714fb2a1 (patch) (unidiff) | |
tree | 9742f2545ef3504e61a07cef2996aa29b9db5b90 /libopie2/opiepim/backend/opimaccessbackend.h | |
parent | 598cfa66b57d61e15bc3c5ea3a9c8e7295864455 (diff) | |
download | opie-549472ef07703ef27dc5f58a37e8f16c714fb2a1.zip opie-549472ef07703ef27dc5f58a37e8f16c714fb2a1.tar.gz opie-549472ef07703ef27dc5f58a37e8f16c714fb2a1.tar.bz2 |
Add void setReadAhead(uint) to the templates
OTodoAccessSQL use the read ahead value
Diffstat (limited to 'libopie2/opiepim/backend/opimaccessbackend.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/backend/opimaccessbackend.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/libopie2/opiepim/backend/opimaccessbackend.h b/libopie2/opiepim/backend/opimaccessbackend.h index 27d3cb8..0bd2723 100644 --- a/libopie2/opiepim/backend/opimaccessbackend.h +++ b/libopie2/opiepim/backend/opimaccessbackend.h | |||
@@ -74,34 +74,41 @@ public: | |||
74 | virtual bool remove( int uid ) = 0; | 74 | virtual bool remove( int uid ) = 0; |
75 | 75 | ||
76 | /** | 76 | /** |
77 | * replace a record with T.uid() | 77 | * replace a record with T.uid() |
78 | */ | 78 | */ |
79 | virtual bool replace( const T& t ) = 0; | 79 | virtual bool replace( const T& t ) = 0; |
80 | 80 | ||
81 | /* | 81 | /* |
82 | * setTheFrontEnd!!! | 82 | * setTheFrontEnd!!! |
83 | */ | 83 | */ |
84 | void setFrontend( Frontend* front ); | 84 | void setFrontend( Frontend* front ); |
85 | 85 | ||
86 | /** | ||
87 | * set the read ahead count | ||
88 | */ | ||
89 | void setReadAhead( uint count ); | ||
86 | protected: | 90 | protected: |
87 | void cache( const T& t )const; | 91 | void cache( const T& t )const; |
88 | 92 | ||
89 | /** | 93 | /** |
90 | * use a prime number here! | 94 | * use a prime number here! |
91 | */ | 95 | */ |
92 | void setSaneCacheSize( int ); | 96 | void setSaneCacheSize( int ); |
93 | 97 | ||
98 | uint readAhead()const; | ||
99 | |||
94 | private: | 100 | private: |
95 | Frontend* m_front; | 101 | Frontend* m_front; |
102 | uint m_read; | ||
96 | 103 | ||
97 | }; | 104 | }; |
98 | 105 | ||
99 | template <class T> | 106 | template <class T> |
100 | OPimAccessBackend<T>::OPimAccessBackend() { | 107 | OPimAccessBackend<T>::OPimAccessBackend() { |
101 | m_front = 0l; | 108 | m_front = 0l; |
102 | } | 109 | } |
103 | template <class T> | 110 | template <class T> |
104 | OPimAccessBackend<T>::~OPimAccessBackend() { | 111 | OPimAccessBackend<T>::~OPimAccessBackend() { |
105 | 112 | ||
106 | } | 113 | } |
107 | template <class T> | 114 | template <class T> |
@@ -114,14 +121,21 @@ void OPimAccessBackend<T>::cache( const T& t )const { | |||
114 | m_front->cache( t ); | 121 | m_front->cache( t ); |
115 | } | 122 | } |
116 | template <class T> | 123 | template <class T> |
117 | void OPimAccessBackend<T>::setSaneCacheSize( int size) { | 124 | void OPimAccessBackend<T>::setSaneCacheSize( int size) { |
118 | if (m_front ) | 125 | if (m_front ) |
119 | m_front->setSaneCacheSize( size ); | 126 | m_front->setSaneCacheSize( size ); |
120 | } | 127 | } |
121 | template <class T> | 128 | template <class T> |
122 | T OPimAccessBackend<T>::find( int uid, const QArray<int>&, | 129 | T OPimAccessBackend<T>::find( int uid, const QArray<int>&, |
123 | uint, Frontend::CacheDirection )const { | 130 | uint, Frontend::CacheDirection )const { |
124 | return find( uid ); | 131 | return find( uid ); |
125 | } | 132 | } |
126 | 133 | template <class T> | |
134 | void OPimAccessBackend<T>::setReadAhead( uint count ) { | ||
135 | m_read = count; | ||
136 | } | ||
137 | template <class T> | ||
138 | uint OPimAccessBackend<T>::readAhead()const { | ||
139 | return m_read; | ||
140 | } | ||
127 | #endif | 141 | #endif |