7#ifndef PXR_BASE_TF_SCRIPT_MODULE_LOADER_H
8#define PXR_BASE_TF_SCRIPT_MODULE_LOADER_H
12#include "pxr/base/tf/api.h"
21#include <boost/python/dict.hpp>
24#include "pxr/base/tf/hashmap.h"
25#include "pxr/base/tf/hashset.h"
29PXR_NAMESPACE_OPEN_SCOPE
58 std::vector<TfToken>
const &predecessors);
90 std::vector<TfToken> predecessors, successors;
93 typedef TfHashMap<TfToken, _LibInfo, TfToken::HashFunctor>
96 typedef TfHashMap<TfToken, TfToken, TfToken::HashFunctor>
99 typedef TfHashSet<TfToken, TfToken::HashFunctor>
107 void _LoadModulesFor(
TfToken const &name);
108 void _LoadUpTo(
TfToken const &name);
109 void _GetOrderedDependenciesRecursive(
TfToken const &lib,
111 std::vector<TfToken> *result)
const;
112 void _GetOrderedDependencies(std::vector<TfToken>
const &input,
113 std::vector<TfToken> *result)
const;
114 void _TopologicalSort(std::vector<TfToken> *result)
const;
116 bool _HasTransitiveSuccessor(
TfToken const &predecessor,
117 TfToken const &successor)
const;
119 _TokenToInfoMap _libInfo;
120 _TokenToTokenMap _libsToModules;
121 _TokenSet _loadedSet;
124 std::deque<TfToken> _remainingLoadWork;
129PXR_NAMESPACE_CLOSE_SCOPE
Provides low-level facilities for shared libraries with script bindings to register themselves with t...
TF_API boost::python::dict GetModulesDict() const
Return a python dict containing all currently known modules under their canonical names.
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...
static TF_API This & GetInstance()
Return the singleton instance.
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...
TF_API void WriteDotFile(std::string const &file) const
Write a graphviz dot-file for the dependency graph of all.
TF_API std::vector< std::string > GetModuleNames() const
Return a list of all currently known modules in a valid dependency order.
Manage a single instance of an object (see.
static T & GetInstance()
Return a reference to an object of type T, creating it if necessary.
Token for efficient comparison, assignment, and hashing of known strings.
TfHashSet< TfToken, TfToken::HashFunctor > HashSet
Predefined type for TfHashSet of tokens, since it's so awkward to manually specify.
Enable a concrete base class for use with TfWeakPtr.
Manage a single instance of an object.
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...