Vuo  2.0.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends | List of all members
VuoCompilerNodeClass Class Reference

Description

The compiler detail class for VuoNodeClass.

Definition at line 32 of file VuoCompilerNodeClass.hh.

Public Member Functions

VuoNodenewNode (string title="", double x=0, double y=0)
 Creates a substantial base node instance from this node class. More...
 
VuoNodenewNode (VuoNode *nodeToCopyMetadataFrom)
 Creates a substantial base node instance with its metadata copied from the existing nodeToCopyMetadataFrom. More...
 
virtual ~VuoCompilerNodeClass (void)
 Destructor. More...
 
virtual string getClassIdentifier (void)
 The unique class name for this node class, rendered as an identifier in the generated code. More...
 
virtual Function * getEventFunction (void)
 Returns an LLVM Function for this node class's implementation of the nodeEvent or nodeInstanceEvent function. More...
 
virtual Function * getInitFunction (void)
 If this node class is stateful, returns an LLVM Function for this node class's implementation of the nodeInstanceInit function. More...
 
virtual Function * getFiniFunction (void)
 If this node class is stateful, returns an LLVM Function for this node class's implementation of the nodeInstanceFini function. More...
 
virtual Function * getCallbackStartFunction (void)
 If this node class is stateful, returns an LLVM Function for this node class's implementation of the nodeInstanceTriggerStart function. More...
 
virtual Function * getCallbackUpdateFunction (void)
 If this node class is stateful, returns an LLVM Function for this node class's implementation of the nodeInstanceTriggerUpdate function. More...
 
virtual Function * getCallbackStopFunction (void)
 If this node class is stateful, returns an LLVM Function for this node class's implementation of the nodeInstanceTriggerStop function. More...
 
virtual Function * getCompositionAddNodeMetadataFunction (void)
 If this node class is a subcomposition, returns an LLVM Function for this subcomposition's implementation of the compositionAddNodeMetadata function. More...
 
virtual Function * getCompositionPerformDataOnlyTransmissionsFunction (void)
 If this node class is a subcomposition, returns an LLVM Function for this subcomposition's implementation of the compositionAddNodeMetadata function. More...
 
virtual Function * getCompositionSetPublishedInputPortValueFunction (void)
 If this node class is a subcomposition, returns an LLVM Function for this subcomposition's implementation of the compositionSetPublishedInputPortValue function. More...
 
virtual Function * getTriggerWorkerFunction (string portIdentifier)
 If this node class is a subcomposition, returns this subcomposition's implementation of the trigger worker function for the trigger with identifier portIdentifier. More...
 
virtual vector< VuoCompilerTriggerDescription * > getTriggerDescriptions (void)
 If this node is a subcomposition, returns information about the triggers internal to the subcomposition, parsed from the subcomposition's metadata. More...
 
virtual VuoCompilerInstanceDataClassgetInstanceDataClass (void)
 If this node class is stateful, returns the instance data class. More...
 
virtual string getDoxygenDocumentation (void)
 Returns a string containing documentation for this node class in Doxygen format. More...
 
virtual string getDefaultSpecializedTypeName (string genericTypeName)
 If this node class is generic, returns the default specialized types to replace the generic type with when creating an instance. More...
 
virtual vector< string > getAutomaticKeywords (void)
 Returns a list of keywords automatically associated with this node class, based on attributes such as its port classes and pro status. More...
 
bool isLikelyImageFilter (void)
 Returns true if this node class is likely an image filter, based on its image-type input and output port counts. More...
 
bool isLikelyImageGenerator (void)
 Returns true if this node class is likely an image generator, based on its image-type input and output port counts. More...
 
bool isLikelyImageTransition (void)
 Returns true if this node class is likely an image transition, based on its image-type input and output port counts. More...
 
int getImagePortCount (bool isInput)
 Returns the number of image-type input or output ports belonging to this node class. More...
 
virtual bool isStateful (void)
 Returns true if this node class is stateful (implements nodeInstance* functions instead of nodeEvent). More...
 
bool isSubcomposition (void)
 Returns true if this node class is a subcomposition (implemented in Vuo language, as opposed to text code). More...
 
bool isIsf (void)
 Returns true if this node class is implemented in ISF text code. More...
 
void setSourcePath (const string &sourcePath)
 Stores the path of the source file for this node class. More...
 
string getSourcePath (void)
 Returns the stored path of the source file for this node class. More...
 
void setSourceCode (const string &sourceCode)
 Stores the source code for this node class. More...
 
