Back to index

openldap  2.4.31
Public Member Functions | Private Attributes
LDAPSearchResults Class Reference

The class stores the results of a synchronous SEARCH-Operation. More...

#include <LDAPSearchResults.h>

Collaboration diagram for LDAPSearchResults:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 LDAPSearchResults ()
 Default-Constructor.
LDAPResultreadMessageQueue (LDAPMessageQueue *msg)
 For internal use only.
LDAPEntrygetNext ()
 The method is used by the client-application to read the result entries of the SEARCH-Operation.

Private Attributes

LDAPEntryList entryList
LDAPReferenceList refList
LDAPEntryList::const_iterator entryPos
LDAPReferenceList::const_iterator refPos

Detailed Description

The class stores the results of a synchronous SEARCH-Operation.

Definition at line 22 of file LDAPSearchResults.h.


Constructor & Destructor Documentation

Default-Constructor.

Definition at line 14 of file LDAPSearchResults.cpp.

Here is the call graph for this function:


Member Function Documentation

The method is used by the client-application to read the result entries of the SEARCH-Operation.

Every call of this method returns one entry. If all entries were read it return 0.

Exceptions:
LDAPReferralExceptionIf a Search Reference was returned by the server
Returns:
A LDAPEntry-object as a result of a SEARCH-Operation or 0 if no more entries are there to return.

Definition at line 47 of file LDAPSearchResults.cpp.

                                     {
    if( entryPos != entryList.end() ){
        LDAPEntry* ret= new LDAPEntry(*entryPos);
        entryPos++;
        return ret;
    }
    if( refPos != refList.end() ){
        LDAPUrlList urls= refPos->getUrls();
        refPos++;
        throw(LDAPReferralException(urls));
    }
    return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

For internal use only.

This method reads Search result entries from a LDAPMessageQueue-object.

Parameters:
msgThe message queue to read

Definition at line 19 of file LDAPSearchResults.cpp.

                                                                    {
    if(msg != 0){
        LDAPMsg* res=0;
        for(;;){
            try{
                res = msg->getNext();
            }catch (LDAPException e){
                throw;
            }
            switch(res->getMessageType()){ 
                case LDAPMsg::SEARCH_ENTRY :
                    entryList.addEntry(*((LDAPSearchResult*)res)->getEntry());
                break;
                case LDAPMsg::SEARCH_REFERENCE :
                    refList.addReference(*((LDAPSearchReference*)res));
                break;
                default:
                    entryPos=entryList.begin();
                    refPos=refList.begin();
                    return ((LDAPResult*) res);
            }
            delete res;
            res=0;
        }
    }
    return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 49 of file LDAPSearchResults.h.

Definition at line 51 of file LDAPSearchResults.h.

Definition at line 50 of file LDAPSearchResults.h.

Definition at line 52 of file LDAPSearchResults.h.


The documentation for this class was generated from the following files: