]> git.sur5r.net Git - openldap/blob - contrib/ldapc++/src/LDAPConstraints.cpp
Initial check of the LDAP C++ SDK written by Ralf Haferkamp <rhafer@suse.de>
[openldap] / contrib / ldapc++ / src / LDAPConstraints.cpp
1 /*
2  * Copyright 2000, OpenLDAP Foundation, All Rights Reserved.
3  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
4  */
5
6 // $Id: LDAPConstraints.cpp,v 1.10 2000/08/31 17:43:48 rhafer Exp $
7
8 #include "debug.h"
9 #include "LDAPConstraints.h"
10 //#include "LDAPAsynConnection.h"
11
12 LDAPConstraints::LDAPConstraints(){
13         m_maxTime=LDAP_NO_LIMIT;
14         m_maxSize=LDAP_NO_LIMIT;
15         m_referralChase=true;
16 }
17
18 LDAPConstraints::LDAPConstraints(const LDAPConstraints& c){
19     m_maxTime=c.m_maxTime;
20     m_maxSize=c.m_maxSize;
21     m_referralChase=c.m_referralChase;
22 }
23
24 LDAPConstraints::~LDAPConstraints(){
25     DEBUG(LDAP_DEBUG_TRACE,"LDAPConstraints::~LDAPConstraints()" << endl);
26 }
27
28 void LDAPConstraints::setMaxTime(int t){
29         m_maxTime=t;
30 }
31
32 void LDAPConstraints::setSizeLimit(int s){
33         m_maxSize=s;
34 }
35
36 void LDAPConstraints::setReferralChase(bool rc){
37 }
38
39 int LDAPConstraints::getMaxTime() const {
40         return m_maxTime;
41 }
42
43 int LDAPConstraints::getSizeLimit() const {
44         return m_maxSize;
45 }
46
47 //TODO
48 LDAPControl** LDAPConstraints::getSrvCtrlsArray() const {
49     return 0;
50 }
51
52 //TODO
53 LDAPControl** LDAPConstraints::getClCtrlsArray() const {
54     return 0;
55 }
56
57 timeval* LDAPConstraints::getTimeoutStruct() const {
58     if(m_maxTime == LDAP_NO_LIMIT){
59         return 0;
60     }else{
61         timeval *ret = new timeval;
62         ret->tv_sec=m_maxTime;
63         ret->tv_usec=0;
64         return ret;
65     }
66 }
67
68 bool LDAPConstraints::getReferralChase() const {
69         return m_referralChase;
70 }
71