Engine → Scripting → script_class_registry.h
script_class_registry
| Type | Class |
| Namespace | conjure::scripting |
| Include File Path | engine/include/conjure/scripting/script_class_registry.h |
| Source File Path | engine/src/scripting/script_class_registry.cpp |
| API ↗ | Scripting, Scripts, components and the runtime |
Syntax
Constructors
| Access | Signature | Description |
|---|---|---|
| public | script_class_registry(); | |
| public | script_class_registry(
script_class_registry &&) noexcept = default; |
Important
Copy constructor and assignment has been deleted.
Destructors
| Access | Signature | Description |
|---|---|---|
| public | ~script_class_registry(); |
Variables
| Access | Name | Type | Default | Description |
|---|---|---|---|---|
| private | mActive | table | {} | |
| private | mStaging | table | {} | |
| private | mStagingOpen | bool | false |
Functions
Public
begin_staging
begin_stagingvoid begin_staging();Empties the staging half and opens it for stage_class/stage_field.
classes
classes[[nodiscard]] std::span<const script_class_info> classes() const noexcept;Active classes in registration order.
clear
clearvoid clear();Empties both halves.
commit_staging
commit_stagingvoid commit_staging();Sorts every staged class' fields, makes the staging half active and closes staging. Requires an open staging (begin_staging); otherwise asserts and leaves the active table untouched.
discard_staging
discard_stagingvoid discard_staging();Drops the staging half; the active schema is untouched.
find
find[[nodiscard]] const script_class_info *find(
u64 classHash) const noexcept;The active class with this hash, or nullptr.
[[nodiscard]] const script_class_info *find(
std::string_view fullName) const noexcept;The active class with this full name, or nullptr.
find_staged
find_staged[[nodiscard]] const script_class_info *find_staged(
u64 classHash) const noexcept;The staged class with this hash, or nullptr.
index_of
index_ofDense index of an active class (the order of classes()), or UINT32_MAX.
is_staging_open
is_staging_open[[nodiscard]] bool is_staging_open() const noexcept;size
size[[nodiscard]] usize size() const noexcept;stage_class
stage_class[[nodiscard]] core::result<void> stage_class(
script_class_info info);Adds a class to the staging half. ALREADY_EXISTS for a hash already staged, INVALID_STATE when no staging is open.
stage_field
stage_field[[nodiscard]] core::result<void> stage_field(
u64 classHash,
script_field_info field);Adds a field to a staged class. CLASS_NOT_FOUND, ALREADY_EXISTS for a duplicate field hash.
staged_classes
staged_classes[[nodiscard]] std::span<const script_class_info> staged_classes() const noexcept;Private
find_in
find_in[[nodiscard]] static const script_class_info *find_in(
const table &source,
u64 classHash) noexcept;Operator Overloads
Public
operator=
operator=script_class_registry &operator=(
script_class_registry &&) noexcept = default;