LDAPReferenceList.h 1.67 KB
Newer Older
Ralf Haferkamp's avatar
Ralf Haferkamp committed
1
// $OpenLDAP$
2
/*
Quanah Gibson-Mount's avatar
Quanah Gibson-Mount committed
3
 * Copyright 2000-2021 The OpenLDAP Foundation, All Rights Reserved.
4
5
6
7
8
9
 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
 */

#ifndef LDAP_REFERENCE_LIST_H
#define LDAP_REFERENCE_LIST_H

Ralf Haferkamp's avatar
Ralf Haferkamp committed
10
#include <cstdio>
11
12
13
14
#include <list>

class LDAPSearchReference;

Ralf Haferkamp's avatar
Ralf Haferkamp committed
15
/**
Ralf Haferkamp's avatar
Ralf Haferkamp committed
16
 * Container class for storing a list of Search References
Ralf Haferkamp's avatar
Ralf Haferkamp committed
17
18
19
 *
 * Used internally only by LDAPSearchResults
 */
20
class LDAPReferenceList{
21
22
    typedef std::list<LDAPSearchReference> ListType;

23
    public:
24
	typedef ListType::const_iterator const_iterator;
25

Ralf Haferkamp's avatar
Ralf Haferkamp committed
26
        /**
Ralf Haferkamp's avatar
Ralf Haferkamp committed
27
         * Constructs an empty list.
Ralf Haferkamp's avatar
Ralf Haferkamp committed
28
         */   
29
        LDAPReferenceList();
Ralf Haferkamp's avatar
Ralf Haferkamp committed
30
31
32
33

        /**
         * Copy-constructor
         */
34
        LDAPReferenceList(const LDAPReferenceList& rl);
Ralf Haferkamp's avatar
Ralf Haferkamp committed
35
36
37
38

        /**
         * Destructor
         */
39
40
        ~LDAPReferenceList();

Ralf Haferkamp's avatar
Ralf Haferkamp committed
41
42
43
44
        /**
         * @return The number of LDAPSearchReference-objects that are 
         * currently stored in this list.
         */
45
        size_t size() const;
Ralf Haferkamp's avatar
Ralf Haferkamp committed
46

47
48
49
50
51
52
        /**
         * @return true if there are zero LDAPSearchReference-objects
         * currently stored in this list.
         */
        bool empty() const;

Ralf Haferkamp's avatar
Ralf Haferkamp committed
53
54
55
        /**
         * @return A iterator that points to the first element of the list.
         */
56
        const_iterator begin() const;
Ralf Haferkamp's avatar
Ralf Haferkamp committed
57
58
59
60
61

        /**
         * @return A iterator that points to the element after the last
         * element of the list.
         */
62
        const_iterator end() const;
Ralf Haferkamp's avatar
Ralf Haferkamp committed
63
64
65
66
67

        /**
         * Adds one element to the end of the list.
         * @param e The LDAPSearchReference to add to the list.
         */
68
69
70
        void addReference(const LDAPSearchReference& e);

    private:
71
        ListType m_refs;
72
73
74
};
#endif // LDAP_REFERENCE_LIST_H