Vuo 2.4.4
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
VuoCompilerEnvironment Class Reference

Description

A set of modules (node classes, types, libraries) and search paths at a certain level of scope.

This class refers to the following independent levels of scope. Listed in order from broadest to narrowest:

At each level of scope, the VuoCompiler has two kinds of modules:

Each combination of level of scope and kind of module comprises a VuoCompilerEnvironment.

Modules at one level of scope can refer to modules at broader levels of scope. For example, a node class at the system level can use types defined at the system level and/or the built-in level.

Within a level of scope, original modules can refer to generated modules and vice versa.

The set of all modules and search paths available to a VuoCompiler instance consists of all of its VuoCompilerEnvironment instances layered on top of one another (like CSS). If a module of the same key exists at multiple levels, the one at the narrowest level of scope is used.

All functions in this class, unless otherwise specified, need to be called on VuoCompiler::environmentQueue.

Definition at line 62 of file VuoCompilerEnvironment.hh.

Public Member Functions

 VuoCompilerEnvironment (string target, bool builtIn, bool generated)
 Creates an empty environment.
 
virtual ~VuoCompilerEnvironment (void)
 Destructor.
 
string getTarget ()
 Returns this environment's LLVM target triple.
 
void addCompilerToNotify (VuoCompiler *compiler)
 Adds a compiler to notify when this VuoCompilerEnvironment loads/unloads modules as a result of changes to the watched search paths.
 
void removeCompilerToNotify (VuoCompiler *compiler)
 Removes a compiler to notify when this VuoCompilerEnvironment loads/unloads modules as a result of changes to the watched search paths.
 
map< string, VuoCompilerNodeClass * > getNodeClasses (void)
 Returns the node classes loaded, plus specialized node classes generated by the compiler.
 
VuoCompilerNodeClassgetNodeClass (const string &moduleKey)
 Returns the node class with the given moduleKey, or null if no node class by that name has been loaded.
 
map< string, VuoCompilerType * > getTypes (void)
 Returns the types loaded.
 
VuoCompilerTypegetType (const string &moduleKey)
 Returns the type with the given moduleKey, or null if no type by that name has been loaded.
 
map< string, VuoNodeSet * > getNodeSets ()
 Returns the node sets loaded.
 
VuoCompilerModulegetLibraryModule (const string &libraryModuleName)
 Returns the library with the given libraryModuleName, or null if no library by that name has been loaded.
 
map< string, VuoCompilerModule * > getLibraryModules (void)
 Returns the library modules loaded.
 
VuoCompilerModulefindModule (const string &moduleKey)
 Returns the VuoCompilerNodeClass, VuoCompilerType, or VuoCompilerModule with the given name, or null if no such module has been loaded.
 
VuoNodeSetfindNodeSet (const string &name)
 Returns the node set with the given name, or null if no such node set been loaded.
 
void addModuleSearchPath (const string &path, bool shouldWatch=true)
 Adds a search path for node classes, types, and library modules, and starts watching it for changes.
 
vector< string > getModuleSearchPaths (void)
 Returns the search paths for node classes, types, and library modules.
 
void addHeaderSearchPath (const string &path)
 Adds a search path for header/include files.
 
vector< string > getHeaderSearchPaths (void)
 Returns the search paths for header/include files.
 
void addLibrarySearchPath (const string &path)
 Adds a search path for libraries (other than Vuo library modules).
 
vector< string > getLibrarySearchPaths (void)
 Returns the search paths for libraries (other than Vuo library modules).
 
void addFrameworkSearchPath (const string &path)
 Adds a search path for frameworks.
 
void setModuleCache (shared_ptr< VuoModuleCache > moduleCache)
 Sets the module cache used by this environment and enables this environment to load cached compiled modules.
 
shared_ptr< VuoModuleCachegetModuleCache (void)
 Returns the module cache used by this environment.
 
string getCompiledModuleCachePath (void)
 Returns the directory containing compiled/generated bitcode for subcompositions and text-code modules (if this is an installed environment) or specialized modules (if this is a generated environment).
 
string getOverriddenCompiledModuleCachePath (void)
 Returns the directory containing compiled bitcode for unsaved subcompositions and text-code modules.
 
vector< string > getFrameworkSearchPaths (void)
 Returns the search paths for frameworks.
 
