Vuo  0.9.1
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
VuoCompilerSpecializedNodeClass Class Reference

Description

A specialization of a generic node class.

In this node class, anywhere from none to all of the generic port types in the generic node class are replaced by concrete port types.

Public Member Functions

 VuoCompilerSpecializedNodeClass (string nodeClassName, Module *module)
 Creates a specialized node class implementation from an LLVM module, and creates its corresponding base VuoNodeClass.
 
 VuoCompilerSpecializedNodeClass (VuoCompilerSpecializedNodeClass *compilerNodeClass, VuoNode *nodeToBack)
 Creates a new compiler node class and creates a new base VuoNodeClass, both from compilerNodeClass.
 
virtual VuoTypegetOriginalPortType (VuoPortClass *portClass)
 Returns this port's type in the generic node that this specialized node class was derived from.
 
virtual string getOriginalGenericNodeClassName (void)
 Returns the original node's class name (without any type suffixes).
 
virtual string getOriginalGenericNodeClassDescription (void)
 Returns the original node's description.
 
virtual VuoNodeSetgetOriginalGenericNodeSet (void)
 Returns the original node's node set.
 
virtual string createUnspecializedNodeClassName (set< VuoPortClass * > portClassesToUnspecialize)
 Returns the name for the node class that would result if the given port were changed back to its original type.
 
virtual string createSpecializedNodeClassNameWithReplacement (string genericTypeName, string specializedTypeName)
 Returns the name for the node class that would result if the given (innermost) specialized type were substituted for the given (innermost) generic type in this node class.
 
string createDefaultSpecializedNodeClassName (void)
 Returns the name for the node class that would result if all of this node class's generic types that have default specialized types (as defined in the node class metadata) were replaced with those types.
 
- Public Member Functions inherited from VuoCompilerNodeClass
VuoNodenewNode (string title="", double x=0, double y=0)
 Creates a substantial base node instance from this node class.
 
VuoNodenewNode (VuoNode *nodeToCopyMetadataFrom)
 Creates a substantial base node instance with its metadata copied from the existing nodeToCopyMetadataFrom.
 
virtual ~VuoCompilerNodeClass (void)
 Destructor.
 
string getClassIdentifier (void)
 The unique class name for this node class, rendered as an identifier in the generated code.
 
Function * getEventFunction (void)
 Returns an LLVM Function for this node class's implementation of the nodeEvent or nodeInstanceEvent function.
 
Function * getInitFunction (void)
 If this node class is stateful, returns an LLVM Function for this node class's implementation of the nodeInstanceInit function.
 
Function * getFiniFunction (void)
 If this node class is stateful, returns an LLVM Function for this node class's implementation of the nodeInstanceFini function.
 
Function * getCallbackStartFunction (void)
 If this node class is stateful, returns an LLVM Function for this node class's implementation of the nodeInstanceTriggerStart function.
 
Function * getCallbackUpdateFunction (void)
 If this node class is stateful, returns an LLVM Function for this node class's implementation of the nodeInstanceTriggerUpdate function.
 
Function * getCallbackStopFunction (void)
 If this node class is stateful, returns an LLVM Function for this node class's implementation of the nodeInstanceTriggerStop function.
 
VuoCompilerInstanceDataClassgetInstanceDataClass (void)
 If this node class is stateful, returns the instance data class.
 
string getDoxygenDocumentation (void)
 Returns a string containing documentation for this node class in Doxygen format.
 
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.
 
vector< string > getAutomaticKeywords (void)
 Returns a list of keywords automatically associated with this node class, based on attributes such as its port classes and premium status.
 
- Public Member Functions inherited from VuoBaseDetail< VuoNodeClass >
 VuoBaseDetail (string description, VuoNodeClass *base)
 Creates a VuoNodeClass detail class.
 
VuoNodeClassgetBase (void) const
 Returns the VuoNodeClass detail class instance's base class instance.
 
void setBase (VuoNodeClass *base)
 Sets the VuoNodeClass detail class instance's base class instance.
 
- Public Member Functions inherited from VuoCompilerModule
virtual ~VuoCompilerModule (void)
 Destructor.
 
VuoCompilerTargetSet parseTargetSet (json_object *o, string key)
 Parses the target set value for key in the top level of the JSON object.
 
VuoCompilerTargetSet::MacVersion parseMacVersion (string version)
 Parses a Mac OS version from a string.
 
set< string > getDependencies (void)
 Returns a list of this VuoCompilerModule's dependencies.
 
