Base class for compiling node classes from various source formats.
Definition at line 20 of file VuoModuleCompiler.hh.
Public Member Functions | |
virtual VuoModuleCompilerResults | compile (dispatch_queue_t llvmQueue, VuoCompilerIssues *issues)=0 |
Compiles the source file to LLVM bitcode that can be loaded as a Vuo node class. | |
virtual string | generateHeader (VuoCompilerIssues *issues) |
Throws an exception. | |
virtual void | overrideSourceCode (const string &sourceCode, const string &sourcePath)=0 |
When compiling, sourceCode will be used instead of the contents of the source file. | |
Static Public Member Functions | |
static VuoModuleCompiler * | newModuleCompiler (const string &type, const string &moduleKey, const string &sourcePath, const VuoModuleCompilerSettings &settings, std::function< VuoCompilerType *(const string &)> getVuoType) |
If a VuoModuleCompiler subclass that is able to handle type and sourcePath is registered, creates an instance of that subclass. | |
Protected Types | |
typedef VuoModuleCompiler *(* | Factory) (const string &moduleKey, const string &sourcePath, const VuoModuleCompilerSettings &settings) |
A method that creates an instance of a subclass of VuoModuleCompiler. | |
Protected Member Functions | |
VuoModuleCompiler (const string &moduleKey, const string &sourcePath, const VuoModuleCompilerSettings &settings) | |
Constructor to be called by derived classes. | |
VuoCompilerType * | lookUpVuoType (const string &typeName) |
Adds the VuoCompilerType with the given name to vuoTypes . | |
Static Protected Member Functions | |
static void | registerModuleCompiler (string type, Factory factory) |
Registers a method that creates an instance of a subclass of VuoModuleCompiler. | |
Protected Attributes | |
string | moduleKey |
The module key of the module to compile. | |
string | sourcePath |
The path of the primary source file to compile. | |
VuoModuleCompilerSettings | settings |
Settings to use when compiling the module (specific to the type of module compiler). | |
map< string, VuoCompilerType * > | vuoTypes |
Cached results of lookUpVuoType(), stored so they can be used on llvmQueue . | |
|
protected |
A method that creates an instance of a subclass of VuoModuleCompiler.
Definition at line 47 of file VuoModuleCompiler.hh.
|
virtual |
Definition at line 104 of file VuoModuleCompiler.cc.
|
protected |
Constructor to be called by derived classes.
Definition at line 97 of file VuoModuleCompiler.cc.
|
pure virtual |
Compiles the source file to LLVM bitcode that can be loaded as a Vuo node class.
The resulting LLVM module and any other generated artifacts are placed in the returned value. If compilation fails, the return value's module
field is null and errors are reported in issues.
Implemented in VuoCModuleCompiler, and VuoIsfModuleCompiler.
|
virtual |
Throws an exception.
Derived classes can override this function to support generating header file contents for a module.
Reimplemented in VuoCModuleCompiler.
Definition at line 111 of file VuoModuleCompiler.cc.
|
protected |
Adds the VuoCompilerType with the given name to vuoTypes
.
This function may be called on any dispatch queue except llvmQueue
.
Definition at line 125 of file VuoModuleCompiler.cc.
|
static |
If a VuoModuleCompiler subclass that is able to handle type and sourcePath is registered, creates an instance of that subclass.
Otherwise, returns null.
Definition at line 71 of file VuoModuleCompiler.cc.
|
pure virtual |
When compiling, sourceCode will be used instead of the contents of the source file.
Optionally, sourceFile specifies which file to override when the module has multiple source files.
Implemented in VuoCModuleCompiler, and VuoIsfModuleCompiler.
|
staticprotected |
Registers a method that creates an instance of a subclass of VuoModuleCompiler.
To be called by plugin dylibs.
Definition at line 55 of file VuoModuleCompiler.cc.
|
protected |
The module key of the module to compile.
Definition at line 53 of file VuoModuleCompiler.hh.
|
protected |
Settings to use when compiling the module (specific to the type of module compiler).
Definition at line 55 of file VuoModuleCompiler.hh.
|
protected |
The path of the primary source file to compile.
Definition at line 54 of file VuoModuleCompiler.hh.
|
protected |
Cached results of lookUpVuoType(), stored so they can be used on llvmQueue
.
Definition at line 56 of file VuoModuleCompiler.hh.