summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/orecordlist.h
Unidiff
Diffstat (limited to 'libopie2/opiepim/orecordlist.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/orecordlist.h40
1 files changed, 38 insertions, 2 deletions
diff --git a/libopie2/opiepim/orecordlist.h b/libopie2/opiepim/orecordlist.h
index a3955b0..3b30a73 100644
--- a/libopie2/opiepim/orecordlist.h
+++ b/libopie2/opiepim/orecordlist.h
@@ -7,16 +7,37 @@
7#include "otemplatebase.h" 7#include "otemplatebase.h"
8#include "opimrecord.h" 8#include "opimrecord.h"
9 9
10 10/**
11 * Our List Iterator
12 * it behaves like STL or Qt
13 *
14 * for(it = list.begin(); it != list.end(); ++it )
15 * doSomeCoolStuff( (*it) );
16 */
11template <class T = OPimRecord> 17template <class T = OPimRecord>
12class ORecordListIterator { 18class ORecordListIterator {
13public: 19public:
14 typedef OTemplateBase<T> Base; 20 typedef OTemplateBase<T> Base;
21
22 /**
23 * The c'tor used internally from
24 * ORecordList
25 */
15 ORecordListIterator( const QArray<int>, const Base* ); 26 ORecordListIterator( const QArray<int>, const Base* );
27
28 /**
29 * The standard c'tor
30 */
16 ORecordListIterator(); 31 ORecordListIterator();
17 ~ORecordListIterator(); 32 ~ORecordListIterator();
33
18 ORecordListIterator( const ORecordListIterator& ); 34 ORecordListIterator( const ORecordListIterator& );
19 ORecordListIterator &operator=(const ORecordListIterator& ); 35 ORecordListIterator &operator=(const ORecordListIterator& );
36
37 /**
38 * a * operator ;)
39 * use it like this T = (*it);
40 */
20 T &operator*(); 41 T &operator*();
21 ORecordListIterator &operator++(); 42 ORecordListIterator &operator++();
22 ORecordListIterator &operator--(); 43 ORecordListIterator &operator--();
@@ -35,16 +56,31 @@ private:
35 class IteratorPrivate; 56 class IteratorPrivate;
36 IteratorPrivate *d; 57 IteratorPrivate *d;
37}; 58};
38 59/**
60 * The recordlist used as a return type
61 * from OPimAccessTemplate
62 */
39template <class T = OPimRecord > 63template <class T = OPimRecord >
40class ORecordList { 64class ORecordList {
41public: 65public:
42 typedef OTemplateBase<T> Base; 66 typedef OTemplateBase<T> Base;
43 typedef ORecordListIterator<T> Iterator; 67 typedef ORecordListIterator<T> Iterator;
68
69 /**
70 * c'tor
71 */
44 ORecordList( const QArray<int>& ids, 72 ORecordList( const QArray<int>& ids,
45 const Base* ); 73 const Base* );
46 ~ORecordList(); 74 ~ORecordList();
75
76 /**
77 * the first iterator
78 */
47 Iterator begin(); 79 Iterator begin();
80
81 /**
82 * the end
83 */
48 Iterator end(); 84 Iterator end();
49 /* 85 /*
50 ConstIterator begin()const; 86 ConstIterator begin()const;