1/*	$NetBSD: LDAPEntryList.h,v 1.1.1.2 2010/03/08 02:14:14 lukem Exp $	*/
2
3// OpenLDAP: pkg/ldap/contrib/ldapc++/src/LDAPEntryList.h,v 1.6.6.1 2008/04/14 23:09:26 quanah Exp
4/*
5 * Copyright 2000, OpenLDAP Foundation, All Rights Reserved.
6 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
7 */
8
9#ifndef LDAP_ENTRY_LIST_H
10#define LDAP_ENTRY_LIST_H
11
12#include <list>
13
14class LDAPEntry;
15
16/**
17 * For internal use only.
18 *
19 * This class is used by LDAPSearchResults to store a std::list of
20 * LDAPEntry-Objects
21 */
22class LDAPEntryList{
23    typedef std::list<LDAPEntry> ListType;
24
25    public:
26	typedef ListType::const_iterator const_iterator;
27
28        /**
29         * Copy-Constructor
30         */
31        LDAPEntryList(const LDAPEntryList& el);
32
33        /**
34         * Default-Constructor
35         */
36        LDAPEntryList();
37
38        /**
39         * Destructor
40         */
41        ~LDAPEntryList();
42
43        /**
44         * @return The number of entries currently stored in the list.
45         */
46        size_t size() const;
47
48        /**
49         * @return true if there are zero entries currently stored in the list.
50         */
51        bool empty() const;
52
53        /**
54         * @return An iterator pointing to the first element of the list.
55         */
56        const_iterator begin() const;
57
58        /**
59         * @return An iterator pointing to the end of the list
60         */
61        const_iterator end() const;
62
63        /**
64         * Adds an Entry to the end of the list.
65         */
66        void addEntry(const LDAPEntry& e);
67
68    private:
69        ListType m_entries;
70};
71#endif // LDAP_ENTRY_LIST_H
72