VuoDirectedAcyclicGraphgetDependencyGraph (void)
 Returns a full dependency graph for this environment, containing all modules that have been loaded and their dependencies.
 
VuoDirectedAcyclicGraphgetCompositionDependencyGraph (void)
 Returns a partial dependency graph for this environment, containing all subcompositions (loaded or not) and the node classes that are their direct dependencies.
 
void addExpatriateSourceFile (const string &sourcePath)
 Adds a source file to this environment even though it's located outside of this environment's module search paths.
 
void removeExpatriateSourceFile (const string &sourcePath)
 Removes the source file at sourcePath previously added by addExpatriateSourceFile, if any.
 
VuoModuleInfolistModule (const string &moduleKey)
 Returns info for the module if it's found in one of the VuoCompilerEnvironment::moduleSearchPaths, otherwise null.
 
VuoModuleInfoIterator listModules (const set< string > &moduleKeys)
 Returns info for each of the modules specified by moduleKeys that is found in one of the VuoCompilerEnvironment::moduleSearchPaths.
 
VuoModuleInfoIterator listAllModules (void)
 Returns info for all of the modules found in the VuoCompilerEnvironment::moduleSearchPaths.
 
VuoModuleInfolistSourceFile (const string &moduleKey)
 Returns info for the module source file if it's found in one of the VuoCompilerEnvironment::moduleSearchPaths, otherwise null.
 
VuoModuleInfoIterator listSourceFiles (const set< string > &moduleKeys)
 Returns info for each of the module source files specified by moduleKeys that is found in one of the VuoCompilerEnvironment::moduleSearchPaths.
 
VuoModuleInfoIterator listAllSourceFiles (void)
 Returns info for all of the module source files found in the VuoCompilerEnvironment::moduleSearchPaths.
 
void stopWatchingModuleSearchPaths (void)
 Stops watching all watched directories.
 
void fileChanged (const string &moduleSearchPath)
 VuoFileWatcher delegate function, called when one or more files in moduleSearchPath have been added, modified, or removed.
 
void moduleSearchPathContentsChanged (const string &moduleSearchPath)
 Callback for when files have been added, modified, or removed from one of the module search paths.
 
void moduleFileChanged (const string &moduleKey, const string &modulePath, const string &moduleSourceCode, std::function< void(void)> moduleLoadedCallback, VuoCompiler *compiler, VuoCompilerIssues *issues=nullptr)
 Callback for when a single file has been added, modified, or removed from one of the module search paths.
 
void deleteOverriddenModuleFile (const string &moduleKey)
 Deletes the files and file record for moduleKey in the overridden compiled modules directory of the module cache.
 
void notifyCompilers (const set< VuoCompilerModule * > &modulesAdded, const set< pair< VuoCompilerModule *, VuoCompilerModule * > > &modulesModified, const set< VuoCompilerModule * > &modulesRemoved, VuoCompilerIssues *issues, bool oldModulesInvalidated=true)
 Notifies each of VuoCompilerEnvironment::compilersToNotify of modules loaded/unloaded and issues encountered.
 
set< VuoCompilerModule * > loadCompiledModules (const set< string > &moduleKeys, const map< string, string > &sourceCodeForModule, dispatch_queue_t llvmQueue)
 Loads each of moduleKeys that is an already-compiled module file or in-memory module, belongs to this environment, and is not already loaded.
 
set< dispatch_group_t > generateSpecializedModules (const set< string > &moduleKeys, VuoCompiler *compiler, dispatch_group_t moduleSourceCompilersExist, dispatch_queue_t llvmQueue)
 Starts generating and loading each of moduleKeys that is a specialization of a generic node class and hasn't already been attempted to be loaded.
 
set< dispatch_group_t > compileModulesFromSourceCode (const set< string > &moduleKeys, bool shouldRecompileIfUnchanged, dispatch_group_t moduleSourceCompilersExist, dispatch_queue_t llvmQueue)
 Starts compiling each of moduleKeys that is a composition or ISF file, belongs to this environment, doesn't have a compiled file or has a compiled file older than the source file, and hasn't already been attempted to be compiled.
 
set< VuoCompilerModule * > unloadCompiledModules (const set< string > &moduleKeys)
 Unloads each of moduleKeys that is a module loaded in this environment.
 