string getSourceCode (void)
 Returns the stored source code for this node class. More...
 
set< pair< string, string > > getContainedNodes (void)
 Returns the nodes (node identifier and node class name) contained within this subcomposition. More...
 
- Public Member Functions inherited from VuoBaseDetail< VuoNodeClass >
 VuoBaseDetail (string description, VuoNodeClass *base)
 Creates a detail class. More...
 
VuoNodeClassgetBase (void) const
 Returns the detail class instance's base class instance. More...
 
void setBase (VuoNodeClass *base)
 Sets the detail class instance's base class instance. More...
 
- Public Member Functions inherited from VuoCompilerModule
virtual ~VuoCompilerModule (void)
 Destructor. More...
 
VuoCompilerTargetSet parseTargetSet (json_object *o, string key)
 Parses the target set value for key in the top level of the JSON object. More...
 
VuoCompilerTargetSet::MacVersion parseMacVersion (string version)
 Parses a Mac OS version from a string. More...
 
virtual set< string > getDependencies (void)
 Returns a list of this VuoCompilerModule's dependencies. More...
 
virtual string getDependencyName (void)
 Returns the name that would represent this VuoCompilerModule in another VuoCompilerModule's list of dependencies. More...
 
VuoCompilerTargetSet getCompatibleTargets (void)
 Returns the set of targets (operating system versions) with which this module is compatible. More...
 
Module * getModule (void)
 Returns this VuoCompilerModule's LLVM module, which other LLVM modules can link to. More...
 
VuoModulegetPseudoBase (void)
 Returns the (pseudo) base for this (pseudo) compiler detail class. More...
 
bool isBuiltIn (void)
 Returns true if this module is one of the built-in modules distributed with Vuo. More...
 
void setBuiltIn (bool builtIn)
 Sets whether this module is one of the built-in modules distributed with Vuo. More...
 
string getModulePath (void)
 Returns the file from which the LLVM module was loaded, or an empty string if the module was contained in an archive or generated by the compiler. More...
 

Static Public Member Functions

static VuoNodeClassnewNodeClass (string nodeClassName, Module *module)
 Creates a new substantial VuoNodeClass from the node class definition in the module. More...
 
static VuoNodeClassnewNodeClassWithoutImplementation (VuoNodeClass *baseNodeClass)
 Creates a new implementation-less compiler node class, using the given node class for its base VuoNodeClass. More...
 
- Static Public Member Functions inherited from VuoCompilerModule
static VuoCompilerModulenewModule (const string &moduleKey, Module *module, const string &modulePath)
 Instantiates a VuoCompilerModule (or child class) corresponding to the type of VuoCompilerModule defined in the LLVM module. More...
 
static Function * declareFunctionInModule (Module *module, Function *function)
 Copies the function's header into the LLVM module, if it's not already there. More...
 

Protected Member Functions

 VuoCompilerNodeClass (string className, Module *module)
 Creates a node class implementation from an LLVM module, and creates its corresponding base VuoNodeClass. More...
 
 VuoCompilerNodeClass (VuoCompilerNodeClass *compilerNodeClass)
 Creates a new compiler node class and creates a new base VuoNodeClass, both from compilerNodeClass. More...
 
 VuoCompilerNodeClass (VuoNodeClass *baseNodeClass)
 Creates a new implementation-less compiler node class, using the given node class for its base VuoNodeClass. More...
 
VuoPortClassgetInputPortClassWithName (string portName)
 Returns the input port class matching the specified portName, if one exists. More...
 
VuoPortClassgetOutputPortClassWithName (string portName)
 Returns the output port class matching the specified portName, if one exists. More...
 
- Protected Member Functions inherited from VuoCompilerModule
 VuoCompilerModule (VuoModule *base, Module *module)
 Creates a VuoCompilerModule associated with the given LLVM module, as a pseudo compiler detail class of the given VuoModule. More...
 
string nameForGlobal (string genericGlobalVarOrFuncName)
 Returns the mangled name for a function or global variable. More...
 
void renameGlobalVarsAndFuncs (void)
 Renames the global variables and functions within the LLVM module so that they are unique to this VuoCompilerModule. More...
 

Static Protected Member Functions

static void parseGenericTypes (json_object *moduleDetails, map< string, string > &defaultSpecializedForGenericTypeName, map< std::string, vector< std::string > > &compatibleSpecializedForGenericTypeName)
 Parses the "genericTypes" portion of a node class's metadata. More...
 
