]> git.sur5r.net Git - openldap/blob - contrib/ldapc++/src/LDAPMessageQueue.h
initial support for SASL
[openldap] / contrib / ldapc++ / src / LDAPMessageQueue.h
1 /*
2  * Copyright 2000, OpenLDAP Foundation, All Rights Reserved.
3  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
4  */
5
6
7 #ifndef LDAP_MESSAGE_QUEUE_H
8 #define LDAP_MESSAGE_QUEUE_H
9
10 #include <stack>
11
12 #include <LDAPUrlList.h>
13 #include <LDAPMessage.h>
14
15 class LDAPAsynConnection;
16 class LDAPRequest;
17 class LDAPSearchRequest;
18 class LDAPUrl;
19 typedef std::stack<LDAPRequest*> LDAPRequestStack;
20 typedef std::list<LDAPRequest*> LDAPRequestList;
21
22 /**
23  * This class is created for the asynchronous LDAP-operations. And can be
24  * used by the client to retrieve the results of an operation.
25  */
26 class LDAPMessageQueue{
27     public :
28
29         /**
30          * This creates a new LDAPMessageQueue. For a LDAP-request
31          *
32          * @param conn  The Request for that is queue can be used to get
33          *              the results.
34          */
35         LDAPMessageQueue(LDAPRequest *conn);
36         /**
37          * Destructor
38          */
39         ~LDAPMessageQueue();
40
41         /**
42          * This method reads exactly one Message from the results of a
43          * Request. 
44          * @throws LDAPException
45          * @return A pointer to an object of one of the classes that were
46          *          derived from LDAPMsg. The user has to cast it to the
47          *          correct type (e.g. LDAPResult or LDAPSearchResult)
48          */           
49         LDAPMsg* getNext();
50
51         /**
52          * For internat use only.
53          *
54          * The method is used to start the automatic referral chasing
55          */
56         LDAPRequest* chaseReferral(LDAPMsg* ref);
57
58         /**
59          * For internal use only
60          *
61          * The referral chasing algorithm needs this method to see the
62          * currently active requests.
63          */
64         LDAPRequestStack* getRequestStack(); 
65     
66     private :
67         LDAPRequestStack m_activeReq;
68         LDAPRequestList m_issuedReq;
69 };
70 #endif //ifndef LDAP_MESSAGE_QUEUE_H
71