]> git.sur5r.net Git - openldap/blob - contrib/ldapc++/src/LDAPReferenceList.h
- The library now supports StartTLS. The patch was provided by Jeff Costlow
[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 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 A iterator that points to the first element of the list.
47          */
48         const_iterator begin() const;
49
50         /**
51          * @return A iterator that points to the element after the last
52          * element of the list.
53          */
54         const_iterator end() const;
55
56         /**
57          * Adds one element to the end of the list.
58          * @param e The LDAPSearchReference to add to the list.
59          */
60         void addReference(const LDAPSearchReference& e);
61
62     private:
63         RefList m_refs;
64 };
65 #endif // LDAP_REFERENCE_LIST_H
66