]> git.sur5r.net Git - openldap/blob - contrib/ldapc++/src/LDAPReferenceList.h
0aa5a18219cb4959b1fb8418c6401795094c1555
[openldap] / contrib / ldapc++ / src / LDAPReferenceList.h
1 /*
2  * Copyright 2000, OpenLDAP Foundation, All Rights Reserved.
3  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
4  */
5
6 #ifndef LDAP_REFERENCE_LIST_H
7 #define LDAP_REFERENCE_LIST_H
8
9 #include <list>
10
11 class LDAPSearchReference;
12
13 typedef std::list<LDAPSearchReference> RefList;
14
15 /**
16  * Container class for storing a list of Search References
17  *
18  * Used internally only by LDAPSearchResults
19  */
20 class LDAPReferenceList{
21     public:
22         typedef RefList::const_iterator const_iterator;
23
24         /**
25          * Constructs an empty list.
26          */   
27         LDAPReferenceList();
28
29         /**
30          * Copy-constructor
31          */
32         LDAPReferenceList(const LDAPReferenceList& rl);
33
34         /**
35          * Destructor
36          */
37         ~LDAPReferenceList();
38
39         /**
40          * @return The number of LDAPSearchReference-objects that are 
41          * currently stored in this list.
42          */
43         size_t size() const;
44
45         /**
46          * @return true if there are zero LDAPSearchReference-objects
47          * currently stored in this list.
48          */
49         bool empty() const;
50
51         /**
52          * @return A iterator that points to the first element of the list.
53          */
54         const_iterator begin() const;
55
56         /**
57          * @return A iterator that points to the element after the last
58          * element of the list.
59          */
60         const_iterator end() const;
61
62         /**
63          * Adds one element to the end of the list.
64          * @param e The LDAPSearchReference to add to the list.
65          */
66         void addReference(const LDAPSearchReference& e);
67
68     private:
69         RefList m_refs;
70 };
71 #endif // LDAP_REFERENCE_LIST_H
72