Diffstat (limited to 'libopie/pim/opimaccesstemplate.h') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie/pim/opimaccesstemplate.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libopie/pim/opimaccesstemplate.h b/libopie/pim/opimaccesstemplate.h index 50cb1e4..c5523a8 100644 --- a/libopie/pim/opimaccesstemplate.h +++ b/libopie/pim/opimaccesstemplate.h | |||
@@ -95,48 +95,49 @@ public: | |||
95 | virtual bool add( const T& t ) ; | 95 | virtual bool add( const T& t ) ; |
96 | 96 | ||
97 | /* only the uid matters */ | 97 | /* only the uid matters */ |
98 | /** | 98 | /** |
99 | * remove T from the backend | 99 | * remove T from the backend |
100 | * @param t The item to remove | 100 | * @param t The item to remove |
101 | * @return <i>true</i> if successful. | 101 | * @return <i>true</i> if successful. |
102 | */ | 102 | */ |
103 | virtual bool remove( const T& t ); | 103 | virtual bool remove( const T& t ); |
104 | 104 | ||
105 | /** | 105 | /** |
106 | * remove the OPimRecord with uid | 106 | * remove the OPimRecord with uid |
107 | * @param uid The ID of the item to remove | 107 | * @param uid The ID of the item to remove |
108 | * @return <i>true</i> if successful. | 108 | * @return <i>true</i> if successful. |
109 | */ | 109 | */ |
110 | virtual bool remove( int uid ); | 110 | virtual bool remove( int uid ); |
111 | 111 | ||
112 | /** | 112 | /** |
113 | * replace T from backend | 113 | * replace T from backend |
114 | * @param t The item to replace | 114 | * @param t The item to replace |
115 | * @return <i>true</i> if successful. | 115 | * @return <i>true</i> if successful. |
116 | */ | 116 | */ |
117 | virtual bool replace( const T& t) ; | 117 | virtual bool replace( const T& t) ; |
118 | 118 | ||
119 | void setReadAhead( uint count ); | ||
119 | /** | 120 | /** |
120 | * @internal | 121 | * @internal |
121 | */ | 122 | */ |
122 | void cache( const T& )const; | 123 | void cache( const T& )const; |
123 | void setSaneCacheSize( int ); | 124 | void setSaneCacheSize( int ); |
124 | protected: | 125 | protected: |
125 | /** | 126 | /** |
126 | * invalidate the cache | 127 | * invalidate the cache |
127 | */ | 128 | */ |
128 | void invalidateCache(); | 129 | void invalidateCache(); |
129 | 130 | ||
130 | void setBackEnd( BackEnd* end ); | 131 | void setBackEnd( BackEnd* end ); |
131 | /** | 132 | /** |
132 | * returns the backend | 133 | * returns the backend |
133 | */ | 134 | */ |
134 | BackEnd* backEnd(); | 135 | BackEnd* backEnd(); |
135 | BackEnd* m_backEnd; | 136 | BackEnd* m_backEnd; |
136 | Cache m_cache; | 137 | Cache m_cache; |
137 | 138 | ||
138 | }; | 139 | }; |
139 | 140 | ||
140 | template <class T> | 141 | template <class T> |
141 | OPimAccessTemplate<T>::OPimAccessTemplate( BackEnd* end ) | 142 | OPimAccessTemplate<T>::OPimAccessTemplate( BackEnd* end ) |
142 | : OTemplateBase<T>(), m_backEnd( end ) | 143 | : OTemplateBase<T>(), m_backEnd( end ) |
@@ -230,25 +231,29 @@ void OPimAccessTemplate<T>::invalidateCache() { | |||
230 | } | 231 | } |
231 | template <class T> | 232 | template <class T> |
232 | OPimAccessTemplate<T>::BackEnd* OPimAccessTemplate<T>::backEnd() { | 233 | OPimAccessTemplate<T>::BackEnd* OPimAccessTemplate<T>::backEnd() { |
233 | return m_backEnd; | 234 | return m_backEnd; |
234 | } | 235 | } |
235 | template <class T> | 236 | template <class T> |
236 | bool OPimAccessTemplate<T>::wasChangedExternally()const { | 237 | bool OPimAccessTemplate<T>::wasChangedExternally()const { |
237 | return false; | 238 | return false; |
238 | } | 239 | } |
239 | template <class T> | 240 | template <class T> |
240 | void OPimAccessTemplate<T>::setBackEnd( BackEnd* end ) { | 241 | void OPimAccessTemplate<T>::setBackEnd( BackEnd* end ) { |
241 | m_backEnd = end; | 242 | m_backEnd = end; |
242 | if (m_backEnd ) | 243 | if (m_backEnd ) |
243 | m_backEnd->setFrontend( this ); | 244 | m_backEnd->setFrontend( this ); |
244 | } | 245 | } |
245 | template <class T> | 246 | template <class T> |
246 | void OPimAccessTemplate<T>::cache( const T& t ) const{ | 247 | void OPimAccessTemplate<T>::cache( const T& t ) const{ |
247 | /* hacky we need to work around the const*/ | 248 | /* hacky we need to work around the const*/ |
248 | ((OPimAccessTemplate<T>*)this)->m_cache.add( t ); | 249 | ((OPimAccessTemplate<T>*)this)->m_cache.add( t ); |
249 | } | 250 | } |
250 | template <class T> | 251 | template <class T> |
251 | void OPimAccessTemplate<T>::setSaneCacheSize( int size ) { | 252 | void OPimAccessTemplate<T>::setSaneCacheSize( int size ) { |
252 | m_cache.setSize( size ); | 253 | m_cache.setSize( size ); |
253 | } | 254 | } |
255 | template <class T> | ||
256 | void OPimAccessTemplate<T>::setReadAhead( uint count ) { | ||
257 | m_backEnd->setReadAhead( count ); | ||
258 | } | ||
254 | #endif | 259 | #endif |