Vuo  2.0.0
Public Types | Public Member Functions | List of all members
VuoModuleManager Class Reference

Description

Handles loading of node classes and types.

When modules are loaded on launch, and when they are installed, uninstalled, or modified while the editor is running, this class receives notifications from the compiler and updates the UI and cached data.

Definition at line 27 of file VuoModuleManager.hh.

Public Types

typedef void(^ CallbackType) (void)
 Invoked when a node class is loaded. More...
 

Public Member Functions

 VuoModuleManager (VuoCompiler *compiler)
 Constructs a VuoModuleManager that is ready to receive notifications when compiler loads/unloads modules. More...
 
virtual ~VuoModuleManager (void)
 Instead of of calling delete directly, call VuoModuleManager::deleteWhenReady. More...
 
void deleteWhenReady (void)
 Destroys this object after waiting for all pending work to complete. More...
 
void setComposition (VuoEditorComposition *composition)
 Sets the composition to update when modules are loaded/unloaded. More...
 
void setCodeWindow (VuoCodeWindow *codeWindow)
 Sets the code window to update when the code window's node class fails to load. More...
 
void setNodeLibrary (VuoNodeLibrary *nodeLibrary)
 Sets the node library to update when modules are loaded/unloaded. More...
 
VuoNodeLibrarygetNodeLibrary (void)
 Returns the node library currently being updated when modules are loaded/unloaded. More...
 
void updateWithAlreadyLoadedModules (void)
 Populates this class and the UI with existing modules, loaded before this VuoModuleManager was created. More...
 
vector< string > getCompatibleTypecastClasses (VuoType *inType, VuoType *outType)
 Returns the typecast node classes available to convert from inType to outType. More...
 
map< string, set< VuoCompilerType * > > getLoadedTypesForNodeSet (void)
 Returns a listing of available types indexed by node set name. More...
 
void doNextTimeNodeClassIsLoaded (const string &nodeClassName, CallbackType callback)
 Schedules the block callback to be called the next time this module manager is notified that a node class with the given name has been added or modified. More...
 
void doEveryTimeNodeClassIsLoaded (const string &nodeClassName, CallbackType callback)
 Schedules the block callback to be called every time this module manager is notified that a node class with the given name has been added or modified. More...
 
void cancelCallbackForNodeClass (const string &nodeClassName)
 Cancels the callback previously scheduled by doNextTimeNodeClassIsLoaded or doEveryTimeNodeClassIsLoaded. More...
 
set< string > findInstancesOfNodeClass (const string &sourcePath)
 Returns the fully qualified node identifier (i.e., prefixed by composition identifier) of each instance of the given node class that appears at any level in this module manager's composition. More...
 
void loadedModules (const map< string, VuoCompilerModule * > &modulesAdded, const map< string, pair< VuoCompilerModule *, VuoCompilerModule * > > &modulesModified, const map< string, VuoCompilerModule * > &modulesRemoved, VuoCompilerIssues *issues)
 Compiler delegate method, called when modules are loaded/unloaded. More...
 
- Public Member Functions inherited from VuoCompilerDelegate
 VuoCompilerDelegate (void)
 Initializes private data members. More...
 
void loadedModulesCompleted (void)
 Signals that this delegate has finished using the argument values from loadedModules. More...
 

Member Typedef Documentation

◆ CallbackType

typedef void(^ VuoModuleManager::CallbackType) (void)

Invoked when a node class is loaded.

Definition at line 30 of file VuoModuleManager.hh.

Constructor & Destructor Documentation

◆ VuoModuleManager()

VuoModuleManager::VuoModuleManager ( VuoCompiler compiler)

Constructs a VuoModuleManager that is ready to receive notifications when compiler loads/unloads modules.

This object becomes responsible for deleting compiler.

Definition at line 41 of file VuoModuleManager.cc.

◆ ~VuoModuleManager()

VuoModuleManager::~VuoModuleManager ( void  )
virtual

Instead of of calling delete directly, call VuoModuleManager::deleteWhenReady.

Definition at line 58 of file VuoModuleManager.cc.

Member Function Documentation

◆ cancelCallbackForNodeClass()

void VuoModuleManager::cancelCallbackForNodeClass ( const string &  nodeClassName)