void deleteFromCompiledModuleCache (const set< string > &moduleKeys)
 Attempts to delete the bitcode file and dependency file for each of moduleKeys from the compiled modules directory in the module cache.
 
void addToDependencyGraph (VuoCompilerModule *module)
 Adds a vertex representing module and edges for the module's dependencies to the environment's full dependency graph.
 
void removeFromDependencyGraph (VuoCompilerModule *module)
 Removes the vertex representing module and all of its edges from the environment's full dependency graph.
 
VuoModuleCacheManifest getCacheableModulesAndDependencies (set< string > &dylibsNeededToLinkToThisCache, set< string > &frameworksNeededToLinkToThisCache)
 Inventories the items that should be included in this environment's cache.
 
void modulesChanged (void)
 Call this function when cacheable modules have been added to, modified in, or removed from this environment.
 
bool isBuiltInOriginal (void)
 Returns true if this is the environment for built-in original modules.
 
bool isBuiltIn (void)
 Returns true if this environment is for built-in modules.
 
bool isGenerated (void)
 Returns true if this environment is for generated modules, false if for original modules.
 
string getName ()
 Returns an identifier for this environment, suitable for log messages.
 

Static Public Member Functions

static vector< string > getBuiltInModuleSearchPaths (void)
 Returns the search paths for built-in node classes, types, and library modules.
 
static vector< string > getBuiltInLibrarySearchPaths (void)
 Returns the search paths for built-in libraries (other than library modules).
 
static vector< string > getBuiltInFrameworkSearchPaths (void)
 Returns the search paths for built-in frameworks.
 

Public Attributes

dispatch_queue_t moduleSearchPathContentsChangedQueue
 Synchronizes calls to moduleSearchPathContentsChanged(). It's OK to call VuoCompiler::environmentQueue from this queue.
 

Friends

class TestCompilingAndLinking
 

Constructor & Destructor Documentation

◆ VuoCompilerEnvironment()

VuoCompilerEnvironment::VuoCompilerEnvironment ( string  target,
bool  builtIn,
bool  generated 
)
explicit

Creates an empty environment.

Definition at line 41 of file VuoCompilerEnvironment.cc.

◆ ~VuoCompilerEnvironment()

VuoCompilerEnvironment::~VuoCompilerEnvironment ( void  )
virtual

Destructor.

Definition at line 55 of file VuoCompilerEnvironment.cc.

Member Function Documentation

◆ addCompilerToNotify()

void VuoCompilerEnvironment::addCompilerToNotify ( VuoCompiler compiler)

Adds a compiler to notify when this VuoCompilerEnvironment loads/unloads modules as a result of changes to the watched search paths.

Definition at line 98 of file VuoCompilerEnvironment.cc.

◆ addExpatriateSourceFile()

void VuoCompilerEnvironment::addExpatriateSourceFile ( const string &  sourcePath)

Adds a source file to this environment even though it's located outside of this environment's module search paths.

The source file is not watched for changes.

Definition at line 356 of file VuoCompilerEnvironment.cc.

◆ addFrameworkSearchPath()

void VuoCompilerEnvironment::addFrameworkSearchPath ( const string &  path)

Adds a search path for frameworks.

Definition at line 274 of file VuoCompilerEnvironment.cc.

◆ addHeaderSearchPath()

void VuoCompilerEnvironment::addHeaderSearchPath ( const string &  path)

Adds a search path for header/include files.

Definition at line 242 of file VuoCompilerEnvironment.cc.

◆ addLibrarySearchPath()

void VuoCompilerEnvironment::addLibrarySearchPath ( const string &  path)

Adds a search path for libraries (other than Vuo library modules).

Definition at line 258 of file VuoCompilerEnvironment.cc.

◆ addModuleSearchPath()

void VuoCompilerEnvironment::addModuleSearchPath ( const string &  path,
bool  shouldWatch = true 
)

Adds a search path for node classes, types, and library modules, and starts watching it for changes.

Definition at line 220 of file VuoCompilerEnvironment.cc.

◆ addToDependencyGraph()

void VuoCompilerEnvironment::addToDependencyGraph ( VuoCompilerModule module)

Adds a vertex representing module and edges for the module's dependencies to the environment's full dependency graph.

