author | zecke <zecke> | 2004-11-18 21:45:49 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-11-18 21:45:49 (UTC) |
commit | 7484344ff5be1f7c54e51715776d0e3cadeb1ed0 (patch) (unidiff) | |
tree | 96f427f7a1fb1c8ca0a6efbd72b51e916cb1651d /libopie2/opiepim/core/opimrecordlist.h | |
parent | 3302eb30390e6053637929316670da3e8fbe279e (diff) | |
download | opie-7484344ff5be1f7c54e51715776d0e3cadeb1ed0.zip opie-7484344ff5be1f7c54e51715776d0e3cadeb1ed0.tar.gz opie-7484344ff5be1f7c54e51715776d0e3cadeb1ed0.tar.bz2 |
Big PIM API Update Core Part (1/2 of what should be implemented):
OPimRecords:
-Add a so called safeCast using the rtti value
OPimTodo:
-Fix memleak with OPimState
OPimOccurrence:
-New class. Every 'Access' can give occurrences
for a period of time
Move Documentation
Diffstat (limited to 'libopie2/opiepim/core/opimrecordlist.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/core/opimrecordlist.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/libopie2/opiepim/core/opimrecordlist.h b/libopie2/opiepim/core/opimrecordlist.h index 1d5027f..0459f41 100644 --- a/libopie2/opiepim/core/opimrecordlist.h +++ b/libopie2/opiepim/core/opimrecordlist.h | |||
@@ -41,6 +41,7 @@ | |||
41 | namespace Opie | 41 | namespace Opie |
42 | { | 42 | { |
43 | 43 | ||
44 | template<class T> class OPimAccessTemplate; | ||
44 | class OPimRecordListIteratorPrivate; | 45 | class OPimRecordListIteratorPrivate; |
45 | /** | 46 | /** |
46 | * Our List Iterator | 47 | * Our List Iterator |
@@ -120,6 +121,7 @@ class OPimRecordListPrivate; | |||
120 | template <class T = OPimRecord > | 121 | template <class T = OPimRecord > |
121 | class OPimRecordList | 122 | class OPimRecordList |
122 | { | 123 | { |
124 | template<class> friend class OPimAccessTemplate; | ||
123 | public: | 125 | public: |
124 | typedef OTemplateBase<T> Base; | 126 | typedef OTemplateBase<T> Base; |
125 | typedef OPimRecordListIterator<T> Iterator; | 127 | typedef OPimRecordListIterator<T> Iterator; |
@@ -127,10 +129,9 @@ class OPimRecordList | |||
127 | /** | 129 | /** |
128 | * c'tor | 130 | * c'tor |
129 | */ | 131 | */ |
130 | OPimRecordList () | 132 | OPimRecordList (){} |
131 | {} | ||
132 | OPimRecordList( const QArray<int>& ids, | 133 | OPimRecordList( const QArray<int>& ids, |
133 | const Base* ); | 134 | const Base* ); |
134 | ~OPimRecordList(); | 135 | ~OPimRecordList(); |
135 | 136 | ||
136 | /** | 137 | /** |
@@ -160,6 +161,9 @@ class OPimRecordList | |||
160 | ConstIterator begin()const; | 161 | ConstIterator begin()const; |
161 | ConstIterator end()const; | 162 | ConstIterator end()const; |
162 | */ | 163 | */ |
164 | protected: | ||
165 | UIDArray uids()const; | ||
166 | |||
163 | private: | 167 | private: |
164 | QArray<int> m_ids; | 168 | QArray<int> m_ids; |
165 | const Base* m_acc; | 169 | const Base* m_acc; |
@@ -190,7 +194,6 @@ OPimRecordListIterator<T>::~OPimRecordListIterator() | |||
190 | template <class T> | 194 | template <class T> |
191 | OPimRecordListIterator<T>::OPimRecordListIterator( const OPimRecordListIterator<T>& it ) | 195 | OPimRecordListIterator<T>::OPimRecordListIterator( const OPimRecordListIterator<T>& it ) |
192 | { | 196 | { |
193 | //owarn << "OPimRecordListIterator copy c'tor" << oendl; | ||
194 | m_uids = it.m_uids; | 197 | m_uids = it.m_uids; |
195 | m_current = it.m_current; | 198 | m_current = it.m_current; |
196 | m_temp = it.m_temp; | 199 | m_temp = it.m_temp; |
@@ -216,7 +219,6 @@ OPimRecordListIterator<T> &OPimRecordListIterator<T>::operator=( const OPimRecor | |||
216 | template <class T> | 219 | template <class T> |
217 | T OPimRecordListIterator<T>::operator*() | 220 | T OPimRecordListIterator<T>::operator*() |
218 | { | 221 | { |
219 | //owarn << "operator* " << m_current << " " << m_uids[m_current] << oendl; | ||
220 | if ( !m_end ) | 222 | if ( !m_end ) |
221 | m_record = m_temp->find( m_uids[ m_current ], m_uids, m_current, | 223 | m_record = m_temp->find( m_uids[ m_current ], m_uids, m_current, |
222 | m_direction ? Base::Forward : | 224 | m_direction ? Base::Forward : |
@@ -399,5 +401,10 @@ bool OPimRecordList<T>::remove( int uid ) | |||
399 | return ret_val; | 401 | return ret_val; |
400 | } | 402 | } |
401 | 403 | ||
404 | template<class T> | ||
405 | UIDArray OPimRecordList<T>::uids()const { | ||
406 | return m_ids; | ||
407 | } | ||
408 | |||
402 | } | 409 | } |
403 | #endif | 410 | #endif |