Vuo 2.4.2
Loading...
Searching...
No Matches
Public Types | Signals | 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 29 of file VuoModuleManager.hh.

Public Types

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

Signals

void loadedModulesAndReadyToUpdate (const vector< string > &nodeClassesToRemove, const vector< VuoCompilerNodeClass * > &nodeClassesToAdd, const vector< string > &typesToRemove, const vector< VuoCompilerType * > &typesToAdd, const vector< string > &librariesToRemove, const ModulesModifiedSet &modulesModified, VuoCompilerIssues *issues)
 Used for scheduling UI changes on the main thread. 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)
 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...
 

Member Typedef Documentation

◆ CallbackType

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

Invoked when a node class is loaded.

Definition at line 34 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 46 of file VuoModuleManager.cc.

◆ ~VuoModuleManager()

VuoModuleManager::~VuoModuleManager ( void  )
virtual

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

Definition at line 67 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 174 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 163 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 151 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 193 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 123 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 142 of file VuoModuleManager.cc.

◆ getNodeLibrary()

VuoNodeLibrary * VuoModuleManager::getNodeLibrary ( void  )

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

May be null if the node library is detached.

Definition at line 115 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 242 of file VuoModuleManager.cc.

◆ loadedModulesAndReadyToUpdate

void VuoModuleManager::loadedModulesAndReadyToUpdate ( const vector< string > &  nodeClassesToRemove,
const vector< VuoCompilerNodeClass * > &  nodeClassesToAdd,
const vector< string > &  typesToRemove,
const vector< VuoCompilerType * > &  typesToAdd,
const vector< string > &  librariesToRemove,
const ModulesModifiedSet modulesModified,
VuoCompilerIssues issues 
)
signal

Used for scheduling UI changes on the main thread.

◆ 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 95 of file VuoModuleManager.cc.

◆ setComposition()

void VuoModuleManager::setComposition ( VuoEditorComposition composition)

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

Definition at line 87 of file VuoModuleManager.cc.

◆ setNodeLibrary()

void VuoModuleManager::setNodeLibrary ( VuoNodeLibrary nodeLibrary)

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

Definition at line 103 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 324 of file VuoModuleManager.cc.


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