Definition at line 1842 of file VuoCompilerEnvironment.cc.

◆ compileModulesFromSourceCode()

set< dispatch_group_t > VuoCompilerEnvironment::compileModulesFromSourceCode ( const set< string > &  moduleKeys,
bool  shouldRecompileIfUnchanged,
dispatch_group_t  moduleSourceCompilersExist,
dispatch_queue_t  llvmQueue 
)

Starts compiling each of moduleKeys that is a composition or ISF file, belongs to this environment, doesn't have a compiled file or has a compiled file older than the source file, and hasn't already been attempted to be compiled.

Compiling is scheduled asynchronously. The caller can wait on the returned dispatch groups.

If a subcomposition to be compiled has other subcompositions as dependencies, the dependencies are compiled first.

Definition at line 1349 of file VuoCompilerEnvironment.cc.

◆ deleteFromCompiledModuleCache()

void VuoCompilerEnvironment::deleteFromCompiledModuleCache ( const set< string > &  moduleKeys)

Attempts to delete the bitcode file and dependency file for each of moduleKeys from the compiled modules directory in the module cache.

Silently fails if the files could not be deleted because the module cache is unavailable.

Definition at line 1684 of file VuoCompilerEnvironment.cc.

◆ deleteOverriddenModuleFile()

void VuoCompilerEnvironment::deleteOverriddenModuleFile ( const string &  moduleKey)

Deletes the files and file record for moduleKey in the overridden compiled modules directory of the module cache.

Definition at line 1036 of file VuoCompilerEnvironment.cc.

◆ fileChanged()

void VuoCompilerEnvironment::fileChanged ( const string &  moduleSearchPath)
virtual

VuoFileWatcher delegate function, called when one or more files in moduleSearchPath have been added, modified, or removed.

This function may be called on any dispatch queue except VuoCompiler::environmentQueue. This function may be called on any dispatch queue except moduleSearchPathContentsChangedQueue.

Implements VuoFileWatcherDelegate.

Definition at line 784 of file VuoCompilerEnvironment.cc.

◆ findModule()

VuoCompilerModule * VuoCompilerEnvironment::findModule ( const string &  moduleKey)

Returns the VuoCompilerNodeClass, VuoCompilerType, or VuoCompilerModule with the given name, or null if no such module has been loaded.

Definition at line 187 of file VuoCompilerEnvironment.cc.

◆ findNodeSet()

VuoNodeSet * VuoCompilerEnvironment::findNodeSet ( const string &  name)

Returns the node set with the given name, or null if no such node set been loaded.

Definition at line 207 of file VuoCompilerEnvironment.cc.

◆ generateSpecializedModules()

set< dispatch_group_t > VuoCompilerEnvironment::generateSpecializedModules ( const set< string > &  moduleKeys,
VuoCompiler compiler,
dispatch_group_t  moduleSourceCompilersExist,
dispatch_queue_t  llvmQueue 
)

Starts generating and loading each of moduleKeys that is a specialization of a generic node class and hasn't already been attempted to be loaded.

Loading is scheduled asynchronously. The caller can wait on the returned dispatch groups, and is responsible for releasing them.

Assumes that the dependencies of each specialized node class have already been loaded.

Definition at line 1203 of file VuoCompilerEnvironment.cc.

◆ getBuiltInFrameworkSearchPaths()

vector< string > VuoCompilerEnvironment::getBuiltInFrameworkSearchPaths ( void  )
static

Returns the search paths for built-in frameworks.

Definition at line 742 of file VuoCompilerEnvironment.cc.

◆ getBuiltInLibrarySearchPaths()

vector< string > VuoCompilerEnvironment::getBuiltInLibrarySearchPaths ( void  )
static

Returns the search paths for built-in libraries (other than library modules).

Definition at line 713 of file VuoCompilerEnvironment.cc.

◆ getBuiltInModuleSearchPaths()

vector< string > VuoCompilerEnvironment::getBuiltInModuleSearchPaths ( void  )
static

Returns the search paths for built-in node classes, types, and library modules.

Definition at line 691 of file VuoCompilerEnvironment.cc.

◆ getCacheableModulesAndDependencies()

VuoModuleCacheManifest VuoCompilerEnvironment::getCacheableModulesAndDependencies ( set< string > &  dylibsNeededToLinkToThisCache,
set< string > &  frameworksNeededToLinkToThisCache 
)

