3 * Copyright 2000-2012 The OpenLDAP Foundation, All Rights Reserved.
4 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
7 #ifndef LDAP_CONTROL_SET_H
8 #define LDAP_CONTROL_SET_H
12 #include <LDAPControl.h>
14 typedef std::list<LDAPCtrl> CtrlList;
17 * This container class is used to store multiple LDAPCtrl-objects.
19 class LDAPControlSet {
20 typedef CtrlList::const_iterator const_iterator;
23 * Constructs an empty std::list
31 LDAPControlSet(const LDAPControlSet& cs);
34 * For internal use only
36 * This constructor creates a new LDAPControlSet for a
37 * 0-terminiated array of LDAPControl-structures as used by the
39 * @param controls: pointer to a 0-terminated array of pointers to
40 * LDAPControll-structures
41 * @note: untested til now. Due to lack of server that return
44 LDAPControlSet(LDAPControl** controls);
52 * @return The number of LDAPCtrl-objects that are currently
53 * stored in this list.
58 * @return true if there are zero LDAPCtrl-objects currently
59 * stored in this list.
64 * @return A iterator that points to the first element of the list.
66 const_iterator begin() const;
69 * @return A iterator that points to the element after the last
70 * element of the list.
72 const_iterator end() const;
75 * Adds one element to the end of the list.
76 * @param ctrl The Control to add to the list.
78 void add(const LDAPCtrl& ctrl);
81 * Translates the list to a 0-terminated array of pointers to
82 * LDAPControl-structures as needed by the C-API
84 LDAPControl** toLDAPControlArray()const ;
85 static void freeLDAPControlArray(LDAPControl **ctrl);
89 #endif //LDAP_CONTROL_SET_H