CQueryPlugin Class Reference

#include <CQueryPlugin.h>

List of all members.

Public Member Functions

CQuerymakeQuery (CAccessorAdminCollection &inAccessorAdminCollection, CAlgorithm &inAlgorithm)
char * getName ()
 CQueryPlugin (string, string, string)
 CQueryPlugin (CQueryPlugin &)
 ~CQueryPlugin ()
bool isSane () const

Protected Attributes

void * mDlOpenHandle
string mName
CQuery *(* mMakeQuery )(CAccessorAdminCollection &inAccessorAdminCollection, CAlgorithm &inAlgorithm)
char *(* mGetName )(void)
bool mIsSane


Detailed Description

Definition at line 42 of file CQueryPlugin.h.


Constructor & Destructor Documentation

CQueryPlugin::CQueryPlugin ( string  inLibraryDirName,
string  inLibraryFileName,
string  inLibraryName 
)

opens the library and sets the make query etc. functions

makes the CQueryPlugin. All it needs is:

Parameters:
inLibraryFileName the file name of the shared object to be treated

Definition at line 41 of file CQueryPlugin.cc.

References mDlOpenHandle, mGetName, mIsSane, mMakeQuery, and mName.

00043                               :
00044   mGetName(0),
00045   mMakeQuery(0),
00046   mName("no name given"),
00047   mIsSane(0){
00048 
00049   char* lError;
00050   string lLibraryPath=inLibraryDirName+"/"+inLibraryFileName;
00051   string lStringGetClassName(inLibraryName+"_getClassName");
00052   string lStringMakeQuery(inLibraryName+"_makeQuery");
00053 
00054   mDlOpenHandle = dlopen (lLibraryPath.c_str(), RTLD_LAZY);
00055   if (!mDlOpenHandle) {
00056     cerr << "..Could not open library: " << endl
00057    << dlerror() << endl;
00058     //exit(1);
00059     mIsSane=0;
00060   }else{
00061     mGetName = (typeof(mGetName))dlsym(mDlOpenHandle, 
00062                lStringGetClassName.c_str());
00063     if ((lError = dlerror()) != NULL)  {
00064       cerr << lError << endl;
00065     }else{
00066       mName=(*mGetName)();
00067       mMakeQuery=(typeof(mMakeQuery))dlsym(mDlOpenHandle,
00068              lStringMakeQuery.c_str());
00069       if ((lError = dlerror()) != NULL)  {
00070   cerr << lError << endl;
00071       }else{
00072   mIsSane=1;
00073       }
00074     }
00075   }
00076 }

CQueryPlugin::CQueryPlugin ( CQueryPlugin inPlugin  ) 

copy all the content

Definition at line 78 of file CQueryPlugin.cc.

00078                                                 :
00079   mGetName(inPlugin.mGetName),
00080   mMakeQuery(inPlugin.mMakeQuery),
00081   mName(inPlugin.mName){
00082 }

CQueryPlugin::~CQueryPlugin (  ) 

close the DlOpenHandle of the library

Definition at line 84 of file CQueryPlugin.cc.

References mDlOpenHandle.

00084                            {
00085   if(mDlOpenHandle){
00086     dlclose(mDlOpenHandle);
00087   }
00088 }


Member Function Documentation

CQuery * CQueryPlugin::makeQuery ( CAccessorAdminCollection inAccessorAdminCollection,
CAlgorithm inAlgorithm 
)

makes a CQuery object

Definition at line 28 of file CQueryPlugin.cc.

References mMakeQuery.

00029                                      {
00030   return (*mMakeQuery)(inAccessorAdminCollection,
00031            inAlgorithm);
00032 }

char * CQueryPlugin::getName (  ) 

gets the name of the plugin

gets the name of the plugin

Definition at line 34 of file CQueryPlugin.cc.

References mGetName.

Referenced by CDynamicQueryFactory::CDynamicQueryFactory().

00034                            {
00035   return (*mGetName)();
00036 };

bool CQueryPlugin::isSane (  )  const

is this well constructed

Definition at line 90 of file CQueryPlugin.cc.

References mIsSane.

Referenced by CDynamicQueryFactory::CDynamicQueryFactory().

00090                               {
00091   return mIsSane;
00092 }


Member Data Documentation

void* CQueryPlugin::mDlOpenHandle [protected]

the handle which enables us to open

Definition at line 45 of file CQueryPlugin.h.

Referenced by CQueryPlugin(), and ~CQueryPlugin().

string CQueryPlugin::mName [protected]

the name of the plugin

Definition at line 47 of file CQueryPlugin.h.

Referenced by CQueryPlugin().

CQuery*(* CQueryPlugin::mMakeQuery)(CAccessorAdminCollection &inAccessorAdminCollection, CAlgorithm &inAlgorithm) [protected]

the function for making a query object

Referenced by CQueryPlugin(), and makeQuery().

char*(* CQueryPlugin::mGetName)(void) [protected]

this function gives us the name of the plugin

Referenced by CQueryPlugin(), and getName().

is this well constructed?

Definition at line 54 of file CQueryPlugin.h.

Referenced by CQueryPlugin(), and isSane().


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

Generated on Wed Jan 7 00:31:14 2009 for Gift by  doxygen 1.5.6