author | zecke <zecke> | 2004-11-18 21:45:49 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-11-18 21:45:49 (UTC) |
commit | 7484344ff5be1f7c54e51715776d0e3cadeb1ed0 (patch) (side-by-side diff) | |
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 @@ -38,12 +38,13 @@ /* QT */ #include <qarray.h> namespace Opie { +template<class T> class OPimAccessTemplate; class OPimRecordListIteratorPrivate; /** * Our List Iterator * it behaves like STL or Qt * * for(it = list.begin(); it != list.end(); ++it ) @@ -117,23 +118,23 @@ class OPimRecordListPrivate; * The recordlist used as a return type * from OPimAccessTemplate */ template <class T = OPimRecord > class OPimRecordList { + template<class> friend class OPimAccessTemplate; public: typedef OTemplateBase<T> Base; typedef OPimRecordListIterator<T> Iterator; /** * c'tor */ - OPimRecordList () - {} + OPimRecordList (){} OPimRecordList( const QArray<int>& ids, - const Base* ); + const Base* ); ~OPimRecordList(); /** * the first iterator */ Iterator begin(); @@ -157,12 +158,15 @@ class OPimRecordList bool remove( int uid ); /* ConstIterator begin()const; ConstIterator end()const; */ + protected: + UIDArray uids()const; + private: QArray<int> m_ids; const Base* m_acc; OPimRecordListPrivate *d; }; @@ -187,13 +191,12 @@ OPimRecordListIterator<T>::~OPimRecordListIterator() } template <class T> OPimRecordListIterator<T>::OPimRecordListIterator( const OPimRecordListIterator<T>& it ) { - //owarn << "OPimRecordListIterator copy c'tor" << oendl; m_uids = it.m_uids; m_current = it.m_current; m_temp = it.m_temp; m_end = it.m_end; m_record = it.m_record; m_direction = it.m_direction; @@ -213,13 +216,12 @@ OPimRecordListIterator<T> &OPimRecordListIterator<T>::operator=( const OPimRecor } template <class T> T OPimRecordListIterator<T>::operator*() { - //owarn << "operator* " << m_current << " " << m_uids[m_current] << oendl; if ( !m_end ) m_record = m_temp->find( m_uids[ m_current ], m_uids, m_current, m_direction ? Base::Forward : Base::Reverse ); else m_record = T(); @@ -396,8 +398,13 @@ bool OPimRecordList<T>::remove( int uid ) m_ids = copy; return ret_val; } +template<class T> +UIDArray OPimRecordList<T>::uids()const { + return m_ids; +} + } #endif |