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