summaryrefslogtreecommitdiffstats
path: root/contrib/ldapc++/src/LDAPMessageQueue.h
blob: ca0e957b7cc281be2f7826599c6f272d00645af9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// $OpenLDAP$
/*
 * Copyright 2000-2021 The OpenLDAP Foundation, All Rights Reserved.
 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
 */


#ifndef LDAP_MESSAGE_QUEUE_H
#define LDAP_MESSAGE_QUEUE_H

#include <stack>

#include <LDAPUrlList.h>
#include <LDAPMessage.h>

class LDAPAsynConnection;
class LDAPRequest;
class LDAPSearchRequest;
class LDAPUrl;
typedef std::stack<LDAPRequest*> LDAPRequestStack;
typedef std::list<LDAPRequest*> LDAPRequestList;

/**
 * This class is created for the asynchronous LDAP-operations. And can be
 * used by the client to retrieve the results of an operation.
 */
class LDAPMessageQueue{
    public :

        /**
         * This creates a new LDAPMessageQueue. For a LDAP-request
         *
         * @param conn  The Request for that is queue can be used to get
         *              the results.
         */
        LDAPMessageQueue(LDAPRequest *conn);
        /**
         * Destructor
         */
        ~LDAPMessageQueue();

        /**
         * This method reads exactly one Message from the results of a
         * Request. 
         * @throws LDAPException
         * @return A pointer to an object of one of the classes that were
         *          derived from LDAPMsg. The user has to cast it to the
         *          correct type (e.g. LDAPResult or LDAPSearchResult)
         */           
        LDAPMsg* getNext();

        /**
         * For internat use only.
         *
         * The method is used to start the automatic referral chasing
         */
        LDAPRequest* chaseReferral(LDAPMsg* ref);

        /**
         * For internal use only
         *
         * The referral chasing algorithm needs this method to see the
         * currently active requests.
         */
        LDAPRequestStack* getRequestStack(); 
    
    private :
        LDAPRequestStack m_activeReq;
        LDAPRequestList m_issuedReq;
};
#endif //ifndef LDAP_MESSAGE_QUEUE_H