Inventories the items that should be included in this environment's cache.

Parameters
[out]dylibsNeededToLinkToThisCacheThe paths of all dylibs that the module cache dylib should link to on behalf of this environment.
[out]frameworksNeededToLinkToThisCacheThe names of all frameworks that the cache dylib should link to on behalf of this environment.

Definition at line 1874 of file VuoCompilerEnvironment.cc.

◆ getCompiledModuleCachePath()

string VuoCompilerEnvironment::getCompiledModuleCachePath ( void  )

Returns the directory containing compiled/generated bitcode for subcompositions and text-code modules (if this is an installed environment) or specialized modules (if this is a generated environment).

Definition at line 338 of file VuoCompilerEnvironment.cc.

◆ getCompositionDependencyGraph()

VuoDirectedAcyclicGraph * VuoCompilerEnvironment::getCompositionDependencyGraph ( void  )

Returns a partial dependency graph for this environment, containing all subcompositions (loaded or not) and the node classes that are their direct dependencies.

Definition at line 299 of file VuoCompilerEnvironment.cc.

◆ getDependencyGraph()

VuoDirectedAcyclicGraph * VuoCompilerEnvironment::getDependencyGraph ( void  )

Returns a full dependency graph for this environment, containing all modules that have been loaded and their dependencies.

Definition at line 290 of file VuoCompilerEnvironment.cc.

◆ getFrameworkSearchPaths()

vector< string > VuoCompilerEnvironment::getFrameworkSearchPaths ( void  )

Returns the search paths for frameworks.

Definition at line 282 of file VuoCompilerEnvironment.cc.

◆ getHeaderSearchPaths()

vector< string > VuoCompilerEnvironment::getHeaderSearchPaths ( void  )

Returns the search paths for header/include files.

Definition at line 250 of file VuoCompilerEnvironment.cc.

◆ getLibraryModule()

VuoCompilerModule * VuoCompilerEnvironment::getLibraryModule ( const string &  libraryModuleName)

Returns the library with the given libraryModuleName, or null if no library by that name has been loaded.

Definition at line 166 of file VuoCompilerEnvironment.cc.

◆ getLibraryModules()

map< string, VuoCompilerModule * > VuoCompilerEnvironment::getLibraryModules ( void  )

Returns the library modules loaded.

Definition at line 178 of file VuoCompilerEnvironment.cc.

◆ getLibrarySearchPaths()

vector< string > VuoCompilerEnvironment::getLibrarySearchPaths ( void  )

Returns the search paths for libraries (other than Vuo library modules).

Definition at line 266 of file VuoCompilerEnvironment.cc.

◆ getModuleCache()

shared_ptr< VuoModuleCache > VuoCompilerEnvironment::getModuleCache ( void  )

Returns the module cache used by this environment.

Definition at line 329 of file VuoCompilerEnvironment.cc.

◆ getModuleSearchPaths()

vector< string > VuoCompilerEnvironment::getModuleSearchPaths ( void  )

Returns the search paths for node classes, types, and library modules.

Definition at line 234 of file VuoCompilerEnvironment.cc.

◆ getName()

string VuoCompilerEnvironment::getName ( )

Returns an identifier for this environment, suitable for log messages.

Definition at line 1995 of file VuoCompilerEnvironment.cc.

◆ getNodeClass()

VuoCompilerNodeClass * VuoCompilerEnvironment::getNodeClass ( const string &  moduleKey)

Returns the node class with the given moduleKey, or null if no node class by that name has been loaded.

Definition at line 126 of file VuoCompilerEnvironment.cc.

◆ getNodeClasses()

map< string, VuoCompilerNodeClass * > VuoCompilerEnvironment::getNodeClasses ( void  )

Returns the node classes loaded, plus specialized node classes generated by the compiler.

Definition at line 118 of file VuoCompilerEnvironment.cc.

◆ getNodeSets()

map< string, VuoNodeSet * > VuoCompilerEnvironment::getNodeSets ( void  )

Returns the node sets loaded.

Definition at line 158 of file VuoCompilerEnvironment.cc.

◆ getOverriddenCompiledModuleCachePath()