- Static Protected Member Functions inherited from VuoCompilerModule
static string nameForGlobal (string nameBeforeCompilation, string moduleKey)
 Returns the mangled name for a function or global variable. More...
 
static bool hasOriginalOrMangledGlobal (string nameBeforeCompilation, Module *module, string moduleKey)
 Returns true if the module contains a function or global variable with name nameBeforeCompilation or with the corresponding mangled name. More...
 

Protected Attributes

map< string, string > defaultSpecializedForGenericTypeName
 If this node class is generic, use these specialized types when creating an instance. More...
 
- Protected Attributes inherited from VuoCompilerModule
struct json_objectmoduleDetails
 This module's metadata, found in the argument to VuoModuleMetadata in the module definition. More...
 
set< string > dependencies
 The dependencies found in this module's metadata. More...
 
Module * module
 The LLVM module that defines this node class or type. More...
 
VuoCompilerBitcodeParserparser
 The parser of the LLVM module. More...
 

Friends

class TestVuoCompilerType
 
class TestVuoCompilerNodeClass
 

Constructor & Destructor Documentation

◆ VuoCompilerNodeClass() [1/3]

VuoCompilerNodeClass::VuoCompilerNodeClass ( string  className,
Module *  module 
)
protected

Creates a node class implementation from an LLVM module, and creates its corresponding base VuoNodeClass.

Definition at line 55 of file VuoCompilerNodeClass.cc.

◆ VuoCompilerNodeClass() [2/3]

VuoCompilerNodeClass::VuoCompilerNodeClass ( VuoCompilerNodeClass compilerNodeClass)
protected

Creates a new compiler node class and creates a new base VuoNodeClass, both from compilerNodeClass.

Transfers ownership of the port classes and instance data class from compilerNodeClass to the newly constructed node class so that compilerNodeClass can be safely destroyed.

Definition at line 76 of file VuoCompilerNodeClass.cc.

◆ VuoCompilerNodeClass() [3/3]

VuoCompilerNodeClass::VuoCompilerNodeClass ( VuoNodeClass baseNodeClass)
protected

Creates a new implementation-less compiler node class, using the given node class for its base VuoNodeClass.

Definition at line 124 of file VuoCompilerNodeClass.cc.

◆ ~VuoCompilerNodeClass()

VuoCompilerNodeClass::~VuoCompilerNodeClass ( void  )
virtual

Destructor.

Definition at line 143 of file VuoCompilerNodeClass.cc.

Member Function Documentation

◆ getAutomaticKeywords()

vector< string > VuoCompilerNodeClass::getAutomaticKeywords ( void  )
virtual

Returns a list of keywords automatically associated with this node class, based on attributes such as its port classes and pro status.

Keep in sync with //etsi/solr/vuo/conf/synonyms.txt.

Definition at line 1288 of file VuoCompilerNodeClass.cc.

◆ getCallbackStartFunction()

Function * VuoCompilerNodeClass::getCallbackStartFunction ( void  )
virtual

If this node class is stateful, returns an LLVM Function for this node class's implementation of the nodeInstanceTriggerStart function.

Otherwise null.

Definition at line 1126 of file VuoCompilerNodeClass.cc.

◆ getCallbackStopFunction()

Function * VuoCompilerNodeClass::getCallbackStopFunction ( void  )
virtual

If this node class is stateful, returns an LLVM Function for this node class's implementation of the nodeInstanceTriggerStop function.

Otherwise null.

Definition at line 1142 of file VuoCompilerNodeClass.cc.

◆ getCallbackUpdateFunction()

Function * VuoCompilerNodeClass::getCallbackUpdateFunction ( void  )
virtual

If this node class is stateful, returns an LLVM Function for this node class's implementation of the nodeInstanceTriggerUpdate function.

Otherwise null.

Definition at line 1134 of file VuoCompilerNodeClass.cc.

◆ getClassIdentifier()

string VuoCompilerNodeClass::getClassIdentifier ( void  )
virtual

The unique class name for this node class, rendered as an identifier in the generated code.

Possible characters: [A-Za-z0-9_]

Example:
vuo_math_lessThan_i64

Definition at line 1094 of file VuoCompilerNodeClass.cc.

◆ getCompositionAddNodeMetadataFunction()

Function * VuoCompilerNodeClass::getCompositionAddNodeMetadataFunction ( void  )
virtual

If this node class is a subcomposition, returns an LLVM Function for this subcomposition's implementation of the compositionAddNodeMetadata function.

Otherwise null.

Definition at line 1150 of file VuoCompilerNodeClass.cc.

