]> git.sur5r.net Git - openldap/blob - contrib/ldapc++/src/LDAPEntryList.h
added empty() method to the list classes. (Patch was provided by Dan
[openldap] / contrib / ldapc++ / src / LDAPEntryList.h
1 /*
2  * Copyright 2000, OpenLDAP Foundation, All Rights Reserved.
3  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
4  */
5
6 #ifndef LDAP_ENTRY_LIST_H
7 #define LDAP_ENTRY_LIST_H
8
9 #include <list>
10
11 class LDAPEntry;
12    
13 typedef list<LDAPEntry> EntryList;
14
15 /**
16  * For internal use only.
17  * 
18  * This class is used by LDAPSearchResults to store a list of
19  * LDAPEntry-Objects
20  */
21 class LDAPEntryList{
22     public:
23         typedef EntryList::const_iterator const_iterator;
24
25         /**
26          * Copy-Constructor
27          */
28         LDAPEntryList(const LDAPEntryList& el);
29
30         /**
31          * Default-Constructor
32          */
33         LDAPEntryList();
34
35         /**
36          * Destructor
37          */
38         ~LDAPEntryList();
39
40         /**
41          * @return The number of entries currently stored in the list.
42          */
43         size_t size() const;
44
45         /**
46          * @return true if there are zero entries currently stored in the list.
47          */
48         bool empty() const;
49
50         /**
51          * @return An iterator pointing to the first element of the list.
52          */
53         const_iterator begin() const;
54
55         /**
56          * @return An iterator pointing to the end of the list
57          */
58         const_iterator end() const;
59
60         /**
61          * Adds an Entry to the end of the list.
62          */
63         void addEntry(const LDAPEntry& e);
64
65     private:
66         EntryList m_entries;
67 };
68 #endif // LDAP_ENTRY_LIST_H