]> git.sur5r.net Git - openldap/blobdiff - contrib/ldapc++/src/LDAPModList.h
Merge remote branch 'origin/mdb.master'
[openldap] / contrib / ldapc++ / src / LDAPModList.h
index 0edcd9e86e953052bc9d287842b49017431e2468..01c996386ca4ba886d9b976b316ea9ff66375374 100644 (file)
@@ -1,5 +1,6 @@
+// $OpenLDAP$
 /*
- * Copyright 2000, OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 2000-2011 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
  */
 
 #include <list>
 #include <LDAPModification.h>
 
-typedef std::list<LDAPModification> ModList;
-
 /**
  * This container class is used to store multiple LDAPModification-objects.
  */
 class LDAPModList{
+    typedef std::list<LDAPModification> ListType;
 
-       public : 
+    public : 
         /**
-         * Constructs an empty std::list.
+         * Constructs an empty list.
          */   
-               LDAPModList();
+        LDAPModList();
                
         /**
          * Copy-constructor
@@ -30,19 +30,29 @@ class LDAPModList{
         LDAPModList(const LDAPModList&);
 
         /**
-         * Adds one element to the end of the std::list.
+         * Adds one element to the end of the list.
          * @param mod The LDAPModification to add to the std::list.
          */
-               void addModification(const LDAPModification &mod);
+        void addModification(const LDAPModification &mod);
 
         /**
-         * Translates the std::list to a 0-terminated array of
+         * Translates the list to a 0-terminated array of
          * LDAPMod-structures as needed by the C-API
          */
         LDAPMod** toLDAPModArray();
 
-       private : 
-               ModList m_modList;
+        /**
+         * @returns true, if the ModList contains no Operations
+         */
+        bool empty() const;
+        
+        /**
+         * @returns number of Modifications in the ModList
+         */
+        unsigned int size() const;
+
+    private : 
+        ListType m_modList;
 };
 #endif //LDAP_MOD_LIST_H