VuoCompilerTargetSet getCompatibleTargets (void)
 Returns the set of targets (operating system versions) with which this module is compatible.
 
Module * getModule (void)
 Returns this VuoCompilerModule's LLVM module, which other LLVM modules can link to.
 
VuoModulegetPseudoBase (void)
 Returns the (psuedo) base for this (psuedo) compiler detail class.
 
bool getPremium (void)
 Returns a boolean indicating whether this module contains premium content.
 
void setPremium (bool premium)
 Sets the boolean indicating whether this module contains premium content.
 

Static Public Member Functions

static VuoNodeClassnewNodeClass (string nodeClassName, VuoCompiler *compiler, VuoNode *nodeToBack=NULL)
 Generates a specalized node class from a generic node class.
 
static void replaceGenericTypesWithBacking (string &nodeClassSource, VuoNode *nodeToBack=NULL)
 Replaces all occurrences of generic type names in the node class source code with a default actual type name.
 
static vector< string > getGenericTypeNamesFromPorts (VuoCompilerNodeClass *nodeClass)
 Returns the generic type names used by this node class's ports, in numerical order of their suffixes.
 
static map< string, string > getBackingTypeNamesFromPorts (VuoNodeClass *nodeClass)
 Returns the backing type for each generic type used by the given node class's ports.
 
static map< string, string > getBackingTypeNamesFromPorts (VuoNode *node)
 Returns the backing type for each generic type used by the given node's ports.
 
static string extractGenericNodeClassName (string specializedNodeClassName, size_t genericTypeCount)
 Extracts the generic node class name from the specialized node class name by removing type names from the end.
 
static string createSpecializedNodeClassName (string genericNodeClassName, vector< string > specializedTypeNames)
 Creates a specialized node class name by appending type names to the generic node class name.
 
- Static Public Member Functions inherited from VuoCompilerNodeClass
static VuoNodeClassnewNodeClass (string nodeClassName, Module *module)
 Creates a new substantial VuoNodeClass from the node class definition in the module.
 
static VuoNodeClassnewNodeClassWithoutImplementation (VuoNodeClass *baseNodeClass)
 Creates a new implementation-less compiler node class, using the given node class for its base VuoNodeClass.
 
- Static Public Member Functions inherited from VuoCompilerModule
static VuoCompilerModulenewModule (string moduleKey, Module *module)
 Instantiates a VuoCompilerModule (or child class) corresponding to the type of VuoCompilerModule defined in the LLVM module.
 
static Function * declareFunctionInModule (Module *module, Function *function)
 Copies the function's header into the LLVM module, if it's not already there.
 

Protected Attributes

map< string, string > specializedForGenericTypeName
 The type name that replaces each generic type name in the original generic node class.
 
- Protected Attributes inherited from VuoCompilerNodeClass
map< string, string > defaultSpecializedForGenericTypeName
 If this node class is generic, use these specialized types when creating an instance.
 
- Protected Attributes inherited from VuoCompilerModule
struct json_object * moduleDetails
 This module's metadata, found in the argument to VuoModuleMetadata in the module definition.
 
set< string > dependencies
 The dependencies found in this module's metadata.
 
Module * module
 The LLVM module that defines this node class or type.
 
VuoModulebase
 The (pseudo) base for this (pseudo) compiler detail class.
 
VuoCompilerBitcodeParserparser
 The parser of the LLVM module.
 
bool isPremium
 A boolean indicating whether this module contains premium content.
 

Additional Inherited Members

- Protected Member Functions inherited from VuoCompilerNodeClass
 VuoCompilerNodeClass (string className, Module *module)
 Creates a node class implementation from an LLVM module, and creates its corresponding base VuoNodeClass.
 
 VuoCompilerNodeClass (VuoCompilerNodeClass *compilerNodeClass)
 Creates a new compiler node class and creates a new base VuoNodeClass, both from compilerNodeClass.
 
 VuoCompilerNodeClass (VuoNodeClass *baseNodeClass)
 Creates a new implementation-less compiler node class, using the given node class for its base VuoNodeClass.
 
VuoPortClassgetInputPortClassWithName (string portName)
 Returns the input port class matching the specified portName, if one exists.
 
VuoPortClassgetOutputPortClassWithName (string portName)
 Returns the output port class matching the specified portName, if one exists.
 
- Static Protected Member Functions inherited from VuoCompilerNodeClass
static void parseGenericTypes (json_object *moduleDetails, map< string, string > &defaultSpecializedForGenericTypeName, map< string, set< string > > &compatibleSpecializedForGenericTypeName)
 Parses the "genericTypes" portion of a node class's metadata.
 