string VuoCompilerEnvironment::getOverriddenCompiledModuleCachePath ( void  )

Returns the directory containing compiled bitcode for unsaved subcompositions and text-code modules.

Definition at line 346 of file VuoCompilerEnvironment.cc.

◆ getTarget()

string VuoCompilerEnvironment::getTarget ( )

Returns this environment's LLVM target triple.

Definition at line 90 of file VuoCompilerEnvironment.cc.

◆ getType()

VuoCompilerType * VuoCompilerEnvironment::getType ( const string &  moduleKey)

Returns the type with the given moduleKey, or null if no type by that name has been loaded.

Definition at line 146 of file VuoCompilerEnvironment.cc.

◆ getTypes()

map< string, VuoCompilerType * > VuoCompilerEnvironment::getTypes ( void  )

Returns the types loaded.

Definition at line 138 of file VuoCompilerEnvironment.cc.

◆ isBuiltIn()

bool VuoCompilerEnvironment::isBuiltIn ( void  )

Returns true if this environment is for built-in modules.

Definition at line 1979 of file VuoCompilerEnvironment.cc.

◆ isBuiltInOriginal()

bool VuoCompilerEnvironment::isBuiltInOriginal ( void  )

Returns true if this is the environment for built-in original modules.

Definition at line 1971 of file VuoCompilerEnvironment.cc.

◆ isGenerated()

bool VuoCompilerEnvironment::isGenerated ( void  )

Returns true if this environment is for generated modules, false if for original modules.

Definition at line 1987 of file VuoCompilerEnvironment.cc.

◆ listAllModules()

VuoModuleInfoIterator VuoCompilerEnvironment::listAllModules ( void  )

Returns info for all of the modules found in the VuoCompilerEnvironment::moduleSearchPaths.

Definition at line 643 of file VuoCompilerEnvironment.cc.

◆ listAllSourceFiles()

VuoModuleInfoIterator VuoCompilerEnvironment::listAllSourceFiles ( void  )

Returns info for all of the module source files found in the VuoCompilerEnvironment::moduleSearchPaths.

Definition at line 680 of file VuoCompilerEnvironment.cc.

◆ listModule()

VuoModuleInfo * VuoCompilerEnvironment::listModule ( const string &  moduleKey)

Returns info for the module if it's found in one of the VuoCompilerEnvironment::moduleSearchPaths, otherwise null.

If the module exists in both the cached compiled modules and the overridden cached compiled modules, returns the overridden version.

Definition at line 607 of file VuoCompilerEnvironment.cc.

◆ listModules()

VuoModuleInfoIterator VuoCompilerEnvironment::listModules ( const set< string > &  moduleKeys)

Returns info for each of the modules specified by moduleKeys that is found in one of the VuoCompilerEnvironment::moduleSearchPaths.

Definition at line 629 of file VuoCompilerEnvironment.cc.

◆ listSourceFile()

VuoModuleInfo * VuoCompilerEnvironment::listSourceFile ( const string &  moduleKey)

Returns info for the module source file if it's found in one of the VuoCompilerEnvironment::moduleSearchPaths, otherwise null.

Definition at line 654 of file VuoCompilerEnvironment.cc.

◆ listSourceFiles()

VuoModuleInfoIterator VuoCompilerEnvironment::listSourceFiles ( const set< string > &  moduleKeys)

Returns info for each of the module source files specified by moduleKeys that is found in one of the VuoCompilerEnvironment::moduleSearchPaths.

Definition at line 669 of file VuoCompilerEnvironment.cc.

◆ loadCompiledModules()

set< VuoCompilerModule * > VuoCompilerEnvironment::loadCompiledModules ( const set< string > &  moduleKeys,
const map< string, string > &  sourceCodeForModule,
dispatch_queue_t  llvmQueue 
)

Loads each of moduleKeys that is an already-compiled module file or in-memory module, belongs to this environment, and is not already loaded.

Returns the modules that were actually loaded.

Issues are logged to the console.

Definition at line 1102 of file VuoCompilerEnvironment.cc.

◆ moduleFileChanged()

void VuoCompilerEnvironment::moduleFileChanged ( const string &  moduleKey,
const string &  modulePath,
const string &  moduleSourceCode,
std::function< void(void)>  moduleLoadedCallback,
VuoCompiler compiler,
VuoCompilerIssues issues = nullptr 
)

