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