1// $OpenLDAP$
2/*
3 * Copyright 2000-2011 The 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 <cstdio>
11#include <list>
12
13class LDAPSearchReference;
14
15/**
16 * Container class for storing a list of Search References
17 *
18 * Used internally only by LDAPSearchResults
19 */
20class LDAPReferenceList{
21    typedef std::list<LDAPSearchReference> ListType;
22
23    public:
24	typedef ListType::const_iterator const_iterator;
25
26        /**
27         * Constructs an empty list.
28         */
29        LDAPReferenceList();
30
31        /**
32         * Copy-constructor
33         */
34        LDAPReferenceList(const LDAPReferenceList& rl);
35
36        /**
37         * Destructor
38         */
39        ~LDAPReferenceList();
40
41        /**
42         * @return The number of LDAPSearchReference-objects that are
43         * currently stored in this list.
44         */
45        size_t size() const;
46
47        /**
48         * @return true if there are zero LDAPSearchReference-objects
49         * currently stored in this list.
50         */
51        bool empty() const;
52
53        /**
54         * @return A iterator that points to the first element of the list.
55         */
56        const_iterator begin() const;
57
58        /**
59         * @return A iterator that points to the element after the last
60         * element of the list.
61         */
62        const_iterator end() const;
63
64        /**
65         * Adds one element to the end of the list.
66         * @param e The LDAPSearchReference to add to the list.
67         */
68        void addReference(const LDAPSearchReference& e);
69
70    private:
71        ListType m_refs;
72};
73#endif // LDAP_REFERENCE_LIST_H
74
75