◆ getCompositionPerformDataOnlyTransmissionsFunction()

Function * VuoCompilerNodeClass::getCompositionPerformDataOnlyTransmissionsFunction ( void  )
virtual

If this node class is a subcomposition, returns an LLVM Function for this subcomposition's implementation of the compositionAddNodeMetadata function.

Otherwise null.

Definition at line 1158 of file VuoCompilerNodeClass.cc.

◆ getCompositionSetPublishedInputPortValueFunction()

Function * VuoCompilerNodeClass::getCompositionSetPublishedInputPortValueFunction ( void  )
virtual

If this node class is a subcomposition, returns an LLVM Function for this subcomposition's implementation of the compositionSetPublishedInputPortValue function.

Otherwise null.

Definition at line 1166 of file VuoCompilerNodeClass.cc.

◆ getContainedNodes()

set< pair< string, string > > VuoCompilerNodeClass::getContainedNodes ( void  )

Returns the nodes (node identifier and node class name) contained within this subcomposition.

Definition at line 1484 of file VuoCompilerNodeClass.cc.

◆ getDefaultSpecializedTypeName()

string VuoCompilerNodeClass::getDefaultSpecializedTypeName ( string  genericTypeName)
virtual

If this node class is generic, returns the default specialized types to replace the generic type with when creating an instance.

Definition at line 1273 of file VuoCompilerNodeClass.cc.

◆ getDoxygenDocumentation()

string VuoCompilerNodeClass::getDoxygenDocumentation ( void  )
virtual

Returns a string containing documentation for this node class in Doxygen format.

Definition at line 1224 of file VuoCompilerNodeClass.cc.

◆ getEventFunction()

Function * VuoCompilerNodeClass::getEventFunction ( void  )
virtual

Returns an LLVM Function for this node class's implementation of the nodeEvent or nodeInstanceEvent function.

Definition at line 1102 of file VuoCompilerNodeClass.cc.

◆ getFiniFunction()

Function * VuoCompilerNodeClass::getFiniFunction ( void  )
virtual

If this node class is stateful, returns an LLVM Function for this node class's implementation of the nodeInstanceFini function.

Otherwise null.

Definition at line 1118 of file VuoCompilerNodeClass.cc.

◆ getImagePortCount()

int VuoCompilerNodeClass::getImagePortCount ( bool  isInput)

Returns the number of image-type input or output ports belonging to this node class.

If isInput is true, searches input ports; otherwise searches output ports. Excludes ports named "mask" from the count.

Helper function for isLikelyImageFilter(), isLikelyImageGenerator(), and isLikelyImageTransition().

Definition at line 1393 of file VuoCompilerNodeClass.cc.

◆ getInitFunction()

Function * VuoCompilerNodeClass::getInitFunction ( void  )
virtual

If this node class is stateful, returns an LLVM Function for this node class's implementation of the nodeInstanceInit function.

Otherwise null.

Definition at line 1110 of file VuoCompilerNodeClass.cc.

◆ getInputPortClassWithName()

VuoPortClass * VuoCompilerNodeClass::getInputPortClassWithName ( string  portName)
protected

Returns the input port class matching the specified portName, if one exists.

Otherwise null.

Definition at line 1190 of file VuoCompilerNodeClass.cc.

◆ getInstanceDataClass()

VuoCompilerInstanceDataClass * VuoCompilerNodeClass::getInstanceDataClass ( void  )
virtual

If this node class is stateful, returns the instance data class.

Otherwise null.

Definition at line 1216 of file VuoCompilerNodeClass.cc.

◆ getOutputPortClassWithName()

VuoPortClass * VuoCompilerNodeClass::getOutputPortClassWithName ( string  portName)
protected

Returns the output port class matching the specified portName, if one exists.

Otherwise null.

Definition at line 1203 of file VuoCompilerNodeClass.cc.

◆ getSourceCode()

string VuoCompilerNodeClass::getSourceCode ( void  )

Returns the stored source code for this node class.

Currently for subcompositions only.

Definition at line 1476 of file VuoCompilerNodeClass.cc.

◆ getSourcePath()

string VuoCompilerNodeClass::getSourcePath ( void  )

Returns the stored path of the source file for this node class.

Currently for subcompositions only.

Definition at line 1460 of file VuoCompilerNodeClass.cc.

◆ getTriggerDescriptions()

vector< VuoCompilerTriggerDescription * > VuoCompilerNodeClass::getTriggerDescriptions ( void  )
virtual

