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 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 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 A iterator that points to the first element of the list.
59 const_iterator begin() const;
62 * @return A iterator that points to the element after the last
63 * element of the list.
65 const_iterator end() const;
68 * Adds one element to the end of the list.
69 * @param ctrl The Control to add to the list.
71 void add(const LDAPCtrl& ctrl);
74 * Translates the list to a 0-terminated array of pointers to
75 * LDAPControl-structures as needed by the C-API
77 LDAPControl** toLDAPControlArray()const ;
82 #endif //LDAP_CONTROL_SET_H