#ifndef __CPlugInList_h__
#define __CPlugInList_h__ 1
#include <CoreFoundation/CFPlugIn.h>
#include "PrivateTypes.h"
#include "DSMutexSemaphore.h"
#include "DSEventSemaphore.h"
#include "PluginData.h"
class CServerPlugin;
class CPlugInList {
public:
typedef struct sTableData
{
const char *fName;
const char *fVersion;
const char *fConfigAvail;
const char *fConfigFile;
CServerPlugin *fPluginPtr;
CFPlugInRef fPluginRef;
CFUUIDRef fCFuuidFactory;
uInt32 fULVers;
FourCharCode fKey;
uInt32 fState;
sTableData *pNext;
} sTableData;
enum {
kMaxPlugIns = 128
};
public:
CPlugInList ( void );
virtual ~CPlugInList ( void );
sInt32 AddPlugIn ( const char *inName,
const char *inVersion,
const char *inConfigAvail,
const char *inConfigFile,
FourCharCode inKey,
CServerPlugin *inPlugin,
CFPlugInRef inPluginRef = NULL,
CFUUIDRef inCFuuidFactory = NULL,
uInt32 inULVers = 0 );
void LoadPlugin ( sTableData *inTableEntry );
void InitPlugIns ( void );
sInt32 IsPresent ( const char *inName );
sInt32 GetState ( const char *inName, uInt32 *outState );
sInt32 SetState ( const char *inName, const uInt32 inState );
uInt32 GetPlugInCount ( void );
uInt32 GetActiveCount ( void );
sTableData* GetPlugInInfo ( uInt32 inIndex );
CServerPlugin* Next ( uInt32 *inIndex );
CServerPlugin* GetPlugInPtr ( const char *inName, bool loadIfNeeded = true );
CServerPlugin* GetPlugInPtr ( const uInt32 inKey, bool loadIfNeeded = true );
private:
uInt32 fPICount;
DSMutexSemaphore fMutex;
sTableData *fTable;
sTableData *fTableTail;
DSEventSemaphore fWaitToInit;
};
#endif