summaryrefslogtreecommitdiff
path: root/libopie/pim/opimaccesstemplate.h
Unidiff
Diffstat (limited to 'libopie/pim/opimaccesstemplate.h') (more/less context) (show whitespace changes)
-rw-r--r--libopie/pim/opimaccesstemplate.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/libopie/pim/opimaccesstemplate.h b/libopie/pim/opimaccesstemplate.h
index c5523a8..6de68b1 100644
--- a/libopie/pim/opimaccesstemplate.h
+++ b/libopie/pim/opimaccesstemplate.h
@@ -70,25 +70,25 @@ public:
70 */ 70 */
71 virtual List queryByExample( const T& t, int querySettings ); 71 virtual List queryByExample( const T& t, int querySettings );
72 72
73 /** 73 /**
74 * find the OPimRecord uid 74 * find the OPimRecord uid
75 */ 75 */
76 virtual T find( int uid )const; 76 virtual T find( int uid )const;
77 77
78 /** 78 /**
79 * read ahead cache find method ;) 79 * read ahead cache find method ;)
80 */ 80 */
81 virtual T find( int uid, const QArray<int>&, 81 virtual T find( int uid, const QArray<int>&,
82 uint current, CacheDirection dir = Forward )const; 82 uint current, typename OTemplateBase<T>::CacheDirection dir = OTemplateBase<T>::Forward )const;
83 83
84 /* invalidate cache here */ 84 /* invalidate cache here */
85 /** 85 /**
86 * clears the backend and invalidates the backend 86 * clears the backend and invalidates the backend
87 */ 87 */
88 virtual void clear() ; 88 virtual void clear() ;
89 89
90 /** 90 /**
91 * add T to the backend 91 * add T to the backend
92 * @param t The item to add. 92 * @param t The item to add.
93 * @return <i>true</i> if added successfully. 93 * @return <i>true</i> if added successfully.
94 */ 94 */
@@ -156,46 +156,46 @@ bool OPimAccessTemplate<T>::load() {
156 return m_backEnd->load(); 156 return m_backEnd->load();
157} 157}
158template <class T> 158template <class T>
159bool OPimAccessTemplate<T>::reload() { 159bool OPimAccessTemplate<T>::reload() {
160 invalidateCache(); // zecke: I think this should be added (se) 160 invalidateCache(); // zecke: I think this should be added (se)
161 return m_backEnd->reload(); 161 return m_backEnd->reload();
162} 162}
163template <class T> 163template <class T>
164bool OPimAccessTemplate<T>::save() { 164bool OPimAccessTemplate<T>::save() {
165 return m_backEnd->save(); 165 return m_backEnd->save();
166} 166}
167template <class T> 167template <class T>
168OPimAccessTemplate<T>::List OPimAccessTemplate<T>::allRecords()const { 168typename OPimAccessTemplate<T>::List OPimAccessTemplate<T>::allRecords()const {
169 QArray<int> ints = m_backEnd->allRecords(); 169 QArray<int> ints = m_backEnd->allRecords();
170 List lis(ints, this ); 170 List lis(ints, this );
171 return lis; 171 return lis;
172} 172}
173template <class T> 173template <class T>
174OPimAccessTemplate<T>::List 174typename OPimAccessTemplate<T>::List
175OPimAccessTemplate<T>::queryByExample( const T& t, int sortOrder ) { 175OPimAccessTemplate<T>::queryByExample( const T& t, int sortOrder ) {
176 QArray<int> ints = m_backEnd->queryByExample( t, sortOrder ); 176 QArray<int> ints = m_backEnd->queryByExample( t, sortOrder );
177 177
178 List lis(ints, this ); 178 List lis(ints, this );
179 return lis; 179 return lis;
180} 180}
181template <class T> 181template <class T>
182T OPimAccessTemplate<T>::find( int uid ) const{ 182T OPimAccessTemplate<T>::find( int uid ) const{
183 T t = m_backEnd->find( uid ); 183 T t = m_backEnd->find( uid );
184 cache( t ); 184 cache( t );
185 return t; 185 return t;
186} 186}
187template <class T> 187template <class T>
188T OPimAccessTemplate<T>::find( int uid, const QArray<int>& ar, 188T OPimAccessTemplate<T>::find( int uid, const QArray<int>& ar,
189 uint current, CacheDirection dir )const { 189 uint current, typename OTemplateBase<T>::CacheDirection dir )const {
190 /* 190 /*
191 * better do T.isEmpty() 191 * better do T.isEmpty()
192 * after a find this way we would 192 * after a find this way we would
193 * avoid two finds in QCache... 193 * avoid two finds in QCache...
194 */ 194 */
195 // qWarning("find it now %d", uid ); 195 // qWarning("find it now %d", uid );
196 if (m_cache.contains( uid ) ) { 196 if (m_cache.contains( uid ) ) {
197 return m_cache.find( uid ); 197 return m_cache.find( uid );
198 } 198 }
199 199
200 T t = m_backEnd->find( uid, ar, current, dir ); 200 T t = m_backEnd->find( uid, ar, current, dir );
201 cache( t ); 201 cache( t );
@@ -221,25 +221,25 @@ bool OPimAccessTemplate<T>::remove( int uid ) {
221 return m_backEnd->remove( uid ); 221 return m_backEnd->remove( uid );
222} 222}
223template <class T> 223template <class T>
224bool OPimAccessTemplate<T>::replace( const T& t ) { 224bool OPimAccessTemplate<T>::replace( const T& t ) {
225 m_cache.replace( t ); 225 m_cache.replace( t );
226 return m_backEnd->replace( t ); 226 return m_backEnd->replace( t );
227} 227}
228template <class T> 228template <class T>
229void OPimAccessTemplate<T>::invalidateCache() { 229void OPimAccessTemplate<T>::invalidateCache() {
230 m_cache.invalidate(); 230 m_cache.invalidate();
231} 231}
232template <class T> 232template <class T>
233OPimAccessTemplate<T>::BackEnd* OPimAccessTemplate<T>::backEnd() { 233typename OPimAccessTemplate<T>::BackEnd* OPimAccessTemplate<T>::backEnd() {
234 return m_backEnd; 234 return m_backEnd;
235} 235}
236template <class T> 236template <class T>
237bool OPimAccessTemplate<T>::wasChangedExternally()const { 237bool OPimAccessTemplate<T>::wasChangedExternally()const {
238 return false; 238 return false;
239} 239}
240template <class T> 240template <class T>
241void OPimAccessTemplate<T>::setBackEnd( BackEnd* end ) { 241void OPimAccessTemplate<T>::setBackEnd( BackEnd* end ) {
242 m_backEnd = end; 242 m_backEnd = end;
243 if (m_backEnd ) 243 if (m_backEnd )
244 m_backEnd->setFrontend( this ); 244 m_backEnd->setFrontend( this );
245} 245}