#ifndef _NISDirNodeRep_
#define _NISDirNodeRep_ 1
#include <stdio.h>
#include <unistd.h> // for _POSIX_THREADS
#include <pthread.h> // for pthread_*_t
#include <CoreFoundation/CoreFoundation.h>
#include <DirectoryService/DirServicesTypes.h>
#include <DirectoryServiceCore/CBuff.h>
#include <DirectoryServiceCore/CDataBuff.h>
#include <DirectoryServiceCore/CAttributeList.h>
#include <DirectoryServiceCore/CDSServerModule.h>
#include <DirectoryServiceCore/SharedConsts.h>
#include <DirectoryServiceCore/PluginData.h>
class BSDPlugin;
class NISRecordLookupThread;
class BSDResult;
class BSDDirNodeRep
{
public:
BSDDirNodeRep ( BSDPlugin* parent, const void* ref );
~BSDDirNodeRep ( void );
void DeleteSelf ( void );
void Initialize ( CFStringRef nodeNameRef, uid_t uid );
sInt32 Initialize ( const char* nodeNamePtr, uid_t uid );
Boolean IsInitialized ( void ) { return mInitialized; } Boolean IsLookupStarted ( void ) { return mLookupStarted; }
void LookupHasStarted ( void ) { mLookupStarted = true; }
void ResetLookupHasStarted ( void ) { mLookupStarted = false; }
Boolean IsTopLevelNode ( void );
CFStringRef GetNodeName ( void ) { return mNodeName; }
Boolean IsFFNode ( void ) { return mIsFFNode; }
uid_t GetUID ( void ) { return mUID; }
void LimitRecSearch ( unsigned long searchLimit ) { mRecSearchLimit = searchLimit; }
Boolean HaveResults ( void );
void NeedToRedoLastResult ( void ) { mCurrentIndex--; }
const BSDResult* GetResult ( CFIndex index );
void AddService ( BSDResult* newResult );
void ResultListQueueLock ( void ) { pthread_mutex_lock( &mResultListQueueLock ); }
void ResultListQueueUnlock ( void ) { pthread_mutex_unlock( &mResultListQueueLock ); }
void SearchListQueueLock ( void ) { pthread_mutex_lock( &mSearchListQueueLock ); }
void SearchListQueueUnlock ( void ) { pthread_mutex_unlock( &mSearchListQueueLock ); }
void Retain ( void ) { mRefCounter++; }
void Release ( void ) { if ( --mRefCounter == 0 ) DeleteSelf(); }
protected:
private:
pthread_mutex_t mResultListQueueLock;
pthread_mutex_t mSearchListQueueLock;
CFStringRef mNodeName;
Boolean mIsFFNode;
uid_t mUID;
BSDPlugin* mParentPlugin;
const void* mRef; CFIndex mRecSearchLimit;
CFMutableArrayRef mResultList;
CFIndex mCurrentIndex;
Boolean mInitialized;
Boolean mDeleteSelfWhenDone;
Boolean mLookupStarted;
UInt32 mDelCounter;
UInt32 mRefCounter;
BSDDirNodeRep* mSelfPtr;
};
#endif // #ifndef