Callback for when a single file has been added, modified, or removed from one of the module search paths.

Unlike VuoCompilerEnvironment::moduleSearchPathContentsChanged, this function only updates the record for the one file. It does not check for other changed files in the directory.

This function may be called on any dispatch queue except VuoCompiler::environmentQueue.

Definition at line 963 of file VuoCompilerEnvironment.cc.

◆ modulesChanged()

void VuoCompilerEnvironment::modulesChanged ( void  )

Call this function when cacheable modules have been added to, modified in, or removed from this environment.

It flags the cache as needing rebuilt.

Definition at line 1960 of file VuoCompilerEnvironment.cc.

◆ moduleSearchPathContentsChanged()

void VuoCompilerEnvironment::moduleSearchPathContentsChanged ( const string &  moduleSearchPath)

Callback for when files have been added, modified, or removed from one of the module search paths.

Updates the records of known module and composition files, unloads and loads compiled modules, schedules module source files to be compiled, and notifies each of VuoCompilerEnvironment::compilersToNotify.

This function may be called on any dispatch queue except VuoCompiler::environmentQueue. This function may only be called on dispatch queue moduleSearchPathContentsChangedQueue.

Definition at line 799 of file VuoCompilerEnvironment.cc.

◆ notifyCompilers()

void VuoCompilerEnvironment::notifyCompilers ( const set< VuoCompilerModule * > &  modulesAdded,
const set< pair< VuoCompilerModule *, VuoCompilerModule * > > &  modulesModified,
const set< VuoCompilerModule * > &  modulesRemoved,
VuoCompilerIssues issues,
bool  oldModulesInvalidated = true 
)

Notifies each of VuoCompilerEnvironment::compilersToNotify of modules loaded/unloaded and issues encountered.

Definition at line 1052 of file VuoCompilerEnvironment.cc.

◆ removeCompilerToNotify()

void VuoCompilerEnvironment::removeCompilerToNotify ( VuoCompiler compiler)

Removes a compiler to notify when this VuoCompilerEnvironment loads/unloads modules as a result of changes to the watched search paths.

Definition at line 108 of file VuoCompilerEnvironment.cc.

◆ removeExpatriateSourceFile()

void VuoCompilerEnvironment::removeExpatriateSourceFile ( const string &  sourcePath)

Removes the source file at sourcePath previously added by addExpatriateSourceFile, if any.

Definition at line 371 of file VuoCompilerEnvironment.cc.

◆ removeFromDependencyGraph()

void VuoCompilerEnvironment::removeFromDependencyGraph ( VuoCompilerModule module)

Removes the vertex representing module and all of its edges from the environment's full dependency graph.

Definition at line 1860 of file VuoCompilerEnvironment.cc.

◆ setModuleCache()

void VuoCompilerEnvironment::setModuleCache ( shared_ptr< VuoModuleCache moduleCache)

Sets the module cache used by this environment and enables this environment to load cached compiled modules.

Definition at line 307 of file VuoCompilerEnvironment.cc.

◆ stopWatchingModuleSearchPaths()

void VuoCompilerEnvironment::stopWatchingModuleSearchPaths ( void  )

Stops watching all watched directories.

Definition at line 769 of file VuoCompilerEnvironment.cc.

◆ unloadCompiledModules()

set< VuoCompilerModule * > VuoCompilerEnvironment::unloadCompiledModules ( const set< string > &  moduleKeys)

Unloads each of moduleKeys that is a module loaded in this environment.

Returns the modules that were actually unloaded. The caller is responsible for deallocating them with VuoCompiler::destroyModule().

Definition at line 1542 of file VuoCompilerEnvironment.cc.

Friends And Related Symbol Documentation

◆ TestCompilingAndLinking

friend class TestCompilingAndLinking
friend

Definition at line 106 of file VuoCompilerEnvironment.hh.

Member Data Documentation

◆ moduleSearchPathContentsChangedQueue

dispatch_queue_t VuoCompilerEnvironment::moduleSearchPathContentsChangedQueue

Synchronizes calls to moduleSearchPathContentsChanged(). It's OK to call VuoCompiler::environmentQueue from this queue.

Definition at line 109 of file VuoCompilerEnvironment.hh.


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