|
| | ScriptLoader (const std::unordered_map< std::string, std::string > &compileDefines, const uint32_t codeVersion, const std::string &buildOptions, const std::vector< std::string > &includePaths, const std::vector< std::string > &libraryPaths, const std::vector< std::string > &libraries, std::shared_ptr< ResourceManager > resourceManager=nullptr) |
| | Constructs a ScriptLoader with the given compiler configuration.
|
| |
| void | Compile (const std::shared_ptr< Archive > &archive) |
| | Compiles script sources from a single archive.
|
| |
| void | CompileAll (const std::optional< std::function< void(const std::shared_ptr< Archive > &)> > &preCallback=std::nullopt, const std::optional< std::function< void()> > &postCallback=std::nullopt) |
| | Compiles scripts from all mounted archives.
|
| |
| void | LoadAll () |
| | Loads all previously compiled script modules into the runtime.
|
| |
| void | UnloadAll () |
| | Unloads all currently loaded script modules.
|
| |
| void * | GetFunction (const std::string &name, const std::string &function) |
| | Looks up a function exported by a loaded script module.
|
| |
| std::vector< std::string > | GetLoadersInDependencyOrder () const |
| | Returns the names of all loaded script modules sorted in dependency order.
|
| |
| void | SetSafeLevel (SafeLevel level) |
| | Sets the security level for script loading.
|
| |
| | Component (const std::string &name, std::shared_ptr< Context > context=nullptr) |
| | Constructs a Component with the given name.
|
| |
| virtual | ~Component () |
| |
| void | Init (const nlohmann::json &initArgs=nlohmann::json::object()) |
| | Performs one-time initialization of this component.
|
| |
| bool | IsInitialized () const |
| | Returns true once Init() (or MarkInitialized()) has completed successfully.
|
| |
| const std::string & | GetName () const |
| | Returns the name of this Component.
|
| |
| std::string | ToString () const |
| | Returns a human-readable string representation (e.g. "Name (id)").
|
| |
| std::string | ToTreeString (int depth=0) const |
| | Returns a human-readable tree representation of this component and its children.
|
| |
| | operator std::string () const |
| | Conversion operator to std::string; equivalent to ToString().
|
| |
| ParentComponentList & | GetParents () |
| | Returns a mutable reference to the parent list.
|
| |
| const ParentComponentList & | GetParents () const |
| | Returns a const reference to the parent list.
|
| |
| ComponentList & | GetChildren () |
| | Returns a mutable reference to the child list.
|
| |
| const ComponentList & | GetChildren () const |
| | Returns a const reference to the child list.
|
| |
| virtual std::shared_ptr< Component > | TryGetSharedComponent () noexcept |
| | Returns a shared_ptr to this Component when available, otherwise nullptr.
|
| |
| virtual std::shared_ptr< Component > | GetSharedComponent () |
| | Returns a shared_ptr to this Component via the correct enable_shared_from_this base.
|
| |
| template<typename T > |
| bool | HasInChildren () const |
| | Checks whether any descendant Component matches type T via BFS.
|
| |
| template<typename T > |
| std::shared_ptr< T > | GetFirstInChildren () const |
| | Returns the first descendant that matches type T via BFS.
|
| |
| template<typename T > |
| std::shared_ptr< std::vector< std::shared_ptr< T > > > | GetInChildren () const |
| | Returns all descendants that match type T via BFS.
|
| |
| template<typename T > |
| bool | HasInParents () const |
| | Checks whether any ancestor Component matches type T via BFS.
|
| |
| template<typename T > |
| std::shared_ptr< T > | GetFirstInParents () const |
| | Returns the first ancestor that matches type T via BFS.
|
| |
| template<typename T > |
| std::shared_ptr< std::vector< std::shared_ptr< T > > > | GetInParents () const |
| | Returns all ancestors that match type T via BFS.
|
| |
| | Part () |
| | Constructs a Part and assigns it a unique ID.
|
| |
| | Part (std::shared_ptr< Context > context) |
| | Constructs a Part with an explicit Context reference and unique ID.
|
| |
| virtual | ~Part ()=default |
| |
| uint64_t | GetId () const |
| | Returns the unique identifier for this Part.
|
| |
| bool | operator== (const Part &other) const |
| | Compares two Parts for equality by their unique IDs.
|
| |
| std::shared_ptr< Context > | GetContext () const |
| | Returns the Context this Part belongs to, or nullptr if unset.
|
| |
| void | SetContext (std::shared_ptr< Context > ctx) |
| | Sets the Context this Part belongs to.
|
| |
Manages compilation, loading, and lifetime of runtime scripts.
ScriptLoader compiles C/C++ source files found in mounted archives using TCC (Tiny C Compiler), then loads the resulting shared objects at runtime so their exported functions can be called by the engine via GetFunction().
Required Context children (looked up at runtime):