Cancels the callback previously scheduled by doNextTimeNodeClassIsLoaded or doEveryTimeNodeClassIsLoaded.

Definition at line 176 of file VuoModuleManager.cc.

◆ deleteWhenReady()

void VuoModuleManager::deleteWhenReady ( void  )

Destroys this object after waiting for all pending work to complete.

Definition at line 67 of file VuoModuleManager.cc.

◆ doEveryTimeNodeClassIsLoaded()

void VuoModuleManager::doEveryTimeNodeClassIsLoaded ( const string &  nodeClassName,
CallbackType  callback 
)

Schedules the block callback to be called every time this module manager is notified that a node class with the given name has been added or modified.

Definition at line 165 of file VuoModuleManager.cc.

◆ doNextTimeNodeClassIsLoaded()

void VuoModuleManager::doNextTimeNodeClassIsLoaded ( const string &  nodeClassName,
CallbackType  callback 
)

Schedules the block callback to be called the next time this module manager is notified that a node class with the given name has been added or modified.

Definition at line 153 of file VuoModuleManager.cc.

◆ findInstancesOfNodeClass()

set< string > VuoModuleManager::findInstancesOfNodeClass ( const string &  sourcePath)

Returns the fully qualified node identifier (i.e., prefixed by composition identifier) of each instance of the given node class that appears at any level in this module manager's composition.

Parameters
sourcePathThe path of the node class's source code. If a node class with the same class name is installed at multiple locations accessible to the composition (e.g., user modules and composition-local modules), this function only returns instances of the node class if the composition actually uses the implementation at sourcePath.

Definition at line 195 of file VuoModuleManager.cc.

◆ getCompatibleTypecastClasses()

vector< string > VuoModuleManager::getCompatibleTypecastClasses ( VuoType inType,
VuoType outType 
)

Returns the typecast node classes available to convert from inType to outType.

Definition at line 125 of file VuoModuleManager.cc.

◆ getLoadedTypesForNodeSet()

map< string, set< VuoCompilerType * > > VuoModuleManager::getLoadedTypesForNodeSet ( void  )

Returns a listing of available types indexed by node set name.

Types that are unaffiliated with any particular node set are indexed with a node set name of the empty string.

A type is listed in association with a given node set if it is used strictly by that node set or if it has been marked as being primarily affiliated with that node set, and has not been included in the set of types explicitly to be included in the "core type" menu.

The listing is cached, so this function call is inexpensive.

Definition at line 144 of file VuoModuleManager.cc.

◆ getNodeLibrary()

VuoNodeLibrary * VuoModuleManager::getNodeLibrary ( void  )

Returns the node library currently being updated when modules are loaded/unloaded.

Definition at line 117 of file VuoModuleManager.cc.

◆ loadedModules()

void VuoModuleManager::loadedModules ( const map< string, VuoCompilerModule * > &  modulesAdded,
const map< string, pair< VuoCompilerModule *, VuoCompilerModule * > > &  modulesModified,
const map< string, VuoCompilerModule * > &  modulesRemoved,
VuoCompilerIssues issues 
)
virtual

Compiler delegate method, called when modules are loaded/unloaded.

Implements VuoCompilerDelegate.

Definition at line 244 of file VuoModuleManager.cc.

◆ setCodeWindow()

void VuoModuleManager::setCodeWindow ( VuoCodeWindow codeWindow)

Sets the code window to update when the code window's node class fails to load.

Definition at line 99 of file VuoModuleManager.cc.

◆ setComposition()

void VuoModuleManager::setComposition ( VuoEditorComposition composition)

Sets the composition to update when modules are loaded/unloaded.

Definition at line 91 of file VuoModuleManager.cc.

◆ setNodeLibrary()

void VuoModuleManager::setNodeLibrary ( VuoNodeLibrary nodeLibrary)

Sets the node library to update when modules are loaded/unloaded.

Definition at line 107 of file VuoModuleManager.cc.

◆ updateWithAlreadyLoadedModules()

void VuoModuleManager::updateWithAlreadyLoadedModules ( void  )

Populates this class and the UI with existing modules, loaded before this VuoModuleManager was created.

Definition at line 315 of file VuoModuleManager.cc.


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