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