00001 /* 00002 Portable Dynamically Linked Libraries (DLL) interface 00003 00004 Orion Sky Lawlor, olawlor@acm.org, 7/26/2002 00005 */ 00006 #ifndef __UIUC_CHARM_DLL_H 00007 #define __UIUC_CHARM_DLL_H 00008 00013 class CkDll { 00014 void *handle; /*Opaque handle to opened library*/ 00015 public: 00019 CkDll(const char *sharedLibraryName); 00020 00022 int valid(void) const {return handle!=0;} 00023 00030 void *lookup(const char *symbolName); 00031 00038 ~CkDll(); 00039 00041 static const char *extension; 00042 }; 00043 00049 class CkCppInterpreter { 00050 char libraryFile[256]; //e.g., "/tmp/sharedLib.123.so" 00051 CkDll *library; 00052 public: 00054 CkCppInterpreter(const char *cppCode,const char *inclPath=0); 00055 00057 int valid(void) const {return library!=0;} 00058 00060 inline const char *getLibraryName(void) const {return libraryFile;} 00061 00064 inline void *lookup(const char *symbolName) 00065 { 00066 if (!library) return 0; 00067 else return library->lookup(symbolName); 00068 } 00069 00072 ~CkCppInterpreter(); 00073 }; 00074 00075 00076 #endif