If this node is a subcomposition, returns information about the triggers internal to the subcomposition, parsed from the subcomposition's metadata.

Definition at line 1182 of file VuoCompilerNodeClass.cc.

◆ getTriggerWorkerFunction()

Function * VuoCompilerNodeClass::getTriggerWorkerFunction ( string  portIdentifier)
virtual

If this node class is a subcomposition, returns this subcomposition's implementation of the trigger worker function for the trigger with identifier portIdentifier.

Definition at line 1174 of file VuoCompilerNodeClass.cc.

◆ isIsf()

bool VuoCompilerNodeClass::isIsf ( void  )

Returns true if this node class is implemented in ISF text code.

Definition at line 1442 of file VuoCompilerNodeClass.cc.

◆ isLikelyImageFilter()

bool VuoCompilerNodeClass::isLikelyImageFilter ( void  )

Returns true if this node class is likely an image filter, based on its image-type input and output port counts.

Definition at line 1363 of file VuoCompilerNodeClass.cc.

◆ isLikelyImageGenerator()

bool VuoCompilerNodeClass::isLikelyImageGenerator ( void  )

Returns true if this node class is likely an image generator, based on its image-type input and output port counts.

Definition at line 1372 of file VuoCompilerNodeClass.cc.

◆ isLikelyImageTransition()

bool VuoCompilerNodeClass::isLikelyImageTransition ( void  )

Returns true if this node class is likely an image transition, based on its image-type input and output port counts.

Definition at line 1381 of file VuoCompilerNodeClass.cc.

◆ isStateful()

bool VuoCompilerNodeClass::isStateful ( void  )
virtual

Returns true if this node class is stateful (implements nodeInstance* functions instead of nodeEvent).

Definition at line 1421 of file VuoCompilerNodeClass.cc.

◆ isSubcomposition()

bool VuoCompilerNodeClass::isSubcomposition ( void  )

Returns true if this node class is a subcomposition (implemented in Vuo language, as opposed to text code).

Definition at line 1429 of file VuoCompilerNodeClass.cc.

◆ newNode() [1/2]

VuoNode * VuoCompilerNodeClass::newNode ( string  title = "",
double  x = 0,
double  y = 0 
)

Creates a substantial base node instance from this node class.

Definition at line 159 of file VuoCompilerNodeClass.cc.

◆ newNode() [2/2]

VuoNode * VuoCompilerNodeClass::newNode ( VuoNode nodeToCopyMetadataFrom)

Creates a substantial base node instance with its metadata copied from the existing nodeToCopyMetadataFrom.

Definition at line 172 of file VuoCompilerNodeClass.cc.

◆ newNodeClass()

VuoNodeClass * VuoCompilerNodeClass::newNodeClass ( string  nodeClassName,
Module *  module 
)
static

Creates a new substantial VuoNodeClass from the node class definition in the module.

If the module does not contain a node class definition, returns NULL.

Definition at line 216 of file VuoCompilerNodeClass.cc.

◆ newNodeClassWithoutImplementation()

VuoNodeClass * VuoCompilerNodeClass::newNodeClassWithoutImplementation ( VuoNodeClass baseNodeClass)
static

Creates a new implementation-less compiler node class, using the given node class for its base VuoNodeClass.

Definition at line 207 of file VuoCompilerNodeClass.cc.

◆ parseGenericTypes()

void VuoCompilerNodeClass::parseGenericTypes ( json_object moduleDetails,
map< string, string > &  defaultSpecializedForGenericTypeName,
map< std::string, vector< std::string > > &  compatibleSpecializedForGenericTypeName 
)
staticprotected

Parses the "genericTypes" portion of a node class's metadata.

See also
VuoModuleMetadata

Definition at line 333 of file VuoCompilerNodeClass.cc.

◆ setSourceCode()

void VuoCompilerNodeClass::setSourceCode ( const string &  sourceCode)

Stores the source code for this node class.

Currently for subcompositions only.

Definition at line 1468 of file VuoCompilerNodeClass.cc.

◆ setSourcePath()

void VuoCompilerNodeClass::setSourcePath ( const string &  sourcePath)

Stores the path of the source file for this node class.

Currently for subcompositions only.

Definition at line 1452 of file VuoCompilerNodeClass.cc.

Member Data Documentation

◆ defaultSpecializedForGenericTypeName

map<string, string> VuoCompilerNodeClass::defaultSpecializedForGenericTypeName
protected

If this node class is generic, use these specialized types when creating an instance.

Definition at line 85 of file VuoCompilerNodeClass.hh.


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