24 #ifndef PXR_BASE_TF_SCRIPT_MODULE_LOADER_H
25 #define PXR_BASE_TF_SCRIPT_MODULE_LOADER_H
29 #include "pxr/base/tf/api.h"
38 #include <boost/python/dict.hpp>
41 #include "pxr/base/tf/hashmap.h"
42 #include "pxr/base/tf/hashset.h"
46 PXR_NAMESPACE_OPEN_SCOPE
75 std::vector<TfToken>
const &predecessors);
107 std::vector<TfToken> predecessors, successors;
110 typedef TfHashMap<TfToken, _LibInfo, TfToken::HashFunctor>
113 typedef TfHashMap<TfToken, TfToken, TfToken::HashFunctor>
116 typedef TfHashSet<TfToken, TfToken::HashFunctor>
124 void _LoadModulesFor(
TfToken const &name);
125 void _LoadUpTo(
TfToken const &name);
126 void _GetOrderedDependenciesRecursive(
TfToken const &lib,
128 std::vector<TfToken> *result)
const;
129 void _GetOrderedDependencies(std::vector<TfToken>
const &input,
130 std::vector<TfToken> *result)
const;
131 void _TopologicalSort(std::vector<TfToken> *result)
const;
133 bool _HasTransitiveSuccessor(
TfToken const &predecessor,
134 TfToken const &successor)
const;
136 _TokenToInfoMap _libInfo;
137 _TokenToTokenMap _libsToModules;
138 _TokenSet _loadedSet;
141 std::deque<TfToken> _remainingLoadWork;
146 PXR_NAMESPACE_CLOSE_SCOPE
148 #endif // PXR_BASE_TF_SCRIPT_MODULE_LOADER_H
Manage a single instance of an object.
Manage a single instance of an object (see.
Token for efficient comparison, assignment, and hashing of known strings.
TF_API void WriteDotFile(std::string const &file) const
Write a graphviz dot-file for the dependency graph of all.
TF_API boost::python::dict GetModulesDict() const
Return a python dict containing all currently known modules under their canonical names...
static TF_API This & GetInstance()
Return the singleton instance.
static T & GetInstance()
Return a reference to an object of type T, creating it if necessary.
TF_API std::vector< std::string > GetModuleNames() const
Return a list of all currently known modules in a valid dependency order.
Provides low-level facilities for shared libraries with script bindings to register themselves with t...
TF_API void RegisterLibrary(TfToken const &name, TfToken const &moduleName, std::vector< TfToken > const &predecessors)
Register a library named name and with script module moduleName and libraries which must be loaded fi...
TfHashSet< TfToken, TfToken::HashFunctor > HashSet
Predefined type for TfHashSet of tokens, since it's so awkward to manually specify.
TF_API void LoadModules()
Load all the script modules for any libraries registered using RegisterLibrary if necessary...
TF_API void LoadModulesForLibrary(TfToken const &name)
Load all the script modules for any libraries registered using RegisterLibrary that depend on library...
Enable a concrete base class for use with TfWeakPtr.
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...