2 * Copyright 2000, OpenLDAP Foundation, All Rights Reserved.
3 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
6 #ifndef LDAP_CONTROL_SET_H
7 #define LDAP_CONTROL_SET_H
11 #include <LDAPControl.h>
13 typedef std::list<LDAPCtrl> CtrlList;
16 * This container class is used to store multiple LDAPCtrl-objects.
18 class LDAPControlSet {
19 typedef CtrlList::const_iterator const_iterator;
22 * Constructs an empty std::list
30 LDAPControlSet(const LDAPControlSet& cs);
33 * For internal use only
35 * This constructor creates a new LDAPControlSet for a
36 * 0-terminiated array of LDAPControl-structures as used by the
38 * @param controls: pointer to a 0-terminated array of pointers to
39 * LDAPControll-structures
40 * @note: untested til now. Due to lack of server that return
43 LDAPControlSet(LDAPControl** controls);
51 * @return The number of LDAPCtrl-objects that are currently
52 * stored in this list.
57 * @return true if there are zero LDAPCtrl-objects currently
58 * stored in this list.
63 * @return A iterator that points to the first element of the list.
65 const_iterator begin() const;
68 * @return A iterator that points to the element after the last
69 * element of the list.
71 const_iterator end() const;
74 * Adds one element to the end of the list.
75 * @param ctrl The Control to add to the list.
77 void add(const LDAPCtrl& ctrl);
80 * Translates the list to a 0-terminated array of pointers to
81 * LDAPControl-structures as needed by the C-API
83 LDAPControl** toLDAPControlArray()const ;
84 static void freeLDAPControlArray(LDAPControl **ctrl);
88 #endif //LDAP_CONTROL_SET_H