]> git.sur5r.net Git - openldap/blobdiff - contrib/ldapc++/src/LDAPRequest.h
Merge remote-tracking branch 'origin/mdb.master'
[openldap] / contrib / ldapc++ / src / LDAPRequest.h
index 45adabdb3e469ec33207fa2cbfa580e870011eb4..9686cae0a1ff7a09b1a190adef359316c6fa02c0 100644 (file)
@@ -1,5 +1,6 @@
+// $OpenLDAP$
 /*
- * Copyright 2000, OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 2000-2012 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
  */
 
@@ -7,13 +8,20 @@
 #ifndef LDAP_REQUEST_H
 #define LDAP_REQUEST_H
 
-#include "LDAPConstraints.h"
-#include "LDAPAsynConnection.h"
-#include "LDAPMessageQueue.h"
+#include <LDAPConstraints.h>
+#include <LDAPAsynConnection.h>
+#include <LDAPMessageQueue.h>
 
 class LDAPUrl;
 
-//!virtual class for Requests
+/**
+ * For internal use only
+ * 
+ * Each request that is sent to a LDAP-server by this library is
+ * represented by a special object that contains the parameters and some
+ * other info of the request. This virtual class is the common base classe
+ * for these specialized request classes.
+ */
 class LDAPRequest{
 
     public :
@@ -33,16 +41,38 @@ class LDAPRequest{
         
         const LDAPConstraints* getConstraints() const;
         const LDAPAsynConnection* getConnection() const;
+        virtual LDAPMsg *getNextMessage() const;
         int getType()const;
         int getMsgID() const;
         int getHopCount() const;
+
+        /**
+         * @return The LDAPRequest that has created this object. Or 0 if
+         * this object was not created by another request.
+         */
         const LDAPRequest* getParent() const;
 
+        /**
+         * @return true if this object was created during the automatic
+         * chasing of referrals. Otherwise false
+         */
         bool isReferral() const;
+        
         void unbind() const; 
+
+        /**
+         * This method encodes the request an calls the apprpriate
+         * functions of the C-API to send the Request to a LDAP-Server
+         */
         virtual LDAPMessageQueue* sendRequest()=0;
-        virtual LDAPRequest* followReferral(LDAPMsg* ref)=0;
+        virtual LDAPRequest* followReferral(LDAPMsg* ref);
+
+        /**
+         * Compare this request with another on. And returns true if they
+         * have the same parameters.
+         */
         virtual bool equals(const LDAPRequest* req) const;
+
         bool isCycle() const;
         
     protected :