Constructor & Destructor Documentation

VuoCompilerSpecializedNodeClass::VuoCompilerSpecializedNodeClass ( string  nodeClassName,
Module *  module 
)

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

VuoCompilerSpecializedNodeClass::VuoCompilerSpecializedNodeClass ( VuoCompilerSpecializedNodeClass compilerNodeClass,
VuoNode nodeToBack 
)

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

Member Function Documentation

string VuoCompilerSpecializedNodeClass::createDefaultSpecializedNodeClassName ( void  )

Returns the name for the node class that would result if all of this node class's generic types that have default specialized types (as defined in the node class metadata) were replaced with those types.

string VuoCompilerSpecializedNodeClass::createSpecializedNodeClassName ( string  genericNodeClassName,
vector< string >  specializedTypeNames 
)
static

Creates a specialized node class name by appending type names to the generic node class name.

string VuoCompilerSpecializedNodeClass::createSpecializedNodeClassNameWithReplacement ( string  genericTypeName,
string  specializedTypeName 
)
virtual

Returns the name for the node class that would result if the given (innermost) specialized type were substituted for the given (innermost) generic type in this node class.

Reimplemented in VuoCompilerMakeListNodeClass.

string VuoCompilerSpecializedNodeClass::createUnspecializedNodeClassName ( set< VuoPortClass * >  portClassesToUnspecialize)
virtual

Returns the name for the node class that would result if the given port were changed back to its original type.

Reimplemented in VuoCompilerMakeListNodeClass.

string VuoCompilerSpecializedNodeClass::extractGenericNodeClassName ( string  specializedNodeClassName,
size_t  genericTypeCount 
)
static

Extracts the generic node class name from the specialized node class name by removing type names from the end.

map< string, string > VuoCompilerSpecializedNodeClass::getBackingTypeNamesFromPorts ( VuoNodeClass nodeClass)
static

Returns the backing type for each generic type used by the given node class's ports.

map< string, string > VuoCompilerSpecializedNodeClass::getBackingTypeNamesFromPorts ( VuoNode node)
static

Returns the backing type for each generic type used by the given node's ports.

vector< string > VuoCompilerSpecializedNodeClass::getGenericTypeNamesFromPorts ( VuoCompilerNodeClass nodeClass)
static

Returns the generic type names used by this node class's ports, in numerical order of their suffixes.

string VuoCompilerSpecializedNodeClass::getOriginalGenericNodeClassDescription ( void  )
virtual

Returns the original node's description.

Reimplemented in VuoCompilerMakeListNodeClass.

string VuoCompilerSpecializedNodeClass::getOriginalGenericNodeClassName ( void  )
virtual

Returns the original node's class name (without any type suffixes).

Reimplemented in VuoCompilerMakeListNodeClass.

VuoNodeSet * VuoCompilerSpecializedNodeClass::getOriginalGenericNodeSet ( void  )
virtual

Returns the original node's node set.

Reimplemented in VuoCompilerMakeListNodeClass.

VuoType * VuoCompilerSpecializedNodeClass::getOriginalPortType ( VuoPortClass portClass)
virtual

Returns this port's type in the generic node that this specialized node class was derived from.

Reimplemented in VuoCompilerMakeListNodeClass.

VuoNodeClass * VuoCompilerSpecializedNodeClass::newNodeClass ( string  nodeClassName,
VuoCompiler compiler,
VuoNode nodeToBack = NULL 
)
static

Generates a specalized node class from a generic node class.

Parameters
nodeClassNameThe name of the node class to generate. It should have the format "<generic node class name>.<type>.(...).<type>" (e.g. "vuo.dictionary.make.VuoText.VuoInteger").
compilerThe compiler to use for looking up the generic node class and compiling the specialized node class.
nodeToBackOptionally, a 'Make List' node whose generic types should be used to determine this node class's backing types.
Returns
The generated node class, or null if the generic node class is not found.
void VuoCompilerSpecializedNodeClass::replaceGenericTypesWithBacking ( string &  nodeClassSource,
VuoNode nodeToBack = NULL 
)
static

Replaces all occurrences of generic type names in the node class source code with a default actual type name.

Member Data Documentation

map<string, string> VuoCompilerSpecializedNodeClass::specializedForGenericTypeName
protected

The type name that replaces each generic type name in the original generic node class.


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