DllProcLoaderFile
is used to load specific procedures from a DLL (shared library) by their name.
typedef void (*MYPROC)(const char *); foo(const uima::util::Filename & crclFilename) { uima::util::DllProcLoaderFile clDll(crclFilename); if(clDll.isValid()) { MYPROC utProc = (MYPROC) clDll.getProcedure("myFunction"); if(utProc) (utProc)("My message"); // call my procedure in DLL else // error handling } }
DllProcLoaderFile
has unloaded the DLL will cause unexpected results. (An application crash is very likely to happen.)NOTE: dropped the Cos Special Requirements for AIX 4.2 and below
Public Member Functions | |
~DllProcLoaderFile (void) | |
Constructors | |
DllProcLoaderFile (const Filename &crclFilename) | |
instantiate a DLL object and load the specified DLL | |
Properties | |
bool | isValid (void) const |
return TRUE if the DLL was loaded successfully | |
TyProcedure | getProcedure (const char *cpszProcName) |
return a pointer to the specified DLL function or NULL if the specified function cannot be found in this DLL | |
TyErrorId | getErrorId (void) const |
map APR error code (status) of last call to a UIMACPP error code. | |
TyMessageId | getErrorMsgId (void) const |
map APR error code to a UIMACPP message id | |
const char * | getErrorMsg (void) const |
return a pointer to the error msg (if any) | |
const Filename & | getFilename (void) const |
return the file's filename | |
bool | isExistent (void) const |
determine whether a file exists for filename on file system |
uima::util::DllProcLoaderFile::DllProcLoaderFile | ( | const Filename & | crclFilename | ) | [inline] |
instantiate a DLL object and load the specified DLL
References uima::util::Filename::determinePath(), DSO_EXTN, DSOBUFLEN, uima::util::Filename::getAsCString(), uima::util::Filename::getExtension(), uima::util::Filename::getName(), uima::util::EnvironmentVariableQueryOnly::getValue(), uima::util::Filename::isAbsolute(), uima::util::Filename::isExistent(), uima::util::Filename::setNewExtension(), uima::util::Filename::setNewName(), UIMA_ERR_ENGINE_OUT_OF_MEMORY, UIMA_EXC_THROW_NEW, and uima::ErrorInfo::unrecoverable.
uima::util::DllProcLoaderFile::~DllProcLoaderFile | ( | void | ) | [inline] |
bool uima::util::DllProcLoaderFile::isValid | ( | void | ) | const [inline] |
return TRUE if the DLL was loaded successfully
TyProcedure uima::util::DllProcLoaderFile::getProcedure | ( | const char * | cpszProcName | ) | [inline] |
return a pointer to the specified DLL function or NULL if the specified function cannot be found in this DLL
TyErrorId uima::util::DllProcLoaderFile::getErrorId | ( | void | ) | const [inline] |
map APR error code (status) of last call to a UIMACPP error code.
References UIMA_ERR_ANNOTATOR_COULD_NOT_FIND, UIMA_ERR_ANNOTATOR_COULD_NOT_LOAD, and UIMA_ERR_NONE.
TyMessageId uima::util::DllProcLoaderFile::getErrorMsgId | ( | void | ) | const [inline] |
const char * uima::util::DllProcLoaderFile::getErrorMsg | ( | void | ) | const [inline] |
const Filename& uima::util::DllProcLoaderFile::getFilename | ( | void | ) | const [inline] |
return the file's filename
bool uima::util::DllProcLoaderFile::isExistent | ( | void | ) | const [inline] |
determine whether a file exists for filename on file system
References uima::util::Filename::isExistent().