PPL Logo

CkCppInterpreter Class Reference

An interpreter for C++ code. More...

#include <ckdll.h>

Collaboration diagram for CkCppInterpreter:

Collaboration graph
[legend]

Public Member Functions

 CkCppInterpreter (const char *cppCode, const char *inclPath=0)
int valid (void) const
 Return true if the compilation was a success.
const char * getLibraryName (void) const
 Get the name of the compiled library (e.g., to copy it somewhere).
void * lookup (const char *symbolName)
 Return a function pointer you can cast to the appropriate type to call the interpreted code.
 ~CkCppInterpreter ()
 Remove "cppCode" from the program.

Private Attributes

char libraryFile [256]
CkDlllibrary

Detailed Description

An interpreter for C++ code.

The string passed in will be written to a file, compiled into a shared library, and then linked into the running program.

Definition at line 49 of file ckdll.h.


Constructor & Destructor Documentation

CkCppInterpreter::CkCppInterpreter ( const char *  cppCode,
const char *  inclPath = 0 
)

fileExists(libraryFile)) {

fileExists(libraryFile)) {

Definition at line 108 of file ckdll.C.

References CkSystem(), CmiMyPe(), CmiPrintf(), CrnRand(), deleteFile(), CkDll::extension, library, and libraryFile.

Here is the call graph for this function:

CkCppInterpreter::~CkCppInterpreter (  ) 

Remove "cppCode" from the program.

This invalidates any function pointers created with lookup

Definition at line 165 of file ckdll.C.

References deleteFile(), library, and libraryFile.

Here is the call graph for this function:


Member Function Documentation

int CkCppInterpreter::valid ( void   )  const [inline]

Return true if the compilation was a success.

Definition at line 57 of file ckdll.h.

References library.

const char* CkCppInterpreter::getLibraryName ( void   )  const [inline]

Get the name of the compiled library (e.g., to copy it somewhere).

Definition at line 60 of file ckdll.h.

References libraryFile.

void* CkCppInterpreter::lookup ( const char *  symbolName  )  [inline]

Return a function pointer you can cast to the appropriate type to call the interpreted code.

Definition at line 64 of file ckdll.h.

References library, and CkDll::lookup().

Here is the call graph for this function:


Field Documentation

char CkCppInterpreter::libraryFile[256] [private]

Definition at line 50 of file ckdll.h.

Referenced by CkCppInterpreter(), getLibraryName(), and ~CkCppInterpreter().

Definition at line 51 of file ckdll.h.

Referenced by CkCppInterpreter(), lookup(), valid(), and ~CkCppInterpreter().


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

Generated on Mon Sep 21 08:19:45 2020 for Charm++ by  doxygen 1.5.5