diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 84576981d69..ac1de6b6ad6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -103,9 +103,10 @@ jobs: run: | sudo mkdir /stdb sudo chmod 777 /stdb - + - name: Run cargo test - run: cargo test --all + #Note: Unreal tests will be run separately + run: cargo test --all -- --skip unreal - name: Check that the test outputs are up-to-date run: bash tools/check-diff.sh @@ -243,6 +244,90 @@ jobs: cargo run --features github-token-auth --target ${{ matrix.target }} -p spacetimedb-update -- self-install --root-dir="${ROOT_DIR}" --yes "${ROOT_DIR}"/spacetime --root-dir="${ROOT_DIR}" help + unreal_engine_tests: + name: Unreal Engine Tests + # This can't go on e.g. ubuntu-latest because that runner runs out of disk space. ChatGPT suggested that the general solution tends to be to use + # a custom runner. + runs-on: spacetimedb-runner + container: + image: ghcr.io/epicgames/unreal-engine:dev-5.6 + credentials: + # Note(bfops): I don't think that `github.actor` needs to match the user that the token is for, because I'm using a token for my account and + # it seems to be totally happy. + # However, the token needs to be for a user that has access to the EpicGames org (see + # https://dev.epicgames.com/documentation/en-us/unreal-engine/downloading-source-code-in-unreal-engine?application_version=5.6) + username: ${{ github.actor }} + password: ${{ secrets.GHCR_TOKEN }} + # Run as root because otherwise we get permission denied for various directories inside the container. I tried doing dances to allow it to run + # without this (reassigning env vars and stuff), but was unable to get it to work and it felt like an uphill battle. + options: --user 0:0 + steps: +# Uncomment this before merging so that it will run properly if run manually through the GH actions flow. It was playing weird with rolled back +# commits though. +# - name: Find Git ref +# env: +# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# shell: bash +# run: | +# PR_NUMBER="${{ github.event.inputs.pr_number || null }}" +# if test -n "${PR_NUMBER}"; then +# GIT_REF="$( gh pr view --repo clockworklabs/SpacetimeDB $PR_NUMBER --json headRefName --jq .headRefName )" +# else +# GIT_REF="${{ github.ref }}" +# fi +# echo "GIT_REF=${GIT_REF}" >>"$GITHUB_ENV" + - name: Checkout sources + uses: actions/checkout@v4 + with: + ref: ${{ env.GIT_REF }} + - uses: dsherret/rust-toolchain-file@v1 + - name: Run Unreal Engine tests + working-directory: sdks/unreal + env: + UE_ROOT_PATH: /home/ue4/UnrealEngine + run: | + + apt-get update + apt-get install -y acl curl ca-certificates + + REPO="$GITHUB_WORKSPACE" + # Let ue4 read/write the workspace & tool caches without changing ownership + for p in "$REPO" "${RUNNER_TEMP:-/__t}" "${RUNNER_TOOL_CACHE:-/__t}"; do + [ -d "$p" ] && setfacl -R -m u:ue4:rwX -m d:u:ue4:rwX "$p" || true + done + + # Rust tool caches live under the runner tool cache so they persist + export CARGO_HOME="${RUNNER_TOOL_CACHE:-/__t}/cargo" + export RUSTUP_HOME="${RUNNER_TOOL_CACHE:-/__t}/rustup" + mkdir -p "$CARGO_HOME" "$RUSTUP_HOME" + chown -R ue4:ue4 "$CARGO_HOME" "$RUSTUP_HOME" + + # Make sure the UE build script is executable (and parents traversable) + UE_DIR="${UE_ROOT_PATH:-/home/ue4/UnrealEngine}" + chmod a+rx "$UE_DIR" "$UE_DIR/Engine" "$UE_DIR/Engine/Build" "$UE_DIR/Engine/Build/BatchFiles/Linux" || true + chmod a+rx "$UE_DIR/Engine/Build/BatchFiles/Linux/Build.sh" || true + + # Run the build & tests as ue4 (who owns the UE tree) + sudo -E -H -u ue4 env \ + HOME=/home/ue4 \ + XDG_CONFIG_HOME=/home/ue4/.config \ + CARGO_HOME="$CARGO_HOME" \ + RUSTUP_HOME="$RUSTUP_HOME" \ + PATH="$CARGO_HOME/bin:$PATH" \ + bash -lc ' + set -euxo pipefail + # Install rustup for ue4 if needed (uses the shared caches) + if ! command -v cargo >/dev/null 2>&1; then + curl -sSf https://sh.rustup.rs | sh -s -- -y + fi + rustup show >/dev/null + git config --global --add safe.directory "$GITHUB_WORKSPACE" || true + + cd "$GITHUB_WORKSPACE/sdks/unreal" + cargo --version + cargo test + ' + cli_docs: name: Check CLI docs permissions: read-all diff --git a/Cargo.lock b/Cargo.lock index 5bed876a5bc..e6121eb4292 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5078,6 +5078,14 @@ dependencies = [ "spacetimedb 1.4.0", ] +[[package]] +name = "sdk-unreal-test-harness" +version = "1.4.0" +dependencies = [ + "serial_test", + "spacetimedb-testing", +] + [[package]] name = "seahash" version = "4.1.0" diff --git a/Cargo.toml b/Cargo.toml index a549d44cd91..b3c6d32228b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,6 +26,7 @@ members = [ "crates/sats", "crates/schema", "sdks/rust", + "sdks/unreal", "crates/snapshot", "crates/sqltest", "crates/sql-parser", diff --git a/crates/cli/src/subcommands/generate.rs b/crates/cli/src/subcommands/generate.rs index 6e60cd00c29..d109a8fab88 100644 --- a/crates/cli/src/subcommands/generate.rs +++ b/crates/cli/src/subcommands/generate.rs @@ -5,7 +5,7 @@ use clap::parser::ValueSource; use clap::Arg; use clap::ArgAction::Set; use fs_err as fs; -use spacetimedb_codegen::{generate, Csharp, Lang, OutputFile, Rust, TypeScript, AUTO_GENERATED_PREFIX}; +use spacetimedb_codegen::{generate, Csharp, Lang, OutputFile, Rust, TypeScript, UnrealCpp, AUTO_GENERATED_PREFIX}; use spacetimedb_lib::de::serde::DeserializeWrapper; use spacetimedb_lib::{sats, RawModuleDef}; use spacetimedb_schema; @@ -25,7 +25,7 @@ use std::io::Read; pub fn cli() -> clap::Command { clap::Command::new("generate") .about("Generate client files for a spacetime module.") - .override_usage("spacetime generate --lang --out-dir [--project-path | --bin-path ]") + .override_usage("spacetime generate --lang --out-dir [--project-path | --bin-path | --module-name | --uproject-dir ]") .arg( Arg::new("wasm_file") .value_parser(clap::value_parser!(PathBuf)) @@ -57,10 +57,19 @@ pub fn cli() -> clap::Command { .arg( Arg::new("out_dir") .value_parser(clap::value_parser!(PathBuf)) - .required(true) .long("out-dir") .short('o') - .help("The system path (absolute or relative) to the generate output directory"), + .help("The system path (absolute or relative) to the generate output directory") + .required_if_eq("lang", "rust") + .required_if_eq("lang", "csharp") + .required_if_eq("lang", "typescript"), + ) + .arg( + Arg::new("uproject_dir") + .value_parser(clap::value_parser!(PathBuf)) + .long("uproject-dir") + .help("Path to the Unreal project directory, replaces --out-dir for Unreal generation (only used with --lang unrealcpp)") + .required_if_eq("lang", "unrealcpp") ) .arg( Arg::new("namespace") @@ -68,6 +77,12 @@ pub fn cli() -> clap::Command { .long("namespace") .help("The namespace that should be used"), ) + .arg( + Arg::new("module_name") + .long("module-name") + .help("The module name that should be used for DLL export macros (required for lang unrealcpp)") + .required_if_eq("lang", "unrealcpp") + ) .arg( Arg::new("lang") .required(true) @@ -86,6 +101,11 @@ pub fn cli() -> clap::Command { ) .arg(common_args::yes()) .after_help("Run `spacetime help publish` for more detailed information.") + .group( + clap::ArgGroup::new("output_dir") + .args(["out_dir", "uproject_dir"]) + .required(true) + ) } pub async fn exec(config: Config, args: &clap::ArgMatches) -> anyhow::Result<()> { @@ -101,9 +121,9 @@ pub async fn exec_ex( let project_path = args.get_one::("project_path").unwrap(); let wasm_file = args.get_one::("wasm_file").cloned(); let json_module = args.get_many::("json_module"); - let out_dir = args.get_one::("out_dir").unwrap(); let lang = *args.get_one::("lang").unwrap(); let namespace = args.get_one::("namespace").unwrap(); + let module_name = args.get_one::("module_name"); let force = args.get_flag("force"); let build_options = args.get_one::("build_options").unwrap(); @@ -111,6 +131,11 @@ pub async fn exec_ex( return Err(anyhow::anyhow!("--namespace is only supported with --lang csharp")); } + let out_dir = args + .get_one::("out_dir") + .or_else(|| args.get_one::("uproject_dir")) + .unwrap(); + let module: ModuleDef = if let Some(mut json_module) = json_module { let DeserializeWrapper::(module) = if let Some(path) = json_module.next() { serde_json::from_slice(&fs::read(path)?)? @@ -136,11 +161,19 @@ pub async fn exec_ex( let mut paths = BTreeSet::new(); let csharp_lang; + let unreal_cpp_lang; let gen_lang = match lang { Language::Csharp => { csharp_lang = Csharp { namespace }; &csharp_lang as &dyn Lang } + Language::UnrealCpp => { + unreal_cpp_lang = UnrealCpp { + module_name: module_name.as_ref().unwrap(), + uproject_dir: out_dir, + }; + &unreal_cpp_lang as &dyn Lang + } Language::Rust => &Rust, Language::TypeScript => &TypeScript, }; @@ -156,9 +189,15 @@ pub async fn exec_ex( paths.insert(path); } + // For Unreal, we want to clean up just the module directory, not the entire uproject directory tree. + let cleanup_root = match lang { + Language::UnrealCpp => out_dir.join("Source").join(module_name.as_ref().unwrap()), + _ => out_dir.clone(), + }; + // TODO: We should probably just delete all generated files before we generate any, rather than selectively deleting some afterward. let mut auto_generated_buf: [u8; AUTO_GENERATED_PREFIX.len()] = [0; AUTO_GENERATED_PREFIX.len()]; - let files_to_delete = walkdir::WalkDir::new(out_dir) + let files_to_delete = walkdir::WalkDir::new(&cleanup_root) .into_iter() .map(|entry_result| { let entry = entry_result?; @@ -213,17 +252,19 @@ pub enum Language { Csharp, TypeScript, Rust, + UnrealCpp, } impl clap::ValueEnum for Language { fn value_variants<'a>() -> &'a [Self] { - &[Self::Csharp, Self::TypeScript, Self::Rust] + &[Self::Csharp, Self::TypeScript, Self::Rust, Self::UnrealCpp] } fn to_possible_value(&self) -> Option { Some(match self { Self::Csharp => clap::builder::PossibleValue::new("csharp").aliases(["c#", "cs"]), Self::TypeScript => clap::builder::PossibleValue::new("typescript").aliases(["ts", "TS"]), Self::Rust => clap::builder::PossibleValue::new("rust").aliases(["rs", "RS"]), + Self::UnrealCpp => PossibleValue::new("unrealcpp").aliases(["uecpp", "ue5cpp", "unreal"]), }) } } @@ -236,6 +277,9 @@ impl Language { Language::TypeScript => { // TODO: implement formatting. } + Language::UnrealCpp => { + // TODO: implement formatting. + } } Ok(()) diff --git a/crates/codegen/src/UnrealCPP-README.md b/crates/codegen/src/UnrealCPP-README.md new file mode 100644 index 00000000000..920af1e4217 --- /dev/null +++ b/crates/codegen/src/UnrealCPP-README.md @@ -0,0 +1,347 @@ +# SpacetimeDB UnrealCPP Code Generator + +This document provides information about the UnrealCPP code generator (`unrealcpp.rs`) and its Blueprint compatibility handling. + +## Overview + +The UnrealCPP code generator creates Unreal Engine-compatible C++ bindings for SpacetimeDB modules, including: + +- **Table classes** with indexing and event handling +- **Reducer classes** with argument structures +- **Type definitions** for module data structures +- **Client connection** management classes +- **Event delegates** for real-time updates + +## Blueprint Compatibility + +Unreal Engine's Blueprint system has limitations on which C++ types can be exposed. The code generator automatically handles this by detecting incompatible types and adjusting the generated code accordingly. + +### Blueprint-Unsupported Types + +The following types **cannot** be used in Unreal Engine Blueprints: +- `int8` (signed 8-bit integer) +- `int16` (signed 16-bit integer) +- `uint16` (unsigned 16-bit integer) +- `uint32` (unsigned 32-bit integer) +- `uint64` (unsigned 64-bit integer) + +### Blueprint-Compatible Types + +These types **can** be used in Blueprints: + +- `bool` +- `int8`, `uint8`, `int16`, `int32`, `int64` +- `float`, `double` +- `FString` +- `All SpacetimeDB SDK types` +- Custom structs and enums +- `TArray` (if T is Blueprint-compatible) + +## Code Generation Behavior + +### Table Find Functions + +When a table has a primary key or unique index with an unsupported type like uint32. In generated code you'll see: + +**Generated Code:** +```cpp +// NOTE: Not exposed to Blueprint because uint32 types are not Blueprint-compatible +FMessageType Find(uint32 Key) +{ + return IdIndexHelper.FindUniqueIndex(Key); +} +``` + +**Behavior:** +- Function is generated without `UFUNCTION(BlueprintCallable)` +- Still fully functional in C++ +- Comment explains why Blueprint exposure was omitted + +### Reducer Functions + +When a reducer has parameters with unsupported types like uint32 and uint64: + +**Generated Code:** +```cpp +// NOTE: Not exposed to Blueprint because uint32, uint64 types are not Blueprint-compatible +void SendMessage(const FString& Text, const uint32& Priority, const uint64& Timestamp); +``` + +**Behavior:** +- Function is generated without `UFUNCTION(BlueprintCallable)` +- Fully functional in C++ +- Multiple unsupported types are listed in the comment + +### Reducer Event Delegates + +When a reducer's event delegate has unsupported parameter types: + +**Generated Code:** +```cpp +DECLARE_DYNAMIC_MULTICAST_DELEGATE_FourParams( + FSendMessageHandler, + const FReducerEventContext&, Context, + const FString&, Text, + const uint32&, Priority, + const uint64&, Timestamp +); +// NOTE: Not exposed to Blueprint because uint32, uint64 types are not Blueprint-compatible +FSendMessageHandler OnSendMessage; +``` + +**Behavior:** +- Delegate is generated without `UPROPERTY(BlueprintAssignable)` +- Still bindable from C++ +- Blueprint cannot access the event + +### Struct Fields + +When struct fields have unsupported types: + +**Generated Code:** +```cpp +USTRUCT(BlueprintType) +struct MYMODULE_API FSendMessageArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FString Text; + + // NOTE: uint32 types can't be used in blueprints + uint32 Priority; + + // NOTE: uint64 types can't be used in blueprints + uint64 Timestamp; +}; +``` + +**Behavior:** +- Blueprint-compatible fields get `UPROPERTY(BlueprintReadWrite)` +- Unsupported fields are plain C++ members with explanatory comments +- Struct is still `USTRUCT(BlueprintType)` for the supported fields + +### Optional Types + +SpacetimeDB optional types (`Option`) are generated as custom Unreal structs with special handling: + +**Generated Structure:** +```cpp +USTRUCT(BlueprintType) +struct MYMODULE_API FMyModuleOptionalString +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB", meta = (EditCondition = "bHasValue")) + bool bHasValue = false; + + // Only gets UPROPERTY if the inner type is Blueprint-compatible + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB", meta = (EditCondition = "bHasValue")) + FString Value; + + // Constructors and helper methods... +}; +``` + +**Behavior:** +- Generated as separate structs in `Public/ModuleBindings/Optionals/` directory +- The `bHasValue` field indicates whether a value is present +- The `Value` field is only editable when `bHasValue` is true (using `EditCondition`) +- If the inner type is not Blueprint-compatible (e.g., `Option`), the `Value` field won't have `UPROPERTY` +- Custom `GetTypeHash` implementation for proper map/set support +- BSATN serialization support via `UE_SPACETIMEDB_OPTIONAL` macro + +### Sum Types (Tagged Enums) + +SpacetimeDB sum types (Rust enums with variants) are generated as UStructs + TVarint + BlueprintFunctionLibrary for Blueprint compatibility: + +**Generated Structure:** +```cpp +// Tag enum for variant identification +UENUM(BlueprintType) +enum class ECompressableQueryUpdateTag : uint8 +{ + Uncompressed, + Brotli, + Gzip +}; + +// Main struct +USTRUCT(BlueprintType) +struct SPACETIMEDBSDK_API FCompressableQueryUpdateType +{ + GENERATED_BODY() + +public: + FCompressableQueryUpdateType() = default; + + TVariant> MessageData; + + UPROPERTY(BlueprintReadOnly) + ECompressableQueryUpdateTag Tag; + + static FCompressableQueryUpdateType Uncompressed(const FQueryUpdateType& Value) + { + FCompressableQueryUpdateType Obj; + Obj.Tag = ECompressableQueryUpdateTag::Uncompressed; + Obj.MessageData.Set(Value); + return Obj; + } + + static FCompressableQueryUpdateType Brotli(const TArray& Value) + { + FCompressableQueryUpdateType Obj; + Obj.Tag = ECompressableQueryUpdateTag::Brotli; + Obj.MessageData.Set>(Value); + return Obj; + } + + static FCompressableQueryUpdateType Gzip(const TArray& Value) + { + FCompressableQueryUpdateType Obj; + Obj.Tag = ECompressableQueryUpdateTag::Gzip; + Obj.MessageData.Set>(Value); + return Obj; + } + + // Is* functions + bool IsUncompressed() const { return Tag == ECompressableQueryUpdateTag::Uncompressed; } + + // GetAs* functions + FQueryUpdateType GetAsUncompressed() const + { + ensureMsgf(IsUncompressed(), TEXT("MessageData does not hold Uncompressed!")); + return MessageData.Get(); + } +}; + +// Corresponding blueprint function library for using the sum types +UCLASS() +class SPACETIMEDBSDK_API UCompressableQueryUpdateBpLib : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() + +private: + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|CompressableQueryUpdate") + static FCompressableQueryUpdateType Uncompressed(const FQueryUpdateType& InValue) + { + return FCompressableQueryUpdateType::Uncompressed(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|CompressableQueryUpdate") + static bool IsUncompressed(const FCompressableQueryUpdateType& InValue) { return InValue.IsUncompressed(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|CompressableQueryUpdate") + static FQueryUpdateType GetAsUncompressed(const FCompressableQueryUpdateType& InValue) + { + return InValue.GetAsUncompressed(); + } + + // Rest is the same for other variants... +} +``` + +**Key Behaviors:** + +- **UStruct + TVarint - based**: Generated as UStruct + TVarint for saving memory +- **TVarint**: Uses Unreal's TVarint to store variant payload +- **Blueprint Function Library**: contains a bunch of private static BlueprintCallable functions. To instantiate and use varints in BPs. +- **Type Safety**: Each variant gets its own factory function and getter +- **Memory Overhead**: C++ unions based +- **Unit Variants**: Variants without payload use `FSpacetimeDBUnit` type +- **Blueprint Compatible**: All functions are BlueprintCallable or BlueprintPure for full Blueprint access +- **BSATN Support**: Generated with proper serialization macros + +### Plain Enums (Simple Enums) + +SpacetimeDB plain enums (Rust enums with only unit variants, no payloads) are generated as simple Unreal Engine enums: + +**Rust Definition:** +```rust +#[derive(...)] +pub enum Status { + Pending, + Active, + Inactive, + Suspended, +} +``` + +**Generated Code:** +```cpp +UENUM(BlueprintType) +enum class EStatusType : uint8 +{ + Pending, + Active, + Inactive, + Suspended, +}; +``` + +**Key Behaviors:** + +- **Simple UENUM**: Generated as standard Unreal Engine enum class with `uint8` backing type +- **Blueprint Compatible**: `UENUM(BlueprintType)` makes it fully accessible in Blueprints +- **Naming Convention**: `E[Name]Type` format (e.g., `EStatusType`) +- **PascalCase Variants**: All variants converted to PascalCase for Unreal conventions +- **Lightweight**: No memory overhead - just a simple enum value +- **Type Safety**: Strongly typed enum class prevents implicit conversions + +**Usage in Generated Code:** +- Used directly as `EStatusType` in struct fields, function parameters, etc. +- Can be used in Blueprint dropdown selections, switch statements, etc. +- Fully compatible with Unreal's reflection and serialization systems + +**Comparison with Sum Types:** +- **Plain Enums**: Simple `UENUM` with no payload → lightweight, direct Blueprint usage +- **Sum Types**: Complex `UStructs` with `TVarint` payload → union based, indirect Blueprint usage through BPLib + +## Generating Module Bindings + +To generate UnrealCPP bindings for your SpacetimeDB module, use the SpacetimeDB CLI: + +### Basic Command + +```bash +cargo run --bin spacetimedb-cli -- generate --lang unrealcpp --uproject-dir --project-path --module-name +``` + +### Example + +```bash +cargo run --bin spacetimedb-cli -- generate --lang unrealcpp --uproject-dir crates/sdk-unreal/examples/QuickstartChat --project-path modules/quickstart-chat --module-name QuickstartChat +``` + +### Parameters + +- `--lang unrealcpp`: Specifies the UnrealCPP code generator +- `--uproject-dir`: Directory containing Unreal's .uproject or .uplugin file +- `--project-path`: Path to your SpacetimeDB module source code +- `--module-name`: **Required** - Name used for generated classes, API prefix and putting generated module bindings in the correct Module's Source + +### Why Module Name is Required + +The `--module-name` parameter is **mandatory** for UnrealCPP generation because: + +1. **Unreal Engine API Macro**: Generated classes use `MODULENAME_API` macros (e.g., `QUICKSTARTCHAT_API`) for proper DLL export/import in Unreal Engine +2. **Class Prefixing**: All the optional generated classes are prefixed with the module name to avoid naming conflicts (e.g., `FQuickstartChatOptionalString`) +3. **Build System Integration**: Unreal Engine's build system requires proper API macros for linking across modules +4. **Generated Module Bindings**: Put generated bindings in correct module's source + +**⚠️ IMPORTANT:** Without the module name, the generated code would not compile in Unreal Engine due to missing API macros and naming conflicts. + +## Implementation Details + +The Blueprint compatibility checking is implemented in the `is_blueprintable()` function, which recursively checks: + +The code generator collects incompatible types during the first parameter iteration to avoid duplicate loops and provides specific error messages listing exactly which types are causing Blueprint incompatibility. + +## Error Messages + +All error messages follow a consistent format: + +- **Single type:** `"uint32 types are not Blueprint-compatible"` +- **Multiple types:** `"uint32, uint64 types are not Blueprint-compatible"` + +This makes it clear to developers exactly which types need to be changed for Blueprint compatibility. \ No newline at end of file diff --git a/crates/codegen/src/csharp.rs b/crates/codegen/src/csharp.rs index f4511c89a60..946eccc82af 100644 --- a/crates/codegen/src/csharp.rs +++ b/crates/codegen/src/csharp.rs @@ -707,7 +707,7 @@ impl Lang for Csharp<'_> { } } - fn generate_globals_file(&self, module: &ModuleDef) -> OutputFile { + fn generate_global_files(&self, module: &ModuleDef) -> Vec { let mut output = CsharpAutogen::new( self.namespace, &[ @@ -861,10 +861,10 @@ impl Lang for Csharp<'_> { }); }); - OutputFile { + vec![OutputFile { filename: "SpacetimeDBClient.g.cs".to_owned(), code: output.into_inner(), - } + }] } } diff --git a/crates/codegen/src/lib.rs b/crates/codegen/src/lib.rs index 25ba367d847..f9493329402 100644 --- a/crates/codegen/src/lib.rs +++ b/crates/codegen/src/lib.rs @@ -4,11 +4,13 @@ mod code_indenter; pub mod csharp; pub mod rust; pub mod typescript; +pub mod unrealcpp; mod util; pub use self::csharp::Csharp; pub use self::rust::Rust; pub use self::typescript::TypeScript; +pub use self::unrealcpp::UnrealCpp; pub use util::AUTO_GENERATED_PREFIX; pub fn generate(module: &ModuleDef, lang: &dyn Lang) -> Vec { @@ -16,7 +18,7 @@ pub fn generate(module: &ModuleDef, lang: &dyn Lang) -> Vec { module.tables().map(|tbl| lang.generate_table_file(module, tbl)), module.types().flat_map(|typ| lang.generate_type_files(module, typ)), util::iter_reducers(module).map(|reducer| lang.generate_reducer_file(module, reducer)), - std::iter::once(lang.generate_globals_file(module)), + lang.generate_global_files(module), ) .collect() } @@ -30,5 +32,5 @@ pub trait Lang { fn generate_table_file(&self, module: &ModuleDef, tbl: &TableDef) -> OutputFile; fn generate_type_files(&self, module: &ModuleDef, typ: &TypeDef) -> Vec; fn generate_reducer_file(&self, module: &ModuleDef, reducer: &ReducerDef) -> OutputFile; - fn generate_globals_file(&self, module: &ModuleDef) -> OutputFile; + fn generate_global_files(&self, module: &ModuleDef) -> Vec; } diff --git a/crates/codegen/src/rust.rs b/crates/codegen/src/rust.rs index 7dabb84f2c8..4bce52293af 100644 --- a/crates/codegen/src/rust.rs +++ b/crates/codegen/src/rust.rs @@ -487,7 +487,7 @@ impl {set_reducer_flags_trait} for super::SetReducerFlags {{ } } - fn generate_globals_file(&self, module: &ModuleDef) -> OutputFile { + fn generate_global_files(&self, module: &ModuleDef) -> Vec { let mut output = CodeIndenter::new(String::new(), INDENT); let out = &mut output; @@ -530,10 +530,10 @@ impl {set_reducer_flags_trait} for super::SetReducerFlags {{ // This includes a method for initializing the tables in the client cache. print_impl_spacetime_module(module, out); - OutputFile { + vec![OutputFile { filename: "mod.rs".to_string(), code: output.into_inner(), - } + }] } } diff --git a/crates/codegen/src/typescript.rs b/crates/codegen/src/typescript.rs index 761195b8780..5b052489c48 100644 --- a/crates/codegen/src/typescript.rs +++ b/crates/codegen/src/typescript.rs @@ -312,7 +312,7 @@ removeOnUpdate = (cb: (ctx: EventContext, onRow: {row_type}, newRow: {row_type}) } } - fn generate_globals_file(&self, module: &ModuleDef) -> OutputFile { + fn generate_global_files(&self, module: &ModuleDef) -> Vec { let mut output = CodeIndenter::new(String::new(), INDENT); let out = &mut output; @@ -484,10 +484,10 @@ setReducerFlagsConstructor: () => {{ "export type ErrorContext = __ErrorContextInterface;" ); - OutputFile { + vec![OutputFile { filename: "index.ts".to_string(), code: output.into_inner(), - } + }] } } diff --git a/crates/codegen/src/unrealcpp.rs b/crates/codegen/src/unrealcpp.rs new file mode 100644 index 00000000000..32aa86cd7b3 --- /dev/null +++ b/crates/codegen/src/unrealcpp.rs @@ -0,0 +1,4222 @@ +//! Autogenerated Unreal‑C++ code‑gen backend for SpacetimeDB CLI +use crate::code_indenter::CodeIndenter; +use crate::util::{ + collect_case, fmt_fn, iter_tables, print_auto_generated_file_comment, print_auto_generated_version_comment, +}; +use crate::util::{iter_indexes, iter_reducers}; +use crate::Lang; +use crate::OutputFile; +use convert_case::{Case, Casing}; +use spacetimedb_lib::sats::layout::PrimitiveType; +use spacetimedb_schema::def::{BTreeAlgorithm, IndexAlgorithm}; +use spacetimedb_schema::def::{ModuleDef, ReducerDef, TableDef, TypeDef}; +use spacetimedb_schema::identifier::Identifier; +use spacetimedb_schema::schema::{Schema, TableSchema}; +use spacetimedb_schema::type_for_generate::{ + AlgebraicTypeDef, AlgebraicTypeUse, PlainEnumTypeDef, ProductTypeDef, SumTypeDef, +}; +use std::collections::HashSet; +use std::fmt::{self}; +use std::ops::Deref; +use std::path::Path; + +pub struct UnrealCpp<'opts> { + pub module_name: &'opts str, + pub uproject_dir: &'opts Path, +} + +// --------------------------------------------------------------------------- +// Lang impl +// --------------------------------------------------------------------------- + +impl UnrealCpp<'_> { + fn get_api_macro(&self) -> String { + format!("{}_API", self.module_name.to_uppercase()) + } +} + +impl Lang for UnrealCpp<'_> { + fn generate_table_file(&self, module: &ModuleDef, table: &TableDef) -> OutputFile { + let struct_name = type_ref_name(module, table.product_type_ref); + let self_header = struct_name.clone() + "Table"; + + let mut output = UnrealCppAutogen::new( + &[ + "Types/Builtins.h", + &format!("ModuleBindings/Types/{struct_name}Type.g.h"), + "Tables/RemoteTable.h", + "DBCache/WithBsatn.h", + "DBCache/TableHandle.h", + "DBCache/TableCache.h", + ], + &self_header, + false, + ); + + let row_struct = format!("F{struct_name}Type"); // e.g. "FUserType", "FMessageType" + let handle_cls = format!("U{struct_name}Table"); // "UMessageTable" + let table_name = table.name.deref().to_string(); + let table_pascal = struct_name.clone(); + + let schema = TableSchema::from_module_def(module, table, (), 0.into()) + .validated() + .expect("table schema should validate"); + + // Generate unique index classes first + let product_type = module.typespace_for_generate()[table.product_type_ref].as_product(); + + let mut unique_indexes = Vec::new(); + let mut multi_key_indexes = Vec::new(); + + for idx in iter_indexes(table) { + let Some(accessor_name) = idx.accessor_name.as_ref() else { + continue; + }; + + if let IndexAlgorithm::BTree(BTreeAlgorithm { columns }) = &idx.algorithm { + if schema.is_unique(columns) { + if let Some(col) = columns.as_singleton() { + let (f_name, f_ty) = &product_type.unwrap().elements[col.idx()]; + let field_name = f_name.deref().to_case(Case::Pascal); + let field_type = cpp_ty_fmt_with_module(module, f_ty, self.module_name).to_string(); + let index_name = accessor_name.deref().to_case(Case::Pascal); + let index_class_name = format!("U{table_pascal}{index_name}UniqueIndex"); + let key_type = field_type.clone(); + let field_name_lowercase = field_name.to_lowercase(); + + writeln!(output, "UCLASS(Blueprintable)"); + writeln!( + output, + "class {} {index_class_name} : public UObject", + self.get_api_macro() + ); + writeln!(output, "{{"); + writeln!(output, " GENERATED_BODY()"); + writeln!(output); + writeln!(output, "private:"); + writeln!(output, " // Declare an instance of your templated helper."); + writeln!( + output, + " // It's private because the UObject wrapper will expose its functionality." + ); + writeln!( + output, + " FUniqueIndexHelper<{row_struct}, {key_type}, FTableCache<{row_struct}>> {index_name}IndexHelper;" + ); + writeln!(output); + writeln!(output, "public:"); + writeln!(output, " {index_class_name}()"); + writeln!( + output, + " // Initialize the helper with the specific unique index name" + ); + writeln!(output, " : {index_name}IndexHelper(\"{}\") {{", f_name.deref()); + writeln!(output, " }}"); + writeln!(output); + writeln!(output, " /**"); + writeln!( + output, + " * Finds a {table_pascal} by their unique {field_name_lowercase}." + ); + writeln!(output, " * @param Key The {field_name_lowercase} to search for."); + writeln!( + output, + " * @return The found {row_struct}, or a default-constructed {row_struct} if not found." + ); + writeln!(output, " */"); + + // Only mark as BlueprintCallable if the key type is Blueprint-compatible + if is_blueprintable(module, f_ty) { + writeln!( + output, + " UFUNCTION(BlueprintCallable, Category = \"SpacetimeDB|{table_pascal}Index\")" + ); + } else { + writeln!( + output, + " // NOTE: Not exposed to Blueprint because {key_type} types are not Blueprint-compatible" + ); + } + + writeln!(output, " {row_struct} Find({key_type} Key)"); + writeln!(output, " {{"); + writeln!(output, " // Simply delegate the call to the internal helper"); + writeln!(output, " return {index_name}IndexHelper.FindUniqueIndex(Key);"); + writeln!(output, " }}"); + writeln!(output); + writeln!( + output, + " // A public setter to provide the cache to the helper after construction" + ); + writeln!(output, " // This is a common pattern when the cache might be created or provided by another system."); + writeln!( + output, + " void SetCache(TSharedPtr> In{table_pascal}Cache)" + ); + writeln!(output, " {{"); + writeln!(output, " {index_name}IndexHelper.Cache = In{table_pascal}Cache;"); + writeln!(output, " }}"); + writeln!(output, "}};"); + writeln!(output, "/***/"); + writeln!(output); + + unique_indexes.push((index_name, index_class_name, field_type, f_name.deref().to_string())); + } + } + // Handle non-unique BTree indexes + else { + // Generate non-unique BTree index class + let _index_name = accessor_name.deref().to_case(Case::Pascal); + let index_class_name = format!("U{table_pascal}{_index_name}Index"); + + // Get column information + let column_info: Vec<_> = columns + .iter() + .map(|col| { + let (f_name, f_ty) = &product_type.unwrap().elements[col.idx()]; + let field_name = f_name.deref().to_case(Case::Pascal); + let field_type = cpp_ty_fmt_with_module(module, f_ty, self.module_name).to_string(); + let param_type = format!("const {field_type}&"); + + (field_name, field_type, param_type, f_ty, f_name.deref().to_string()) + }) + .collect(); + + // Create filter method name by concatenating column names + let filter_method_name = format!( + "Filter{}", + column_info + .iter() + .map(|(name, _, _, _, _)| name.as_str()) + .collect::>() + .join("") + ); + + // Create parameter list for methods + let method_params = column_info + .iter() + .map(|(field_name, _, param_type, _, _)| format!("{param_type} {field_name}")) + .collect::>() + .join(", "); + + // Create parameter names for internal call + let param_names = column_info + .iter() + .map(|(field_name, _, _, _, _)| field_name.clone()) + .collect::>() + .join(", "); + + // Create TTuple type for FindByMultiKeyBTreeIndex + let tuple_types = column_info + .iter() + .map(|(_, field_type, _, _, _)| field_type.clone()) + .collect::>() + .join(", "); + + // This is a potential bug in the original code, but keeping it as is for now + // Originally Arvikasoft had if column_info.len() == 1 { format!("TTuple<{tuple_types}>"); } else { format!("TTuple<{tuple_types}>"); } + // This makes no sense since both branches are the same + let tuple_type = format!("TTuple<{tuple_types}>"); + + writeln!(output, "UCLASS(Blueprintable)"); + writeln!(output, "class {index_class_name} : public UObject"); + writeln!(output, "{{"); + writeln!(output, " GENERATED_BODY()"); + writeln!(output); + writeln!(output, "public:"); + + writeln!(output, " TArray<{row_struct}> Filter({method_params}) const"); + writeln!(output, " {{"); + writeln!(output, " TArray<{row_struct}> OutResults;"); + writeln!(output); + writeln!(output, " LocalCache->FindByMultiKeyBTreeIndex<{tuple_type}>("); + writeln!(output, " OutResults,"); + writeln!(output, " TEXT(\"{}\"),", accessor_name.deref()); + writeln!(output, " MakeTuple({param_names})"); + writeln!(output, " );"); + writeln!(output); + writeln!(output, " return OutResults;"); + writeln!(output, " }}"); + writeln!(output); + + writeln!( + output, + " void SetCache(TSharedPtr> InCache)" + ); + writeln!(output, " {{"); + writeln!(output, " LocalCache = InCache;"); + writeln!(output, " }}"); + writeln!(output); + writeln!(output, "private:"); + + // Check if all parameter types are Blueprint-compatible + let all_blueprintable = column_info + .iter() + .all(|(_, _, _, f_ty, _)| is_blueprintable(module, f_ty)); + + if all_blueprintable { + writeln!(output, " UFUNCTION(BlueprintCallable)"); + } else { + writeln!(output, " // NOTE: Not exposed to Blueprint because some parameter types are not Blueprint-compatible"); + } + + writeln!( + output, + " void {filter_method_name}(TArray<{row_struct}>& OutResults, {method_params})" + ); + writeln!(output, " {{"); + writeln!(output, " OutResults = Filter({param_names});"); + writeln!(output, " }}"); + writeln!(output); + + writeln!(output, " TSharedPtr> LocalCache;"); + writeln!(output, "}};"); + writeln!(output); + + // Store information for PostInitialize generation + let property_name = accessor_name.deref().to_case(Case::Pascal); + multi_key_indexes.push((property_name, index_class_name)); + } + } + } + + writeln!(output, "UCLASS(BlueprintType)"); + writeln!( + output, + "class {} {handle_cls} : public URemoteTable", + self.get_api_macro() + ); + writeln!(output, "{{"); + writeln!(output, " GENERATED_BODY()"); + writeln!(output); + writeln!(output, "public:"); + + // Generate unique index properties + for (index_name, index_class_name, _, _) in &unique_indexes { + writeln!(output, " UPROPERTY(BlueprintReadOnly)"); + writeln!(output, " {index_class_name}* {index_name};"); + writeln!(output); + } + + // Generate non-unique BTree index properties + for (index_name, index_class_name) in &multi_key_indexes { + writeln!(output, " UPROPERTY(BlueprintReadOnly)"); + writeln!(output, " {index_class_name}* {};", index_name.to_case(Case::Pascal)); + writeln!(output); + } + + writeln!(output, " void PostInitialize();"); + writeln!(output); + + writeln!(output, " /** Update function for {table_name} table*/"); + writeln!( + output, + " FTableAppliedDiff<{row_struct}> Update(TArray> InsertsRef, TArray> DeletesRef);" + ); + writeln!(output); + + writeln!(output, " /** Number of subscribed rows currently in the cache */"); + writeln!(output, " UFUNCTION(BlueprintCallable, Category = \"SpacetimeDB\")"); + writeln!(output, " int32 Count() const;"); + writeln!(output); + + writeln!(output, " /** Return all subscribed rows in the cache */"); + writeln!(output, " UFUNCTION(BlueprintCallable, Category = \"SpacetimeDB\")"); + writeln!(output, " TArray<{row_struct}> Iter() const;"); + writeln!(output); + + // Generate table events in public section + writeln!(output, " // Table Events"); + writeln!(output, " DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( "); + writeln!(output, " FOn{table_pascal}Insert,"); + writeln!(output, " const FEventContext&, Context,"); + writeln!(output, " const {row_struct}&, NewRow);"); + writeln!(output); + + writeln!(output, " DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( "); + writeln!(output, " FOn{table_pascal}Update,"); + writeln!(output, " const FEventContext&, Context,"); + writeln!(output, " const {row_struct}&, OldRow,"); + writeln!(output, " const {row_struct}&, NewRow);"); + writeln!(output); + + writeln!(output, " DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( "); + writeln!(output, " FOn{table_pascal}Delete,"); + writeln!(output, " const FEventContext&, Context,"); + writeln!(output, " const {row_struct}&, DeletedRow);"); + writeln!(output); + + writeln!( + output, + " UPROPERTY(BlueprintAssignable, Category = \"SpacetimeDB Events\")" + ); + writeln!(output, " FOn{table_pascal}Insert OnInsert;"); + writeln!(output); + + writeln!( + output, + " UPROPERTY(BlueprintAssignable, Category = \"SpacetimeDB Events\")" + ); + writeln!(output, " FOn{table_pascal}Update OnUpdate;"); + writeln!(output); + + writeln!( + output, + " UPROPERTY(BlueprintAssignable, Category = \"SpacetimeDB Events\")" + ); + writeln!(output, " FOn{table_pascal}Delete OnDelete;"); + writeln!(output); + + writeln!(output, "private:"); + writeln!(output, " const FString TableName = TEXT(\"{table_name}\");"); + writeln!(output); + writeln!(output, " TSharedPtr> Data;"); + + writeln!(output, "}};"); // end UCLASS + + OutputFile { + filename: format!( + "Source/{}/Public/ModuleBindings/Tables/{}Table.g.h", + self.module_name, + type_ref_name(module, table.product_type_ref) + ), + code: output.into_inner(), + } + } + + fn generate_type_files(&self, module: &ModuleDef, typ: &TypeDef) -> Vec { + let name = typ + .name + .name_segments() + .last() + .map(|id| id.deref()) + .unwrap_or("Unnamed"); + let filename = format!( + "Source/{}/Public/ModuleBindings/Types/{}Type.g.h", + self.module_name, + collect_case(Case::Pascal, typ.name.name_segments()) + ); + let code: String = match &module.typespace_for_generate()[typ.ty] { + AlgebraicTypeDef::PlainEnum(plain_enum) => autogen_cpp_enum(name, plain_enum), + AlgebraicTypeDef::Product(product_type_def) => { + autogen_cpp_struct(module, name, product_type_def, &self.get_api_macro(), self.module_name) + } + AlgebraicTypeDef::Sum(sum_type_def) => { + autogen_cpp_sum(module, name, sum_type_def, &self.get_api_macro(), self.module_name) + } + }; + + vec![OutputFile { filename, code }] + } + + fn generate_reducer_file(&self, module: &ModuleDef, reducer: &ReducerDef) -> OutputFile { + let reducer_snake = reducer.name.deref(); + let pascal = reducer_snake.to_case(Case::Pascal); + + // Collect includes for parameter types + let mut includes = HashSet::::new(); + for (_param_name, param_type) in &reducer.params_for_generate.elements { + collect_includes_for_type(module, param_type, &mut includes, self.module_name); + } + + // Add ReducerBase.g.h for UReducerBase definition + includes.insert("ModuleBindings/ReducerBase.g.h".to_string()); + + // Convert to sorted vector + let mut include_vec: Vec = includes.into_iter().collect(); + include_vec.sort(); + + // Convert to string references + let include_refs: Vec<&str> = include_vec.iter().map(|s| s.as_str()).collect(); + + let mut header = UnrealCppAutogen::new(&include_refs, &pascal, false); + + let args_struct = format!("F{pascal}Args"); + + // Generate reducer arguments struct + writeln!(header, "// Reducer arguments struct for {pascal}"); + writeln!(header, "USTRUCT(BlueprintType)"); + writeln!(header, "struct {} {args_struct}", self.get_api_macro()); + writeln!(header, "{{"); + writeln!(header, " GENERATED_BODY()"); + writeln!(header); + + // Generate properties for each parameter + for (param_name, param_type) in &reducer.params_for_generate.elements { + let param_pascal = param_name.deref().to_case(Case::Pascal); + let type_str = cpp_ty_fmt_with_module(module, param_type, self.module_name).to_string(); + let field_decl = format!("{type_str} {param_pascal}"); + + // Check if the type is blueprintable + if is_blueprintable(module, param_type) { + writeln!(header, " UPROPERTY(BlueprintReadWrite, Category=\"SpacetimeDB\")"); + } else { + // Add comment explaining why the field isn't exposed as UPROPERTY + writeln!( + header, + " // NOTE: {type_str} field not exposed to Blueprint due to non-blueprintable elements" + ); + } + writeln!(header, " {field_decl};"); + writeln!(header); + } + + // Generate default constructor + writeln!(header, " {args_struct}() = default;"); + writeln!(header); + + // Generate parameterized constructor (for BSATN/internal use) + if !reducer.params_for_generate.elements.is_empty() { + write!(header, " {args_struct}("); + let mut first = true; + for (param_name, param_type) in &reducer.params_for_generate.elements { + if !first { + write!(header, ", "); + } + first = false; + let param_pascal = param_name.deref().to_case(Case::Pascal); + let type_str = cpp_ty_fmt_with_module(module, param_type, self.module_name).to_string(); + + write!(header, "const {type_str}& In{param_pascal}"); + } + writeln!(header, ")"); + + write!(header, " : "); + let mut first = true; + for (param_name, _) in &reducer.params_for_generate.elements { + if !first { + write!(header, ", "); + } + first = false; + let param_pascal = param_name.deref().to_case(Case::Pascal); + write!(header, "{param_pascal}(In{param_pascal})"); + } + writeln!(header); + writeln!(header, " {{}}"); + writeln!(header); + } + + // Add operator== and operator!= + writeln!(header); + writeln!( + header, + " FORCEINLINE bool operator==(const {args_struct}& Other) const" + ); + writeln!(header, " {{"); + + // Generate comparison for each field + let mut comparisons = Vec::new(); + for (param_name, _) in &reducer.params_for_generate.elements { + let param_pascal = param_name.deref().to_case(Case::Pascal); + + // For value types, direct comparison + comparisons.push(format!("{param_pascal} == Other.{param_pascal}")); + } + + if comparisons.is_empty() { + writeln!(header, " return true;"); + } else { + writeln!(header, " return {};", comparisons.join(" && ")); + } + + writeln!(header, " }}"); + writeln!( + header, + " FORCEINLINE bool operator!=(const {args_struct}& Other) const" + ); + writeln!(header, " {{"); + writeln!(header, " return !(*this == Other);"); + writeln!(header, " }}"); + + writeln!(header, "}};"); + writeln!(header); + + // Add BSATN serialization support for reducer args struct + writeln!(header, "namespace UE::SpacetimeDB"); + writeln!(header, "{{"); + + // Generate the field list for the UE_SPACETIMEDB_STRUCT macro + let field_names: Vec = reducer + .params_for_generate + .elements + .iter() + .map(|(name, _)| name.deref().to_case(Case::Pascal)) + .collect(); + + if field_names.is_empty() { + writeln!(header, " UE_SPACETIMEDB_STRUCT_EMPTY({args_struct});"); + } else { + writeln!( + header, + " UE_SPACETIMEDB_STRUCT({args_struct}, {});", + field_names.join(", ") + ); + } + + writeln!(header, "}}"); + writeln!(header); + + // Generate the reducer class + writeln!(header, "// Reducer class for internal dispatching"); + writeln!(header, "UCLASS(BlueprintType)"); + writeln!( + header, + "class {} U{pascal}Reducer : public UReducerBase", + self.get_api_macro() + ); + writeln!(header, "{{"); + writeln!(header, " GENERATED_BODY()"); + writeln!(header); + writeln!(header, "public:"); + + // Generate properties for each parameter (for dispatching) + for (param_name, param_type) in &reducer.params_for_generate.elements { + let param_pascal = param_name.deref().to_case(Case::Pascal); + let type_str = cpp_ty_fmt_with_module(module, param_type, self.module_name).to_string(); + let field_decl = format!("{type_str} {param_pascal}"); + + // Check if the type is blueprintable + if is_blueprintable(module, param_type) { + writeln!(header, " UPROPERTY(BlueprintReadOnly, Category=\"SpacetimeDB\")"); + } else { + // Add comment explaining why the field isn't exposed as UPROPERTY + writeln!( + header, + " // NOTE: {type_str} field not exposed to Blueprint due to non-blueprintable elements" + ); + } + writeln!(header, " {field_decl};"); + } + if !reducer.params_for_generate.elements.is_empty() { + writeln!(header); + } + + writeln!(header, "}};"); + writeln!(header); + + writeln!(header); + + let module_name = &self.module_name; + OutputFile { + filename: format!("Source/{module_name}/Public/ModuleBindings/Reducers/{pascal}.g.h"), + code: header.into_inner(), + } + } + + fn generate_global_files(&self, module: &ModuleDef) -> Vec { + let mut files: Vec = vec![]; + + // First, collect and generate all optional types + let optional_types = collect_optional_types(module); + for optional_name in optional_types { + let module_name_pascal = self.module_name.to_case(Case::Pascal); + let filename = format!( + "Source/{module_name_pascal}/Public/ModuleBindings/Optionals/{module_name_pascal}{optional_name}.g.h" + ); + + let content = generate_optional_type(&optional_name, module, &self.get_api_macro(), self.module_name); + files.push(OutputFile { + filename, + code: content, + }); + } + + // Generate the main SpacetimeDBClient file with proper manual includes + let mut includes = HashSet::::new(); + + // Add base includes + includes.insert("Connection/DbConnectionBase.h".to_string()); + includes.insert("Connection/DbConnectionBuilder.h".to_string()); + includes.insert("Connection/Subscription.h".to_string()); + includes.insert("Connection/SetReducerFlags.h".to_string()); + includes.insert("Connection/Callback.h".to_string()); + includes.insert("ModuleBindings/ReducerBase.g.h".to_string()); + includes.insert("Kismet/BlueprintFunctionLibrary.h".to_string()); + + // Include reducers + for reducer in iter_reducers(module) { + let reducer_pascal = reducer.name.deref().to_case(Case::Pascal); + includes.insert(format!("ModuleBindings/Reducers/{reducer_pascal}.g.h")); + } + + // Collect includes for types used in delegates and contexts + // FSpacetimeDBIdentity is used in FOnConnectDelegate and context methods + collect_includes_for_type(module, &AlgebraicTypeUse::Identity, &mut includes, self.module_name); + // FSpacetimeDBConnectionId is used in context methods + collect_includes_for_type(module, &AlgebraicTypeUse::ConnectionId, &mut includes, self.module_name); + + // Collect includes for all reducer parameter types + for reducer in iter_reducers(module) { + for (_param_name, param_type) in &reducer.params_for_generate.elements { + collect_includes_for_type(module, param_type, &mut includes, self.module_name); + } + } + + // Convert to sorted vector + let mut include_vec: Vec = includes.into_iter().collect(); + include_vec.sort(); + + // Convert to string references + let include_refs: Vec<&str> = include_vec.iter().map(|s| s.as_str()).collect(); + + let mut client_h = UnrealCppAutogen::new(&include_refs, "SpacetimeDBClient", true); + + // Forward declarations + writeln!(client_h, "// Forward declarations"); + writeln!(client_h, "class UDbConnection;"); + writeln!(client_h, "class URemoteTables;"); + writeln!(client_h, "class URemoteReducers;"); + writeln!(client_h, "class USubscriptionBuilder;"); + writeln!(client_h, "class USubscriptionHandle;"); + writeln!(client_h); + + writeln!(client_h, "/** Forward declaration for tables */"); + for table in iter_tables(module) { + let table_pascal = type_ref_name(module, table.product_type_ref); + writeln!(client_h, "class U{table_pascal}Table;"); + } + writeln!(client_h, "/***/"); + writeln!(client_h); + + // Delegates first (as in manual) + generate_delegates(&mut client_h); + + // Context structs + generate_context_structs( + &mut client_h, + module, + &self.get_api_macro(), + &self.module_name.to_case(Case::Pascal), + ); + + // SetReducerFlags class - inherits from USetReducerFlagsBase + writeln!(client_h, "UCLASS(BlueprintType)"); + writeln!( + client_h, + "class {} USetReducerFlags : public USetReducerFlagsBase", + self.get_api_macro() + ); + writeln!(client_h, "{{"); + writeln!(client_h, "\tGENERATED_BODY()"); + writeln!(client_h); + writeln!(client_h, "public:"); + + for reducer in iter_reducers(module) { + let reducer_pascal = reducer.name.deref().to_case(Case::Pascal); + writeln!(client_h, "\tUFUNCTION(BlueprintCallable, Category = \"SpacetimeDB\")"); + writeln!(client_h, "\tvoid {reducer_pascal}(ECallReducerFlags Flag);"); + } + + writeln!(client_h); + writeln!(client_h, "}};"); + writeln!(client_h); + + // RemoteTables class + generate_remote_tables_class(&mut client_h, module, &self.get_api_macro()); + + // RemoteReducers class + generate_remote_reducers_class(&mut client_h, module, &self.get_api_macro(), self.module_name); + + // SubscriptionBuilder class + generate_subscription_builder_class(&mut client_h, &self.get_api_macro()); + + // SubscriptionHandle class + generate_subscription_handle_class(&mut client_h, &self.get_api_macro()); + + // DbConnectionBuilder class + generate_db_connection_builder_class(&mut client_h, &self.get_api_macro()); + + // Main DbConnection class + generate_db_connection_class(&mut client_h, module, &self.get_api_macro()); + + // Generate the separate ReducerBase file + let mut reducer_base_header = UnrealCppAutogen::new(&[], "ReducerBase", false); + + // Generate the UReducerBase class + writeln!(reducer_base_header, "// Abstract Reducer base class"); + writeln!(reducer_base_header, "UCLASS(Abstract, BlueprintType)"); + writeln!( + reducer_base_header, + "class {} UReducerBase : public UObject", + self.get_api_macro() + ); + writeln!(reducer_base_header, "{{"); + writeln!(reducer_base_header, " GENERATED_BODY()"); + writeln!(reducer_base_header); + writeln!(reducer_base_header, "public:"); + writeln!(reducer_base_header, " virtual ~UReducerBase() = default;"); + writeln!(reducer_base_header, "}};"); + writeln!(reducer_base_header); + + files.push(OutputFile { + filename: format!("Source/{}/Public/ModuleBindings/ReducerBase.g.h", self.module_name), + code: reducer_base_header.into_inner(), + }); + + files.push(OutputFile { + filename: format!( + "Source/{}/Public/ModuleBindings/SpacetimeDBClient.g.h", + self.module_name + ), + code: client_h.into_inner(), + }); + + // Build table includes + let table_includes: Vec = module + .tables() + .map(|table| { + format!( + "ModuleBindings/Tables/{}Table.g.h", + type_ref_name(module, table.product_type_ref) + ) + }) + .collect(); + let table_includes_str: Vec<&str> = table_includes.iter().map(|s| s.as_str()).collect(); + + let mut cpp_includes = vec!["ModuleBindings/SpacetimeDBClient.g.h"]; + + // Add additional includes from manual reference + cpp_includes.extend_from_slice(&["DBCache/WithBsatn.h", "BSATN/UEBSATNHelpers.h"]); + + // Add table includes + cpp_includes.extend(table_includes_str); + + let mut client_cpp = UnrealCppAutogen::new_cpp(&cpp_includes); + generate_client_implementation(&mut client_cpp, module, self.module_name); + files.push(OutputFile { + filename: format!( + "Source/{}/Private/ModuleBindings/SpacetimeDBClient.g.cpp", + self.module_name + ), + code: client_cpp.into_inner(), + }); + + // Generate .cpp implementation files for each table + for table in module.tables() { + let table_cpp_content = generate_table_cpp(module, table, self.module_name); + let table_cpp_filename = format!( + "Source/{}/Private/ModuleBindings/Tables/{}Table.g.cpp", + self.module_name, + type_ref_name(module, table.product_type_ref) + ); + files.push(OutputFile { + filename: table_cpp_filename, + code: table_cpp_content, + }); + } + + files + } +} + +// Helper function to generate table .cpp implementation files +fn generate_table_cpp(module: &ModuleDef, table: &TableDef, module_name: &str) -> String { + let table_pascal = type_ref_name(module, table.product_type_ref); + let row_struct = format!("F{table_pascal}Type"); + + // Include the table header and other necessary headers + let table_header = format!("ModuleBindings/Tables/{table_pascal}Table.g.h"); + let includes = vec![ + table_header.as_str(), + "DBCache/UniqueIndex.h", + "DBCache/BTreeUniqueIndex.h", + "DBCache/ClientCache.h", + "DBCache/TableCache.h", + ]; + + let mut output = UnrealCppAutogen::new_cpp(&includes); + + let schema = TableSchema::from_module_def(module, table, (), 0.into()) + .validated() + .expect("table schema should validate"); + + // Get unique indexes and non-unique BTree indexes + let product_type = module.typespace_for_generate()[table.product_type_ref].as_product(); + + let mut unique_indexes = Vec::new(); + let mut multi_key_indexes = Vec::new(); + + for idx in iter_indexes(table) { + let Some(accessor_name) = idx.accessor_name.as_ref() else { + continue; + }; + if let IndexAlgorithm::BTree(BTreeAlgorithm { columns }) = &idx.algorithm { + if schema.is_unique(columns) { + if let Some(col) = columns.as_singleton() { + let (f_name, f_ty) = &product_type.unwrap().elements[col.idx()]; + let _field_name = f_name.deref().to_case(Case::Pascal); + let field_type = cpp_ty_fmt_with_module(module, f_ty, module_name).to_string(); + let index_name = accessor_name.deref().to_case(Case::Pascal); + unique_indexes.push((index_name, field_type, f_name.deref().to_string())); + } + } else { + // Non-unique BTree index + let index_name = accessor_name.deref().to_case(Case::Pascal); + let index_class_name = format!("U{table_pascal}{index_name}Index"); + + // Collect column information for AddMultiKeyBTreeIndex call + let column_info: Vec<_> = columns + .iter() + .map(|col| { + let (f_name, f_ty) = &product_type.unwrap().elements[col.idx()]; + let field_name = f_name.deref().to_case(Case::Pascal); + let field_type = cpp_ty_fmt_with_module(module, f_ty, module_name).to_string(); + (field_name, field_type) + }) + .collect(); + + multi_key_indexes.push(( + index_name, + index_class_name, + accessor_name.deref().to_string(), + column_info, + )); + } + } + } + + // Generate PostInitialize implementation + writeln!(output, "void U{table_pascal}Table::PostInitialize()"); + writeln!(output, "{{"); + writeln!(output, " /** Client cache init and setting up indexes*/"); + writeln!(output, " Data = MakeShared>();"); + writeln!(output); + writeln!( + output, + " TSharedPtr> {table_pascal}Table = Data->GetOrAdd(TableName);" + ); + + // Add unique constraints for each unique index + for (_index_name, field_type, field_name) in &unique_indexes { + writeln!( + output, + " {table_pascal}Table->AddUniqueConstraint<{field_type}>(\"{}\", [](const {row_struct}& Row) -> const {field_type}& {{", + field_name.to_lowercase() + ); + writeln!(output, " return Row.{}; }});", field_name.to_case(Case::Pascal)); + } + + writeln!(output); + for (index_name, _, _) in &unique_indexes { + let index_class_name = format!("U{table_pascal}{index_name}UniqueIndex"); + writeln!(output, " {index_name} = NewObject<{index_class_name}>(this);"); + writeln!(output, " {index_name}->SetCache({table_pascal}Table);"); + writeln!(output); + } + + // Add multi-key BTree indexes + for (index_name, index_class_name, accessor_name, column_info) in &multi_key_indexes { + // Generate TTuple type for AddMultiKeyBTreeIndex + let tuple_types: Vec = column_info.iter().map(|(_, field_type)| field_type.clone()).collect(); + let tuple_type = format!("TTuple<{}>", tuple_types.join(", ")); + + // Generate field access expressions + let field_accesses: Vec = column_info + .iter() + .map(|(field_name, _)| format!("Row.{field_name}")) + .collect(); + + writeln!( + output, + " // Register a new multi-key B-Tree index named \"{accessor_name}\" on the {table_pascal}Table." + ); + writeln!(output, " {table_pascal}Table->AddMultiKeyBTreeIndex<{tuple_type}>("); + writeln!(output, " TEXT(\"{accessor_name}\"),"); + writeln!(output, " [](const {row_struct}& Row)"); + writeln!(output, " {{"); + writeln!( + output, + " // This tuple is stored in the B-Tree index for fast composite key lookups." + ); + writeln!(output, " return MakeTuple({});", field_accesses.join(", ")); + writeln!(output, " }}"); + writeln!(output, " );"); + writeln!(output); + writeln!(output, " {index_name} = NewObject<{index_class_name}>(this);"); + writeln!(output, " {index_name}->SetCache({table_pascal}Table);"); + writeln!(output); + } + + writeln!(output, " /***/"); + writeln!(output, "}}"); + writeln!(output); + + // Generate Update implementation + writeln!( + output, + "FTableAppliedDiff<{row_struct}> U{table_pascal}Table::Update(TArray> InsertsRef, TArray> DeletesRef)" + ); + writeln!(output, "{{"); + writeln!( + output, + " FTableAppliedDiff<{row_struct}> Diff = BaseUpdate<{row_struct}>(InsertsRef, DeletesRef, Data, TableName);" + ); + writeln!(output); + + // Add DeriveUpdatesByPrimaryKey if table has a primary key + if let Some(pk) = schema.pk() { + let pk_field_name = pk.col_name.deref().to_case(Case::Pascal); + let pk_type = &product_type.unwrap().elements[pk.col_pos.idx()].1; + let pk_type_str = cpp_ty_fmt_with_module(module, pk_type, module_name).to_string(); + writeln!(output, " Diff.DeriveUpdatesByPrimaryKey<{pk_type_str}>("); + writeln!(output, " [](const {row_struct}& Row) "); + writeln!(output, " {{"); + writeln!(output, " return Row.{pk_field_name}; "); + writeln!(output, " }}"); + writeln!(output, " );"); + writeln!(output); + } + + // Reset cache for indexes + // for (index_name, _, _) in &unique_indexes { + // writeln!(output, " {}->SetCache(Data->GetOrAdd(TableName));", index_name); + // } + + // for (index_name, _, _, _) in &multi_key_indexes { + // writeln!(output, " {}->SetCache(Data->GetOrAdd(TableName));", index_name); + // } + + writeln!(output, " return Diff;"); + writeln!(output, "}}"); + writeln!(output); + + // Generate Count implementation + writeln!(output, "int32 U{table_pascal}Table::Count() const"); + writeln!(output, "{{"); + writeln!( + output, + " return GetRowCountFromTable<{row_struct}>(Data, TableName);" + ); + writeln!(output, "}}"); + writeln!(output); + + // Generate Iter implementation + writeln!(output, "TArray<{row_struct}> U{table_pascal}Table::Iter() const"); + writeln!(output, "{{"); + writeln!(output, " return GetAllRowsFromTable<{row_struct}>(Data, TableName);"); + writeln!(output, "}}"); + + output.into_inner() +} + +// Helper functions for generating the consolidated SpacetimeDBClient file + +fn generate_delegates(output: &mut UnrealCppAutogen) { + writeln!( + output, + "// Delegates using the generated connection type. These wrap the base" + ); + writeln!( + output, + "// delegates defined in the SDK so that projects can work directly with" + ); + writeln!(output, "// UDbConnection without manual casting in user code."); + writeln!(output, "DECLARE_DYNAMIC_DELEGATE_ThreeParams("); + writeln!(output, "\tFOnConnectDelegate,"); + writeln!(output, "\tUDbConnection*, Connection,"); + writeln!(output, "\tFSpacetimeDBIdentity, Identity,"); + writeln!(output, "\tconst FString&, Token);"); + writeln!(output); + writeln!(output, "DECLARE_DYNAMIC_DELEGATE_TwoParams("); + writeln!(output, "\tFOnDisconnectDelegate,"); + writeln!(output, "\tUDbConnection*, Connection,"); + writeln!(output, "\tconst FString&, Error);"); + writeln!(output); + writeln!(output); +} + +fn generate_context_structs(output: &mut UnrealCppAutogen, module: &ModuleDef, api_macro: &str, module_name: &str) { + writeln!(output, "// Context classes for event handling"); + writeln!(output); + writeln!(output, "USTRUCT(BlueprintType)"); + writeln!(output, "struct {api_macro} FContextBase"); + writeln!(output, "{{"); + writeln!(output, "\tGENERATED_BODY()"); + writeln!(output); + writeln!(output, "\tFContextBase() = default;"); + writeln!(output, "\tFContextBase(UDbConnection* InConn);"); + writeln!(output); + writeln!(output, "\tUPROPERTY(BlueprintReadOnly, Category = \"SpacetimeDB\")"); + writeln!(output, "\tURemoteTables* Db;"); + writeln!(output); + writeln!(output, "\tUPROPERTY(BlueprintReadOnly, Category = \"SpacetimeDB\")"); + writeln!(output, "\tURemoteReducers* Reducers;"); + writeln!(output); + writeln!(output, "\tUPROPERTY(BlueprintReadOnly, Category = \"SpacetimeDB\")"); + writeln!(output, "\tUSetReducerFlags* SetReducerFlags;"); + writeln!(output); + writeln!(output, "\tbool IsActive() const;"); + writeln!(output, "\tvoid Disconnect();"); + writeln!( + output, + "\tbool TryGetIdentity(FSpacetimeDBIdentity& OutIdentity) const;" + ); + writeln!(output, "\tFSpacetimeDBConnectionId GetConnectionId() const;"); + writeln!(output, "\tUSubscriptionBuilder* SubscriptionBuilder();"); + writeln!(output); + writeln!(output, "protected:"); + writeln!(output, "\tUPROPERTY()"); + writeln!(output, "\tUDbConnection* Conn;"); + writeln!(output); + writeln!(output, "}};"); + writeln!(output); + + // --------------------------------------------------------------------- + // Per-module typed Reducer tagged union + typed Event + // --------------------------------------------------------------------- + writeln!(output, "UENUM(BlueprintType, Category = \"SpacetimeDB\")"); + writeln!(output, "enum class EReducerTag : uint8"); + writeln!(output, "{{"); + { + let mut first = true; + for reducer in iter_reducers(module) { + let reducer_pascal = reducer.name.deref().to_case(Case::Pascal); + if !first { + writeln!(output, ","); + } else { + first = false; + } + write!(output, " {reducer_pascal}"); + } + writeln!(output); + } + writeln!(output, "}};"); + writeln!(output); + + // FReducer: tagged union over reducer args, with optional metadata + writeln!(output, "USTRUCT(BlueprintType)"); + writeln!(output, "struct {api_macro} FReducer"); + writeln!(output, "{{"); + writeln!(output, " GENERATED_BODY()"); + writeln!(output); + writeln!(output, "public:"); + writeln!(output, " UPROPERTY(BlueprintReadOnly, Category = \"SpacetimeDB\")"); + writeln!(output, " EReducerTag Tag;"); + writeln!(output); + write!(output, " TVariant<"); + { + let mut first = true; + for reducer in iter_reducers(module) { + let reducer_pascal = reducer.name.deref().to_case(Case::Pascal); + if !first { + write!(output, ", "); + } else { + first = false; + } + write!(output, "F{reducer_pascal}Args"); + } + } + writeln!(output, "> Data;"); + writeln!(output); + writeln!(output, " // Optional metadata"); + writeln!(output, " UPROPERTY(BlueprintReadOnly, Category = \"SpacetimeDB\")"); + writeln!(output, " FString ReducerName;"); + writeln!(output, " uint32 ReducerId = 0;"); + writeln!(output, " uint32 RequestId = 0;"); + writeln!(output); + + // Static constructors, Is*, GetAs* + for reducer in iter_reducers(module) { + let reducer_pascal = reducer.name.deref().to_case(Case::Pascal); + writeln!( + output, + " static FReducer {reducer_pascal}(const F{reducer_pascal}Args& Value)" + ); + writeln!(output, " {{"); + writeln!(output, " FReducer Out;"); + writeln!(output, " Out.Tag = EReducerTag::{reducer_pascal};"); + writeln!(output, " Out.Data.Set(Value);"); + writeln!(output, " Out.ReducerName = TEXT(\"{}\");", reducer.name.deref()); + writeln!(output, " return Out;"); + writeln!(output, " }}"); + writeln!(output); + writeln!( + output, + " FORCEINLINE bool Is{reducer_pascal}() const {{ return Tag == EReducerTag::{reducer_pascal}; }}" + ); + writeln!( + output, + " FORCEINLINE F{reducer_pascal}Args GetAs{reducer_pascal}() const" + ); + writeln!(output, " {{"); + writeln!( + output, + " ensureMsgf(Is{reducer_pascal}(), TEXT(\"Reducer does not hold {reducer_pascal}!\"));" + ); + writeln!(output, " return Data.Get();"); + writeln!(output, " }}"); + writeln!(output); + } + writeln!(output, " FORCEINLINE bool operator==(const FReducer& Other) const"); + writeln!(output, " {{"); + writeln!(output, " if (Tag != Other.Tag || ReducerId != Other.ReducerId || RequestId != Other.RequestId || ReducerName != Other.ReducerName) return false;"); + writeln!(output, " switch (Tag)"); + writeln!(output, " {{"); + for reducer in iter_reducers(module) { + let reducer_pascal = reducer.name.deref().to_case(Case::Pascal); + writeln!(output, " case EReducerTag::{reducer_pascal}:"); + writeln!( + output, + " return GetAs{reducer_pascal}() == Other.GetAs{reducer_pascal}();" + ); + } + writeln!(output, " default: return false;"); + writeln!(output, " }}"); + writeln!(output, " }}"); + writeln!( + output, + " FORCEINLINE bool operator!=(const FReducer& Other) const {{ return !(*this == Other); }}" + ); + writeln!(output, "}};"); + writeln!(output); + + // BPLib for FReducer + writeln!(output, "UCLASS()"); + writeln!( + output, + "class {api_macro} UReducerBpLib : public UBlueprintFunctionLibrary" + ); + writeln!(output, "{{"); + writeln!(output, " GENERATED_BODY()"); + writeln!(output); + writeln!(output, "private:"); + + for reducer in iter_reducers(module) { + let reducer_pascal = reducer.name.deref().to_case(Case::Pascal); + // ---- Static constructors ---- + writeln!(output); + writeln!( + output, + " UFUNCTION(BlueprintCallable, Category = \"SpacetimeDB|Reducer\")" + ); + writeln!( + output, + " static FReducer {reducer_pascal}(const F{reducer_pascal}Args& Value) {{" + ); + writeln!(output, " return FReducer::{reducer_pascal}(Value);"); + writeln!(output, " }}"); + writeln!(output); + + // Is* + writeln!( + output, + " UFUNCTION(BlueprintPure, Category = \"SpacetimeDB|Reducer\")" + ); + writeln!( + output, + " static bool Is{reducer_pascal}(const FReducer& Reducer) {{ return Reducer.Is{reducer_pascal}(); }}" + ); + writeln!(output); + + // GetAs* + writeln!( + output, + " UFUNCTION(BlueprintPure, Category = \"SpacetimeDB|Reducer\")" + ); + writeln!( + output, + " static F{reducer_pascal}Args GetAs{reducer_pascal}(const FReducer& Reducer) {{" + ); + writeln!(output, " return Reducer.GetAs{reducer_pascal}();"); + writeln!(output, " }}"); + } + + writeln!(output, "}};"); + writeln!(output); + + // FReducerEvent: metadata about a reducer invocation, with typed args + writeln!(output, "/** Metadata describing a reducer run. */"); + writeln!(output, "USTRUCT(BlueprintType)"); + writeln!(output, "struct {api_macro} F{module_name}ReducerEvent"); + writeln!(output, "{{"); + writeln!(output, "\tGENERATED_BODY()"); + writeln!(output); + + writeln!(output, "\t/** Timestamp for when the reducer executed */"); + writeln!( + output, + "\tUPROPERTY(EditAnywhere, BlueprintReadWrite, Category=\"SpacetimeDB\")" + ); + writeln!(output, "\tFSpacetimeDBTimestamp Timestamp;"); + writeln!(output); + + writeln!(output, "\t/** Result status of the reducer */"); + writeln!( + output, + "\tUPROPERTY(EditAnywhere, BlueprintReadWrite, Category=\"SpacetimeDB\")" + ); + writeln!(output, "\tFSpacetimeDBStatus Status;"); + writeln!(output); + + writeln!(output, "\t/** Identity that initiated the call */"); + writeln!( + output, + "\tUPROPERTY(EditAnywhere, BlueprintReadWrite, Category=\"SpacetimeDB\")" + ); + writeln!(output, "\tFSpacetimeDBIdentity CallerIdentity;"); + writeln!(output); + + writeln!(output, "\t/** Connection ID for the caller */"); + writeln!( + output, + "\tUPROPERTY(EditAnywhere, BlueprintReadWrite, Category=\"SpacetimeDB\")" + ); + writeln!(output, "\tFSpacetimeDBConnectionId CallerConnectionId;"); + writeln!(output); + + writeln!(output, "\t/** Energy consumed while executing */"); + writeln!( + output, + "\tUPROPERTY(EditAnywhere, BlueprintReadWrite, Category=\"SpacetimeDB\")" + ); + writeln!(output, "\tFEnergyQuantaType EnergyConsumed;"); + writeln!(output); + + writeln!(output, "\t/** Detailed call information */"); + writeln!( + output, + "\tUPROPERTY(EditAnywhere, BlueprintReadWrite, Category=\"SpacetimeDB\")" + ); + writeln!(output, "\tFReducer Reducer;"); + writeln!(output); + + writeln!( + output, + "\tFORCEINLINE bool operator==(const F{module_name}ReducerEvent& Other) const" + ); + writeln!(output, "\t{{"); + writeln!(output, "\t\treturn Status == Other.Status && Timestamp == Other.Timestamp && CallerIdentity == Other.CallerIdentity &&"); + writeln!( + output, + "\t\t\tCallerConnectionId == Other.CallerConnectionId && EnergyConsumed == Other.EnergyConsumed &&" + ); + writeln!(output, "\t\t\tReducer == Other.Reducer;"); + writeln!(output, "\t}}"); + writeln!(output); + + writeln!( + output, + "\tFORCEINLINE bool operator!=(const F{module_name}ReducerEvent& Other) const" + ); + writeln!(output, "\t{{"); + writeln!(output, "\t\treturn !(*this == Other);"); + writeln!(output, "\t}}"); + writeln!(output, "}};"); + writeln!(output); + + // {}Event: union-like struct representing SpacetimeDB event messages + writeln!(output, "/** Represents event with variant message data. */"); + writeln!(output, "USTRUCT(BlueprintType)"); + writeln!(output, "struct {api_macro} F{module_name}Event"); + writeln!(output, "{{"); + writeln!(output, "\tGENERATED_BODY()"); + writeln!(output); + + writeln!( + output, + "\t/** Tagged union holding reducer call, unit events, or error string */" + ); + writeln!(output, "\tTVariant MessageData;"); + writeln!(output); + + writeln!(output, "\t/** Type tag indicating what this event represents */"); + writeln!(output, "\tUPROPERTY(BlueprintReadOnly, Category=\"SpacetimeDB\")"); + writeln!( + output, + "\tESpacetimeDBEventTag Tag = ESpacetimeDBEventTag::UnknownTransaction;" + ); + writeln!(output); + + // === Static factory methods === + writeln!(output, "\t/** === Static factory methods ===*/"); + writeln!(output, "\tstatic F{module_name}Event Reducer(const FReducer& Value)"); + writeln!(output, "\t{{"); + writeln!(output, "\t\tF{module_name}Event Obj;"); + writeln!(output, "\t\tObj.Tag = ESpacetimeDBEventTag::Reducer;"); + writeln!(output, "\t\tObj.MessageData.Set(Value);"); + writeln!(output, "\t\treturn Obj;"); + writeln!(output, "\t}}"); + writeln!(output); + + writeln!( + output, + "\tstatic F{module_name}Event SubscribeApplied(const FSpacetimeDBUnit& Value)" + ); + writeln!(output, "\t{{"); + writeln!(output, "\t\tF{module_name}Event Obj;"); + writeln!(output, "\t\tObj.Tag = ESpacetimeDBEventTag::SubscribeApplied;"); + writeln!(output, "\t\tObj.MessageData.Set(Value);"); + writeln!(output, "\t\treturn Obj;"); + writeln!(output, "\t}}"); + writeln!(output); + + writeln!( + output, + "\tstatic F{module_name}Event UnsubscribeApplied(const FSpacetimeDBUnit& Value)" + ); + writeln!(output, "\t{{"); + writeln!(output, "\t\tF{module_name}Event Obj;"); + writeln!(output, "\t\tObj.Tag = ESpacetimeDBEventTag::UnsubscribeApplied;"); + writeln!(output, "\t\tObj.MessageData.Set(Value);"); + writeln!(output, "\t\treturn Obj;"); + writeln!(output, "\t}}"); + writeln!(output); + + writeln!( + output, + "\tstatic F{module_name}Event Disconnected(const FSpacetimeDBUnit& Value)" + ); + writeln!(output, "\t{{"); + writeln!(output, "\t\tF{module_name}Event Obj;"); + writeln!(output, "\t\tObj.Tag = ESpacetimeDBEventTag::Disconnected;"); + writeln!(output, "\t\tObj.MessageData.Set(Value);"); + writeln!(output, "\t\treturn Obj;"); + writeln!(output, "\t}}"); + writeln!(output); + + writeln!( + output, + "\tstatic F{module_name}Event SubscribeError(const FString& Value)" + ); + writeln!(output, "\t{{"); + writeln!(output, "\t\tF{module_name}Event Obj;"); + writeln!(output, "\t\tObj.Tag = ESpacetimeDBEventTag::SubscribeError;"); + writeln!(output, "\t\tObj.MessageData.Set(Value);"); + writeln!(output, "\t\treturn Obj;"); + writeln!(output, "\t}}"); + writeln!(output); + + writeln!( + output, + "\tstatic F{module_name}Event UnknownTransaction(const FSpacetimeDBUnit& Value)" + ); + writeln!(output, "\t{{"); + writeln!(output, "\t\tF{module_name}Event Obj;"); + writeln!(output, "\t\tObj.Tag = ESpacetimeDBEventTag::UnknownTransaction;"); + writeln!(output, "\t\tObj.MessageData.Set(Value);"); + writeln!(output, "\t\treturn Obj;"); + writeln!(output, "\t}}"); + writeln!(output); + + // === Tag checks and getters === + writeln!( + output, + "\tFORCEINLINE bool IsReducer() const {{ return Tag == ESpacetimeDBEventTag::Reducer; }}" + ); + writeln!(output, "\tFORCEINLINE FReducer GetAsReducer() const"); + writeln!(output, "\t{{"); + writeln!( + output, + "\t\tensureMsgf(IsReducer(), TEXT(\"MessageData does not hold Reducer!\"));" + ); + writeln!(output, "\t\treturn MessageData.Get();"); + writeln!(output, "\t}}"); + writeln!(output); + writeln!( + output, + "\tFORCEINLINE bool IsSubscribeApplied() const {{ return Tag == ESpacetimeDBEventTag::SubscribeApplied; }}" + ); + writeln!(output, "\tFORCEINLINE FSpacetimeDBUnit GetAsSubscribeApplied() const"); + writeln!(output, "\t{{"); + writeln!( + output, + "\t\tensureMsgf(IsSubscribeApplied(), TEXT(\"MessageData does not hold SubscribeApplied!\"));" + ); + writeln!(output, "\t\treturn MessageData.Get();"); + writeln!(output, "\t}}"); + writeln!(output); + writeln!( + output, + "\tFORCEINLINE bool IsUnsubscribeApplied() const {{ return Tag == ESpacetimeDBEventTag::UnsubscribeApplied; }}" + ); + writeln!(output, "\tFORCEINLINE FSpacetimeDBUnit GetAsUnsubscribeApplied() const"); + writeln!(output, "\t{{"); + writeln!( + output, + "\t\tensureMsgf(IsUnsubscribeApplied(), TEXT(\"MessageData does not hold UnsubscribeApplied!\"));" + ); + writeln!(output, "\t\treturn MessageData.Get();"); + writeln!(output, "\t}}"); + writeln!(output); + writeln!( + output, + "\tFORCEINLINE bool IsDisconnected() const {{ return Tag == ESpacetimeDBEventTag::Disconnected; }}" + ); + writeln!(output, "\tFORCEINLINE FSpacetimeDBUnit GetAsDisconnected() const"); + writeln!(output, "\t{{"); + writeln!( + output, + "\t\tensureMsgf(IsDisconnected(), TEXT(\"MessageData does not hold Disconnected!\"));" + ); + writeln!(output, "\t\treturn MessageData.Get();"); + writeln!(output, "\t}}"); + writeln!(output); + writeln!( + output, + "\tFORCEINLINE bool IsSubscribeError() const {{ return Tag == ESpacetimeDBEventTag::SubscribeError; }}" + ); + writeln!(output, "\tFORCEINLINE FString GetAsSubscribeError() const"); + writeln!(output, "\t{{"); + writeln!( + output, + "\t\tensureMsgf(IsSubscribeError(), TEXT(\"MessageData does not hold SubscribeError!\"));" + ); + writeln!(output, "\t\treturn MessageData.Get();"); + writeln!(output, "\t}}"); + writeln!(output); + writeln!( + output, + "\tFORCEINLINE bool IsUnknownTransaction() const {{ return Tag == ESpacetimeDBEventTag::UnknownTransaction; }}" + ); + writeln!(output, "\tFORCEINLINE FSpacetimeDBUnit GetAsUnknownTransaction() const"); + writeln!(output, "\t{{"); + writeln!( + output, + "\t\tensureMsgf(IsUnknownTransaction(), TEXT(\"MessageData does not hold UnknownTransaction!\"));" + ); + writeln!(output, "\t\treturn MessageData.Get();"); + writeln!(output, "\t}}"); + writeln!(output); + + // === Equality operators === + writeln!( + output, + "\tFORCEINLINE bool operator==(const F{module_name}Event& Other) const" + ); + writeln!(output, "\t{{"); + writeln!(output, "\t\tif (Tag != Other.Tag) return false;"); + writeln!(output, "\t\tswitch (Tag)"); + writeln!(output, "\t\t{{"); + writeln!( + output, + "\t\tcase ESpacetimeDBEventTag::Reducer: return GetAsReducer() == Other.GetAsReducer();" + ); + writeln!(output, "\t\tcase ESpacetimeDBEventTag::SubscribeApplied: return GetAsSubscribeApplied() == Other.GetAsSubscribeApplied();"); + writeln!(output, "\t\tcase ESpacetimeDBEventTag::UnsubscribeApplied: return GetAsUnsubscribeApplied() == Other.GetAsUnsubscribeApplied();"); + writeln!( + output, + "\t\tcase ESpacetimeDBEventTag::Disconnected: return GetAsDisconnected() == Other.GetAsDisconnected();" + ); + writeln!( + output, + "\t\tcase ESpacetimeDBEventTag::SubscribeError: return GetAsSubscribeError() == Other.GetAsSubscribeError();" + ); + writeln!(output, "\t\tcase ESpacetimeDBEventTag::UnknownTransaction: return GetAsUnknownTransaction() == Other.GetAsUnknownTransaction();"); + writeln!(output, "\t\tdefault: return false;"); + writeln!(output, "\t\t}}"); + writeln!(output, "\t}}"); + writeln!(output); + + writeln!( + output, + "\tFORCEINLINE bool operator!=(const F{module_name}Event& Other) const" + ); + writeln!(output, "\t{{"); + writeln!(output, "\t\treturn !(*this == Other);"); + writeln!(output, "\t}}"); + writeln!(output, "}};"); + writeln!(output); + + // BPLib + writeln!(output, "UCLASS()"); + writeln!( + output, + "class {api_macro} U{module_name}EventBpLib : public UBlueprintFunctionLibrary" + ); + writeln!(output, "{{"); + writeln!(output, " GENERATED_BODY()"); + writeln!(output); + writeln!(output, "private:"); + + // Reducer + writeln!( + output, + " UFUNCTION(BlueprintCallable, Category = \"SpacetimeDB|{module_name}Event\")" + ); + writeln!( + output, + " static F{module_name}Event Reducer(const FReducer& InValue)" + ); + writeln!(output, " {{"); + writeln!(output, " return F{module_name}Event::Reducer(InValue);"); + writeln!(output, " }}"); + writeln!(output); + + // SubscribeApplied + writeln!( + output, + " UFUNCTION(BlueprintCallable, Category = \"SpacetimeDB|{module_name}Event\")" + ); + writeln!( + output, + " static F{module_name}Event SubscribeApplied(const FSpacetimeDBUnit& InValue)" + ); + writeln!(output, " {{"); + writeln!(output, " return F{module_name}Event::SubscribeApplied(InValue);"); + writeln!(output, " }}"); + writeln!(output); + + // UnsubscribeApplied + writeln!( + output, + " UFUNCTION(BlueprintCallable, Category = \"SpacetimeDB|{module_name}Event\")" + ); + writeln!( + output, + " static F{module_name}Event UnsubscribeApplied(const FSpacetimeDBUnit& InValue)" + ); + writeln!(output, " {{"); + writeln!( + output, + " return F{module_name}Event::UnsubscribeApplied(InValue);" + ); + writeln!(output, " }}"); + writeln!(output); + + // Disconnected + writeln!( + output, + " UFUNCTION(BlueprintCallable, Category = \"SpacetimeDB|{module_name}Event\")" + ); + writeln!( + output, + " static F{module_name}Event Disconnected(const FSpacetimeDBUnit& InValue)" + ); + writeln!(output, " {{"); + writeln!(output, " return F{module_name}Event::Disconnected(InValue);"); + writeln!(output, " }}"); + writeln!(output); + + // SubscribeError + writeln!( + output, + " UFUNCTION(BlueprintCallable, Category = \"SpacetimeDB|{module_name}Event\")" + ); + writeln!( + output, + " static F{module_name}Event SubscribeError(const FString& InValue)" + ); + writeln!(output, " {{"); + writeln!(output, " return F{module_name}Event::SubscribeError(InValue);"); + writeln!(output, " }}"); + writeln!(output); + + // UnknownTransaction + writeln!( + output, + " UFUNCTION(BlueprintCallable, Category = \"SpacetimeDB|{module_name}Event\")" + ); + writeln!( + output, + " static F{module_name}Event UnknownTransaction(const FSpacetimeDBUnit& InValue)" + ); + writeln!(output, " {{"); + writeln!( + output, + " return F{module_name}Event::UnknownTransaction(InValue);" + ); + writeln!(output, " }}"); + writeln!(output); + + // Is* helpers + for case in [ + "Reducer", + "SubscribeApplied", + "UnsubscribeApplied", + "Disconnected", + "SubscribeError", + "UnknownTransaction", + ] { + writeln!( + output, + " UFUNCTION(BlueprintPure, Category = \"SpacetimeDB|{module_name}Event\")" + ); + writeln!( + output, + " static bool Is{case}(const F{module_name}Event& Event) {{ return Event.Is{case}(); }}" + ); + writeln!(output); + } + + // GetAs* helpers + writeln!( + output, + " UFUNCTION(BlueprintPure, Category = \"SpacetimeDB|{module_name}Event\")" + ); + writeln!( + output, + " static FReducer GetAsReducer(const F{module_name}Event& Event)" + ); + writeln!(output, " {{"); + writeln!(output, " return Event.GetAsReducer();"); + writeln!(output, " }}"); + writeln!(output); + + writeln!( + output, + " UFUNCTION(BlueprintPure, Category = \"SpacetimeDB|{module_name}Event\")" + ); + writeln!( + output, + " static FSpacetimeDBUnit GetAsSubscribeApplied(const F{module_name}Event& Event)" + ); + writeln!(output, " {{"); + writeln!(output, " return Event.GetAsSubscribeApplied();"); + writeln!(output, " }}"); + writeln!(output); + + writeln!( + output, + " UFUNCTION(BlueprintPure, Category = \"SpacetimeDB|{module_name}Event\")" + ); + writeln!( + output, + " static FSpacetimeDBUnit GetAsUnsubscribeApplied(const F{module_name}Event& Event)" + ); + writeln!(output, " {{"); + writeln!(output, " return Event.GetAsUnsubscribeApplied();"); + writeln!(output, " }}"); + writeln!(output); + + writeln!( + output, + " UFUNCTION(BlueprintPure, Category = \"SpacetimeDB|{module_name}Event\")" + ); + writeln!( + output, + " static FSpacetimeDBUnit GetAsDisconnected(const F{module_name}Event& Event)" + ); + writeln!(output, " {{"); + writeln!(output, " return Event.GetAsDisconnected();"); + writeln!(output, " }}"); + writeln!(output); + + writeln!( + output, + " UFUNCTION(BlueprintPure, Category = \"SpacetimeDB|{module_name}Event\")" + ); + writeln!( + output, + " static FString GetAsSubscribeError(const F{module_name}Event& Event)" + ); + writeln!(output, " {{"); + writeln!(output, " return Event.GetAsSubscribeError();"); + writeln!(output, " }}"); + writeln!(output); + + writeln!( + output, + " UFUNCTION(BlueprintPure, Category = \"SpacetimeDB|{module_name}Event\")" + ); + writeln!( + output, + " static FSpacetimeDBUnit GetAsUnknownTransaction(const F{module_name}Event& Event)" + ); + writeln!(output, " {{"); + writeln!(output, " return Event.GetAsUnknownTransaction();"); + writeln!(output, " }}"); + writeln!(output); + + writeln!(output, "}};"); + writeln!(output); + + // FEventContext, FReducerEventContext, FErrorContext, FSubscriptionEventContext + writeln!(output); + writeln!(output, "USTRUCT(BlueprintType)"); + writeln!(output, "struct {api_macro} FEventContext : public FContextBase"); + writeln!(output, "{{"); + writeln!(output, "\tGENERATED_BODY()"); + writeln!(output); + writeln!(output, "\tFEventContext() = default;"); + writeln!( + output, + "\tFEventContext(UDbConnection* InConn, const F{module_name}Event& InEvent) : FContextBase(InConn), Event(InEvent) {{}}" + ); + writeln!(output); + writeln!(output, "\tUPROPERTY(BlueprintReadOnly, Category=\"SpacetimeDB\")"); + writeln!(output, "\tF{module_name}Event Event;"); + writeln!(output, "}};"); + writeln!(output); + writeln!(output, "USTRUCT(BlueprintType)"); + writeln!(output, "struct {api_macro} FReducerEventContext : public FContextBase"); + writeln!(output, "{{"); + writeln!(output, "\tGENERATED_BODY()"); + writeln!(output); + writeln!(output, "\tFReducerEventContext() = default;"); + writeln!(output, "\tFReducerEventContext(UDbConnection* InConn, F{module_name}ReducerEvent InEvent) : FContextBase(InConn), Event(InEvent) {{}}"); + writeln!(output, "\t"); + writeln!(output, "\tUPROPERTY(BlueprintReadOnly, Category=\"SpacetimeDB\") "); + writeln!(output, "\tF{module_name}ReducerEvent Event;"); + writeln!(output, "}};"); + writeln!(output); + writeln!(output, "USTRUCT(BlueprintType)"); + writeln!(output, "struct {api_macro} FErrorContext : public FContextBase"); + writeln!(output, "{{"); + writeln!(output, "\tGENERATED_BODY()"); + writeln!(output); + writeln!(output, "\tFErrorContext() = default;"); + writeln!( + output, + "\tFErrorContext(UDbConnection* InConn, const FString& InError) : FContextBase(InConn), Error(InError) {{}}" + ); + writeln!(output); + writeln!(output, "\tUPROPERTY(BlueprintReadOnly, Category=\"SpacetimeDB\")"); + writeln!(output, "\tFString Error;"); + writeln!(output); + writeln!(output, "}};"); + writeln!(output); + writeln!(output, "USTRUCT(BlueprintType)"); + writeln!( + output, + "struct {api_macro} FSubscriptionEventContext : public FContextBase" + ); + writeln!(output, "{{"); + writeln!(output, "\tGENERATED_BODY()"); + writeln!(output); + writeln!(output, "\tFSubscriptionEventContext() = default;"); + writeln!( + output, + "\tFSubscriptionEventContext(UDbConnection* InConn) : FContextBase(InConn) {{}}" + ); + writeln!(output); + writeln!(output, "}};"); + writeln!(output); + writeln!(output, "DECLARE_DYNAMIC_DELEGATE_OneParam("); + writeln!(output, "\tFOnSubscriptionApplied,"); + writeln!(output, "\tFSubscriptionEventContext, Context);"); + writeln!(output); + writeln!(output, "DECLARE_DYNAMIC_DELEGATE_OneParam("); + writeln!(output, "\tFOnSubscriptionError,"); + writeln!(output, "\tFErrorContext, Context);"); + writeln!(output); +} + +fn generate_remote_tables_class(output: &mut UnrealCppAutogen, module: &ModuleDef, api_macro: &str) { + writeln!(output, "// RemoteTables class"); + writeln!(output, "UCLASS(BlueprintType)"); + writeln!(output, "class {api_macro} URemoteTables : public UObject"); + writeln!(output, "{{"); + writeln!(output, " GENERATED_BODY()"); + writeln!(output); + writeln!(output, "public:"); + writeln!(output, " void Initialize();"); + writeln!(output); + + // Generate table handle properties + for table in module.tables() { + let table_pascal = type_ref_name(module, table.product_type_ref); + + writeln!(output, " UPROPERTY(BlueprintReadOnly, Category=\"SpacetimeDB\")"); + writeln!( + output, + " U{table_pascal}Table* {};", + table.name.deref().to_case(Case::Pascal) + ); + writeln!(output); + } + + writeln!(output, "}};"); + writeln!(output); +} + +fn generate_remote_reducers_class( + output: &mut UnrealCppAutogen, + module: &ModuleDef, + api_macro: &str, + module_name: &str, +) { + writeln!(output, "// RemoteReducers class"); + writeln!(output, "UCLASS(BlueprintType)"); + writeln!(output, "class {api_macro} URemoteReducers : public UObject"); + writeln!(output, "{{"); + writeln!(output, " GENERATED_BODY()"); + writeln!(output); + writeln!(output, "public:"); + writeln!(output); + + // Generate reducer events and call methods + for reducer in iter_reducers(module) { + let reducer_pascal = reducer.name.deref().to_case(Case::Pascal); + + // Generate delegate for reducer event + let param_count = reducer.params_for_generate.elements.len() + 1; // +1 for context + let use_args_struct = param_count > 9; // Unreal only supports up to 9 params in delegates + + let mut non_blueprintable_types_for_delegate = Vec::new(); + let mut non_blueprintable_types_for_function = Vec::new(); + + if use_args_struct { + // For more than 9 params, use a struct to wrap the arguments + writeln!(output, " DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams("); + writeln!(output, " F{reducer_pascal}Handler,"); + writeln!(output, " const FReducerEventContext&, Context,"); + writeln!(output, " const F{reducer_pascal}Args&, Args"); + writeln!(output, " );"); + + // For delegates using args struct, check the actual delegate parameters: + // 1. FReducerEventContext (always blueprintable) + // 2. F{Reducer}Args struct (always blueprintable as a USTRUCT) + // So delegates with args struct are always blueprintable + + // But functions still need to check individual parameters + for (_, param_type) in &reducer.params_for_generate.elements { + if !is_type_blueprintable_for_delegates(module, param_type) { + let type_str = cpp_ty_fmt_with_module(module, param_type, module_name).to_string(); + non_blueprintable_types_for_function.push(type_str); + } + } + } else { + // Use the original approach for 9 or fewer params + let delegate_macro = match param_count { + 1 => "DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam", + 2 => "DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams", + 3 => "DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams", + 4 => "DECLARE_DYNAMIC_MULTICAST_DELEGATE_FourParams", + 5 => "DECLARE_DYNAMIC_MULTICAST_DELEGATE_FiveParams", + 6 => "DECLARE_DYNAMIC_MULTICAST_DELEGATE_SixParams", + 7 => "DECLARE_DYNAMIC_MULTICAST_DELEGATE_SevenParams", + 8 => "DECLARE_DYNAMIC_MULTICAST_DELEGATE_EightParams", + 9 => "DECLARE_DYNAMIC_MULTICAST_DELEGATE_NineParams", + _ => unreachable!("Should use args struct for >9 params"), + }; + + write!( + output, + " {delegate_macro}(\n F{reducer_pascal}Handler,\n const FReducerEventContext&, Context" + ); + + for (param_name, param_type) in &reducer.params_for_generate.elements { + // Use Blueprint-compatible types for delegates + let type_str = cpp_ty_fmt_blueprint_compatible(module, param_type, module_name).to_string(); + + // Collect non-blueprintable types for both delegate and function + if !is_type_blueprintable_for_delegates(module, param_type) { + non_blueprintable_types_for_delegate.push(type_str.clone()); + non_blueprintable_types_for_function.push(type_str.clone()); + } + + if should_pass_by_value_in_delegate(module, param_type) { + // Only true primitives are passed by value in delegates + write!( + output, + ",\n {type_str}, {}", + param_name.deref().to_case(Case::Pascal) + ); + } else { + // Complex types (including FSpacetimeDB structs) use const references + write!( + output, + ",\n const {type_str}&, {}", + param_name.deref().to_case(Case::Pascal) + ); + } + } + writeln!(output, "\n );"); + } + + // Generate delegate property + if non_blueprintable_types_for_delegate.is_empty() { + writeln!(output, " UPROPERTY(BlueprintAssignable, Category=\"SpacetimeDB\")"); + } else { + // Generate specific message about which types are not Blueprint-compatible + let types_str = non_blueprintable_types_for_delegate.join(", "); + writeln!( + output, + " // NOTE: Not exposed to Blueprint because {types_str} types are not Blueprint-compatible" + ); + } + writeln!(output, " F{reducer_pascal}Handler On{reducer_pascal};"); + writeln!(output); + + // Generate call method + if non_blueprintable_types_for_function.is_empty() { + write!( + output, + " UFUNCTION(BlueprintCallable, Category=\"SpacetimeDB\")\n void {reducer_pascal}(" + ); + } else { + // Generate specific message about which types are not Blueprint-compatible + let types_str = non_blueprintable_types_for_function.join(", "); + write!( + output, + " // NOTE: Not exposed to Blueprint because {types_str} types are not Blueprint-compatible\n void {reducer_pascal}(" + ); + } + + let mut first = true; + for (param_name, param_type) in &reducer.params_for_generate.elements { + if !first { + write!(output, ", "); + } + first = false; + + // For UFUNCTION parameters, use Blueprint-compatible types + let type_str = if non_blueprintable_types_for_function.is_empty() { + cpp_ty_fmt_blueprint_compatible(module, param_type, module_name).to_string() + } else { + cpp_ty_fmt_with_module(module, param_type, module_name).to_string() + }; + + if should_pass_by_value_in_delegate(module, param_type) { + // Primitives use const by-value in functions + write!( + output, + "const {} {}", + type_str, + param_name.deref().to_case(Case::Pascal) + ); + } else { + // Complex types (including FSpacetimeDB structs) use const references + write!( + output, + "const {}& {}", + type_str, + param_name.deref().to_case(Case::Pascal) + ); + } + } + writeln!(output, ");"); + writeln!(output); + + // Generate invoke method + write!( + output, + " bool Invoke{reducer_pascal}(const FReducerEventContext& Context, const U{reducer_pascal}Reducer* Args);" + ); + writeln!(output); + writeln!(output); + } + + // Internal error handling + writeln!(output, " // Internal error handling"); + writeln!(output, " DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FInternalOnUnhandledReducerError, const FReducerEventContext&, Context, const FString&, Error);"); + writeln!( + output, + " FInternalOnUnhandledReducerError InternalOnUnhandledReducerError;" + ); + writeln!(output); + + writeln!(output, "private:"); + writeln!(output); + writeln!(output, " friend UDbConnection;"); + writeln!(output); + writeln!(output, " UPROPERTY()"); + writeln!(output, " class UDbConnection* Conn;"); + writeln!(output); + writeln!(output, " UPROPERTY()"); + writeln!(output, " USetReducerFlags* SetCallReducerFlags;"); + writeln!(output, "}};"); + writeln!(output); +} + +fn generate_subscription_builder_class(output: &mut UnrealCppAutogen, api_macro: &str) { + writeln!(output, "// SubscriptionBuilder class"); + writeln!(output, "UCLASS(BlueprintType)"); + writeln!( + output, + "class {api_macro} USubscriptionBuilder : public USubscriptionBuilderBase" + ); + writeln!(output, "{{"); + writeln!(output, " GENERATED_BODY()"); + writeln!(output); + writeln!(output, "public:"); + writeln!(output); + writeln!(output, " UFUNCTION(BlueprintCallable, Category = \"SpacetimeDB\")"); + writeln!( + output, + " USubscriptionBuilder* OnApplied(FOnSubscriptionApplied Callback);" + ); + writeln!(output); + writeln!(output, " UFUNCTION(BlueprintCallable, Category = \"SpacetimeDB\")"); + writeln!( + output, + " USubscriptionBuilder* OnError(FOnSubscriptionError Callback);" + ); + writeln!(output); + writeln!(output, " UFUNCTION(BlueprintCallable, Category=\"SpacetimeDB\")"); + writeln!( + output, + " USubscriptionHandle* Subscribe(const TArray& SQL);" + ); + writeln!(output); + writeln!( + output, + " /** Convenience for subscribing to all rows from all tables */" + ); + writeln!(output, " UFUNCTION(BlueprintCallable, Category = \"SpacetimeDB\")"); + writeln!(output, " USubscriptionHandle* SubscribeToAllTables();"); + writeln!(output); + writeln!(output); + writeln!(output, " friend class UDbConnection;"); + writeln!(output, " friend class UDbConnectionBase;"); + writeln!(output); + writeln!(output, "protected:"); + writeln!(output, " UPROPERTY()"); + writeln!(output, " class UDbConnection* Conn;"); + writeln!(output); + writeln!( + output, + " // Delegates stored so Subscribe() can bind forwarding callbacks" + ); + writeln!(output, " FOnSubscriptionApplied OnAppliedDelegateInternal;"); + writeln!(output, " FOnSubscriptionError OnErrorDelegateInternal;"); + writeln!(output, "}};"); + writeln!(output); +} + +fn generate_subscription_handle_class(output: &mut UnrealCppAutogen, api_macro: &str) { + writeln!(output, "// SubscriptionHandle class"); + writeln!(output, "UCLASS(BlueprintType)"); + writeln!( + output, + "class {api_macro} USubscriptionHandle : public USubscriptionHandleBase" + ); + writeln!(output, "{{"); + writeln!(output, " GENERATED_BODY()"); + writeln!(output); + writeln!(output, "public:"); + writeln!(output); + writeln!(output, " USubscriptionHandle() {{}};"); + writeln!(output); + writeln!(output, " explicit USubscriptionHandle(UDbConnection* InConn);"); + writeln!(output); + writeln!(output, " friend class USubscriptionBuilder;"); + writeln!(output); + writeln!(output, "private:"); + writeln!(output, " UPROPERTY()"); + writeln!(output, " class UDbConnection* Conn;"); + writeln!(output); + writeln!( + output, + " // Delegates that expose subscription events with connection aware contexts" + ); + writeln!(output, " FOnSubscriptionApplied OnAppliedDelegate;"); + writeln!(output, " FOnSubscriptionError OnErrorDelegate;"); + writeln!(output); + writeln!(output, " UFUNCTION()"); + writeln!( + output, + " void ForwardOnApplied(const FSubscriptionEventContextBase& BaseCtx);" + ); + writeln!(output); + writeln!(output, " UFUNCTION()"); + writeln!(output, " void ForwardOnError(const FErrorContextBase& BaseCtx);"); + writeln!(output, "}};"); + writeln!(output); +} + +fn generate_db_connection_builder_class(output: &mut UnrealCppAutogen, api_macro: &str) { + writeln!(output, "/*"); + writeln!(output, " @Note: Child class of UDbConnectionBuilderBase."); + writeln!(output, "*/"); + writeln!(output, "UCLASS(BlueprintType)"); + writeln!( + output, + "class {api_macro} UDbConnectionBuilder : public UDbConnectionBuilderBase" + ); + writeln!(output, "{{"); + writeln!(output, " GENERATED_BODY()"); + writeln!(output, "public:"); + writeln!(output); + writeln!(output, " UFUNCTION(BlueprintCallable, Category = \"SpacetimeDB\")"); + writeln!(output, " UDbConnectionBuilder* WithUri(const FString& InUri);"); + writeln!(output, " UFUNCTION(BlueprintCallable, Category = \"SpacetimeDB\")"); + writeln!( + output, + " UDbConnectionBuilder* WithModuleName(const FString& InName);" + ); + writeln!(output, " UFUNCTION(BlueprintCallable, Category = \"SpacetimeDB\")"); + writeln!(output, " UDbConnectionBuilder* WithToken(const FString& InToken);"); + writeln!(output, " UFUNCTION(BlueprintCallable, Category = \"SpacetimeDB\")"); + writeln!( + output, + " UDbConnectionBuilder* WithCompression(const ESpacetimeDBCompression& InCompression);" + ); + writeln!(output, " UFUNCTION(BlueprintCallable, Category = \"SpacetimeDB\")"); + writeln!( + output, + " UDbConnectionBuilder* OnConnect(FOnConnectDelegate Callback);" + ); + writeln!(output, " UFUNCTION(BlueprintCallable, Category = \"SpacetimeDB\")"); + writeln!( + output, + " UDbConnectionBuilder* OnConnectError(FOnConnectErrorDelegate Callback);" + ); + writeln!(output, " UFUNCTION(BlueprintCallable, Category = \"SpacetimeDB\")"); + writeln!( + output, + " UDbConnectionBuilder* OnDisconnect(FOnDisconnectDelegate Callback);" + ); + writeln!(output, " UFUNCTION(BlueprintCallable, Category = \"SpacetimeDB\")"); + writeln!(output, " UDbConnection* Build();"); + writeln!(output); + writeln!(output, "private:"); + writeln!(output); + writeln!( + output, + " // Stored delegates which will be forwarded when the connection events occur." + ); + writeln!(output, " FOnConnectDelegate OnConnectDelegateInternal;"); + writeln!(output, " FOnDisconnectDelegate OnDisconnectDelegateInternal;"); + writeln!(output, "}};"); + writeln!(output); +} + +fn generate_db_connection_class(output: &mut UnrealCppAutogen, _module: &ModuleDef, api_macro: &str) { + writeln!(output, "// Main DbConnection class"); + writeln!(output, "UCLASS(BlueprintType)"); + writeln!(output, "class {api_macro} UDbConnection : public UDbConnectionBase"); + writeln!(output, "{{"); + writeln!(output, " GENERATED_BODY()"); + writeln!(output); + writeln!(output, "public:"); + writeln!( + output, + " explicit UDbConnection(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get());" + ); + writeln!(output); + writeln!(output); + writeln!(output, " UPROPERTY(BlueprintReadOnly, Category=\"SpacetimeDB\")"); + writeln!(output, " URemoteTables* Db;"); + writeln!(output); + writeln!(output, " UPROPERTY(BlueprintReadOnly, Category=\"SpacetimeDB\")"); + writeln!(output, " URemoteReducers* Reducers;"); + writeln!(output); + writeln!(output, " UPROPERTY(BlueprintReadOnly, Category=\"SpacetimeDB\")"); + writeln!(output, " USetReducerFlags* SetReducerFlags;"); + writeln!(output); + writeln!( + output, + " // Delegates that allow users to bind with the concrete connection type." + ); + writeln!(output, " FOnConnectDelegate OnConnectDelegate;"); + writeln!(output, " FOnDisconnectDelegate OnDisconnectDelegate;"); + writeln!(output); + writeln!(output, " UFUNCTION(BlueprintCallable, Category=\"SpacetimeDB\")"); + writeln!(output, " USubscriptionBuilder* SubscriptionBuilder();"); + writeln!(output); + writeln!(output, " /** Static entry point for constructing a connection. */"); + writeln!( + output, + " UFUNCTION(BlueprintCallable, Category = \"SpacetimeDB\", DisplayName = \"SpacetimeDB Builder\")" + ); + writeln!(output, " static UDbConnectionBuilder* Builder();"); + writeln!(output); + writeln!(output, " // Error handling"); + writeln!(output, " DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnUnhandledReducerError, const FReducerEventContext&, Context, const FString&, Error);"); + writeln!(output, " UPROPERTY(BlueprintAssignable, Category=\"SpacetimeDB\")"); + writeln!(output, " FOnUnhandledReducerError OnUnhandledReducerError;"); + writeln!(output); + writeln!(output); + writeln!(output, "protected:"); + writeln!(output); + writeln!(output, " // Hook up error handling to reducers"); + writeln!(output, " virtual void PostInitProperties() override;"); + writeln!(output); + writeln!(output, " UFUNCTION()"); + writeln!(output, " void ForwardOnConnect(UDbConnectionBase* BaseConnection, FSpacetimeDBIdentity InIdentity, const FString& InToken);"); + writeln!(output, " UFUNCTION()"); + writeln!( + output, + " void ForwardOnDisconnect(UDbConnectionBase* BaseConnection, const FString& Error);" + ); + writeln!(output); + writeln!(output, " UFUNCTION()"); + writeln!( + output, + " void OnUnhandledReducerErrorHandler(const FReducerEventContext& Context, const FString& Error);" + ); + writeln!(output); + writeln!( + output, + " // Override the DbConnectionBase methods to handle updates and events" + ); + writeln!( + output, + " virtual void DbUpdate(const FDatabaseUpdateType& Update, const FSpacetimeDBEvent& Event) override;" + ); + writeln!(output, " "); + writeln!( + output, + " // Override the reducer event handler to dispatch events to the appropriate reducers" + ); + writeln!( + output, + " virtual void ReducerEvent(const FReducerEvent& Event) override;" + ); + writeln!(output, " "); + writeln!(output, " // Override the reducer event failed handler"); + writeln!( + output, + " virtual void ReducerEventFailed(const FReducerEvent& Event, const FString ErrorMessage) override;" + ); + writeln!(output, "}};"); + writeln!(output); +} + +fn generate_client_implementation(output: &mut UnrealCppAutogen, module: &ModuleDef, module_name: &str) { + // Helper: Decode reducer args into FReducer from either event types + writeln!(output, "static FReducer DecodeReducer(const FReducerEvent& Event)"); + writeln!(output, "{{"); + writeln!( + output, + " const FString& ReducerName = Event.ReducerCall.ReducerName;" + ); + writeln!(output); + + for reducer in iter_reducers(module) { + let reducer_name = reducer.name.deref(); + let reducer_pascal = reducer_name.to_case(Case::Pascal); + + writeln!(output, " if (ReducerName == TEXT(\"{reducer_name}\"))"); + writeln!(output, " {{"); + writeln!( + output, + " F{reducer_pascal}Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args);" + ); + writeln!(output, " return FReducer::{reducer_pascal}(Args);"); + writeln!(output, " }}"); + writeln!(output); + } + + writeln!(output, " return FReducer();"); + writeln!(output, "}}"); + writeln!(output); + + // UDbConnection constructor + writeln!( + output, + "UDbConnection::UDbConnection(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)" + ); + writeln!(output, "{{"); + writeln!(output, "\tSetReducerFlags = ObjectInitializer.CreateDefaultSubobject(this, TEXT(\"SetReducerFlags\"));"); + writeln!(output); + writeln!( + output, + "\tDb = ObjectInitializer.CreateDefaultSubobject(this, TEXT(\"RemoteTables\"));" + ); + writeln!(output, "\tDb->Initialize();"); + writeln!(output, "\t"); + writeln!( + output, + "\tReducers = ObjectInitializer.CreateDefaultSubobject(this, TEXT(\"RemoteReducers\"));" + ); + writeln!(output, "\tReducers->SetCallReducerFlags = SetReducerFlags;"); + writeln!(output, "\tReducers->Conn = this;"); + writeln!(output); + for table in module.tables() { + let table_pascal = type_ref_name(module, table.product_type_ref); + let table_name = table.name.deref(); + writeln!( + output, + "\tRegisterTable(TEXT(\"{}\"), Db->{});", + table_pascal, + table_pascal, + table_name, + table.name.deref().to_case(Case::Pascal) + ); + } + writeln!(output, "}}"); + writeln!(output); + + // FContextBase constructor + writeln!(output, "FContextBase::FContextBase(UDbConnection* InConn)"); + writeln!(output, "{{"); + writeln!(output, "\tDb = InConn->Db;"); + writeln!(output, "\tReducers = InConn->Reducers;"); + writeln!(output, "\tSetReducerFlags = InConn->SetReducerFlags;"); + writeln!(output, "\tConn = InConn;"); + writeln!(output, "}}"); + + // FContextBase methods + writeln!(output, "bool FContextBase::IsActive() const"); + writeln!(output, "{{"); + writeln!(output, "\treturn Conn->IsActive();"); + writeln!(output, "}}"); + writeln!(output, "void FContextBase::Disconnect()"); + writeln!(output, "{{"); + writeln!(output, "\tConn->Disconnect();"); + writeln!(output, "}}"); + writeln!(output, "USubscriptionBuilder* FContextBase::SubscriptionBuilder()"); + writeln!(output, "{{"); + writeln!(output, "\treturn Conn->SubscriptionBuilder();"); + writeln!(output, "}}"); + writeln!( + output, + "bool FContextBase::TryGetIdentity(FSpacetimeDBIdentity& OutIdentity) const" + ); + writeln!(output, "{{"); + writeln!(output, "\treturn Conn->TryGetIdentity(OutIdentity);"); + writeln!(output, "}}"); + writeln!(output, "FSpacetimeDBConnectionId FContextBase::GetConnectionId() const"); + writeln!(output, "{{"); + writeln!(output, "\treturn Conn->GetConnectionId();"); + writeln!(output, "}}"); + writeln!(output); + + // URemoteTables Initialize method + writeln!(output, "void URemoteTables::Initialize()"); + writeln!(output, "{{"); + writeln!(output); + writeln!(output, "\t/** Creating tables */"); + for table in module.tables() { + let table_pascal = type_ref_name(module, table.product_type_ref); + writeln!( + output, + "\t{} = NewObject(this);", + table.name.deref().to_case(Case::Pascal), + table_pascal + ); + } + writeln!(output, "\t/**/"); + writeln!(output); + writeln!(output, "\t/** Initialization */"); + for table in module.tables() { + writeln!( + output, + "\t{}->PostInitialize();", + table.name.deref().to_case(Case::Pascal) + ); + } + writeln!(output, "\t/**/"); + writeln!(output, "}}"); + writeln!(output); + + // USetReducerFlags methods + for reducer in iter_reducers(module) { + let reducer_pascal = reducer.name.deref().to_case(Case::Pascal); + writeln!( + output, + "void USetReducerFlags::{reducer_pascal}(ECallReducerFlags Flag)" + ); + writeln!(output, "{{"); + writeln!(output, "\tFlagMap.Add(\"{reducer_pascal}\", Flag);"); + writeln!(output, "}}"); + } + writeln!(output); + + // Reducer implementations + for reducer in iter_reducers(module) { + let reducer_pascal = reducer.name.deref().to_case(Case::Pascal); + let reducer_snake = reducer.name.deref(); + + // Call method implementation + write!(output, "void URemoteReducers::{reducer_pascal}("); + let mut first = true; + for (param_name, param_type) in &reducer.params_for_generate.elements { + if !first { + write!(output, ", "); + } + first = false; + // Use Blueprint-compatible types (same as UFUNCTION and delegates) + let type_str = cpp_ty_fmt_blueprint_compatible(module, param_type, module_name).to_string(); + if should_pass_by_value_in_delegate(module, param_type) { + // Primitives use const by-value in URemoteReducers methods (same as UFUNCTION) + write!( + output, + "const {} {}", + type_str, + param_name.deref().to_case(Case::Pascal) + ); + } else { + // Complex types (including FSpacetimeDB structs) use const references + write!( + output, + "const {}& {}", + type_str, + param_name.deref().to_case(Case::Pascal) + ); + } + } + writeln!(output, ")"); + writeln!(output, "{{"); + writeln!(output, " if (!Conn)"); + writeln!(output, " {{"); + writeln!( + output, + " UE_LOG(LogTemp, Error, TEXT(\"SpacetimeDB connection is null\"));" + ); + writeln!(output, " return;"); + writeln!(output, " }}"); + writeln!(output); + // Call reducer using typed helper to hide serialization + if reducer.params_for_generate.elements.is_empty() { + writeln!( + output, + "\tConn->CallReducerTyped(TEXT(\"{reducer_snake}\"), F{reducer_pascal}Args(), SetCallReducerFlags);" + ); + } else { + write!( + output, + "\tConn->CallReducerTyped(TEXT(\"{reducer_snake}\"), F{reducer_pascal}Args(" + ); + let mut first = true; + for (param_name, _) in &reducer.params_for_generate.elements { + if !first { + write!(output, ", "); + } + first = false; + let param_pascal = param_name.deref().to_case(Case::Pascal); + write!(output, "{param_pascal}"); + } + writeln!(output, "), SetCallReducerFlags);"); + } + writeln!(output, "}}"); + writeln!(output); + + // Invoke method implementation + write!( + output, + "bool URemoteReducers::Invoke{reducer_pascal}(const FReducerEventContext& Context, const U{reducer_pascal}Reducer* Args)" + ); + writeln!(output); + writeln!(output, "{{"); + writeln!(output, " if (!On{reducer_pascal}.IsBound())"); + writeln!(output, " {{"); + writeln!(output, " // Handle unhandled reducer error"); + writeln!(output, " if (InternalOnUnhandledReducerError.IsBound())"); + writeln!(output, " {{"); + writeln!( + output, + " // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases" + ); + writeln!(output, " // For now, just broadcast any error"); + writeln!( + output, + " InternalOnUnhandledReducerError.Broadcast(Context, TEXT(\"No handler registered for {reducer_pascal}\"));" + ); + writeln!(output, " }}"); + writeln!(output, " return false;"); + writeln!(output, " }}"); + writeln!(output); + + // Check if we're using args struct (more than 9 params including context) + let param_count = reducer.params_for_generate.elements.len() + 1; // +1 for context + let use_args_struct = param_count > 9; + + if use_args_struct { + // Create args struct from individual fields + writeln!(output, " F{reducer_pascal}Args ArgsStruct;"); + for (param_name, _) in &reducer.params_for_generate.elements { + let param_pascal = param_name.deref().to_case(Case::Pascal); + writeln!(output, " ArgsStruct.{param_pascal} = Args->{param_pascal};"); + } + writeln!(output, " On{reducer_pascal}.Broadcast(Context, ArgsStruct);"); + } else { + // Use individual parameters + write!(output, " On{reducer_pascal}.Broadcast(Context"); + for (param_name, _) in &reducer.params_for_generate.elements { + let param_pascal = param_name.deref().to_case(Case::Pascal); + write!(output, ", Args->{param_pascal}"); + } + writeln!(output, ");"); + } + + writeln!(output, " return true;"); + writeln!(output, "}}"); + writeln!(output); + } + + // Hook up error handling + writeln!(output, "void UDbConnection::PostInitProperties()"); + writeln!(output, "{{"); + writeln!(output, " Super::PostInitProperties();"); + writeln!(output, " "); + writeln!( + output, + " // Connect OnUnhandledReducerError to Reducers.InternalOnUnhandledReducerError" + ); + writeln!(output, " if (Reducers)"); + writeln!(output, " {{"); + writeln!(output, " Reducers->InternalOnUnhandledReducerError.AddDynamic(this, &UDbConnection::OnUnhandledReducerErrorHandler);"); + writeln!(output, " }}"); + writeln!(output, "}}"); + writeln!(output); + + // Error handler method + writeln!(output, "UFUNCTION()"); + writeln!( + output, + "void UDbConnection::OnUnhandledReducerErrorHandler(const FReducerEventContext& Context, const FString& Error)" + ); + writeln!(output, "{{"); + writeln!(output, " if (OnUnhandledReducerError.IsBound())"); + writeln!(output, " {{"); + writeln!(output, " OnUnhandledReducerError.Broadcast(Context, Error);"); + writeln!(output, " }}"); + writeln!(output, "}}"); + writeln!(output); + + // ReducerEvent method implementation + writeln!(output, "void UDbConnection::ReducerEvent(const FReducerEvent& Event)"); + writeln!(output, "{{"); + writeln!(output, " if (!Reducers) {{ return; }}"); + writeln!(output); + + // Decode reducer call args + writeln!(output, " FReducer DecodedReducer = DecodeReducer(Event);"); + writeln!(output); + + let module_name_pascal = module_name.to_case(Case::Pascal); + // Build the {}ReducerEvent object + writeln!(output, " F{module_name_pascal}ReducerEvent ReducerEvent;"); + writeln!( + output, + " ReducerEvent.CallerConnectionId = Event.CallerConnectionId;" + ); + writeln!(output, " ReducerEvent.CallerIdentity = Event.CallerIdentity;"); + writeln!(output, " ReducerEvent.EnergyConsumed = Event.EnergyConsumed;"); + writeln!(output, " ReducerEvent.Status = Event.Status;"); + writeln!(output, " ReducerEvent.Timestamp = Event.Timestamp;"); + writeln!(output, " ReducerEvent.Reducer = DecodedReducer;"); + writeln!(output); + + writeln!(output, " FReducerEventContext Context(this, ReducerEvent);"); + writeln!(output); + writeln!(output, " // Use hardcoded string matching for reducer dispatching"); + writeln!( + output, + " const FString& ReducerName = Event.ReducerCall.ReducerName;" + ); + writeln!(output); + + for reducer in iter_reducers(module) { + let reducer_name = reducer.name.deref(); + let reducer_pascal = reducer.name.deref().to_case(Case::Pascal); + writeln!(output, " if (ReducerName == TEXT(\"{reducer_name}\"))"); + writeln!(output, " {{"); + writeln!( + output, + " F{reducer_pascal}Args Args = ReducerEvent.Reducer.GetAs{reducer_pascal}();" + ); + writeln!( + output, + " U{reducer_pascal}Reducer* Reducer = NewObject();" + ); + + // Copy fields from Args struct to Reducer object + for (param_name, _) in &reducer.params_for_generate.elements { + let param_pascal = param_name.deref().to_case(Case::Pascal); + writeln!(output, " Reducer->{param_pascal} = Args.{param_pascal};"); + } + + writeln!(output, " Reducers->Invoke{reducer_pascal}(Context, Reducer);"); + writeln!(output, " return;"); + writeln!(output, " }}"); + } + writeln!(output); + writeln!( + output, + " UE_LOG(LogTemp, Warning, TEXT(\"Unknown reducer: %s\"), *ReducerName);" + ); + writeln!(output, "}}"); + writeln!(output); + + // ReducerEventFailed method implementation + writeln!( + output, + "void UDbConnection::ReducerEventFailed(const FReducerEvent& Event, const FString ErrorMessage)" + ); + writeln!(output, "{{"); + writeln!(output, " if (!Reducers) {{ return; }}"); + writeln!(output); + + // Build the {}ReducerEvent object + writeln!(output, " F{module_name_pascal}ReducerEvent ReducerEvent;"); + writeln!( + output, + " ReducerEvent.CallerConnectionId = Event.CallerConnectionId;" + ); + writeln!(output, " ReducerEvent.CallerIdentity = Event.CallerIdentity;"); + writeln!(output, " ReducerEvent.EnergyConsumed = Event.EnergyConsumed;"); + writeln!(output, " ReducerEvent.Status = Event.Status;"); + writeln!(output, " ReducerEvent.Timestamp = Event.Timestamp;"); + writeln!(output); + + writeln!(output, " FReducerEventContext Context(this, ReducerEvent);"); + writeln!(output); + writeln!(output, " if (Reducers->InternalOnUnhandledReducerError.IsBound())"); + writeln!(output, " {{"); + writeln!( + output, + " Reducers->InternalOnUnhandledReducerError.Broadcast(Context, ErrorMessage);" + ); + writeln!(output, " }}"); + writeln!(output, "}}"); + writeln!(output); + + // Additional methods from manual reference + writeln!(output, "UDbConnectionBuilder* UDbConnection::Builder()"); + writeln!(output, "{{"); + writeln!(output, "\treturn NewObject();"); + writeln!(output, "}}"); + writeln!(output, "// Added for creating subscriptions"); + writeln!(output, "USubscriptionBuilder* UDbConnection::SubscriptionBuilder()"); + writeln!(output, "{{"); + writeln!( + output, + "\tUSubscriptionBuilder* Builder = NewObject(this);" + ); + writeln!(output, "\tBuilder->Conn = this;"); + writeln!(output, "\treturn Builder;"); + writeln!(output, "}}"); + writeln!( + output, + "USubscriptionBuilder* USubscriptionBuilder::OnApplied(FOnSubscriptionApplied Callback)" + ); + writeln!(output, "{{"); + writeln!(output, "\tOnAppliedDelegateInternal = Callback;"); + writeln!(output, "\treturn this;"); + writeln!(output, "}}"); + writeln!( + output, + "USubscriptionBuilder* USubscriptionBuilder::OnError(FOnSubscriptionError Callback)" + ); + writeln!(output, "{{"); + writeln!(output, "\tOnErrorDelegateInternal = Callback;"); + writeln!(output, "\treturn this;"); + writeln!(output, "}}"); + writeln!( + output, + "USubscriptionHandle* USubscriptionBuilder::Subscribe(const TArray& SQL)" + ); + writeln!(output, "{{"); + writeln!( + output, + "\tUSubscriptionHandle* Handle = NewObject();" + ); + writeln!(output); + writeln!(output, "\t// Store user callbacks on the handle"); + writeln!(output, "\tHandle->Conn = Conn;"); + writeln!(output, "\tHandle->OnAppliedDelegate = OnAppliedDelegateInternal;"); + writeln!(output, "\tHandle->OnErrorDelegate = OnErrorDelegateInternal;"); + writeln!(output); + writeln!(output, "\t// Bind forwarding functions that will convert base contexts"); + writeln!(output, "\tFSubscriptionEventDelegate BaseApplied;"); + writeln!( + output, + "\tBaseApplied.BindUFunction(Handle, TEXT(\"ForwardOnApplied\"));" + ); + writeln!(output, "\tOnAppliedBase(BaseApplied);"); + writeln!(output); + writeln!(output, "\tFSubscriptionErrorDelegate BaseError;"); + writeln!(output, "\tBaseError.BindUFunction(Handle, TEXT(\"ForwardOnError\"));"); + writeln!(output, "\tOnErrorBase(BaseError);"); + writeln!(output); + writeln!(output, "\tSubscribeBase(SQL, Handle);"); + writeln!(output, "\tif (Conn)"); + writeln!(output, "\t{{"); + writeln!(output, "\t\tConn->StartSubscription(Handle);"); + writeln!(output, "\t}}"); + writeln!(output, "\treturn Handle;"); + writeln!(output, "}}"); + writeln!( + output, + "USubscriptionHandle* USubscriptionBuilder::SubscribeToAllTables()" + ); + writeln!(output, "{{"); + writeln!(output, "\treturn Subscribe({{ \"SELECT * FROM * \" }});"); + writeln!(output, "}}"); + writeln!(output); + writeln!( + output, + "USubscriptionHandle::USubscriptionHandle(UDbConnection* InConn)" + ); + writeln!(output, "{{"); + writeln!(output, "\tConn = InConn;"); + writeln!(output, "}}"); + writeln!(output); + writeln!( + output, + "void USubscriptionHandle::ForwardOnApplied(const FSubscriptionEventContextBase& BaseCtx)" + ); + writeln!(output, "{{"); + writeln!(output, "\tif (OnAppliedDelegate.IsBound())"); + writeln!(output, "\t{{"); + writeln!(output, "\t\tFSubscriptionEventContext Ctx(Conn);"); + writeln!(output, "\t\tOnAppliedDelegate.Execute(Ctx);"); + writeln!(output, "\t}}"); + writeln!(output, "}}"); + writeln!(output); + writeln!( + output, + "void USubscriptionHandle::ForwardOnError(const FErrorContextBase& BaseCtx)" + ); + writeln!(output, "{{"); + writeln!(output, "\tif (OnErrorDelegate.IsBound())"); + writeln!(output, "\t{{"); + writeln!(output, "\t\tFErrorContext Ctx(Conn, BaseCtx.Error);"); + writeln!(output, "\t\tOnErrorDelegate.Execute(Ctx);"); + writeln!(output, "\t}}"); + writeln!(output, "}}"); + writeln!(output); + writeln!(output); + writeln!(output, "// Cast from parent to child class"); + writeln!( + output, + "UDbConnectionBuilder* UDbConnectionBuilder::WithUri(const FString& InUri)" + ); + writeln!(output, "{{"); + writeln!(output, "\treturn Cast(WithUriBase(InUri));"); + writeln!(output, "}}"); + writeln!( + output, + "UDbConnectionBuilder* UDbConnectionBuilder::WithModuleName(const FString& InName)" + ); + writeln!(output, "{{"); + writeln!( + output, + "\treturn Cast(WithModuleNameBase(InName));" + ); + writeln!(output, "}}"); + writeln!( + output, + "UDbConnectionBuilder* UDbConnectionBuilder::WithToken(const FString& InToken)" + ); + writeln!(output, "{{"); + writeln!(output, "\treturn Cast(WithTokenBase(InToken));"); + writeln!(output, "}}"); + writeln!( + output, + "UDbConnectionBuilder* UDbConnectionBuilder::WithCompression(const ESpacetimeDBCompression& InCompression)" + ); + writeln!(output, "{{"); + writeln!( + output, + "\treturn Cast(WithCompressionBase(InCompression));" + ); + writeln!(output, "}}"); + writeln!( + output, + "UDbConnectionBuilder* UDbConnectionBuilder::OnConnect(FOnConnectDelegate Callback)" + ); + writeln!(output, "{{"); + writeln!(output, "\tOnConnectDelegateInternal = Callback;"); + writeln!(output, "\treturn this;"); + writeln!(output, "}}"); + writeln!( + output, + "UDbConnectionBuilder* UDbConnectionBuilder::OnConnectError(FOnConnectErrorDelegate Callback)" + ); + writeln!(output, "{{"); + writeln!( + output, + "\treturn Cast(OnConnectErrorBase(Callback));" + ); + writeln!(output, "}}"); + writeln!( + output, + "UDbConnectionBuilder* UDbConnectionBuilder::OnDisconnect(FOnDisconnectDelegate Callback)" + ); + writeln!(output, "{{"); + writeln!(output, "\tOnDisconnectDelegateInternal = Callback;"); + writeln!(output, "\treturn this;"); + writeln!(output, "}}"); + writeln!(output, "UDbConnection* UDbConnectionBuilder::Build()"); + writeln!(output, "{{"); + writeln!(output, "\tUDbConnection* Connection = NewObject();"); + writeln!(output); + writeln!(output, "\t// Store delegates on the connection for later use"); + writeln!(output, "\tConnection->OnConnectDelegate = OnConnectDelegateInternal;"); + writeln!( + output, + "\tConnection->OnDisconnectDelegate = OnDisconnectDelegateInternal;" + ); + writeln!(output); + writeln!(output, "\t// Wrap delegates so the base builder can bind them"); + writeln!(output, "\tFOnConnectBaseDelegate BaseConnect;"); + writeln!( + output, + "\tBaseConnect.BindUFunction(Connection, TEXT(\"ForwardOnConnect\"));" + ); + writeln!(output, "\tConnection->SetOnConnectDelegate(BaseConnect);"); + writeln!(output, "\tOnConnectBase(BaseConnect);"); + writeln!(output); + writeln!(output, "\tFOnDisconnectBaseDelegate BaseDisconnect;"); + writeln!( + output, + "\tBaseDisconnect.BindUFunction(Connection, TEXT(\"ForwardOnDisconnect\"));" + ); + writeln!(output, "\tConnection->SetOnDisconnectDelegate(BaseDisconnect);"); + writeln!(output, "\tOnDisconnectBase(BaseDisconnect);"); + writeln!(output); + writeln!(output, "\treturn Cast(BuildConnection(Connection));"); + writeln!(output, "}}"); + writeln!(output, "void UDbConnection::ForwardOnConnect(UDbConnectionBase* BaseConnection, FSpacetimeDBIdentity InIdentity, const FString& InToken)"); + writeln!(output, "{{"); + writeln!(output, "\tif (OnConnectDelegate.IsBound())"); + writeln!(output, "\t{{"); + writeln!(output, "\t\tOnConnectDelegate.Execute(this, Identity, Token);"); + writeln!(output, "\t}}"); + writeln!(output, "}}"); + writeln!( + output, + "void UDbConnection::ForwardOnDisconnect(UDbConnectionBase* BaseConnection, const FString& Error)" + ); + writeln!(output, "{{"); + writeln!(output, "\tif (OnDisconnectDelegate.IsBound())"); + writeln!(output, "\t{{"); + writeln!(output, "\t\tOnDisconnectDelegate.Execute(this, Error);"); + writeln!(output, "\t}}"); + writeln!(output, "}}"); + writeln!(output); + writeln!(output); + + writeln!( + output, + "void UDbConnection::DbUpdate(const FDatabaseUpdateType& Update, const FSpacetimeDBEvent& Event)" + ); + writeln!(output, "{{"); + + // Create {}Event + writeln!(output, " F{module_name_pascal}Event BaseEvent;"); + writeln!(output, " BaseEvent.Tag = Event.Tag;"); + writeln!(output); + + // Switch on Event.Tag + writeln!(output, " switch (Event.Tag)"); + writeln!(output, " {{"); + + // Reducer case + writeln!(output, " case ESpacetimeDBEventTag::Reducer:"); + writeln!(output, " {{"); + writeln!(output, " FReducerEvent ReducerEvent = Event.GetAsReducer();"); + writeln!(output, " FReducer Reducer = DecodeReducer(ReducerEvent);"); + writeln!( + output, + " BaseEvent = F{module_name_pascal}Event::Reducer(Reducer);" + ); + writeln!(output, " break;"); + writeln!(output, " }}"); + writeln!(output); + + // Other cases + writeln!(output, " case ESpacetimeDBEventTag::SubscribeApplied:"); + writeln!( + output, + " BaseEvent = F{module_name_pascal}Event::SubscribeApplied(Event.GetAsSubscribeApplied());" + ); + writeln!(output, " break;"); + writeln!(output); + + writeln!(output, " case ESpacetimeDBEventTag::UnsubscribeApplied:"); + writeln!( + output, + " BaseEvent = F{module_name_pascal}Event::UnsubscribeApplied(Event.GetAsUnsubscribeApplied());" + ); + writeln!(output, " break;"); + writeln!(output); + + writeln!(output, " case ESpacetimeDBEventTag::Disconnected:"); + writeln!( + output, + " BaseEvent = F{module_name_pascal}Event::Disconnected(Event.GetAsDisconnected());" + ); + writeln!(output, " break;"); + writeln!(output); + + writeln!(output, " case ESpacetimeDBEventTag::SubscribeError:"); + writeln!( + output, + " BaseEvent = F{module_name_pascal}Event::SubscribeError(Event.GetAsSubscribeError());" + ); + writeln!(output, " break;"); + writeln!(output); + + writeln!(output, " case ESpacetimeDBEventTag::UnknownTransaction:"); + writeln!( + output, + " BaseEvent = F{module_name_pascal}Event::UnknownTransaction(Event.GetAsUnknownTransaction());" + ); + writeln!(output, " break;"); + writeln!(output); + + writeln!(output, " default:"); + writeln!(output, " break;"); + writeln!(output, " }}"); + writeln!(output); + + // Wrap in EventContext + writeln!(output, " FEventContext Context(this, BaseEvent);"); + writeln!( + output, + " // Populate typed reducer args for convenience in table handlers" + ); + writeln!(output); + + // Apply updates + writeln!(output, " ApplyRegisteredTableUpdates(Update, &Context);"); + writeln!(output, "}}"); + writeln!(output); +} + +struct UnrealCppAutogen { + output: CodeIndenter, +} + +impl Deref for UnrealCppAutogen { + type Target = CodeIndenter; + fn deref(&self) -> &Self::Target { + &self.output + } +} +impl std::ops::DerefMut for UnrealCppAutogen { + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.output + } +} + +impl UnrealCppAutogen { + fn new(extra_includes: &[&str], self_header: &str, include_version: bool) -> Self { + let mut output = CodeIndenter::new(String::new(), " "); + print_auto_generated_file_comment(&mut output); + if include_version { + print_auto_generated_version_comment(&mut output); + } + writeln!(output, "#pragma once"); + writeln!(output, "#include \"CoreMinimal.h\""); + writeln!(output, "#include \"BSATN/UESpacetimeDB.h\""); + + // Add specific includes based on what's needed + for include in extra_includes { + writeln!(output, "#include \"{include}\""); + } + writeln!(output, "#include \"{self_header}.g.generated.h\""); // need to include the generated header for Unreal's reflection + writeln!(output); + Self { output } + } + + fn new_cpp(extra_includes: &[&str]) -> Self { + let mut output = CodeIndenter::new(String::new(), " "); + print_auto_generated_file_comment(&mut output); + for include in extra_includes { + writeln!(output, "#include \"{include}\""); + } + writeln!(output); + Self { output } + } + + fn into_inner(self) -> String { + self.output.into_inner() + } +} + +// --------------------------------------------------------------------------- +// Helpers +// --------------------------------------------------------------------------- + +fn collect_optional_types(module: &ModuleDef) -> HashSet { + let mut optional_types = HashSet::new(); + + // Helper function to collect from a type + fn collect_from_type(module: &ModuleDef, ty: &AlgebraicTypeUse, out: &mut HashSet) { + match ty { + AlgebraicTypeUse::Option(inner) => { + // Generate the optional type name + let optional_name = get_optional_type_name(module, inner); + out.insert(optional_name); + // Recursively collect from inner type + collect_from_type(module, inner, out); + } + AlgebraicTypeUse::Array(elem) => { + collect_from_type(module, elem, out); + } + AlgebraicTypeUse::Ref(r) => { + // Check if the referenced type contains optionals + match &module.typespace_for_generate()[*r] { + AlgebraicTypeDef::Product(product) => { + for (_, field_ty) in &product.elements { + collect_from_type(module, field_ty, out); + } + } + AlgebraicTypeDef::Sum(sum) => { + for (_, variant_ty) in &sum.variants { + collect_from_type(module, variant_ty, out); + } + } + _ => {} + } + } + _ => {} + } + } + + // Collect from all tables + for table in module.tables() { + let product_type = module.typespace_for_generate()[table.product_type_ref] + .as_product() + .unwrap(); + for (_, field_ty) in &product_type.elements { + collect_from_type(module, field_ty, &mut optional_types); + } + } + + // Collect from all types + for typ in module.types() { + match &module.typespace_for_generate()[typ.ty] { + AlgebraicTypeDef::Product(product) => { + for (_, field_ty) in &product.elements { + collect_from_type(module, field_ty, &mut optional_types); + } + } + AlgebraicTypeDef::Sum(sum) => { + for (_, variant_ty) in &sum.variants { + collect_from_type(module, variant_ty, &mut optional_types); + } + } + _ => {} + } + } + + // Collect from reducer parameters + for reducer in iter_reducers(module) { + for (_, param_ty) in &reducer.params_for_generate.elements { + collect_from_type(module, param_ty, &mut optional_types); + } + } + + optional_types +} + +// Helper function to get C++ type for array elements in optional arrays +fn get_cpp_type_for_array_element(elem_type_str: &str, _: &ModuleDef, module_name: &str) -> String { + match elem_type_str { + "Bool" => "bool".to_string(), + "I8" => "int8".to_string(), + "U8" => "uint8".to_string(), + "I16" => "int16".to_string(), + "U16" => "uint16".to_string(), + "I32" => "int32".to_string(), + "U32" => "uint32".to_string(), + "I64" => "int64".to_string(), + "U64" => "uint64".to_string(), + "F32" => "float".to_string(), + "F64" => "double".to_string(), + "I128" => "FSpacetimeDBInt128".to_string(), + "U128" => "FSpacetimeDBUInt128".to_string(), + "I256" => "FSpacetimeDBInt256".to_string(), + "U256" => "FSpacetimeDBUInt256".to_string(), + "String" => "FString".to_string(), + "Identity" => "FSpacetimeDBIdentity".to_string(), + "ConnectionId" => "FSpacetimeDBConnectionId".to_string(), + "Timestamp" => "FSpacetimeDBTimestamp".to_string(), + "TimeDuration" => "FSpacetimeDBTimeDuration".to_string(), + "ScheduleAt" => "FSpacetimeDBScheduleAt".to_string(), + _ if elem_type_str.starts_with("Int32") => { + // Handle nested optionals like Int32 from OptionalInt32 + let module_name_pascal = module_name.to_case(Case::Pascal); + format!("F{module_name_pascal}OptionalInt32") + } + _ => { + format!("E{elem_type_str}Type") + } + } +} + +// Helper function to get array element type name for optional array types +fn get_array_element_type_name(module: &ModuleDef, elem: &AlgebraicTypeUse) -> String { + match elem { + AlgebraicTypeUse::Primitive(p) => match p { + PrimitiveType::Bool => "Bool".to_string(), + PrimitiveType::I8 => "I8".to_string(), + PrimitiveType::U8 => "U8".to_string(), + PrimitiveType::I16 => "I16".to_string(), + PrimitiveType::U16 => "U16".to_string(), + PrimitiveType::I32 => "I32".to_string(), + PrimitiveType::U32 => "U32".to_string(), + PrimitiveType::I64 => "I64".to_string(), + PrimitiveType::U64 => "U64".to_string(), + PrimitiveType::F32 => "F32".to_string(), + PrimitiveType::F64 => "F64".to_string(), + PrimitiveType::I128 => "I128".to_string(), + PrimitiveType::U128 => "U128".to_string(), + PrimitiveType::I256 => "I256".to_string(), + PrimitiveType::U256 => "U256".to_string(), + }, + AlgebraicTypeUse::String => "String".to_string(), + AlgebraicTypeUse::Identity => "Identity".to_string(), + AlgebraicTypeUse::ConnectionId => "ConnectionId".to_string(), + AlgebraicTypeUse::Timestamp => "Timestamp".to_string(), + AlgebraicTypeUse::TimeDuration => "TimeDuration".to_string(), + AlgebraicTypeUse::ScheduleAt => "ScheduleAt".to_string(), + AlgebraicTypeUse::Ref(r) => type_ref_name(module, *r), + AlgebraicTypeUse::Option(nested_inner) => { + // Handle optional elements in arrays like Vec> + let inner_optional_name = get_optional_type_name(module, nested_inner); + inner_optional_name + .strip_prefix("Optional") + .unwrap_or(&inner_optional_name) + .to_string() + } + _ => "Unknown".to_string(), + } +} + +// Get the name for an optional type (e.g., "OptionalString", "OptionalInt32") +fn get_optional_type_name(module: &ModuleDef, inner: &AlgebraicTypeUse) -> String { + match inner { + AlgebraicTypeUse::Primitive(p) => match p { + PrimitiveType::Bool => "OptionalBool".to_string(), + PrimitiveType::I8 => "OptionalInt8".to_string(), + PrimitiveType::U8 => "OptionalUInt8".to_string(), + PrimitiveType::I16 => "OptionalInt16".to_string(), + PrimitiveType::U16 => "OptionalUInt16".to_string(), + PrimitiveType::I32 => "OptionalInt32".to_string(), + PrimitiveType::U32 => "OptionalUInt32".to_string(), + PrimitiveType::I64 => "OptionalInt64".to_string(), + PrimitiveType::U64 => "OptionalUInt64".to_string(), + PrimitiveType::F32 => "OptionalFloat".to_string(), + PrimitiveType::F64 => "OptionalDouble".to_string(), + PrimitiveType::I128 => "OptionalInt128".to_string(), + PrimitiveType::U128 => "OptionalUInt128".to_string(), + PrimitiveType::I256 => "OptionalInt256".to_string(), + PrimitiveType::U256 => "OptionalUInt256".to_string(), + }, + AlgebraicTypeUse::String => "OptionalString".to_string(), + AlgebraicTypeUse::Identity => "OptionalIdentity".to_string(), + AlgebraicTypeUse::ConnectionId => "OptionalConnectionId".to_string(), + AlgebraicTypeUse::Timestamp => "OptionalTimestamp".to_string(), + AlgebraicTypeUse::TimeDuration => "OptionalTimeDuration".to_string(), + AlgebraicTypeUse::ScheduleAt => "OptionalScheduleAt".to_string(), + AlgebraicTypeUse::Array(elem) => { + // Generate specific optional array types based on element type + let elem_name = get_array_element_type_name(module, elem); + format!("OptionalVec{elem_name}") + } + AlgebraicTypeUse::Ref(r) => { + let type_name = type_ref_name(module, *r); + format!("Optional{type_name}") + } + AlgebraicTypeUse::Option(nested_inner) => { + // Handle nested optionals like Option> + let inner_optional_name = get_optional_type_name(module, nested_inner); + format!("Optional{inner_optional_name}") + } + _ => "OptionalUnknown".to_string(), + } +} + +// Generate the content for an optional type file +fn generate_optional_type(optional_name: &str, module: &ModuleDef, api_macro: &str, module_name: &str) -> String { + // Extract the inner type from the optional name + let inner_type_str = optional_name.strip_prefix("Optional").unwrap_or(optional_name); + + // Determine the C++ type for the inner value + let cpp_inner_type = match inner_type_str { + "Bool" => "bool".to_string(), + "Int8" => "int8".to_string(), + "UInt8" => "uint8".to_string(), + "Int16" => "int16".to_string(), + "UInt16" => "uint16".to_string(), + "Int32" => "int32".to_string(), + "UInt32" => "uint32".to_string(), + "Int64" => "int64".to_string(), + "UInt64" => "uint64".to_string(), + "Float" => "float".to_string(), + "Double" => "double".to_string(), + "Int128" => "FSpacetimeDBInt128".to_string(), + "UInt128" => "FSpacetimeDBUInt128".to_string(), + "Int256" => "FSpacetimeDBInt256".to_string(), + "UInt256" => "FSpacetimeDBUInt256".to_string(), + "String" => "FString".to_string(), + "Identity" => "FSpacetimeDBIdentity".to_string(), + "ConnectionId" => "FSpacetimeDBConnectionId".to_string(), + "Timestamp" => "FSpacetimeDBTimestamp".to_string(), + "TimeDuration" => "FSpacetimeDBTimeDuration".to_string(), + "ScheduleAt" => "FSpacetimeDBScheduleAt".to_string(), + "Array" => "TArray".to_string(), // Fallback for generic array type (should not be used with new system) + _ if inner_type_str.starts_with("Optional") => { + // Handle nested optionals like OptionalOptionalString + let module_name_pascal = module_name.to_case(Case::Pascal); + format!("F{module_name_pascal}{inner_type_str}") + } + _ if inner_type_str.starts_with("Vec") => { + // Handle OptionalVecXxx -> should use TArray + let elem_type_str = &inner_type_str[3..]; // Remove "Vec" prefix + let module_name_pascal = module_name.to_case(Case::Pascal); + format!("TArray") + } + _ if inner_type_str.starts_with("OptionalVec") => { + // Handle specific optional array types like OptionalVecI32, OptionalVecString, etc. + let elem_type_str = &inner_type_str[11..]; // Remove "OptionalVec" prefix + let cpp_elem_type = get_cpp_type_for_array_element(elem_type_str, module, module_name); + format!("TArray<{cpp_elem_type}>") + } + _ => { + // For custom types, check if it's an enum or struct + let is_enum = module.types().any(|type_def| { + let type_name = type_def + .name + .name_segments() + .last() + .map(|id| id.deref().to_string()) + .unwrap_or_else(|| "Unnamed".to_string()); + type_name == inner_type_str + && matches!( + module.typespace_for_generate()[type_def.ty], + AlgebraicTypeDef::Sum(_) | AlgebraicTypeDef::PlainEnum(_) + ) + }); + + if is_enum { + format!("E{inner_type_str}Type") + } else { + format!("F{inner_type_str}Type") + } + } + }; + + // Determine if we need extra includes + let mut extra_includes = vec![]; + match inner_type_str { + "Identity" | "ConnectionId" | "Timestamp" | "TimeDuration" | "ScheduleAt" => { + extra_includes.push("Types/Builtins.h".to_string()); + } + "Int128" | "UInt128" | "Int256" | "UInt256" => { + extra_includes.push("Types/LargeIntegers.h".to_string()); + } + "String" | "Bool" | "Int8" | "UInt8" | "Int16" | "UInt16" | "Int32" | "UInt32" | "Int64" | "UInt64" + | "Float" | "Double" | "Array" => { + // Basic types, no extra includes needed + } + _ if inner_type_str.starts_with("Vec") => { + // Handle OptionalVecXxx -> needs OptionalXxx include + let elem_type_str = &inner_type_str[3..]; // Remove "Vec" prefix + let module_name_pascal = module_name.to_case(Case::Pascal); + extra_includes.push(format!( + "ModuleBindings/Optionals/{module_name_pascal}Optional{elem_type_str}.g.h" + )); + } + _ if inner_type_str.starts_with("OptionalVec") => { + // Handle includes for specific optional array types + let elem_type_str = &inner_type_str[11..]; // Remove "OptionalVec" prefix + match elem_type_str { + "Identity" | "ConnectionId" | "Timestamp" | "TimeDuration" | "ScheduleAt" => { + extra_includes.push("Types/Builtins.h".to_string()); + } + "I128" | "U128" | "I256" | "U256" => { + extra_includes.push("Types/LargeIntegers.h".to_string()); + } + _ if elem_type_str.starts_with("Int32") => { + // Handle nested optional includes like Int32 from OptionalInt32 + let module_name_pascal = module_name.to_case(Case::Pascal); + extra_includes.push(format!( + "ModuleBindings/Optionals/{module_name_pascal}OptionalInt32.g.h" + )); + } + _ if !elem_type_str.starts_with("Bool") + && !elem_type_str.starts_with("I") + && !elem_type_str.starts_with("U") + && !elem_type_str.starts_with("F") + && elem_type_str != "String" => + { + // Custom type, need its header + extra_includes.push(format!("ModuleBindings/Types/{elem_type_str}Type.g.h")); + } + _ => {} // Primitive types don't need extra includes + } + } + _ if inner_type_str.starts_with("Optional") => { + // Nested optional, need its header + let module_name_pascal = module_name.to_case(Case::Pascal); + extra_includes.push(format!( + "ModuleBindings/Optionals/{module_name_pascal}{inner_type_str}.g.h" + )); + } + _ if !inner_type_str.starts_with("Int") && !inner_type_str.starts_with("UInt") => { + // Custom type, need its header + extra_includes.push(format!("ModuleBindings/Types/{inner_type_str}Type.g.h")); + } + _ => {} + } + + let extra_includes_refs: Vec<&str> = extra_includes.iter().map(|s| s.as_str()).collect(); + let module_name_pascal = module_name.to_case(Case::Pascal); + let struct_name = format!("F{module_name_pascal}{optional_name}"); + let header_name = format!("{module_name_pascal}{optional_name}"); + let mut output = UnrealCppAutogen::new(&extra_includes_refs, &header_name, false); + + writeln!(output, "USTRUCT(BlueprintType)"); + writeln!(output, "struct {api_macro} {struct_name}"); + writeln!(output, "{{"); + output.indent(1); + writeln!(output, "GENERATED_BODY()"); + writeln!(output); + + // Has value flag + writeln!( + output, + "UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = \"SpacetimeDB\")" + ); + writeln!(output, "bool bHasValue = false;"); + writeln!(output); + + // The actual value + // Check if the type is blueprintable + let is_blueprintable = match inner_type_str { + "UInt16" | "UInt32" | "UInt64" => false, + _ if inner_type_str.starts_with("Vec") => { + // Check blueprintability of array element type for VecXxx types + let elem_type_str = &inner_type_str[3..]; // Remove "Vec" prefix + match elem_type_str { + "UInt16" | "UInt32" | "UInt64" => false, // Unsigned types are not blueprintable + _ => true, + } + } + _ if inner_type_str.starts_with("OptionalVec") => { + // Check blueprintability of array element type + let elem_type_str = &inner_type_str[11..]; // Remove "OptionalVec" prefix + match elem_type_str { + "U16" | "U32" | "U64" => false, // Unsigned types are not blueprintable + _ => true, + } + } + _ => true, + }; + + if is_blueprintable { + writeln!(output, "UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = \"SpacetimeDB\", meta = (EditCondition = \"bHasValue\"))"); + } else { + writeln!( + output, + "// NOTE: {cpp_inner_type} field not exposed to Blueprint due to non-blueprintable elements" + ); + } + writeln!(output, "{cpp_inner_type} Value;"); + writeln!(output); + + // Constructors + writeln!(output, "{struct_name}() = default;"); + writeln!(output); + writeln!(output, "explicit {struct_name}(const {cpp_inner_type}& InValue)"); + writeln!(output, " : bHasValue(true), Value(InValue) {{}}"); + writeln!(output); + + // Helper methods + writeln!(output, "bool IsSet() const {{ return bHasValue; }}"); + writeln!(output, "void Reset() {{ bHasValue = false; }}"); + writeln!(output); + + // Operators + writeln!(output, "FORCEINLINE bool operator==(const {struct_name}& Other) const"); + writeln!(output, "{{"); + output.indent(1); + writeln!(output, "if (bHasValue != Other.bHasValue) return false;"); + writeln!(output, "return !bHasValue || Value == Other.Value;"); + output.dedent(1); + writeln!(output, "}}"); + writeln!(output); + + writeln!(output, "FORCEINLINE bool operator!=(const {struct_name}& Other) const"); + writeln!(output, "{{"); + output.indent(1); + writeln!(output, "return !(*this == Other);"); + output.dedent(1); + writeln!(output, "}}"); + + output.dedent(1); + writeln!(output, "}};"); + writeln!(output); + + // Add GetTypeHash implementation for optional types + writeln!(output, "/**"); + writeln!(output, " * Custom hash function for {struct_name}."); + writeln!(output, " * Hashes the HasValue flag and the Value if present."); + writeln!(output, " * @param Optional The {struct_name} instance to hash."); + writeln!(output, " * @return The combined hash value."); + writeln!(output, " */"); + writeln!(output, "FORCEINLINE uint32 GetTypeHash(const {struct_name}& Optional)"); + writeln!(output, "{{"); + output.indent(1); + writeln!(output, "uint32 Hash = GetTypeHash(Optional.bHasValue);"); + writeln!(output, "if (Optional.bHasValue)"); + writeln!(output, "{{"); + output.indent(1); + writeln!(output, "Hash = HashCombine(Hash, GetTypeHash(Optional.Value));"); + output.dedent(1); + writeln!(output, "}}"); + writeln!(output, "return Hash;"); + output.dedent(1); + writeln!(output, "}}"); + writeln!(output); + + // BSATN serialization support + writeln!(output, "namespace UE::SpacetimeDB"); + writeln!(output, "{{"); + + writeln!(output, " UE_SPACETIMEDB_ENABLE_TARRAY({struct_name});"); + + writeln!(output); + + writeln!(output, " UE_SPACETIMEDB_OPTIONAL({struct_name}, bHasValue, Value);"); + writeln!(output, "}}"); + + output.into_inner() +} + +fn autogen_cpp_struct( + module: &ModuleDef, + name: &str, // Changed to &str + product_type: &ProductTypeDef, + api_macro: &str, + module_name: &str, +) -> String { + let mut headers = HashSet::::new(); + + for (_, field_ty) in product_type { + collect_includes_for_type(module, field_ty, &mut headers, module_name); + } + + // Convert to `Vec<&str>` so UnrealCppAutogen::new works + let mut slices: Vec<&str> = headers.iter().map(|s| s.as_str()).collect(); + slices.sort(); // make output deterministic + + // --------- start writing file --------- + let type_name = format!("{name}Type"); + let mut output = UnrealCppAutogen::new(&slices, &type_name, false); + + writeln!(output, "USTRUCT(BlueprintType)"); + writeln!(output, "struct {api_macro} F{name}Type"); + writeln!(output, "{{"); + output.indent(1); + writeln!(output, "GENERATED_BODY()"); + writeln!(output); + + for (orig_name, ty) in product_type.into_iter() { + let field_name = orig_name.deref().to_case(Case::Pascal); + let ty_str = cpp_ty_fmt_with_module(module, ty, module_name).to_string(); + let field_decl = format!("{ty_str} {field_name}"); + + // Check if the type is blueprintable + if is_blueprintable(module, ty) { + writeln!( + output, + "UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = \"SpacetimeDB\")" + ); + } else { + // Add comment explaining why the field isn't exposed as UPROPERTY + writeln!( + output, + "// NOTE: {ty_str} field not exposed to Blueprint due to non-blueprintable elements" + ); + } + writeln!(output, "{field_decl};"); + writeln!(output); + } + + // Generate operator== and operator!= + writeln!(output, "FORCEINLINE bool operator==(const F{name}Type& Other) const"); + writeln!(output, "{{"); + output.indent(1); + + // Generate comparison for each field + let mut comparisons = Vec::new(); + for (orig_name, _) in product_type.into_iter() { + let field_name = orig_name.deref().to_case(Case::Pascal); + + // For value types, direct comparison + comparisons.push(format!("{field_name} == Other.{field_name}")); + } + + if comparisons.is_empty() { + writeln!(output, "return true;"); + } else { + writeln!(output, "return {};", comparisons.join(" && ")); + } + + output.dedent(1); + writeln!(output, "}}"); + writeln!(output); + + writeln!(output, "FORCEINLINE bool operator!=(const F{name}Type& Other) const"); + writeln!(output, "{{"); + output.indent(1); + writeln!(output, "return !(*this == Other);"); + output.dedent(1); + writeln!(output, "}}"); + + output.dedent(1); + writeln!(output, "}};"); + writeln!(output); + + // Add GetTypeHash implementation + writeln!(output, "/**"); + writeln!(output, " * Custom hash function for F{name}Type."); + writeln!( + output, + " * Combines the hashes of all fields that are compared in operator==." + ); + writeln!(output, " * @param {name}Type The F{name}Type instance to hash."); + writeln!(output, " * @return The combined hash value."); + writeln!(output, " */"); + writeln!(output, "FORCEINLINE uint32 GetTypeHash(const F{name}Type& {name}Type)"); + writeln!(output, "{{"); + output.indent(1); + + // Generate hash combining for each field + let field_names: Vec = product_type + .into_iter() + .map(|(name, _)| name.deref().to_case(Case::Pascal)) + .collect(); + + if field_names.is_empty() { + writeln!(output, "return 0; // Empty struct"); + } else { + // First field + writeln!(output, "uint32 Hash = GetTypeHash({}Type.{});", name, field_names[0]); + + // Combine with remaining fields + for field_name in field_names.iter().skip(1) { + writeln!( + output, + "Hash = HashCombine(Hash, GetTypeHash({name}Type.{field_name}));" + ); + } + + writeln!(output, "return Hash;"); + } + + output.dedent(1); + writeln!(output, "}}"); + writeln!(output); + + // Add BSATN serialization support + writeln!(output, "namespace UE::SpacetimeDB"); + writeln!(output, "{{"); + + writeln!(output, " UE_SPACETIMEDB_ENABLE_TARRAY(F{name}Type);"); + + writeln!(output); + + if field_names.is_empty() { + writeln!(output, " UE_SPACETIMEDB_STRUCT_EMPTY(F{name}Type);"); + } else { + writeln!( + output, + " UE_SPACETIMEDB_STRUCT(F{}Type, {});", + name, + field_names.join(", ") + ); + } + + writeln!(output, "}}"); + + output.into_inner() +} + +fn is_primitive_or_fstring(ty: &AlgebraicTypeUse) -> bool { + matches!(ty, AlgebraicTypeUse::Primitive(_) | AlgebraicTypeUse::String) +} + +// Helper function to check if a type should be passed by value (only true primitives) +fn should_pass_by_value_in_delegate(_module: &ModuleDef, ty: &AlgebraicTypeUse) -> bool { + match ty { + // Only basic C++ primitives should be passed by value in delegates + AlgebraicTypeUse::Primitive(p) => match p { + PrimitiveType::Bool + | PrimitiveType::I8 + | PrimitiveType::U8 + | PrimitiveType::I16 + | PrimitiveType::U16 + | PrimitiveType::I32 + | PrimitiveType::U32 + | PrimitiveType::I64 + | PrimitiveType::U64 + | PrimitiveType::F32 + | PrimitiveType::F64 => true, + // These are mapped to FSpacetimeDB types which are USTRUCTs + PrimitiveType::I128 | PrimitiveType::U128 | PrimitiveType::I256 | PrimitiveType::U256 => false, + }, + AlgebraicTypeUse::Unit => true, + // ALL built-in SpacetimeDB types are USTRUCTs, use const references + AlgebraicTypeUse::String => false, + AlgebraicTypeUse::Identity => false, // FSpacetimeDBIdentity is a USTRUCT + AlgebraicTypeUse::ConnectionId => false, // FSpacetimeDBConnectionId is a USTRUCT + AlgebraicTypeUse::Timestamp => false, // FSpacetimeDBTimestamp is a USTRUCT + AlgebraicTypeUse::TimeDuration => false, // FSpacetimeDBTimeDuration is a USTRUCT + // Custom structs/enums use const references + AlgebraicTypeUse::Ref(_) => false, + AlgebraicTypeUse::Array(_) => false, // Arrays use const references + AlgebraicTypeUse::Option(inner) => should_pass_by_value_in_delegate(_module, inner), + AlgebraicTypeUse::ScheduleAt => false, + AlgebraicTypeUse::Never => false, + } +} + +// Helper function to check if a type is blueprintable as a field (UPROPERTY) +fn is_blueprintable(module: &ModuleDef, ty: &AlgebraicTypeUse) -> bool { + match ty { + AlgebraicTypeUse::Primitive(p) => match p { + // These types are not blueprintable in Unreal Engine + PrimitiveType::I8 | PrimitiveType::I16 | PrimitiveType::U16 | PrimitiveType::U32 | PrimitiveType::U64 => { + false + } + // All other primitive types are blueprintable + _ => true, + }, + // Arrays are blueprintable if their element type is a struct/enum/primitive that can be used in Blueprint + // TArray is always blueprintable, even if the USTRUCT has non-blueprintable fields + AlgebraicTypeUse::Array(inner) => match inner.as_ref() { + AlgebraicTypeUse::Ref(r) => { + // TArray is blueprintable if CustomType is a UStruct/UEnum + match &module.typespace_for_generate()[*r] { + AlgebraicTypeDef::Product(_) => true, // TArray is always blueprintable + AlgebraicTypeDef::Sum(_) => true, // TArray is always blueprintable + AlgebraicTypeDef::PlainEnum(_) => true, // TArray is always blueprintable + } + } + // For primitive arrays, check if the primitive is blueprintable + _ => is_blueprintable(module, inner), + }, + AlgebraicTypeUse::String => true, + AlgebraicTypeUse::Identity => true, + AlgebraicTypeUse::ConnectionId => true, + AlgebraicTypeUse::Timestamp => true, + AlgebraicTypeUse::TimeDuration => true, + AlgebraicTypeUse::ScheduleAt => true, // ScheduleAt is blueprintable as a property (TObjectPtr) + AlgebraicTypeUse::Unit => true, + AlgebraicTypeUse::Ref(r) => { + // For struct/class fields, USTRUCTs and UENUMs are always blueprintable as field types + // The individual fields within the struct may not be accessible, but the struct itself can be used + match &module.typespace_for_generate()[*r] { + AlgebraicTypeDef::Product(_) => true, // USTRUCTs are always blueprintable as field types + AlgebraicTypeDef::Sum(_) => true, // Sum types are blueprintable + AlgebraicTypeDef::PlainEnum(_) => true, // Enums are blueprintable + } + } + AlgebraicTypeUse::Option(inner) => is_blueprintable(module, inner), + AlgebraicTypeUse::Never => false, + } +} + +// Helper function to check if a type can be used as a delegate parameter +// For delegates, structs are blueprintable even if they contain non-blueprintable fields +fn is_type_blueprintable_for_delegates(module: &ModuleDef, ty: &AlgebraicTypeUse) -> bool { + match ty { + AlgebraicTypeUse::Primitive(p) => match p { + // These types are not blueprintable in Unreal Engine + PrimitiveType::I8 | PrimitiveType::I16 | PrimitiveType::U16 | PrimitiveType::U32 | PrimitiveType::U64 => { + false + } + // All other primitive types are blueprintable + _ => true, + }, + // Arrays are blueprintable only if their element type is blueprintable for delegates + AlgebraicTypeUse::Array(inner) => is_type_blueprintable_for_delegates(module, inner), + AlgebraicTypeUse::String => true, + AlgebraicTypeUse::Identity => true, + AlgebraicTypeUse::ConnectionId => true, + AlgebraicTypeUse::Timestamp => true, + AlgebraicTypeUse::TimeDuration => true, + AlgebraicTypeUse::ScheduleAt => true, + AlgebraicTypeUse::Unit => true, + AlgebraicTypeUse::Ref(r) => { + // For delegate parameters, any USTRUCT is blueprintable regardless of its fields + match &module.typespace_for_generate()[*r] { + AlgebraicTypeDef::Product(_) => true, // All structs are blueprintable as delegate params + _ => true, // Enums and sum types are generally blueprintable + } + } + AlgebraicTypeUse::Option(inner) => is_type_blueprintable_for_delegates(module, inner), + AlgebraicTypeUse::Never => false, + } +} + +// Helper function to generate a C++ enum definition +fn autogen_cpp_enum(name: &str, enum_type: &PlainEnumTypeDef) -> String { + // Changed name to &str + + let type_name = format!("{name}Type"); + let mut output = UnrealCppAutogen::new(&[], &type_name, false); + writeln!(output, "UENUM(BlueprintType)"); + writeln!(output, "enum class E{name}Type : uint8"); + writeln!(output, "{{"); + output.indent(1); + + for variant in &*enum_type.variants { + writeln!(output, "{},", variant.deref().to_case(Case::Pascal)); // Ensure variants are PascalCase, common for UE enums + } + + output.dedent(1); + writeln!(output, "}};"); + writeln!(output); + + // Add BSATN serialization support + writeln!(output, "namespace UE::SpacetimeDB"); + writeln!(output, "{{"); + + writeln!(output, " UE_SPACETIMEDB_ENABLE_TARRAY(E{name}Type);"); + + writeln!(output, "}}"); + + output.into_inner() +} + +fn autogen_cpp_sum( + module: &ModuleDef, + name: &str, + sum_type: &SumTypeDef, + api_macro: &str, + module_name: &str, +) -> String { + use convert_case::Case; + + /* ------------------------------------------------------------------ */ + /* 1. gather #includes for every variant payload -------------------- */ + /* ------------------------------------------------------------------ */ + let mut includes = HashSet::::new(); + for (_, alg_ty) in &sum_type.variants { + collect_includes_for_type(module, alg_ty, &mut includes, module_name); + } + + includes.insert("Kismet/BlueprintFunctionLibrary.h".to_string()); + + let include_slices: Vec<&str> = includes.iter().map(|s| s.as_str()).collect(); + + // /* ------------------------------------------------------------------ */ + // /* 2. emit boiler-plate + forward decls ----------------------------- */ + // /* ------------------------------------------------------------------ */ + let type_name = format!("{name}Type"); + let mut output = UnrealCppAutogen::new(&include_slices, &type_name, false); + + /* ------------------------------------------------------------------ */ + /* 3. generate the tag enum ----------------------------------------- */ + /* ------------------------------------------------------------------ */ + writeln!(output, "UENUM(BlueprintType)\nenum class E{name}Tag : uint8\n{{"); + + let mut variant_type = HashSet::::new(); + + for (ix, (variant, _variant_type)) in sum_type.variants.iter().enumerate() { + let comma = if ix + 1 == sum_type.variants.len() { "" } else { "," }; + writeln!(output, " {}{}", variant.to_case(Case::Pascal), comma); + + let variant_cpp_type = cpp_ty_fmt_with_module(module, _variant_type, module_name).to_string(); + variant_type.insert(variant_cpp_type); + } + writeln!(output, "}};\n"); + + /* ------------------------------------------------------------------ */ + /* 4. generate the UStruct ----------------------------------- */ + /* ------------------------------------------------------------------ */ + + writeln!(output, "USTRUCT(BlueprintType)\nstruct {api_macro} F{name}Type\n{{"); + writeln!(output, " GENERATED_BODY()\n"); + + // default ctor + writeln!(output, "public:\n F{name}Type() = default;\n"); + + // data + tag + writeln!( + output, + " TVariant<{}> MessageData;", + variant_type + .iter() + .map(|s| s.as_str()) + .collect::>() + .join(", ") + ); + + writeln!(output); + + writeln!(output, " UPROPERTY(BlueprintReadOnly)\n E{name}Tag Tag;\n"); + + /* 4a. Static factories per variant -------------------------------- */ + for (variant_name, variant_type) in &sum_type.variants { + let pas = variant_name.to_case(Case::Pascal); + let variant_cpp_type = cpp_ty_fmt_with_module(module, variant_type, module_name).to_string(); + let param_type = format!("const {variant_cpp_type}& "); + + writeln!(output, " static F{name}Type {pas}({param_type}Value)\n {{"); + + writeln!(output, " F{name}Type Obj;"); + writeln!(output, " Obj.Tag = E{name}Tag::{pas};"); + + writeln!( + output, + " Obj.MessageData.Set<{variant_cpp_type}>(Value);\n return Obj;\n }}\n" + ); + } + + /* 4b. Get/Is helpers ---------------------------------------------- */ + for (variant_name, variant_type) in &sum_type.variants { + let pas = variant_name.to_case(Case::Pascal); + let variant_cpp_type = cpp_ty_fmt_with_module(module, variant_type, module_name).to_string(); + + // Is* + writeln!( + output, + " FORCEINLINE bool Is{pas}() const {{ return Tag == E{name}Tag::{pas}; }}" + ); + + // GetAs* + writeln!( + output, + "\n FORCEINLINE {variant_cpp_type} GetAs{pas}() const\n {{" + ); + + writeln!( + output, + " ensureMsgf(Is{pas}(), TEXT(\"MessageData does not hold {pas}!\"));\n return MessageData.Get<{variant_cpp_type}>();\n }}\n" + ); + } + + // Add inline equality operators + writeln!(output, " // Inline equality operators"); + writeln!( + output, + " FORCEINLINE bool operator==(const F{name}Type& Other) const" + ); + writeln!(output, " {{"); + writeln!(output, " if (Tag != Other.Tag) return false;"); + writeln!(output); + writeln!(output, " switch (Tag)"); + writeln!(output, " {{"); + + // Generate cases for each variant + for (variant_name, _variant_type) in &sum_type.variants { + let pas = variant_name.to_case(Case::Pascal); + + writeln!(output, " case E{name}Tag::{pas}:"); + writeln!( + output, + " return GetAs{variant_name}() == Other.GetAs{variant_name}();" + ); + } + + writeln!(output, " default:"); + writeln!(output, " return false;"); + writeln!(output, " }}"); + writeln!(output, " }}"); + writeln!(output); + + writeln!( + output, + " FORCEINLINE bool operator!=(const F{name}Type& Other) const" + ); + writeln!(output, " {{"); + writeln!(output, " return !(*this == Other);"); + writeln!(output, " }}"); + + writeln!(output, "}};\n"); + + // Add GetTypeHash implementation + writeln!(output, "/**"); + writeln!(output, " * Custom hash function for F{name}Type."); + writeln!( + output, + " * Combines the hashes of all fields that are compared in operator==." + ); + writeln!(output, " * @param {name}Type The F{name}Type instance to hash."); + writeln!(output, " * @return The combined hash value."); + writeln!(output, " */"); + writeln!(output, "FORCEINLINE uint32 GetTypeHash(const F{name}Type& {name})"); + writeln!(output, "{{"); + writeln!( + output, + " const uint32 TagHash = GetTypeHash(static_cast({name}.Tag));" + ); + + writeln!(output, " switch ({name}.Tag)"); + writeln!(output, " {{"); + + output.indent(1); + + for (variant_name, variant_type) in &sum_type.variants { + let pascal_variant = variant_name.deref().to_case(Case::Pascal); + + let hash_fn_prefix = if is_primitive_or_fstring(variant_type) { + "GetTypeHash" + } else { + "::GetTypeHash" + }; + + writeln!( + output, + " case E{name}Tag::{pascal_variant}: return HashCombine(TagHash, {hash_fn_prefix}({name}.GetAs{pascal_variant}()));" + ); + } + + writeln!(output, " default: return TagHash;"); + + output.dedent(1); + writeln!(output, " }}"); + writeln!(output, "}}"); + writeln!(output); + + // Add BSATN serialization support for tagged variant + writeln!(output, "namespace UE::SpacetimeDB"); + writeln!(output, "{{"); + + writeln!(output, " UE_SPACETIMEDB_ENABLE_TARRAY(F{name}Type);"); + + writeln!(output); + + writeln!(output, " UE_SPACETIMEDB_TAGGED_ENUM("); + writeln!(output, " F{name}Type,"); + writeln!(output, " E{name}Tag,"); + writeln!(output, " MessageData,"); + + // Generate the variant list + let variant_count = sum_type.variants.len(); + for (idx, (variant_name, variant_type)) in sum_type.variants.iter().enumerate() { + let variant_pascal = variant_name.to_case(Case::Pascal); + let variant_cpp_type = cpp_ty_fmt_with_module(module, variant_type, module_name).to_string(); + + if idx < variant_count - 1 { + writeln!(output, " {variant_pascal}, {variant_cpp_type},"); + } else { + writeln!(output, " {variant_pascal}, {variant_cpp_type}"); + } + } + + writeln!(output, " );"); + writeln!(output, "}}"); + writeln!(output); + + // Blueprint Function Library support for BPs + writeln!( + output, + "UCLASS()\nclass {api_macro} U{name}BpLib : public UBlueprintFunctionLibrary\n{{" + ); + writeln!(output, " GENERATED_BODY()\n"); + + writeln!(output, "private:"); + + for (variant_name, variant_type) in &sum_type.variants { + let pas = variant_name.to_case(Case::Pascal); + let variant_cpp_type = cpp_ty_fmt_with_module(module, variant_type, module_name).to_string(); + + // ctor functions + if is_blueprintable(module, variant_type) { + writeln!( + output, + " UFUNCTION(BlueprintCallable, Category = \"SpacetimeDB|{name}\")" + ); + } else { + writeln!( + output, + " // NOTE: Not exposed to Blueprint because {variant_cpp_type} types are not Blueprint-compatible" + ); + } + + writeln!( + output, + " static F{name}Type {pas}(const {variant_cpp_type}& InValue)" + ); + writeln!(output, " {{"); + writeln!(output, " return F{name}Type::{pas}(InValue);"); + writeln!(output, " }}"); + writeln!(output); + + // Is* + writeln!( + output, + " UFUNCTION(BlueprintPure, Category = \"SpacetimeDB|{name}\")" + ); + writeln!( + output, + " static bool Is{pas}(const F{name}Type& InValue) {{ return InValue.Is{pas}(); }}" + ); + + writeln!(output); + + // GetAs* + if is_blueprintable(module, variant_type) { + writeln!( + output, + " UFUNCTION(BlueprintPure, Category = \"SpacetimeDB|{name}\")" + ); + } else { + writeln!( + output, + " // NOTE: Not exposed to Blueprint because {variant_cpp_type} types are not Blueprint-compatible" + ); + } + writeln!( + output, + " static {variant_cpp_type} GetAs{pas}(const F{name}Type& InValue)\n {{" + ); + + writeln!(output, " return InValue.GetAs{pas}();\n }}\n"); + } + + writeln!(output, "}};"); + + output.into_inner() +} + +// Helper trait for Identifier case conversion +trait IdentifierCasing { + fn to_case(&self, case: Case) -> String; +} + +impl IdentifierCasing for Identifier { + fn to_case(&self, case: Case) -> String { + self.deref().to_case(case) + } +} + +fn cpp_ty_fmt_with_module<'a>( + module: &'a ModuleDef, + ty: &'a AlgebraicTypeUse, + module_name: &'a str, +) -> impl fmt::Display + 'a { + cpp_ty_fmt_impl(module, ty, module_name) +} + +fn cpp_ty_fmt_blueprint_compatible<'a>( + module: &'a ModuleDef, + ty: &'a AlgebraicTypeUse, + module_name: &'a str, +) -> impl fmt::Display + 'a { + cpp_ty_fmt_blueprint_impl(module, ty, module_name) +} + +fn cpp_ty_fmt_blueprint_impl<'a>( + module: &'a ModuleDef, + ty: &'a AlgebraicTypeUse, + module_name: &'a str, +) -> impl fmt::Display + 'a { + fmt_fn(move |f| match ty { + AlgebraicTypeUse::Array(elem) => { + let elem_type = cpp_ty_fmt_with_module(module, elem, module_name).to_string(); + write!(f, "TArray<{elem_type}>") + } + // For all other types, use the regular implementation + _ => { + let display_obj = cpp_ty_fmt_with_module(module, ty, module_name); + write!(f, "{display_obj}") + } + }) +} + +fn cpp_ty_fmt_impl<'a>( + module: &'a ModuleDef, + ty: &'a AlgebraicTypeUse, + module_name: &'a str, +) -> impl fmt::Display + 'a { + fmt_fn(move |f| match ty { + // --------- primitives etc --------- + AlgebraicTypeUse::Primitive(p) => f.write_str(match p { + PrimitiveType::Bool => "bool", + PrimitiveType::I8 => "int8", + PrimitiveType::U8 => "uint8", + PrimitiveType::I16 => "int16", + PrimitiveType::U16 => "uint16", + PrimitiveType::I32 => "int32", + PrimitiveType::U32 => "uint32", + PrimitiveType::I64 => "int64", + PrimitiveType::U64 => "uint64", + PrimitiveType::F32 => "float", + PrimitiveType::F64 => "double", + PrimitiveType::I128 => "FSpacetimeDBInt128", + PrimitiveType::U128 => "FSpacetimeDBUInt128", + PrimitiveType::I256 => "FSpacetimeDBInt256", + PrimitiveType::U256 => "FSpacetimeDBUInt256", + }), + + AlgebraicTypeUse::Array(elem) if matches!(elem.as_ref(), AlgebraicTypeUse::Primitive(PrimitiveType::U8)) => { + f.write_str("TArray") + } + + AlgebraicTypeUse::Array(elem) => { + let elem_type = cpp_ty_fmt_impl(module, elem, module_name).to_string(); + write!(f, "TArray<{elem_type}>") + } + + AlgebraicTypeUse::String => f.write_str("FString"), + AlgebraicTypeUse::Identity => f.write_str("FSpacetimeDBIdentity"), + AlgebraicTypeUse::ConnectionId => f.write_str("FSpacetimeDBConnectionId"), + AlgebraicTypeUse::Timestamp => f.write_str("FSpacetimeDBTimestamp"), + AlgebraicTypeUse::TimeDuration => f.write_str("FSpacetimeDBTimeDuration"), + AlgebraicTypeUse::ScheduleAt => f.write_str("FSpacetimeDBScheduleAt"), + AlgebraicTypeUse::Unit => f.write_str("FSpacetimeDBUnit"), + + // --------- references to user-defined types --------- + AlgebraicTypeUse::Ref(r) => { + let scoped = type_ref_name(module, *r); // PascalCase + match &module.typespace_for_generate()[*r] { + AlgebraicTypeDef::PlainEnum(_) => write!(f, "E{scoped}Type"), // enum → EFooType + AlgebraicTypeDef::Product(_) => write!(f, "F{scoped}Type"), // struct/record → FFooType + AlgebraicTypeDef::Sum(_) => write!(f, "F{scoped}Type"), // sum type → FFooType (UStruct) + } + } + + // Options use the generated optional types + AlgebraicTypeUse::Option(inner) => { + let optional_name = get_optional_type_name(module, inner); + if module_name.is_empty() { + write!(f, "F{optional_name}") + } else { + let module_name_pascal = module_name.to_case(Case::Pascal); + write!(f, "F{module_name_pascal}{optional_name}") + } + } + + AlgebraicTypeUse::Never => unreachable!("never type"), + }) +} + +// Given an `AlgebraicTypeUse`, add every referenced type’s generated +// header name (`".g.h"`) into `out` (a `HashSet` avoids dups). +fn collect_includes_for_type( + module: &ModuleDef, + ty: &AlgebraicTypeUse, + out: &mut std::collections::HashSet, + module_name: &str, +) { + use AlgebraicTypeUse::*; + match ty { + Ref(r) => { + let header = format!("ModuleBindings/Types/{}Type.g.h", type_ref_name(module, *r)); + out.insert(header); + } + Option(inner) => { + // Add the optional type header + let optional_name = get_optional_type_name(module, inner); + let module_name_pascal = module_name.to_case(Case::Pascal); + let header = format!("ModuleBindings/Optionals/{module_name_pascal}{optional_name}.g.h"); + out.insert(header); + // Also collect includes for the inner type + collect_includes_for_type(module, inner, out, module_name); + } + Array(inner) => { + collect_includes_for_type(module, inner, out, module_name); + } + // Builtin types that require Builtins.h (also includes LargeIntegers.h) + Identity | ConnectionId | Timestamp | TimeDuration | ScheduleAt => { + out.insert("Types/Builtins.h".to_string()); + } + // Large integer primitives also need Builtins.h (for LargeIntegers.h) + Primitive(PrimitiveType::I128) + | Primitive(PrimitiveType::U128) + | Primitive(PrimitiveType::I256) + | Primitive(PrimitiveType::U256) => { + out.insert("Types/Builtins.h".to_string()); + } + // String type - we use FString directly, no special includes needed + String => { + // FString is a native Unreal type, no additional includes required + } + // Other primitive types - we use native C++ types directly, no special includes needed + Primitive(_) => { + // Native types like uint8, int32, float, etc. don't need special includes + } + // Unit type needs UnitType.h header + Unit => { + out.insert("Types/UnitType.h".to_string()); + } + // Never type needs no special headers + Never => {} + } +} + +// UnrealCPP-specific type reference name function that preserves original case +fn type_ref_name(module: &ModuleDef, typeref: spacetimedb_lib::sats::AlgebraicTypeRef) -> String { + let (name, _def) = module.type_def_from_ref(typeref).unwrap(); + // Preserve original case instead of applying Pascal case conversion + name.name_segments() + .last() + .map(|id| id.deref().to_string()) + .unwrap_or_else(|| "Unnamed".to_string()) +} diff --git a/crates/testing/src/lib.rs b/crates/testing/src/lib.rs index 4500f6a0409..61e7adc29c5 100644 --- a/crates/testing/src/lib.rs +++ b/crates/testing/src/lib.rs @@ -1,7 +1,9 @@ -use clap::Command; +use clap::Command as ClapCommand; use spacetimedb_cli::Config; use spacetimedb_paths::SpacetimePaths; use spacetimedb_schema::def::ModuleDef; +use std::env; +use std::process::Command; pub mod modules; pub mod sdk; @@ -13,19 +15,46 @@ pub fn invoke_cli(paths: &SpacetimePaths, args: &[&str]) { .enable_all() .build() .unwrap(); - static ref COMMAND: Command = Command::new("spacetime").no_binary_name(true).subcommands(spacetimedb_cli::get_subcommands()); + static ref COMMAND: ClapCommand = ClapCommand::new("spacetime").no_binary_name(true).subcommands(spacetimedb_cli::get_subcommands()); } - let config = Config::new_with_localhost(paths.cli_config_dir.cli_toml()); - let args = COMMAND.clone().get_matches_from(args); - let (cmd, args) = args.subcommand().expect("Could not split subcommand and args"); + // Parse once so we can decide which path to use. + let matches = COMMAND.clone().get_matches_from(args); + let (cmd, sub_args) = matches.subcommand().expect("Could not split subcommand and args"); + + // If CUSTOM_SPACETIMEDB == true, try to use CUSTOM_SPACETIMEDB_PATH and shell out. + let use_custom = env::var("CUSTOM_SPACETIMEDB") + .map(|v| v.eq_ignore_ascii_case("true")) + .unwrap_or(false); + + if use_custom && cmd == "generate" { + if let Ok(custom_path) = env::var("CUSTOM_SPACETIMEDB_PATH") { + // Call the dev CLI exactly like the manual command: + // cargo run --bin spacetimedb-cli -- generate ... + let status = Command::new("cargo") + .current_dir(&custom_path) // Ensure we run in the custom path directory + .arg("run") + .arg("--bin") + .arg("spacetimedb-cli") + .arg("--") + .args(args) // `args` are like ["generate", "--lang", ...] + .status() + .expect("Failed to run custom SpacetimeDB CLI via cargo"); + assert!(status.success(), "Custom SpacetimeDB CLI failed"); + return; + } + // If CUSTOM_SPACETIMEDB_PATH is missing, fall through to the default behavior. + } + + // Default: run in-process CLI (fast/path-friendly for tests). + let config = Config::new_with_localhost(paths.cli_config_dir.cli_toml()); RUNTIME .block_on(async { if cmd == "generate" { - spacetimedb_cli::generate::exec_ex(config, args, extract_descriptions).await + spacetimedb_cli::generate::exec_ex(config, sub_args, extract_descriptions).await } else { - spacetimedb_cli::exec_subcommand(config, paths, None, cmd, args) + spacetimedb_cli::exec_subcommand(config, paths, None, cmd, sub_args) .await .map(drop) } diff --git a/crates/testing/src/sdk.rs b/crates/testing/src/sdk.rs index 0c2b3751724..5eb18e9ea2d 100644 --- a/crates/testing/src/sdk.rs +++ b/crates/testing/src/sdk.rs @@ -70,14 +70,24 @@ pub struct Test { module_name: String, /// An arbitrary path to the client project. + /// For unrealcpp this should be the .uproject root directory. client_project: String, /// A language suitable for the `spacetime generate` CLI command. + /// + /// The string `"unrealcpp"` is recognized and treated differently here + /// because code-generation takes different arguments for Unreal client projects. + /// Tests written for the Unreal client SDK must specify exactly `"unrealcpp"`, + /// not any of the aliases the SpacetimeDB CLI's `generate` command would accept. generate_language: String, /// A relative path within the `client_project` to place the module bindings. /// - /// Usually `src/module_bindings` + /// Usually `src/module_bindings`. + /// + /// For Unreal tests (i.e. when `generate_language == "unrealcpp"`), + /// this is instead the Unreal module name, and so should be a non-path string. + /// In this case, it will usually be `"TestClient"`. generate_subdir: String, /// A shell command to compile the client project. @@ -98,6 +108,10 @@ pub const TEST_MODULE_PROJECT_ENV_VAR: &str = "SPACETIME_SDK_TEST_MODULE_PROJECT pub const TEST_DB_NAME_ENV_VAR: &str = "SPACETIME_SDK_TEST_DB_NAME"; pub const TEST_CLIENT_PROJECT_ENV_VAR: &str = "SPACETIME_SDK_TEST_CLIENT_PROJECT"; +fn language_is_unreal(language: &str) -> bool { + language.eq_ignore_ascii_case("unrealcpp") +} + impl Test { pub fn builder() -> TestBuilder { TestBuilder::default() @@ -142,16 +156,36 @@ fn random_module_name() -> String { .collect() } +/// Memoize computing `body` based on `key` by storing the result in a [`HashMap`]. +/// +/// The hash map is protected by a [`Mutex`]. +/// Only a single operator may be computing a value at a time. +/// Computing the values must not be re-entrant / recursive. +/// +/// The key(s) of the hash map must already be in scope as variables. +/// +/// The keys may be either a single variable or a tuple of variables. +/// +/// The key types must be `'static`, `Clone`, `Eq` and `Hash`, as they'll be stored in a [`HashMap`]. +/// +/// Used in this file primarily for running expensive and side-effecting subprocesses +/// like compilation or code generation. macro_rules! memoized { + // Recursive case: rewrite a single `key` to be a 1-tuple `(key,)`. (|$key:ident: $key_ty:ty| -> $value_ty:ty $body:block) => {{ + memoized!(|($key,): ($key_ty,)| -> $value_ty $body) + }}; + + // Base case: keys are a tuple. + (|($($key_tuple:ident),* $(,)?): $key_ty:ty| -> $value_ty:ty $body:block) => {{ static MEMOIZED: Mutex>> = Mutex::new(None); MEMOIZED .lock() .unwrap() .get_or_insert_default() - .entry($key) - .or_insert_with_key(|$key| -> $value_ty { $body }) + .entry(($($key_tuple,)*)) + .or_insert_with_key(|($($key_tuple,)*)| -> $value_ty { $body }) .clone() }}; } @@ -190,6 +224,24 @@ fn publish_module(paths: &SpacetimePaths, wasm_file: &str) -> String { name } +/// Run `spacetime generate` to generate client bindings into the `client_project`. +/// +/// `language` should be a string suitable for the `--lang` argument to `spacetime generate`. +/// `"unrealcpp"` is special-cased to account for the CLI taking different arguments. +/// Tests of the Unreal client SDK must use exactly that string, not any alias accepted by the CLI. +/// +/// `wasm_file` is a path to a compiled WASM blob, as returned by [`compile_module`]. +/// +/// `client_project` and `generate_subdir` will be the values set in the [`Test`]. +/// These have different semantics depending on whether `language` is `"unrealcpp"`. +/// +/// For Unreal SDK tests, the `client_project` should be the directory which contains the `.uproject` file, +/// and `generate_subdir` should be the Unreal module name. +/// +/// For non-unreal SDK tests, the `client_project` may be an arbitrary path, +/// and the `generate_subdir` an arbitrary relative path within it. +/// These will be combined as `"{client_project}/{generate_subdir}"` to produce the `--out-dir`. +/// /// Note: this function is memoized to ensure we only run `spacetime generate` once for each target directory. /// /// Without this lock, if multiple `Test`s ran concurrently in the same process @@ -226,30 +278,65 @@ fn generate_bindings( client_project: &str, generate_subdir: &str, ) { - let generate_dir = format!("{client_project}/{generate_subdir}"); + // We need these to be owned `String`s so we can memoize on them. + let client_project = client_project.to_owned(); + let generate_subdir = generate_subdir.to_owned(); + + // Codegen is side-effecting and doesn't meaningfully return a Rust value, + // so our memoization has unit as the value. + // This makes it run at most once for each key. + memoized!(|(client_project, generate_subdir): (String, String)| -> () { + let mut args: Vec<&str> = vec!["generate", "--lang", language, "--bin-path", wasm_file]; + + let generate_dir: String; + + // `generate --lang unrealcpp` takes different arguments from non-Unreal languages + // to account for some quirks of Unreal project structure. + if language_is_unreal(language) { + // For unreal, we use `client_project` as the uproject directory, + // and `generate_subdir` as the module name. + args.extend_from_slice(&["--uproject-dir", client_project]); + args.extend_from_slice(&["--module-name", generate_subdir]); + } else { + generate_dir = format!("{client_project}/{generate_subdir}"); + create_dir_all(&generate_dir).unwrap(); + args.extend_from_slice(&["--out-dir", &generate_dir]); + } - memoized!(|generate_dir: String| -> () { - create_dir_all(generate_dir).expect("Error creating generate subdir"); - invoke_cli( - paths, - &[ - "generate", - "--lang", - language, - "--bin-path", - wasm_file, - "--out-dir", - generate_dir, - ], - ); + invoke_cli(paths, &args); }) } -fn split_command_string(command: &str) -> (&str, Vec<&str>) { - let mut iter = command.split(' '); +fn split_command_string(command: &str) -> (String, Vec) { + let mut parts = Vec::new(); + let mut current = String::new(); + let mut in_quotes = false; + let mut quote_char = '\0'; + + for c in command.chars() { + match c { + '"' | '\'' if !in_quotes => { + in_quotes = true; + quote_char = c; + } + '"' | '\'' if in_quotes && c == quote_char => { + in_quotes = false; + } + ' ' if !in_quotes => { + if !current.is_empty() { + parts.push(std::mem::take(&mut current)); + } + } + _ => current.push(c), + } + } + if !current.is_empty() { + parts.push(current); + } + + let mut iter = parts.into_iter(); let exe = iter.next().expect("Command should have at least a program name"); - let args = iter.collect(); - (exe, args) + (exe, iter.collect()) } // Note: this function is memoized to ensure we only compile each client once. @@ -339,6 +426,14 @@ impl TestBuilder { } } + // Unreal-only: names the Unreal module into which bindings are generated. + pub fn with_unreal_module(self, unreal_module_name: impl Into) -> Self { + TestBuilder { + generate_subdir: Some(unreal_module_name.into()), + ..self + } + } + pub fn with_compile_command(self, compile_command: impl Into) -> Self { TestBuilder { compile_command: Some(compile_command.into()), @@ -354,6 +449,19 @@ impl TestBuilder { } pub fn build(self) -> Test { + let generate_language = self + .generate_language + .expect("Supply a client language using TestBuilder::with_language"); + + // For non-Unreal: require generate_subdir as before. + // For Unreal: ignore generate_subdir entirely, but still populate with a harmless placeholder. + let msg = if language_is_unreal(&generate_language) { + "Supply an Unreal module name using TestBuilder::with_unreal_module" + } else { + "Supply a module_bindings subdirectory using TestBuilder::with_bindings_dir" + }; + let generate_subdir = self.generate_subdir.expect(msg); + Test { name: self.name.expect("Supply a test name using TestBuilder::with_name"), module_name: self @@ -362,12 +470,8 @@ impl TestBuilder { client_project: self .client_project .expect("Supply a client project directory using TestBuilder::with_client"), - generate_language: self - .generate_language - .expect("Supply a client language using TestBuilder::with_language"), - generate_subdir: self - .generate_subdir - .expect("Supply a module_bindings subdirectory using TestBuilder::with_bindings_dir"), + generate_language, + generate_subdir, compile_command: self .compile_command .expect("Supply a compile command using TestBuilder::with_compile_command"), diff --git a/docs/docs/cli-reference.md b/docs/docs/cli-reference.md index 42d61171e49..c09b1174ea1 100644 --- a/docs/docs/cli-reference.md +++ b/docs/docs/cli-reference.md @@ -241,7 +241,7 @@ Run `spacetime rename --help` for more detailed information. Generate client files for a spacetime module. -**Usage:** `spacetime spacetime generate --lang --out-dir [--project-path | --bin-path ]` +**Usage:** `spacetime spacetime generate --lang --out-dir [--project-path | --bin-path | --module-name | --uproject-dir ]` Run `spacetime help publish` for more detailed information. @@ -252,12 +252,14 @@ Run `spacetime help publish` for more detailed information. Default value: `.` * `-o`, `--out-dir ` — The system path (absolute or relative) to the generate output directory +* `--uproject-dir ` — Path to the Unreal project directory, replaces --out-dir for Unreal generation (only used with --lang unrealcpp) * `--namespace ` — The namespace that should be used Default value: `SpacetimeDB.Types` +* `--module-name ` — The module name that should be used for DLL export macros (required for lang unrealcpp) * `-l`, `--lang ` — The language to generate - Possible values: `csharp`, `typescript`, `rust` + Possible values: `csharp`, `typescript`, `rust`, `unrealcpp` * `--build-options ` — Options to pass to the build command, for example --build-options='--lint-dir=' Default value: \`\` diff --git a/sdks/unreal/.gitignore b/sdks/unreal/.gitignore new file mode 100644 index 00000000000..6df606c19d7 --- /dev/null +++ b/sdks/unreal/.gitignore @@ -0,0 +1,30 @@ +# Unreal plugin build artifacts +Binaries/ +Intermediate/ +DerivedDataCache/ +Saved/ +.vs/ +.idea/ +*.VC.db +*.VC.opendb +*.sln +*.opensdf +*.sdf +*.suo +*.user +*.userprefs +*.log +*.tlog +*.ipch +*.obj +*.pch +*.pdb +*.idb +*.aps +*.ncb +*.cache +*.sbr +*.db +*.xcodeproj +xcuserdata/ +/sdks/unreal/tests/TestClient/TestResults \ No newline at end of file diff --git a/sdks/unreal/Cargo.toml b/sdks/unreal/Cargo.toml new file mode 100644 index 00000000000..cfee1f430d2 --- /dev/null +++ b/sdks/unreal/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "sdk-unreal-test-harness" +#version = "0.1.0" +#edition = "2021" +#publish = false + +version.workspace = true +edition.workspace = true +license-file = "LICENSE" +description = "An Unreal SDK for clients to interface with SpacetimeDB" + +[dev-dependencies] +spacetimedb-testing = { path = "../../crates/testing" } +serial_test.workspace = true diff --git a/sdks/unreal/DEVELOP.md b/sdks/unreal/DEVELOP.md new file mode 100644 index 00000000000..ceb414e35cf --- /dev/null +++ b/sdks/unreal/DEVELOP.md @@ -0,0 +1,44 @@ +# Notes for maintainers + +The directory `sdk-unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings` is generated from [the SpacetimeDB client-api-messages](https://github.com/clockworklabs/SpacetimeDB/tree/master/crates/client-api-messages). +This is not automated. +Whenever the `client-api-messages` crate changes, you'll have to manually re-generate the definitions. +See that crate's DEVELOP.md for how to do this. + +**⚠️ IMPORTANT:** The following files/folders needs to be deleted everytime we re-generate: +- `crates/sdk-unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Private/ModuleBindings` +- `crates/sdk-unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/ReducerBase.g.h` +- `crates/sdk-unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/SpacetimeDBClient.g.h` + +# How to use AdditionalPluginDirectories + +When integrating the SDK, you will need to place the plugin in the Engine or Project Plugins folder. Alternatively, you can specify additional directories where Unreal Engine should look for plugins. This is particularly useful when your plugin is located outside the standard `Plugins` folder of your project or engine installation, as in this case. + +To use `AdditionalPluginDirectories`, add the key to your `.uproject` file, pointing to the exact location of your plugin's root directory. + +## Example + +Here's an example of how to include `AdditionalPluginDirectories` in your `.uproject` file: + +```json +{ + "FileVersion": 3, + "EngineAssociation": "5.6", + "Category": "Tutorial", + "Description": "Unreal Engine tutorial project", + "Modules": [ + { + "Name": "QuickstartChat", + "Type": "Runtime", + "LoadingPhase": "Default" + } + ], + "_Note": "Make sure to point to the SpacetimeDbSdk root directory, exact location, no relative paths.", + "AdditionalPluginDirectories": [ + "C:/Github/clockworklabs/SpacetimeDB/crates/sdk-unreal" + ] +} +``` + + + diff --git a/sdks/unreal/README.md b/sdks/unreal/README.md new file mode 100644 index 00000000000..425aa040cd0 --- /dev/null +++ b/sdks/unreal/README.md @@ -0,0 +1,46 @@ +# SpacetimeDB Unreal SDK + +This folder contains the Unreal Engine plugin that allows games to talk to a SpacetimeDB server. The design mirrors the official **Rust** SDK and borrows ideas from the **C#** SDK so that projects can share a common workflow across languages. + +## Overview + +The plugin exposes a high level API for establishing connections, invoking reducers and keeping a synchronized cache of database tables. Communication happens over WebSockets using the BSATN binary format. Most of the message and type headers are generated by the SpacetimeDB CLI so that Unreal games can send and receive the same structures as other SDKs. + +## Feature Highlights + +- Connect to a SpacetimeDB server and authenticate with identity tokens +- Call reducers and receive their results via Blueprint exposed delegates +- Subscribe to queries and maintain a local table cache updated by server diffs +- Serialize common Unreal types to BSATN, including arrays +- Auto-generated table types keep the API in sync with your database +- Pure C++ implementation with Blueprint wrappers for easy gameplay scripting + +## Directory Layout + +``` +crates/sdk-unreal/ +├── DEVELOP.md # Notes on integrating the plugin into a project +├── SpacetimeDbSdk/ # The Unreal plugin sources +│ ├── Resources/ # Plugin icons and metadata +│ └── Source/ +│ └── SpacetimeDbSdk/ +│ ├── Public/ # Headers used by gameplay code +│ │ ├── BSATN/ # BSATN serializer +│ │ ├── Connection/ # Connection and subscription classes +│ │ ├── DBCache/ # Client side table cache utilities +│ │ ├── Tables/ # Base class for generated table wrappers +│ │ ├── Types/ # Generated message and type headers +│ │ └── tests/ # Unit test helpers for BSATN +│ ├── Private/ # Implementation files +│ └── SpacetimeDbSdk.Build.cs +``` + +See the README files in each subfolder for more details on the available classes and helpers. + +## Getting Started + +1. Copy `SpacetimeDbSdk` into your project's `Plugins` directory or use the `AdditionalPluginDirectories` option described in `DEVELOP.md`. +2. Regenerate the headers under `Public/Types` by running the SpacetimeDB CLI against your module schema. +3. Include `SpacetimeDbSdk` in your game's build files and start a connection using `UDbConnectionBuilder`. + +With the connection established you can call reducers, subscribe to queries and drive gameplay logic using incoming table data. \ No newline at end of file diff --git a/sdks/unreal/examples/QuickstartChat/.vsconfig b/sdks/unreal/examples/QuickstartChat/.vsconfig new file mode 100644 index 00000000000..3b919ea7b8f --- /dev/null +++ b/sdks/unreal/examples/QuickstartChat/.vsconfig @@ -0,0 +1,17 @@ +{ + "version": "1.0", + "components": [ + "Component.Unreal.Debugger", + "Component.Unreal.Ide", + "Microsoft.Net.Component.4.6.2.TargetingPack", + "Microsoft.VisualStudio.Component.VC.14.38.17.8.ATL", + "Microsoft.VisualStudio.Component.VC.14.38.17.8.x86.x64", + "Microsoft.VisualStudio.Component.VC.Llvm.Clang", + "Microsoft.VisualStudio.Component.VC.Tools.x86.x64", + "Microsoft.VisualStudio.Component.Windows11SDK.22621", + "Microsoft.VisualStudio.Workload.CoreEditor", + "Microsoft.VisualStudio.Workload.ManagedDesktop", + "Microsoft.VisualStudio.Workload.NativeDesktop", + "Microsoft.VisualStudio.Workload.NativeGame" + ] +} diff --git a/sdks/unreal/examples/QuickstartChat/Config/DefaultEditor.ini b/sdks/unreal/examples/QuickstartChat/Config/DefaultEditor.ini new file mode 100644 index 00000000000..e69de29bb2d diff --git a/sdks/unreal/examples/QuickstartChat/Config/DefaultEngine.ini b/sdks/unreal/examples/QuickstartChat/Config/DefaultEngine.ini new file mode 100644 index 00000000000..633a42917e3 --- /dev/null +++ b/sdks/unreal/examples/QuickstartChat/Config/DefaultEngine.ini @@ -0,0 +1,55 @@ + + +[Audio] +UseAudioMixer=True + +[/Script/HardwareTargeting.HardwareTargetingSettings] +TargetedHardwareClass=Desktop +AppliedTargetedHardwareClass=Desktop +DefaultGraphicsPerformance=Maximum +AppliedDefaultGraphicsPerformance=Maximum + +[/Script/WindowsTargetPlatform.WindowsTargetSettings] +DefaultGraphicsRHI=DefaultGraphicsRHI_DX12 +DefaultGraphicsRHI=DefaultGraphicsRHI_DX12 +!D3D12TargetedShaderFormats=ClearArray ++D3D12TargetedShaderFormats=PCD3D_SM6 + +[/Script/Engine.RendererSettings] +r.AllowStaticLighting=0 +r.GenerateMeshDistanceFields=True +r.DynamicGlobalIlluminationMethod=1 +r.ReflectionMethod=1 +r.Shadow.Virtual.Enable=1 +r.DefaultFeature.AutoExposure.ExtendDefaultLuminanceRange=True +r.DefaultFeature.LocalExposure.HighlightContrastScale=0.8 +r.DefaultFeature.LocalExposure.ShadowContrastScale=0.8 +r.SkinCache.CompileShaders=True +r.RayTracing.RayTracingProxies.ProjectEnabled=True + +[/Script/WorldPartitionEditor.WorldPartitionEditorSettings] +CommandletClass=Class'/Script/UnrealEd.WorldPartitionConvertCommandlet' + +[/Script/Engine.UserInterfaceSettings] +bAuthorizeAutomaticWidgetVariableCreation=False +FontDPIPreset=Standard +FontDPI=72 + +[/Script/AndroidFileServerEditor.AndroidFileServerRuntimeSettings] +bEnablePlugin=True +bAllowNetworkConnection=True +SecurityToken=D6E8269E4D7F7BCED1F45AAF1098AA71 +bIncludeInShipping=False +bAllowExternalStartInShipping=False +bCompileAFSProject=False +bUseCompression=False +bLogFiles=False +bReportStats=False +ConnectionType=USBOnly +bUseManualIPAddress=False +ManualIPAddress= + +[/Script/EngineSettings.GameMapsSettings] +EditorStartupMap=None +GameDefaultMap=None + diff --git a/sdks/unreal/examples/QuickstartChat/Config/DefaultGame.ini b/sdks/unreal/examples/QuickstartChat/Config/DefaultGame.ini new file mode 100644 index 00000000000..8e0350b25d7 --- /dev/null +++ b/sdks/unreal/examples/QuickstartChat/Config/DefaultGame.ini @@ -0,0 +1,5 @@ +[/Script/EngineSettings.GeneralProjectSettings] +ProjectID=868BD790461430EB4DAAAD9FE1AD3E78 + +[/Script/CommonUI.CommonUISettings] +CommonButtonAcceptKeyHandling=TriggerClick diff --git a/sdks/unreal/examples/QuickstartChat/Config/DefaultInput.ini b/sdks/unreal/examples/QuickstartChat/Config/DefaultInput.ini new file mode 100644 index 00000000000..a72fda22b24 --- /dev/null +++ b/sdks/unreal/examples/QuickstartChat/Config/DefaultInput.ini @@ -0,0 +1,85 @@ +[/Script/Engine.InputSettings] +-AxisConfig=(AxisKeyName="Gamepad_LeftX",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f)) +-AxisConfig=(AxisKeyName="Gamepad_LeftY",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f)) +-AxisConfig=(AxisKeyName="Gamepad_RightX",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f)) +-AxisConfig=(AxisKeyName="Gamepad_RightY",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f)) +-AxisConfig=(AxisKeyName="MouseX",AxisProperties=(DeadZone=0.f,Exponent=1.f,Sensitivity=0.07f)) +-AxisConfig=(AxisKeyName="MouseY",AxisProperties=(DeadZone=0.f,Exponent=1.f,Sensitivity=0.07f)) +-AxisConfig=(AxisKeyName="Mouse2D",AxisProperties=(DeadZone=0.f,Exponent=1.f,Sensitivity=0.07f)) ++AxisConfig=(AxisKeyName="Gamepad_LeftX",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Gamepad_LeftY",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Gamepad_RightX",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Gamepad_RightY",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MouseX",AxisProperties=(DeadZone=0.000000,Sensitivity=0.070000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MouseY",AxisProperties=(DeadZone=0.000000,Sensitivity=0.070000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Mouse2D",AxisProperties=(DeadZone=0.000000,Sensitivity=0.070000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MouseWheelAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Gamepad_LeftTriggerAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Gamepad_RightTriggerAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Gamepad_Special_Left_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Gamepad_Special_Left_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Vive_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Vive_Left_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Vive_Left_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Vive_Right_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Vive_Right_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Vive_Right_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MixedReality_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MixedReality_Left_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MixedReality_Left_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MixedReality_Left_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MixedReality_Left_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MixedReality_Right_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MixedReality_Right_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MixedReality_Right_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MixedReality_Right_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MixedReality_Right_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="OculusTouch_Left_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="OculusTouch_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="OculusTouch_Left_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="OculusTouch_Left_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="OculusTouch_Right_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="OculusTouch_Right_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="OculusTouch_Right_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="OculusTouch_Right_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Left_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Left_Grip_Force",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Left_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Left_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Left_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Left_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Left_Trackpad_Force",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Right_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Right_Grip_Force",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Right_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Right_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Right_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Right_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Right_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Right_Trackpad_Force",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) +bAltEnterTogglesFullscreen=True +bF11TogglesFullscreen=True +bUseMouseForTouch=False +bEnableMouseSmoothing=True +bEnableFOVScaling=True +bCaptureMouseOnLaunch=True +bEnableLegacyInputScales=True +bEnableMotionControls=True +bFilterInputByPlatformUser=False +bShouldFlushPressedKeysOnViewportFocusLost=True +bEnableDynamicComponentInputBinding=True +bAlwaysShowTouchInterface=False +bShowConsoleOnFourFingerTap=True +bEnableGestureRecognizer=False +bUseAutocorrect=False +DefaultViewportMouseCaptureMode=CapturePermanently_IncludingInitialMouseDown +DefaultViewportMouseLockMode=LockOnCapture +FOVScale=0.011110 +DoubleClickTime=0.200000 +DefaultPlayerInputClass=/Script/EnhancedInput.EnhancedPlayerInput +DefaultInputComponentClass=/Script/EnhancedInput.EnhancedInputComponent +DefaultTouchInterface=/Engine/MobileResources/HUD/DefaultVirtualJoysticks.DefaultVirtualJoysticks +-ConsoleKeys=Tilde ++ConsoleKeys=Tilde + diff --git a/sdks/unreal/examples/QuickstartChat/Content/BP/BP_ChatClientActor.uasset b/sdks/unreal/examples/QuickstartChat/Content/BP/BP_ChatClientActor.uasset new file mode 100644 index 00000000000..ccf0eb66d4c Binary files /dev/null and b/sdks/unreal/examples/QuickstartChat/Content/BP/BP_ChatClientActor.uasset differ diff --git a/sdks/unreal/examples/QuickstartChat/Content/BP/BP_ConnectionTestBP.uasset b/sdks/unreal/examples/QuickstartChat/Content/BP/BP_ConnectionTestBP.uasset new file mode 100644 index 00000000000..ff639f2a128 Binary files /dev/null and b/sdks/unreal/examples/QuickstartChat/Content/BP/BP_ConnectionTestBP.uasset differ diff --git a/sdks/unreal/examples/QuickstartChat/QuickstartChat.uproject b/sdks/unreal/examples/QuickstartChat/QuickstartChat.uproject new file mode 100644 index 00000000000..fc92e30ea6d --- /dev/null +++ b/sdks/unreal/examples/QuickstartChat/QuickstartChat.uproject @@ -0,0 +1,25 @@ +{ + "FileVersion": 3, + "EngineAssociation": "5.6", + "Category": "", + "Description": "", + "Modules": [ + { + "Name": "QuickstartChat", + "Type": "Runtime", + "LoadingPhase": "Default" + } + ], + "Plugins": [ + { + "Name": "ModelingToolsEditorMode", + "Enabled": true, + "TargetAllowList": [ + "Editor" + ] + } + ], + "AdditionalPluginDirectories": [ + "../../src" + ] +} \ No newline at end of file diff --git a/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat.Target.cs b/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat.Target.cs new file mode 100644 index 00000000000..7d4b69199b6 --- /dev/null +++ b/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat.Target.cs @@ -0,0 +1,15 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +using UnrealBuildTool; +using System.Collections.Generic; + +public class QuickstartChatTarget : TargetRules +{ + public QuickstartChatTarget(TargetInfo Target) : base(Target) + { + Type = TargetType.Game; + DefaultBuildSettings = BuildSettingsVersion.V5; + + ExtraModuleNames.AddRange( new string[] { "QuickstartChat" } ); + } +} diff --git a/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Private/ChatClientActor.cpp b/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Private/ChatClientActor.cpp new file mode 100644 index 00000000000..6d0377b4e80 --- /dev/null +++ b/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Private/ChatClientActor.cpp @@ -0,0 +1,453 @@ +#include "ChatClientActor.h" +#include "Connection/Credentials.h" +#include "Connection/DbConnectionBuilder.h" +#include "ModuleBindings/SpacetimeDBClient.g.h" + + +AChatClientActor::AChatClientActor() +{ + PrimaryActorTick.bCanEverTick = true; + Conn = nullptr; + LocalIdentity = FSpacetimeDBIdentity(); +} + + + +void AChatClientActor::BeginPlay() +{ + Super::BeginPlay(); + + // Abort initialization if the actor is inactive + if (!bActive) + { + return; + } + + // Connection details for the local SpacetimeDB instance + // @note: Make sure the SpacetimeDB server is running. Replace the host and database name with your server details if need be. + Host = TEXT("127.0.0.1:3000"); // SpacetimeDB server address (default is localhost:3000) + DbName = TEXT("quickstart-chat"); // module name used by the sample server + + // Load any previously saved authentication token + UCredentials::Init(TEXT(".spacetime_unreal_quickstart")); //Can be any path you want, it will be used to save the token + const FString SavedToken = UCredentials::LoadToken(); + + // Setup delegate handlers for connection lifecycle events + FOnConnectDelegate ConnectDelegate; + BIND_DELEGATE_SAFE(ConnectDelegate, this, AChatClientActor, OnConnected); + + FOnDisconnectDelegate DisconnectDelegate; + BIND_DELEGATE_SAFE(DisconnectDelegate, this, AChatClientActor, OnDisconnected); + + FOnConnectErrorDelegate ErrorDelegate; + BIND_DELEGATE_SAFE(ErrorDelegate, this, AChatClientActor, OnConnectError); + + // Build the connection using the fluent builder API + Conn = UDbConnection::Builder() + ->WithUri(Host) // Host address to connect to + ->WithModuleName(DbName) // Database/module name + ->WithToken(SavedToken) // Optional authentication token + ->WithCompression(ESpacetimeDBCompression::Gzip) // Enable gzip compression + ->OnConnect(ConnectDelegate) // Bind connect handler + ->OnDisconnect(DisconnectDelegate) // Bind disconnect handler + ->OnConnectError(ErrorDelegate) // Bind failure handler + ->Build(); + + Conn->SetAutoTicking(true); // Enable automatic ticking of the connection each frame + // Register table and reducer callbacks after connection creation + RegisterCallbacks(); +} + +void AChatClientActor::EndPlay(const EEndPlayReason::Type EndPlayReason) +{ + // Close the connection when the actor is removed + if (Conn) + { + Conn->Disconnect(); + } + + Super::EndPlay(EndPlayReason); +} + +void AChatClientActor::Tick(float DeltaSeconds) +{ + Super::Tick(DeltaSeconds); +} + +void AChatClientActor::RegisterCallbacks() +{ + // Listen for changes on the user table + Conn->Db->User->OnInsert.AddDynamic(this, &AChatClientActor::OnUserInsert); + Conn->Db->User->OnDelete.AddDynamic(this, &AChatClientActor::OnUserDelete); + Conn->Db->User->OnUpdate.AddDynamic(this, &AChatClientActor::OnUserUpdate); + + // Listen for changes on the message table + Conn->Db->Message->OnInsert.AddDynamic(this, &AChatClientActor::OnMessageInsert); + Conn->Db->Message->OnDelete.AddDynamic(this, &AChatClientActor::OnMessageDelete); + Conn->Db->Message->OnUpdate.AddDynamic(this, &AChatClientActor::OnMessageUpdate); + + // Example avlilable unbind usage: + // Conn->Db->Message->OnDelete.RemoveAll(this); + // UNBIND_DELEGATE_SAFE(Conn->Db->Message->OnDelete, this, AChatClientActor, OnMessageDelete); + + // Opt in to receive the reducer result and any table updates + Conn->SetReducerFlags->SendMessage(ECallReducerFlags::FullUpdate); + Conn->Reducers->OnSendMessage.AddDynamic(this, &AChatClientActor::OnReducerOnSendMessage); + + Conn->SetReducerFlags->SetName(ECallReducerFlags::FullUpdate); + Conn->Reducers->OnSetName.AddDynamic(this, &AChatClientActor::OnReducerOnSetName); + + // Hook error delegate for any reducers without explicit bindings + Conn->Reducers->InternalOnUnhandledReducerError.AddDynamic(this, &AChatClientActor::OnUnhandledReducerError); +} + +void AChatClientActor::OnConnected(UDbConnection* Connection, FSpacetimeDBIdentity Identity, const FString& Token) +{ + LocalIdentity = Identity; + LogAndDisplayMessage(TEXT("Connected to SpacetimeDB"), FColor::Emerald); + + UCredentials::SaveToken(Token); + + SubscribeToAll(); +} + +void AChatClientActor::OnDisconnected(UDbConnection* Connection, const FString& ErrorMessage) +{ + const FString Message = FString::Printf( + TEXT("OnDisconnected -> Error: %s"), + ErrorMessage.IsEmpty() ? TEXT("None") : *ErrorMessage); + LogAndDisplayMessage(Message, FColor::Red); +} + +void AChatClientActor::OnConnectError(const FString& ErrorMessage) +{ + const FString Message = FString::Printf( + TEXT("OnConnectError -> Error: %s "), + *ErrorMessage); + LogAndDisplayMessage(Message, FColor::Red); +} + +void AChatClientActor::SubscribeToAll() +{ + + // Bind subscription delegates + FOnSubscriptionApplied SubscriptionApplyDelegate; + BIND_DELEGATE_SAFE(SubscriptionApplyDelegate, this, AChatClientActor, OnSubscriptionApplied); + + FOnSubscriptionError SubscriptionErrorDelegate; + BIND_DELEGATE_SAFE(SubscriptionErrorDelegate, this, AChatClientActor, OnSubscriptionError); + + // Subscribe to every table in the schema + SubscriptionHandleAll = Conn->SubscriptionBuilder() + ->OnApplied(SubscriptionApplyDelegate) + ->OnError(SubscriptionErrorDelegate) + ->SubscribeToAllTables(); +} + +void AChatClientActor::SubscribeToUser() +{ + + // Subscribe specifically to the user table + FOnSubscriptionApplied SubscriptionApplyDelegate; + BIND_DELEGATE_SAFE(SubscriptionApplyDelegate, this, AChatClientActor, OnSubscriptionApplied); + + FOnSubscriptionError SubscriptionErrorDelegate; + BIND_DELEGATE_SAFE(SubscriptionErrorDelegate, this, AChatClientActor, OnSubscriptionError); + + SubscriptionHandleUser = Conn->SubscriptionBuilder() + ->OnApplied(SubscriptionApplyDelegate) + ->OnError(SubscriptionErrorDelegate) + ->Subscribe({ "SELECT * FROM user" }); +} + +void AChatClientActor::SubscribeToMessage() +{ + + // Subscribe specifically to the message table + FOnSubscriptionApplied SubscriptionApplyDelegate; + BIND_DELEGATE_SAFE(SubscriptionApplyDelegate, this, AChatClientActor, OnSubscriptionApplied); + + FOnSubscriptionError SubscriptionErrorDelegate; + BIND_DELEGATE_SAFE(SubscriptionErrorDelegate, this, AChatClientActor, OnSubscriptionError); + + SubscriptionHandleMessage = Conn->SubscriptionBuilder() + ->OnApplied(SubscriptionApplyDelegate) + ->OnError(SubscriptionErrorDelegate) + ->Subscribe({ "SELECT * FROM message" }); +} + + +void AChatClientActor::UnsubscribeFromAll() +{ + if (!SubscriptionHandleAll) return; + // Stop receiving updates from all tables + SubscriptionHandleAll->Unsubscribe(); +} + +void AChatClientActor::UnsubscribeFromUser() +{ + if (!SubscriptionHandleUser) return; + // Stop receiving updates from the user table + SubscriptionHandleUser->Unsubscribe(); +} + +void AChatClientActor::UnsubscribeFromMessage() +{ + if (!SubscriptionHandleMessage) return; + // Stop receiving updates from the message table + SubscriptionHandleMessage->Unsubscribe(); +} + + +void AChatClientActor::OnUserInsert(const FEventContext& Context, const FUserType& NewRow) +{ + if (NewRow.Online) + { + const FString Msg = FString::Printf(TEXT("%s is online"), *UserNameOrIdentity(NewRow)); + LogAndDisplayMessage(Msg, FColor::Green); + } +} + +void AChatClientActor::OnUserUpdate(const FEventContext& Context, const FUserType& OldRow, const FUserType& NewRow) +{ + if (OldRow.Name != NewRow.Name) + { + const FString Msg = FString::Printf(TEXT("%s renamed to %s"), *UserNameOrIdentity(OldRow), *NewRow.Name.Value); + LogAndDisplayMessage(Msg, FColor::Yellow); + } + if (OldRow.Online != NewRow.Online) + { + if (NewRow.Online) + { + const FString Msg = FString::Printf(TEXT("%s connected."), *UserNameOrIdentity(NewRow)); + LogAndDisplayMessage(Msg, FColor::Emerald); + } + else + { + const FString Msg = FString::Printf(TEXT("%s disconnected."), *UserNameOrIdentity(NewRow)); + LogAndDisplayMessage(Msg, FColor::Orange); + } + } +} + +void AChatClientActor::OnUserDelete(const FEventContext& Context, const FUserType& RemovedRow) +{ + // Inform about the deleted user record + const FString HexId = RemovedRow.Identity.ToHex(); + const FString Message = FString::Printf( + TEXT("OnUserDelete -> Identity: %s | Name: %s | Online: %s"), + *HexId, + RemovedRow.Name.bHasValue ? *RemovedRow.Name.Value : TEXT("None"), + RemovedRow.Online ? TEXT("true") : TEXT("false")); + + LogAndDisplayMessage(Message, FColor::Red); +} + +void AChatClientActor::OnMessageInsert(const FEventContext& Context, const FMessageType& NewRow) +{ + // Log a new inserted chat message + if (!Context.Event.IsSubscribeApplied()) + { + PrintMessage(NewRow); + } +} + +void AChatClientActor::OnMessageUpdate(const FEventContext& Context, const FMessageType& OldRow, const FMessageType& NewRow) +{ + // Display both the old and new values for the modified message + const FString HexSender = OldRow.Sender.ToHex(); + const FString Message = FString::Printf( + TEXT("OnMessageUpdate -> Sender: %s\nOld Timestamp: %s | Old Text: %s\nNew Timestamp: %s | New Text: %s"), + *HexSender, + *OldRow.Sent.ToString(), + *OldRow.Text, + *NewRow.Sent.ToString(), + *NewRow.Text); + + LogAndDisplayMessage(Message, FColor::Yellow); +} + +void AChatClientActor::OnMessageDelete(const FEventContext& Context, const FMessageType& DeletedRow) +{ + // Inform the user about the removed message + const FString HexSender = DeletedRow.Sender.ToHex(); + const FString TimestampStr = DeletedRow.Sent.ToString(); + const FString Message = FString::Printf( + TEXT("OnMessageDelete -> Sender: %s | Timestamp: %s | Text: %s"), + *HexSender, + *TimestampStr, + *DeletedRow.Text); + + LogAndDisplayMessage(Message, FColor::Red); +} + +void AChatClientActor::OnUnhandledReducerError(const FReducerEventContext& Context, const FString& Error) +{ + // Generic error handler for reducers without custom delegates + const FString Message = FString::Printf( + TEXT("OnUnhandledReducerError -> Error: %s"), + *Error); + + LogAndDisplayMessage(Message, FColor::Red); +} + + +void AChatClientActor::OnReducerOnSetName(const FReducerEventContext& Context, const FString& Name) +{ + // Display the resulting name after the reducer call + FString Message = FString::Printf( + TEXT("OnReducerOnSetName -> Name: %s"), + *Name); + + LogAndDisplayMessage(Message, FColor::Purple); +} + +void AChatClientActor::OnReducerOnSendMessage(const FReducerEventContext& Context, const FString& Text) +{ + // Check context event if valid + FString Message = FString::Printf( + TEXT("OnReducerOnSendMessage -> Text: %s"), + *Text); + + LogAndDisplayMessage(Message, FColor::Purple); +} + + +FString AChatClientActor::UserNameOrIdentity(const FUserType& User) const +{ + if (User.Name.bHasValue) + { + return User.Name.Value; + } + return User.Identity.ToHex().Left(8); +} + +void AChatClientActor::PrintMessage(const FMessageType& Message) +{ + FUserType Sender = Conn->Db->User->Identity->Find(Message.Sender); + FString SenderName = TEXT("unknown"); + if (Sender.Identity != FSpacetimeDBIdentity() || Sender.Name.bHasValue) + { + SenderName = UserNameOrIdentity(Sender); + } + + const FString Output = FString::Printf(TEXT("%s: %s"), *SenderName, *Message.Text); + LogAndDisplayMessage(Output, FColor::Silver); +} + +void AChatClientActor::PrintMessagesInOrder() +{ + if (!Conn) + { + return; + } + + TArray Messages = Conn->Db->Message->Iter(); + Messages.Sort([](const FMessageType& A, const FMessageType& B) + { + return A.Sent < B.Sent; + }); + + for (const FMessageType& Msg : Messages) + { + PrintMessage(Msg); + } +} + +void AChatClientActor::OnSubscriptionApplied(FSubscriptionEventContext& Ctx) +{ + const FString Message = FString::Printf( + TEXT("OnSubscriptionApplied -> Subscription applied ")); + LogAndDisplayMessage(Message, FColor::Emerald); + PrintMessagesInOrder(); +} + +void AChatClientActor::OnSubscriptionError(const FErrorContext& Ctx) +{ + const FString Message = FString::Printf( + TEXT("OnSubscriptionError -> Error: %s "), + *Ctx.Error); + LogAndDisplayMessage(Message, FColor::Red); +} + + +void AChatClientActor::PrintCurrentUser() +{ + // Verify we have a valid connection + if (!Conn) + { + LogAndDisplayMessage(TEXT("Connection is not established."), FColor::Red); + return; + } + + // Fetch our identity from the connection + FSpacetimeDBIdentity CurrentIdentity; + if (!Conn->TryGetIdentity(CurrentIdentity)) + { + LogAndDisplayMessage(TEXT("Failed to get current identity."), FColor::Red); + return; + } + + // Echo the identity to the log + const FString CurrentHexId = "Current Identity found: " + CurrentIdentity.ToHex(); + LogAndDisplayMessage(CurrentHexId, FColor::Blue); + + // Retrieve the corresponding user row + FUserType CurrentUser = Conn->Db->User->Identity->Find(CurrentIdentity); + + // Format a display string for the user + const FString HexId = CurrentUser.Identity.ToHex(); + const FString Message = FString::Printf( + TEXT("PrintCurrentUser -> Identity: %s | Name: %s | Online: %s"), + *HexId, + CurrentUser.Name.bHasValue ? *CurrentUser.Name.Value : TEXT("None"), + CurrentUser.Online ? TEXT("true") : TEXT("false")); + + LogAndDisplayMessage(Message, FColor::Cyan); +} + +void AChatClientActor::ReducerSetName(const FString NewName) +{ + if (!Conn) + { + UE_LOG(LogTemp, Warning, TEXT("Connection is not established.")); + return; + } + // Call the reducer to set the name + Conn->Reducers->SetName(NewName); +} + +void AChatClientActor::ReducerSendMessage(const FString Text) +{ + if (!Conn) + { + UE_LOG(LogTemp, Warning, TEXT("Connection is not established.")); + return; + } + // Call the reducer to send a message + Conn->Reducers->SendMessage(Text); +} + +void AChatClientActor::ReducerSetRandomName() +{ + // Generate a random name for the user, used as call in editor function + ReducerSetName(FString::Printf(TEXT("UEClient_%d"), FMath::RandRange(1, 1000))); +} + +void AChatClientActor::ReducerSendRandomMessage() +{ + // Generate a random message, used as call in editor function + ReducerSendMessage(FString::Printf(TEXT("Hello with random nr %d!"), FMath::RandRange(1, 1000))); +} + +void AChatClientActor::LogAndDisplayMessage(const FString& Message, const FColor& Color) +{ + // Write to the log for debugging + UE_LOG(LogTemp, Log, TEXT("%s"), *Message); + + // Display on the screen for quick feedback + if (GEngine) + { + GEngine->AddOnScreenDebugMessage(-1, 5.f, Color, Message); + } +} \ No newline at end of file diff --git a/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Private/ModuleBindings/SpacetimeDBClient.g.cpp b/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Private/ModuleBindings/SpacetimeDBClient.g.cpp new file mode 100644 index 00000000000..bdc637f592b --- /dev/null +++ b/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Private/ModuleBindings/SpacetimeDBClient.g.cpp @@ -0,0 +1,510 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/SpacetimeDBClient.g.h" +#include "DBCache/WithBsatn.h" +#include "BSATN/UEBSATNHelpers.h" +#include "ModuleBindings/Tables/UserTable.g.h" +#include "ModuleBindings/Tables/MessageTable.g.h" + +static FReducer DecodeReducer(const FReducerEvent& Event) +{ + const FString& ReducerName = Event.ReducerCall.ReducerName; + + if (ReducerName == TEXT("ClientConnected")) + { + FClientConnectedArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::ClientConnected(Args); + } + + if (ReducerName == TEXT("ClientDisconnected")) + { + FClientDisconnectedArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::ClientDisconnected(Args); + } + + if (ReducerName == TEXT("SendMessage")) + { + FSendMessageArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::SendMessage(Args); + } + + if (ReducerName == TEXT("SetName")) + { + FSetNameArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::SetName(Args); + } + + return FReducer(); +} + +UDbConnection::UDbConnection(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer) +{ + SetReducerFlags = ObjectInitializer.CreateDefaultSubobject(this, TEXT("SetReducerFlags")); + + Db = ObjectInitializer.CreateDefaultSubobject(this, TEXT("RemoteTables")); + Db->Initialize(); + + Reducers = ObjectInitializer.CreateDefaultSubobject(this, TEXT("RemoteReducers")); + Reducers->SetCallReducerFlags = SetReducerFlags; + Reducers->Conn = this; + + RegisterTable(TEXT("user"), Db->User); + RegisterTable(TEXT("message"), Db->Message); +} + +FContextBase::FContextBase(UDbConnection* InConn) +{ + Db = InConn->Db; + Reducers = InConn->Reducers; + SetReducerFlags = InConn->SetReducerFlags; + Conn = InConn; +} +bool FContextBase::IsActive() const +{ + return Conn->IsActive(); +} +void FContextBase::Disconnect() +{ + Conn->Disconnect(); +} +USubscriptionBuilder* FContextBase::SubscriptionBuilder() +{ + return Conn->SubscriptionBuilder(); +} +bool FContextBase::TryGetIdentity(FSpacetimeDBIdentity& OutIdentity) const +{ + return Conn->TryGetIdentity(OutIdentity); +} +FSpacetimeDBConnectionId FContextBase::GetConnectionId() const +{ + return Conn->GetConnectionId(); +} + +void URemoteTables::Initialize() +{ + + /** Creating tables */ + User = NewObject(this); + Message = NewObject(this); + /**/ + + /** Initialization */ + User->PostInitialize(); + Message->PostInitialize(); + /**/ +} + +void USetReducerFlags::ClientConnected(ECallReducerFlags Flag) +{ + FlagMap.Add("ClientConnected", Flag); +} +void USetReducerFlags::ClientDisconnected(ECallReducerFlags Flag) +{ + FlagMap.Add("ClientDisconnected", Flag); +} +void USetReducerFlags::SendMessage(ECallReducerFlags Flag) +{ + FlagMap.Add("SendMessage", Flag); +} +void USetReducerFlags::SetName(ECallReducerFlags Flag) +{ + FlagMap.Add("SetName", Flag); +} + +void URemoteReducers::ClientConnected() +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("ClientConnected"), FClientConnectedArgs(), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeClientConnected(const FReducerEventContext& Context, const UClientConnectedReducer* Args) +{ + if (!OnClientConnected.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for ClientConnected")); + } + return false; + } + + OnClientConnected.Broadcast(Context); + return true; +} + +void URemoteReducers::ClientDisconnected() +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("ClientDisconnected"), FClientDisconnectedArgs(), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeClientDisconnected(const FReducerEventContext& Context, const UClientDisconnectedReducer* Args) +{ + if (!OnClientDisconnected.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for ClientDisconnected")); + } + return false; + } + + OnClientDisconnected.Broadcast(Context); + return true; +} + +void URemoteReducers::SendMessage(const FString& Text) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("SendMessage"), FSendMessageArgs(Text), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeSendMessage(const FReducerEventContext& Context, const USendMessageReducer* Args) +{ + if (!OnSendMessage.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for SendMessage")); + } + return false; + } + + OnSendMessage.Broadcast(Context, Args->Text); + return true; +} + +void URemoteReducers::SetName(const FString& Name) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("SetName"), FSetNameArgs(Name), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeSetName(const FReducerEventContext& Context, const USetNameReducer* Args) +{ + if (!OnSetName.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for SetName")); + } + return false; + } + + OnSetName.Broadcast(Context, Args->Name); + return true; +} + +void UDbConnection::PostInitProperties() +{ + Super::PostInitProperties(); + + // Connect OnUnhandledReducerError to Reducers.InternalOnUnhandledReducerError + if (Reducers) + { + Reducers->InternalOnUnhandledReducerError.AddDynamic(this, &UDbConnection::OnUnhandledReducerErrorHandler); + } +} + +UFUNCTION() +void UDbConnection::OnUnhandledReducerErrorHandler(const FReducerEventContext& Context, const FString& Error) +{ + if (OnUnhandledReducerError.IsBound()) + { + OnUnhandledReducerError.Broadcast(Context, Error); + } +} + +void UDbConnection::ReducerEvent(const FReducerEvent& Event) +{ + if (!Reducers) { return; } + + FReducer DecodedReducer = DecodeReducer(Event); + + FQuickstartChatReducerEvent ReducerEvent; + ReducerEvent.CallerConnectionId = Event.CallerConnectionId; + ReducerEvent.CallerIdentity = Event.CallerIdentity; + ReducerEvent.EnergyConsumed = Event.EnergyConsumed; + ReducerEvent.Status = Event.Status; + ReducerEvent.Timestamp = Event.Timestamp; + ReducerEvent.Reducer = DecodedReducer; + + FReducerEventContext Context(this, ReducerEvent); + + // Use hardcoded string matching for reducer dispatching + const FString& ReducerName = Event.ReducerCall.ReducerName; + + if (ReducerName == TEXT("ClientConnected")) + { + FClientConnectedArgs Args = ReducerEvent.Reducer.GetAsClientConnected(); + UClientConnectedReducer* Reducer = NewObject(); + Reducers->InvokeClientConnected(Context, Reducer); + return; + } + if (ReducerName == TEXT("ClientDisconnected")) + { + FClientDisconnectedArgs Args = ReducerEvent.Reducer.GetAsClientDisconnected(); + UClientDisconnectedReducer* Reducer = NewObject(); + Reducers->InvokeClientDisconnected(Context, Reducer); + return; + } + if (ReducerName == TEXT("SendMessage")) + { + FSendMessageArgs Args = ReducerEvent.Reducer.GetAsSendMessage(); + USendMessageReducer* Reducer = NewObject(); + Reducer->Text = Args.Text; + Reducers->InvokeSendMessage(Context, Reducer); + return; + } + if (ReducerName == TEXT("SetName")) + { + FSetNameArgs Args = ReducerEvent.Reducer.GetAsSetName(); + USetNameReducer* Reducer = NewObject(); + Reducer->Name = Args.Name; + Reducers->InvokeSetName(Context, Reducer); + return; + } + + UE_LOG(LogTemp, Warning, TEXT("Unknown reducer: %s"), *ReducerName); +} + +void UDbConnection::ReducerEventFailed(const FReducerEvent& Event, const FString ErrorMessage) +{ + if (!Reducers) { return; } + + FQuickstartChatReducerEvent ReducerEvent; + ReducerEvent.CallerConnectionId = Event.CallerConnectionId; + ReducerEvent.CallerIdentity = Event.CallerIdentity; + ReducerEvent.EnergyConsumed = Event.EnergyConsumed; + ReducerEvent.Status = Event.Status; + ReducerEvent.Timestamp = Event.Timestamp; + + FReducerEventContext Context(this, ReducerEvent); + + if (Reducers->InternalOnUnhandledReducerError.IsBound()) + { + Reducers->InternalOnUnhandledReducerError.Broadcast(Context, ErrorMessage); + } +} + +UDbConnectionBuilder* UDbConnection::Builder() +{ + return NewObject(); +} +// Added for creating subscriptions +USubscriptionBuilder* UDbConnection::SubscriptionBuilder() +{ + USubscriptionBuilder* Builder = NewObject(this); + Builder->Conn = this; + return Builder; +} +USubscriptionBuilder* USubscriptionBuilder::OnApplied(FOnSubscriptionApplied Callback) +{ + OnAppliedDelegateInternal = Callback; + return this; +} +USubscriptionBuilder* USubscriptionBuilder::OnError(FOnSubscriptionError Callback) +{ + OnErrorDelegateInternal = Callback; + return this; +} +USubscriptionHandle* USubscriptionBuilder::Subscribe(const TArray& SQL) +{ + USubscriptionHandle* Handle = NewObject(); + + // Store user callbacks on the handle + Handle->Conn = Conn; + Handle->OnAppliedDelegate = OnAppliedDelegateInternal; + Handle->OnErrorDelegate = OnErrorDelegateInternal; + + // Bind forwarding functions that will convert base contexts + FSubscriptionEventDelegate BaseApplied; + BaseApplied.BindUFunction(Handle, TEXT("ForwardOnApplied")); + OnAppliedBase(BaseApplied); + + FSubscriptionErrorDelegate BaseError; + BaseError.BindUFunction(Handle, TEXT("ForwardOnError")); + OnErrorBase(BaseError); + + SubscribeBase(SQL, Handle); + if (Conn) + { + Conn->StartSubscription(Handle); + } + return Handle; +} +USubscriptionHandle* USubscriptionBuilder::SubscribeToAllTables() +{ + return Subscribe({ "SELECT * FROM * " }); +} + +USubscriptionHandle::USubscriptionHandle(UDbConnection* InConn) +{ + Conn = InConn; +} + +void USubscriptionHandle::ForwardOnApplied(const FSubscriptionEventContextBase& BaseCtx) +{ + if (OnAppliedDelegate.IsBound()) + { + FSubscriptionEventContext Ctx(Conn); + OnAppliedDelegate.Execute(Ctx); + } +} + +void USubscriptionHandle::ForwardOnError(const FErrorContextBase& BaseCtx) +{ + if (OnErrorDelegate.IsBound()) + { + FErrorContext Ctx(Conn, BaseCtx.Error); + OnErrorDelegate.Execute(Ctx); + } +} + + +// Cast from parent to child class +UDbConnectionBuilder* UDbConnectionBuilder::WithUri(const FString& InUri) +{ + return Cast(WithUriBase(InUri)); +} +UDbConnectionBuilder* UDbConnectionBuilder::WithModuleName(const FString& InName) +{ + return Cast(WithModuleNameBase(InName)); +} +UDbConnectionBuilder* UDbConnectionBuilder::WithToken(const FString& InToken) +{ + return Cast(WithTokenBase(InToken)); +} +UDbConnectionBuilder* UDbConnectionBuilder::WithCompression(const ESpacetimeDBCompression& InCompression) +{ + return Cast(WithCompressionBase(InCompression)); +} +UDbConnectionBuilder* UDbConnectionBuilder::OnConnect(FOnConnectDelegate Callback) +{ + OnConnectDelegateInternal = Callback; + return this; +} +UDbConnectionBuilder* UDbConnectionBuilder::OnConnectError(FOnConnectErrorDelegate Callback) +{ + return Cast(OnConnectErrorBase(Callback)); +} +UDbConnectionBuilder* UDbConnectionBuilder::OnDisconnect(FOnDisconnectDelegate Callback) +{ + OnDisconnectDelegateInternal = Callback; + return this; +} +UDbConnection* UDbConnectionBuilder::Build() +{ + UDbConnection* Connection = NewObject(); + + // Store delegates on the connection for later use + Connection->OnConnectDelegate = OnConnectDelegateInternal; + Connection->OnDisconnectDelegate = OnDisconnectDelegateInternal; + + // Wrap delegates so the base builder can bind them + FOnConnectBaseDelegate BaseConnect; + BaseConnect.BindUFunction(Connection, TEXT("ForwardOnConnect")); + Connection->SetOnConnectDelegate(BaseConnect); + OnConnectBase(BaseConnect); + + FOnDisconnectBaseDelegate BaseDisconnect; + BaseDisconnect.BindUFunction(Connection, TEXT("ForwardOnDisconnect")); + Connection->SetOnDisconnectDelegate(BaseDisconnect); + OnDisconnectBase(BaseDisconnect); + + return Cast(BuildConnection(Connection)); +} +void UDbConnection::ForwardOnConnect(UDbConnectionBase* BaseConnection, FSpacetimeDBIdentity InIdentity, const FString& InToken) +{ + if (OnConnectDelegate.IsBound()) + { + OnConnectDelegate.Execute(this, Identity, Token); + } +} +void UDbConnection::ForwardOnDisconnect(UDbConnectionBase* BaseConnection, const FString& Error) +{ + if (OnDisconnectDelegate.IsBound()) + { + OnDisconnectDelegate.Execute(this, Error); + } +} + + +void UDbConnection::DbUpdate(const FDatabaseUpdateType& Update, const FSpacetimeDBEvent& Event) +{ + FQuickstartChatEvent BaseEvent; + BaseEvent.Tag = Event.Tag; + + switch (Event.Tag) + { + case ESpacetimeDBEventTag::Reducer: + { + FReducerEvent ReducerEvent = Event.GetAsReducer(); + FReducer Reducer = DecodeReducer(ReducerEvent); + BaseEvent = FQuickstartChatEvent::Reducer(Reducer); + break; + } + + case ESpacetimeDBEventTag::SubscribeApplied: + BaseEvent = FQuickstartChatEvent::SubscribeApplied(Event.GetAsSubscribeApplied()); + break; + + case ESpacetimeDBEventTag::UnsubscribeApplied: + BaseEvent = FQuickstartChatEvent::UnsubscribeApplied(Event.GetAsUnsubscribeApplied()); + break; + + case ESpacetimeDBEventTag::Disconnected: + BaseEvent = FQuickstartChatEvent::Disconnected(Event.GetAsDisconnected()); + break; + + case ESpacetimeDBEventTag::SubscribeError: + BaseEvent = FQuickstartChatEvent::SubscribeError(Event.GetAsSubscribeError()); + break; + + case ESpacetimeDBEventTag::UnknownTransaction: + BaseEvent = FQuickstartChatEvent::UnknownTransaction(Event.GetAsUnknownTransaction()); + break; + + default: + break; + } + + FEventContext Context(this, BaseEvent); + // Populate typed reducer args for convenience in table handlers + + ApplyRegisteredTableUpdates(Update, &Context); +} + diff --git a/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Private/ModuleBindings/Tables/MessageTable.g.cpp b/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Private/ModuleBindings/Tables/MessageTable.g.cpp new file mode 100644 index 00000000000..15270abbca5 --- /dev/null +++ b/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Private/ModuleBindings/Tables/MessageTable.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/MessageTable.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UMessageTable::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> MessageTable = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UMessageTable::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UMessageTable::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UMessageTable::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Private/ModuleBindings/Tables/UserTable.g.cpp b/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Private/ModuleBindings/Tables/UserTable.g.cpp new file mode 100644 index 00000000000..953e4c8c342 --- /dev/null +++ b/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Private/ModuleBindings/Tables/UserTable.g.cpp @@ -0,0 +1,47 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/UserTable.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UUserTable::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> UserTable = Data->GetOrAdd(TableName); + UserTable->AddUniqueConstraint("identity", [](const FUserType& Row) -> const FSpacetimeDBIdentity& { + return Row.Identity; }); + + Identity = NewObject(this); + Identity->SetCache(UserTable); + + /***/ +} + +FTableAppliedDiff UUserTable::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + Diff.DeriveUpdatesByPrimaryKey( + [](const FUserType& Row) + { + return Row.Identity; + } + ); + + return Diff; +} + +int32 UUserTable::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UUserTable::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Private/QuickstartChat.cpp b/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Private/QuickstartChat.cpp new file mode 100644 index 00000000000..fd1d20b0b20 --- /dev/null +++ b/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Private/QuickstartChat.cpp @@ -0,0 +1,6 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#include "QuickstartChat.h" +#include "Modules/ModuleManager.h" + +IMPLEMENT_PRIMARY_GAME_MODULE( FDefaultGameModuleImpl, QuickstartChat, "QuickstartChat" ); diff --git a/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Public/ChatClientActor.h b/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Public/ChatClientActor.h new file mode 100644 index 00000000000..09c3dfd1a5a --- /dev/null +++ b/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Public/ChatClientActor.h @@ -0,0 +1,248 @@ +#pragma once + +/** + * Actor used to drive the Quickstart chat sample. + * Handles connecting to SpacetimeDB and exposing + * a set of convenience Blueprint functions for the + * test level. + */ + +#include "CoreMinimal.h" +#include "GameFramework/Actor.h" +#include "Connection/Credentials.h" +#include "ModuleBindings/SpacetimeDBClient.g.h" + +#include "ModuleBindings/Tables/MessageTable.g.h" +#include "ModuleBindings/Tables/UserTable.g.h" + +#include "ChatClientActor.generated.h" + + + /** + * Simple client actor used by the sample project. It owns the + * database connection and exposes helper Blueprint callable + * functions to exercise the chat reducers and subscriptions. + */ +UCLASS(BlueprintType) +class QUICKSTARTCHAT_API AChatClientActor : public AActor +{ + GENERATED_BODY() + +public: + AChatClientActor(); + + // ------------------------------------------------------------------------- + // Utility + // ------------------------------------------------------------------------- + + /** If true the actor will attempt to maintain the database connection */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + bool bActive = true; + + + UFUNCTION(CallInEditor, Category = "SpacetimeDB") + void PrintCurrentUser(); + + // ------------------------------------------------------------------------- + // Reducer callers + // ------------------------------------------------------------------------- + + /** Calls the SetName reducer with the specified value */ + UFUNCTION() + void ReducerSetName(const FString NewName); + + /** Picks a random name and calls the SetName reducer */ + UFUNCTION(CallInEditor, Category = "SpacetimeDB") + void ReducerSetRandomName(); + + // ------------------------------------------------------------------------- + // Reducer helpers (Can be called in editor) + // ------------------------------------------------------------------------- + + /** Sends a chat message via reducer */ + UFUNCTION() + void ReducerSendMessage(const FString Text); + + UFUNCTION(CallInEditor, Category = "SpacetimeDB") + void ReducerSendRandomMessage(); + + // ------------------------------------------------------------------------- + // Subsctiption Control (Can be called in editor) + // ------------------------------------------------------------------------- + + /** Subscribe to all tables in the demo schema */ + UFUNCTION(CallInEditor, Category = "SpacetimeDB") + void SubscribeToAll(); + + /** Subscribe to user updates only */ + UFUNCTION(CallInEditor, Category = "SpacetimeDB") + void SubscribeToUser(); + + /** Subscribe to message table updates */ + UFUNCTION(CallInEditor, Category = "SpacetimeDB") + void SubscribeToMessage(); + + /** Unsubscribe from all active subscriptions */ + UFUNCTION(CallInEditor, Category = "SpacetimeDB") + void UnsubscribeFromAll(); + + /** Unsubscribe from user table */ + UFUNCTION(CallInEditor, Category = "SpacetimeDB") + void UnsubscribeFromUser(); + + /** Unsubscribe from message table */ + UFUNCTION(CallInEditor, Category = "SpacetimeDB") + void UnsubscribeFromMessage(); + + +protected: + + // ------------------------------------------------------------------------- + // Actor Lifecycle + // ------------------------------------------------------------------------- + + /** Called when the actor enters the world */ + virtual void BeginPlay() override; + /** Clean up the database connection on shutdown */ + virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override; + /** Ticks the active connection */ + virtual void Tick(float DeltaSeconds) override; + +private: + + // ------------------------------------------------------------------------- + // Connection object + // ------------------------------------------------------------------------- + + /** Live database connection instance */ + UPROPERTY() + UDbConnection* Conn; + + // ------------------------------------------------------------------------- + // Subscription handlers + // ------------------------------------------------------------------------- + + /** Handle to the "all" subscription */ + UPROPERTY() + USubscriptionHandle* SubscriptionHandleAll; + + /** Handle to the user table subscription */ + UPROPERTY() + USubscriptionHandle* SubscriptionHandleUser; + + /** Handle to the message table subscription */ + UPROPERTY() + USubscriptionHandle* SubscriptionHandleMessage; + + // ------------------------------------------------------------------------- + // Variables + // ------------------------------------------------------------------------- + + /** Local client identity returned from the server on connect */ + FSpacetimeDBIdentity LocalIdentity; + + /** Configured host name */ + FString Host; + + /** Database name */ + FString DbName; + + // ------------------------------------------------------------------------- + // Registration + // ------------------------------------------------------------------------- + + /** Registers all SpacetimeDB callbacks */ + UFUNCTION() + void RegisterCallbacks(); + + // ------------------------------------------------------------------------- + // Connection callbacks + // ------------------------------------------------------------------------- + + /** Callback for successful connection */ + UFUNCTION() + void OnConnected(UDbConnection* Connection, FSpacetimeDBIdentity Identity, const FString& Token); + + /** Called when the connection is closed */ + UFUNCTION() + void OnDisconnected(UDbConnection* Connection, const FString& ErrorMessage); + + /** Called when the initial connection fails */ + UFUNCTION() + void OnConnectError(const FString& ErrorMessage); + + + // ------------------------------------------------------------------------- + // Subsctription updates + // ------------------------------------------------------------------------- + + /** Fired when a subscription is successfully applied */ + UFUNCTION() + void OnSubscriptionApplied(FSubscriptionEventContext& Ctx); + + /** Fired when applying a subscription fails */ + UFUNCTION() + void OnSubscriptionError(const FErrorContext& Ctx); + + + // ------------------------------------------------------------------------- + // Table changes updates + // ------------------------------------------------------------------------- + + /** Called when a user row is inserted */ + UFUNCTION() + void OnUserInsert(const FEventContext& Context, const FUserType& NewRow); + /** Called when a user row is updated */ + UFUNCTION() + void OnUserUpdate(const FEventContext& Context, const FUserType& OldRow, const FUserType& NewRow); + /** Called when a user row is deleted */ + UFUNCTION() + void OnUserDelete(const FEventContext& Context, const FUserType& RemovedRow); + + /** Called when a message row is inserted */ + UFUNCTION() + void OnMessageInsert(const FEventContext& Context, const FMessageType& NewRow); + /** Called when a message row is updated */ + UFUNCTION() + void OnMessageUpdate(const FEventContext& Context, const FMessageType& OldRow, const FMessageType& NewRow); + /** Called when a message row is deleted */ + UFUNCTION() + void OnMessageDelete(const FEventContext& Context, const FMessageType& DeletedRow); + + // ------------------------------------------------------------------------- + // Reducer updates + // ------------------------------------------------------------------------- + + /** Catch-all reducer error handler */ + UFUNCTION() + void OnUnhandledReducerError(const FReducerEventContext& Context, const FString& Error); + + /** Handler for SetName reducer result */ + UFUNCTION() + void OnReducerOnSetName(const FReducerEventContext& Context, const FString& Name); + + /** Handler for SendMessage reducer result */ + UFUNCTION() + void OnReducerOnSendMessage(const FReducerEventContext& Context, const FString& Text); + + // ------------------------------------------------------------------------- + // Helper functions + // ------------------------------------------------------------------------- + + /** Print all messages in message table in incoming time order */ + UFUNCTION() + void PrintMessagesInOrder(); + + /** Print a message and who sent it */ + UFUNCTION() + void PrintMessage(const FMessageType& Message); + + /** Get user name if set else get part of identification */ + UFUNCTION() + FString UserNameOrIdentity(const FUserType& User) const; + + /** Logs a string to the output log and screen */ + UFUNCTION(BlueprintCallable, Category = "Debug") + void LogAndDisplayMessage(const FString& Message, const FColor& Color); + +}; \ No newline at end of file diff --git a/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Public/ModuleBindings/Optionals/QuickstartChatOptionalString.g.h b/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Public/ModuleBindings/Optionals/QuickstartChatOptionalString.g.h new file mode 100644 index 00000000000..3d9a1d9b368 --- /dev/null +++ b/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Public/ModuleBindings/Optionals/QuickstartChatOptionalString.g.h @@ -0,0 +1,61 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "QuickstartChatOptionalString.g.generated.h" + +USTRUCT(BlueprintType) +struct QUICKSTARTCHAT_API FQuickstartChatOptionalString +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + bool bHasValue = false; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB", meta = (EditCondition = "bHasValue")) + FString Value; + + FQuickstartChatOptionalString() = default; + + explicit FQuickstartChatOptionalString(const FString& InValue) + : bHasValue(true), Value(InValue) {} + + bool IsSet() const { return bHasValue; } + void Reset() { bHasValue = false; } + + FORCEINLINE bool operator==(const FQuickstartChatOptionalString& Other) const + { + if (bHasValue != Other.bHasValue) return false; + return !bHasValue || Value == Other.Value; + } + + FORCEINLINE bool operator!=(const FQuickstartChatOptionalString& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FQuickstartChatOptionalString. + * Hashes the HasValue flag and the Value if present. + * @param Optional The FQuickstartChatOptionalString instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FQuickstartChatOptionalString& Optional) +{ + uint32 Hash = GetTypeHash(Optional.bHasValue); + if (Optional.bHasValue) + { + Hash = HashCombine(Hash, GetTypeHash(Optional.Value)); + } + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FQuickstartChatOptionalString); + + UE_SPACETIMEDB_OPTIONAL(FQuickstartChatOptionalString, bHasValue, Value); +} diff --git a/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Public/ModuleBindings/ReducerBase.g.h b/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Public/ModuleBindings/ReducerBase.g.h new file mode 100644 index 00000000000..1019cd74747 --- /dev/null +++ b/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Public/ModuleBindings/ReducerBase.g.h @@ -0,0 +1,18 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ReducerBase.g.generated.h" + +// Abstract Reducer base class +UCLASS(Abstract, BlueprintType) +class QUICKSTARTCHAT_API UReducerBase : public UObject +{ + GENERATED_BODY() + +public: + virtual ~UReducerBase() = default; +}; + diff --git a/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Public/ModuleBindings/Reducers/ClientConnected.g.h b/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Public/ModuleBindings/Reducers/ClientConnected.g.h new file mode 100644 index 00000000000..bc97b8e7ee7 --- /dev/null +++ b/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Public/ModuleBindings/Reducers/ClientConnected.g.h @@ -0,0 +1,43 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "ClientConnected.g.generated.h" + +// Reducer arguments struct for ClientConnected +USTRUCT(BlueprintType) +struct QUICKSTARTCHAT_API FClientConnectedArgs +{ + GENERATED_BODY() + + FClientConnectedArgs() = default; + + + FORCEINLINE bool operator==(const FClientConnectedArgs& Other) const + { + return true; + } + FORCEINLINE bool operator!=(const FClientConnectedArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT_EMPTY(FClientConnectedArgs); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class QUICKSTARTCHAT_API UClientConnectedReducer : public UReducerBase +{ + GENERATED_BODY() + +public: +}; + + diff --git a/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Public/ModuleBindings/Reducers/ClientDisconnected.g.h b/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Public/ModuleBindings/Reducers/ClientDisconnected.g.h new file mode 100644 index 00000000000..07687d50f03 --- /dev/null +++ b/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Public/ModuleBindings/Reducers/ClientDisconnected.g.h @@ -0,0 +1,43 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "ClientDisconnected.g.generated.h" + +// Reducer arguments struct for ClientDisconnected +USTRUCT(BlueprintType) +struct QUICKSTARTCHAT_API FClientDisconnectedArgs +{ + GENERATED_BODY() + + FClientDisconnectedArgs() = default; + + + FORCEINLINE bool operator==(const FClientDisconnectedArgs& Other) const + { + return true; + } + FORCEINLINE bool operator!=(const FClientDisconnectedArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT_EMPTY(FClientDisconnectedArgs); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class QUICKSTARTCHAT_API UClientDisconnectedReducer : public UReducerBase +{ + GENERATED_BODY() + +public: +}; + + diff --git a/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Public/ModuleBindings/Reducers/SendMessage.g.h b/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Public/ModuleBindings/Reducers/SendMessage.g.h new file mode 100644 index 00000000000..d47d9380666 --- /dev/null +++ b/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Public/ModuleBindings/Reducers/SendMessage.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "SendMessage.g.generated.h" + +// Reducer arguments struct for SendMessage +USTRUCT(BlueprintType) +struct QUICKSTARTCHAT_API FSendMessageArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FString Text; + + FSendMessageArgs() = default; + + FSendMessageArgs(const FString& InText) + : Text(InText) + {} + + + FORCEINLINE bool operator==(const FSendMessageArgs& Other) const + { + return Text == Other.Text; + } + FORCEINLINE bool operator!=(const FSendMessageArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FSendMessageArgs, Text); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class QUICKSTARTCHAT_API USendMessageReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FString Text; + +}; + + diff --git a/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Public/ModuleBindings/Reducers/SetName.g.h b/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Public/ModuleBindings/Reducers/SetName.g.h new file mode 100644 index 00000000000..c742224903a --- /dev/null +++ b/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Public/ModuleBindings/Reducers/SetName.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "SetName.g.generated.h" + +// Reducer arguments struct for SetName +USTRUCT(BlueprintType) +struct QUICKSTARTCHAT_API FSetNameArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FString Name; + + FSetNameArgs() = default; + + FSetNameArgs(const FString& InName) + : Name(InName) + {} + + + FORCEINLINE bool operator==(const FSetNameArgs& Other) const + { + return Name == Other.Name; + } + FORCEINLINE bool operator!=(const FSetNameArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FSetNameArgs, Name); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class QUICKSTARTCHAT_API USetNameReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FString Name; + +}; + + diff --git a/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Public/ModuleBindings/SpacetimeDBClient.g.h b/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Public/ModuleBindings/SpacetimeDBClient.g.h new file mode 100644 index 00000000000..f2ba5aabf96 --- /dev/null +++ b/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Public/ModuleBindings/SpacetimeDBClient.g.h @@ -0,0 +1,833 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.4.0 (commit dc59211c1453848981aeb2efce2249c9a07947b2). + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Connection/Callback.h" +#include "Connection/DbConnectionBase.h" +#include "Connection/DbConnectionBuilder.h" +#include "Connection/SetReducerFlags.h" +#include "Connection/Subscription.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "ModuleBindings/Reducers/ClientConnected.g.h" +#include "ModuleBindings/Reducers/ClientDisconnected.g.h" +#include "ModuleBindings/Reducers/SendMessage.g.h" +#include "ModuleBindings/Reducers/SetName.g.h" +#include "Types/Builtins.h" +#include "SpacetimeDBClient.g.generated.h" + +// Forward declarations +class UDbConnection; +class URemoteTables; +class URemoteReducers; +class USubscriptionBuilder; +class USubscriptionHandle; + +/** Forward declaration for tables */ +class UMessageTable; +class UUserTable; +/***/ + +// Delegates using the generated connection type. These wrap the base +// delegates defined in the SDK so that projects can work directly with +// UDbConnection without manual casting in user code. +DECLARE_DYNAMIC_DELEGATE_ThreeParams( + FOnConnectDelegate, + UDbConnection*, Connection, + FSpacetimeDBIdentity, Identity, + const FString&, Token); + +DECLARE_DYNAMIC_DELEGATE_TwoParams( + FOnDisconnectDelegate, + UDbConnection*, Connection, + const FString&, Error); + + +// Context classes for event handling + +USTRUCT(BlueprintType) +struct QUICKSTARTCHAT_API FContextBase +{ + GENERATED_BODY() + + FContextBase() = default; + FContextBase(UDbConnection* InConn); + + UPROPERTY(BlueprintReadOnly, Category = "SpacetimeDB") + URemoteTables* Db; + + UPROPERTY(BlueprintReadOnly, Category = "SpacetimeDB") + URemoteReducers* Reducers; + + UPROPERTY(BlueprintReadOnly, Category = "SpacetimeDB") + USetReducerFlags* SetReducerFlags; + + bool IsActive() const; + void Disconnect(); + bool TryGetIdentity(FSpacetimeDBIdentity& OutIdentity) const; + FSpacetimeDBConnectionId GetConnectionId() const; + USubscriptionBuilder* SubscriptionBuilder(); + +protected: + UPROPERTY() + UDbConnection* Conn; + +}; + +UENUM(BlueprintType, Category = "SpacetimeDB") +enum class EReducerTag : uint8 +{ + ClientConnected, + ClientDisconnected, + SendMessage, + SetName +}; + +USTRUCT(BlueprintType) +struct QUICKSTARTCHAT_API FReducer +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category = "SpacetimeDB") + EReducerTag Tag; + + TVariant Data; + + // Optional metadata + UPROPERTY(BlueprintReadOnly, Category = "SpacetimeDB") + FString ReducerName; + uint32 ReducerId = 0; + uint32 RequestId = 0; + + static FReducer ClientConnected(const FClientConnectedArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::ClientConnected; + Out.Data.Set(Value); + Out.ReducerName = TEXT("ClientConnected"); + return Out; + } + + FORCEINLINE bool IsClientConnected() const { return Tag == EReducerTag::ClientConnected; } + FORCEINLINE FClientConnectedArgs GetAsClientConnected() const + { + ensureMsgf(IsClientConnected(), TEXT("Reducer does not hold ClientConnected!")); + return Data.Get(); + } + + static FReducer ClientDisconnected(const FClientDisconnectedArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::ClientDisconnected; + Out.Data.Set(Value); + Out.ReducerName = TEXT("ClientDisconnected"); + return Out; + } + + FORCEINLINE bool IsClientDisconnected() const { return Tag == EReducerTag::ClientDisconnected; } + FORCEINLINE FClientDisconnectedArgs GetAsClientDisconnected() const + { + ensureMsgf(IsClientDisconnected(), TEXT("Reducer does not hold ClientDisconnected!")); + return Data.Get(); + } + + static FReducer SendMessage(const FSendMessageArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::SendMessage; + Out.Data.Set(Value); + Out.ReducerName = TEXT("SendMessage"); + return Out; + } + + FORCEINLINE bool IsSendMessage() const { return Tag == EReducerTag::SendMessage; } + FORCEINLINE FSendMessageArgs GetAsSendMessage() const + { + ensureMsgf(IsSendMessage(), TEXT("Reducer does not hold SendMessage!")); + return Data.Get(); + } + + static FReducer SetName(const FSetNameArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::SetName; + Out.Data.Set(Value); + Out.ReducerName = TEXT("SetName"); + return Out; + } + + FORCEINLINE bool IsSetName() const { return Tag == EReducerTag::SetName; } + FORCEINLINE FSetNameArgs GetAsSetName() const + { + ensureMsgf(IsSetName(), TEXT("Reducer does not hold SetName!")); + return Data.Get(); + } + + FORCEINLINE bool operator==(const FReducer& Other) const + { + if (Tag != Other.Tag || ReducerId != Other.ReducerId || RequestId != Other.RequestId || ReducerName != Other.ReducerName) return false; + switch (Tag) + { + case EReducerTag::ClientConnected: + return GetAsClientConnected() == Other.GetAsClientConnected(); + case EReducerTag::ClientDisconnected: + return GetAsClientDisconnected() == Other.GetAsClientDisconnected(); + case EReducerTag::SendMessage: + return GetAsSendMessage() == Other.GetAsSendMessage(); + case EReducerTag::SetName: + return GetAsSetName() == Other.GetAsSetName(); + default: return false; + } + } + FORCEINLINE bool operator!=(const FReducer& Other) const { return !(*this == Other); } +}; + +UCLASS() +class QUICKSTARTCHAT_API UReducerBpLib : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() + +private: + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer ClientConnected(const FClientConnectedArgs& Value) { + return FReducer::ClientConnected(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsClientConnected(const FReducer& Reducer) { return Reducer.IsClientConnected(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FClientConnectedArgs GetAsClientConnected(const FReducer& Reducer) { + return Reducer.GetAsClientConnected(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer ClientDisconnected(const FClientDisconnectedArgs& Value) { + return FReducer::ClientDisconnected(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsClientDisconnected(const FReducer& Reducer) { return Reducer.IsClientDisconnected(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FClientDisconnectedArgs GetAsClientDisconnected(const FReducer& Reducer) { + return Reducer.GetAsClientDisconnected(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer SendMessage(const FSendMessageArgs& Value) { + return FReducer::SendMessage(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsSendMessage(const FReducer& Reducer) { return Reducer.IsSendMessage(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FSendMessageArgs GetAsSendMessage(const FReducer& Reducer) { + return Reducer.GetAsSendMessage(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer SetName(const FSetNameArgs& Value) { + return FReducer::SetName(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsSetName(const FReducer& Reducer) { return Reducer.IsSetName(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FSetNameArgs GetAsSetName(const FReducer& Reducer) { + return Reducer.GetAsSetName(); + } +}; + +/** Metadata describing a reducer run. */ +USTRUCT(BlueprintType) +struct QUICKSTARTCHAT_API FQuickstartChatReducerEvent +{ + GENERATED_BODY() + + /** Timestamp for when the reducer executed */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBTimestamp Timestamp; + + /** Result status of the reducer */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBStatus Status; + + /** Identity that initiated the call */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBIdentity CallerIdentity; + + /** Connection ID for the caller */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBConnectionId CallerConnectionId; + + /** Energy consumed while executing */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="SpacetimeDB") + FEnergyQuantaType EnergyConsumed; + + /** Detailed call information */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="SpacetimeDB") + FReducer Reducer; + + FORCEINLINE bool operator==(const FQuickstartChatReducerEvent& Other) const + { + return Status == Other.Status && Timestamp == Other.Timestamp && CallerIdentity == Other.CallerIdentity && + CallerConnectionId == Other.CallerConnectionId && EnergyConsumed == Other.EnergyConsumed && + Reducer == Other.Reducer; + } + + FORCEINLINE bool operator!=(const FQuickstartChatReducerEvent& Other) const + { + return !(*this == Other); + } +}; + +/** Represents event with variant message data. */ +USTRUCT(BlueprintType) +struct QUICKSTARTCHAT_API FQuickstartChatEvent +{ + GENERATED_BODY() + + /** Tagged union holding reducer call, unit events, or error string */ + TVariant MessageData; + + /** Type tag indicating what this event represents */ + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + ESpacetimeDBEventTag Tag = ESpacetimeDBEventTag::UnknownTransaction; + + /** === Static factory methods ===*/ + static FQuickstartChatEvent Reducer(const FReducer& Value) + { + FQuickstartChatEvent Obj; + Obj.Tag = ESpacetimeDBEventTag::Reducer; + Obj.MessageData.Set(Value); + return Obj; + } + + static FQuickstartChatEvent SubscribeApplied(const FSpacetimeDBUnit& Value) + { + FQuickstartChatEvent Obj; + Obj.Tag = ESpacetimeDBEventTag::SubscribeApplied; + Obj.MessageData.Set(Value); + return Obj; + } + + static FQuickstartChatEvent UnsubscribeApplied(const FSpacetimeDBUnit& Value) + { + FQuickstartChatEvent Obj; + Obj.Tag = ESpacetimeDBEventTag::UnsubscribeApplied; + Obj.MessageData.Set(Value); + return Obj; + } + + static FQuickstartChatEvent Disconnected(const FSpacetimeDBUnit& Value) + { + FQuickstartChatEvent Obj; + Obj.Tag = ESpacetimeDBEventTag::Disconnected; + Obj.MessageData.Set(Value); + return Obj; + } + + static FQuickstartChatEvent SubscribeError(const FString& Value) + { + FQuickstartChatEvent Obj; + Obj.Tag = ESpacetimeDBEventTag::SubscribeError; + Obj.MessageData.Set(Value); + return Obj; + } + + static FQuickstartChatEvent UnknownTransaction(const FSpacetimeDBUnit& Value) + { + FQuickstartChatEvent Obj; + Obj.Tag = ESpacetimeDBEventTag::UnknownTransaction; + Obj.MessageData.Set(Value); + return Obj; + } + + FORCEINLINE bool IsReducer() const { return Tag == ESpacetimeDBEventTag::Reducer; } + FORCEINLINE FReducer GetAsReducer() const + { + ensureMsgf(IsReducer(), TEXT("MessageData does not hold Reducer!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsSubscribeApplied() const { return Tag == ESpacetimeDBEventTag::SubscribeApplied; } + FORCEINLINE FSpacetimeDBUnit GetAsSubscribeApplied() const + { + ensureMsgf(IsSubscribeApplied(), TEXT("MessageData does not hold SubscribeApplied!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsUnsubscribeApplied() const { return Tag == ESpacetimeDBEventTag::UnsubscribeApplied; } + FORCEINLINE FSpacetimeDBUnit GetAsUnsubscribeApplied() const + { + ensureMsgf(IsUnsubscribeApplied(), TEXT("MessageData does not hold UnsubscribeApplied!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsDisconnected() const { return Tag == ESpacetimeDBEventTag::Disconnected; } + FORCEINLINE FSpacetimeDBUnit GetAsDisconnected() const + { + ensureMsgf(IsDisconnected(), TEXT("MessageData does not hold Disconnected!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsSubscribeError() const { return Tag == ESpacetimeDBEventTag::SubscribeError; } + FORCEINLINE FString GetAsSubscribeError() const + { + ensureMsgf(IsSubscribeError(), TEXT("MessageData does not hold SubscribeError!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsUnknownTransaction() const { return Tag == ESpacetimeDBEventTag::UnknownTransaction; } + FORCEINLINE FSpacetimeDBUnit GetAsUnknownTransaction() const + { + ensureMsgf(IsUnknownTransaction(), TEXT("MessageData does not hold UnknownTransaction!")); + return MessageData.Get(); + } + + FORCEINLINE bool operator==(const FQuickstartChatEvent& Other) const + { + if (Tag != Other.Tag) return false; + switch (Tag) + { + case ESpacetimeDBEventTag::Reducer: return GetAsReducer() == Other.GetAsReducer(); + case ESpacetimeDBEventTag::SubscribeApplied: return GetAsSubscribeApplied() == Other.GetAsSubscribeApplied(); + case ESpacetimeDBEventTag::UnsubscribeApplied: return GetAsUnsubscribeApplied() == Other.GetAsUnsubscribeApplied(); + case ESpacetimeDBEventTag::Disconnected: return GetAsDisconnected() == Other.GetAsDisconnected(); + case ESpacetimeDBEventTag::SubscribeError: return GetAsSubscribeError() == Other.GetAsSubscribeError(); + case ESpacetimeDBEventTag::UnknownTransaction: return GetAsUnknownTransaction() == Other.GetAsUnknownTransaction(); + default: return false; + } + } + + FORCEINLINE bool operator!=(const FQuickstartChatEvent& Other) const + { + return !(*this == Other); + } +}; + +UCLASS() +class QUICKSTARTCHAT_API UQuickstartChatEventBpLib : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() + +private: + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|QuickstartChatEvent") + static FQuickstartChatEvent Reducer(const FReducer& InValue) + { + return FQuickstartChatEvent::Reducer(InValue); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|QuickstartChatEvent") + static FQuickstartChatEvent SubscribeApplied(const FSpacetimeDBUnit& InValue) + { + return FQuickstartChatEvent::SubscribeApplied(InValue); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|QuickstartChatEvent") + static FQuickstartChatEvent UnsubscribeApplied(const FSpacetimeDBUnit& InValue) + { + return FQuickstartChatEvent::UnsubscribeApplied(InValue); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|QuickstartChatEvent") + static FQuickstartChatEvent Disconnected(const FSpacetimeDBUnit& InValue) + { + return FQuickstartChatEvent::Disconnected(InValue); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|QuickstartChatEvent") + static FQuickstartChatEvent SubscribeError(const FString& InValue) + { + return FQuickstartChatEvent::SubscribeError(InValue); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|QuickstartChatEvent") + static FQuickstartChatEvent UnknownTransaction(const FSpacetimeDBUnit& InValue) + { + return FQuickstartChatEvent::UnknownTransaction(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|QuickstartChatEvent") + static bool IsReducer(const FQuickstartChatEvent& Event) { return Event.IsReducer(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|QuickstartChatEvent") + static bool IsSubscribeApplied(const FQuickstartChatEvent& Event) { return Event.IsSubscribeApplied(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|QuickstartChatEvent") + static bool IsUnsubscribeApplied(const FQuickstartChatEvent& Event) { return Event.IsUnsubscribeApplied(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|QuickstartChatEvent") + static bool IsDisconnected(const FQuickstartChatEvent& Event) { return Event.IsDisconnected(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|QuickstartChatEvent") + static bool IsSubscribeError(const FQuickstartChatEvent& Event) { return Event.IsSubscribeError(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|QuickstartChatEvent") + static bool IsUnknownTransaction(const FQuickstartChatEvent& Event) { return Event.IsUnknownTransaction(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|QuickstartChatEvent") + static FReducer GetAsReducer(const FQuickstartChatEvent& Event) + { + return Event.GetAsReducer(); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|QuickstartChatEvent") + static FSpacetimeDBUnit GetAsSubscribeApplied(const FQuickstartChatEvent& Event) + { + return Event.GetAsSubscribeApplied(); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|QuickstartChatEvent") + static FSpacetimeDBUnit GetAsUnsubscribeApplied(const FQuickstartChatEvent& Event) + { + return Event.GetAsUnsubscribeApplied(); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|QuickstartChatEvent") + static FSpacetimeDBUnit GetAsDisconnected(const FQuickstartChatEvent& Event) + { + return Event.GetAsDisconnected(); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|QuickstartChatEvent") + static FString GetAsSubscribeError(const FQuickstartChatEvent& Event) + { + return Event.GetAsSubscribeError(); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|QuickstartChatEvent") + static FSpacetimeDBUnit GetAsUnknownTransaction(const FQuickstartChatEvent& Event) + { + return Event.GetAsUnknownTransaction(); + } + +}; + + +USTRUCT(BlueprintType) +struct QUICKSTARTCHAT_API FEventContext : public FContextBase +{ + GENERATED_BODY() + + FEventContext() = default; + FEventContext(UDbConnection* InConn, const FQuickstartChatEvent& InEvent) : FContextBase(InConn), Event(InEvent) {} + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FQuickstartChatEvent Event; +}; + +USTRUCT(BlueprintType) +struct QUICKSTARTCHAT_API FReducerEventContext : public FContextBase +{ + GENERATED_BODY() + + FReducerEventContext() = default; + FReducerEventContext(UDbConnection* InConn, FQuickstartChatReducerEvent InEvent) : FContextBase(InConn), Event(InEvent) {} + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FQuickstartChatReducerEvent Event; +}; + +USTRUCT(BlueprintType) +struct QUICKSTARTCHAT_API FErrorContext : public FContextBase +{ + GENERATED_BODY() + + FErrorContext() = default; + FErrorContext(UDbConnection* InConn, const FString& InError) : FContextBase(InConn), Error(InError) {} + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FString Error; + +}; + +USTRUCT(BlueprintType) +struct QUICKSTARTCHAT_API FSubscriptionEventContext : public FContextBase +{ + GENERATED_BODY() + + FSubscriptionEventContext() = default; + FSubscriptionEventContext(UDbConnection* InConn) : FContextBase(InConn) {} + +}; + +DECLARE_DYNAMIC_DELEGATE_OneParam( + FOnSubscriptionApplied, + FSubscriptionEventContext, Context); + +DECLARE_DYNAMIC_DELEGATE_OneParam( + FOnSubscriptionError, + FErrorContext, Context); + +UCLASS(BlueprintType) +class QUICKSTARTCHAT_API USetReducerFlags : public USetReducerFlagsBase +{ + GENERATED_BODY() + +public: + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void ClientConnected(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void ClientDisconnected(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void SendMessage(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void SetName(ECallReducerFlags Flag); + +}; + +// RemoteTables class +UCLASS(BlueprintType) +class QUICKSTARTCHAT_API URemoteTables : public UObject +{ + GENERATED_BODY() + +public: + void Initialize(); + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UUserTable* User; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UMessageTable* Message; + +}; + +// RemoteReducers class +UCLASS(BlueprintType) +class QUICKSTARTCHAT_API URemoteReducers : public UObject +{ + GENERATED_BODY() + +public: + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam( + FClientConnectedHandler, + const FReducerEventContext&, Context + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FClientConnectedHandler OnClientConnected; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void ClientConnected(); + + bool InvokeClientConnected(const FReducerEventContext& Context, const UClientConnectedReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam( + FClientDisconnectedHandler, + const FReducerEventContext&, Context + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FClientDisconnectedHandler OnClientDisconnected; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void ClientDisconnected(); + + bool InvokeClientDisconnected(const FReducerEventContext& Context, const UClientDisconnectedReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FSendMessageHandler, + const FReducerEventContext&, Context, + const FString&, Text + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FSendMessageHandler OnSendMessage; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void SendMessage(const FString& Text); + + bool InvokeSendMessage(const FReducerEventContext& Context, const USendMessageReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FSetNameHandler, + const FReducerEventContext&, Context, + const FString&, Name + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FSetNameHandler OnSetName; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void SetName(const FString& Name); + + bool InvokeSetName(const FReducerEventContext& Context, const USetNameReducer* Args); + + // Internal error handling + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FInternalOnUnhandledReducerError, const FReducerEventContext&, Context, const FString&, Error); + FInternalOnUnhandledReducerError InternalOnUnhandledReducerError; + +private: + + friend UDbConnection; + + UPROPERTY() + class UDbConnection* Conn; + + UPROPERTY() + USetReducerFlags* SetCallReducerFlags; +}; + +// SubscriptionBuilder class +UCLASS(BlueprintType) +class QUICKSTARTCHAT_API USubscriptionBuilder : public USubscriptionBuilderBase +{ + GENERATED_BODY() + +public: + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + USubscriptionBuilder* OnApplied(FOnSubscriptionApplied Callback); + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + USubscriptionBuilder* OnError(FOnSubscriptionError Callback); + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + USubscriptionHandle* Subscribe(const TArray& SQL); + + /** Convenience for subscribing to all rows from all tables */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + USubscriptionHandle* SubscribeToAllTables(); + + + friend class UDbConnection; + friend class UDbConnectionBase; + +protected: + UPROPERTY() + class UDbConnection* Conn; + + // Delegates stored so Subscribe() can bind forwarding callbacks + FOnSubscriptionApplied OnAppliedDelegateInternal; + FOnSubscriptionError OnErrorDelegateInternal; +}; + +// SubscriptionHandle class +UCLASS(BlueprintType) +class QUICKSTARTCHAT_API USubscriptionHandle : public USubscriptionHandleBase +{ + GENERATED_BODY() + +public: + + USubscriptionHandle() {}; + + explicit USubscriptionHandle(UDbConnection* InConn); + + friend class USubscriptionBuilder; + +private: + UPROPERTY() + class UDbConnection* Conn; + + // Delegates that expose subscription events with connection aware contexts + FOnSubscriptionApplied OnAppliedDelegate; + FOnSubscriptionError OnErrorDelegate; + + UFUNCTION() + void ForwardOnApplied(const FSubscriptionEventContextBase& BaseCtx); + + UFUNCTION() + void ForwardOnError(const FErrorContextBase& BaseCtx); +}; + +/* + @Note: Child class of UDbConnectionBuilderBase. +*/ +UCLASS(BlueprintType) +class QUICKSTARTCHAT_API UDbConnectionBuilder : public UDbConnectionBuilderBase +{ + GENERATED_BODY() +public: + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + UDbConnectionBuilder* WithUri(const FString& InUri); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + UDbConnectionBuilder* WithModuleName(const FString& InName); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + UDbConnectionBuilder* WithToken(const FString& InToken); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + UDbConnectionBuilder* WithCompression(const ESpacetimeDBCompression& InCompression); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + UDbConnectionBuilder* OnConnect(FOnConnectDelegate Callback); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + UDbConnectionBuilder* OnConnectError(FOnConnectErrorDelegate Callback); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + UDbConnectionBuilder* OnDisconnect(FOnDisconnectDelegate Callback); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + UDbConnection* Build(); + +private: + + // Stored delegates which will be forwarded when the connection events occur. + FOnConnectDelegate OnConnectDelegateInternal; + FOnDisconnectDelegate OnDisconnectDelegateInternal; +}; + +// Main DbConnection class +UCLASS(BlueprintType) +class QUICKSTARTCHAT_API UDbConnection : public UDbConnectionBase +{ + GENERATED_BODY() + +public: + explicit UDbConnection(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get()); + + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + URemoteTables* Db; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + URemoteReducers* Reducers; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + USetReducerFlags* SetReducerFlags; + + // Delegates that allow users to bind with the concrete connection type. + FOnConnectDelegate OnConnectDelegate; + FOnDisconnectDelegate OnDisconnectDelegate; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + USubscriptionBuilder* SubscriptionBuilder(); + + /** Static entry point for constructing a connection. */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB", DisplayName = "SpacetimeDB Builder") + static UDbConnectionBuilder* Builder(); + + // Error handling + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnUnhandledReducerError, const FReducerEventContext&, Context, const FString&, Error); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FOnUnhandledReducerError OnUnhandledReducerError; + + +protected: + + // Hook up error handling to reducers + virtual void PostInitProperties() override; + + UFUNCTION() + void ForwardOnConnect(UDbConnectionBase* BaseConnection, FSpacetimeDBIdentity InIdentity, const FString& InToken); + UFUNCTION() + void ForwardOnDisconnect(UDbConnectionBase* BaseConnection, const FString& Error); + + UFUNCTION() + void OnUnhandledReducerErrorHandler(const FReducerEventContext& Context, const FString& Error); + + // Override the DbConnectionBase methods to handle updates and events + virtual void DbUpdate(const FDatabaseUpdateType& Update, const FSpacetimeDBEvent& Event) override; + + // Override the reducer event handler to dispatch events to the appropriate reducers + virtual void ReducerEvent(const FReducerEvent& Event) override; + + // Override the reducer event failed handler + virtual void ReducerEventFailed(const FReducerEvent& Event, const FString ErrorMessage) override; +}; + diff --git a/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Public/ModuleBindings/Tables/MessageTable.g.h b/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Public/ModuleBindings/Tables/MessageTable.g.h new file mode 100644 index 00000000000..c959977cbb0 --- /dev/null +++ b/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Public/ModuleBindings/Tables/MessageTable.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/MessageType.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "MessageTable.g.generated.h" + +UCLASS(BlueprintType) +class QUICKSTARTCHAT_API UMessageTable : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for message table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnMessageInsert, + const FEventContext&, Context, + const FMessageType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnMessageUpdate, + const FEventContext&, Context, + const FMessageType&, OldRow, + const FMessageType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnMessageDelete, + const FEventContext&, Context, + const FMessageType&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnMessageInsert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnMessageUpdate OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnMessageDelete OnDelete; + +private: + const FString TableName = TEXT("message"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Public/ModuleBindings/Tables/UserTable.g.h b/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Public/ModuleBindings/Tables/UserTable.g.h new file mode 100644 index 00000000000..7e567066cb9 --- /dev/null +++ b/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Public/ModuleBindings/Tables/UserTable.g.h @@ -0,0 +1,104 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/UserType.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "UserTable.g.generated.h" + +UCLASS(Blueprintable) +class QUICKSTARTCHAT_API UUserIdentityUniqueIndex : public UObject +{ + GENERATED_BODY() + +private: + // Declare an instance of your templated helper. + // It's private because the UObject wrapper will expose its functionality. + FUniqueIndexHelper> IdentityIndexHelper; + +public: + UUserIdentityUniqueIndex() + // Initialize the helper with the specific unique index name + : IdentityIndexHelper("Identity") { + } + + /** + * Finds a User by their unique identity. + * @param Key The identity to search for. + * @return The found FUserType, or a default-constructed FUserType if not found. + */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|UserIndex") + FUserType Find(FSpacetimeDBIdentity Key) + { + // Simply delegate the call to the internal helper + return IdentityIndexHelper.FindUniqueIndex(Key); + } + + // A public setter to provide the cache to the helper after construction + // This is a common pattern when the cache might be created or provided by another system. + void SetCache(TSharedPtr> InUserCache) + { + IdentityIndexHelper.Cache = InUserCache; + } +}; +/***/ + +UCLASS(BlueprintType) +class QUICKSTARTCHAT_API UUserTable : public URemoteTable +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly) + UUserIdentityUniqueIndex* Identity; + + void PostInitialize(); + + /** Update function for user table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnUserInsert, + const FEventContext&, Context, + const FUserType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnUserUpdate, + const FEventContext&, Context, + const FUserType&, OldRow, + const FUserType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnUserDelete, + const FEventContext&, Context, + const FUserType&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUserInsert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUserUpdate OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUserDelete OnDelete; + +private: + const FString TableName = TEXT("user"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Public/ModuleBindings/Types/MessageType.g.h b/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Public/ModuleBindings/Types/MessageType.g.h new file mode 100644 index 00000000000..8df2892195e --- /dev/null +++ b/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Public/ModuleBindings/Types/MessageType.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "MessageType.g.generated.h" + +USTRUCT(BlueprintType) +struct QUICKSTARTCHAT_API FMessageType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBIdentity Sender; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBTimestamp Sent; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FString Text; + + FORCEINLINE bool operator==(const FMessageType& Other) const + { + return Sender == Other.Sender && Sent == Other.Sent && Text == Other.Text; + } + + FORCEINLINE bool operator!=(const FMessageType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FMessageType. + * Combines the hashes of all fields that are compared in operator==. + * @param MessageType The FMessageType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FMessageType& MessageType) +{ + uint32 Hash = GetTypeHash(MessageType.Sender); + Hash = HashCombine(Hash, GetTypeHash(MessageType.Sent)); + Hash = HashCombine(Hash, GetTypeHash(MessageType.Text)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FMessageType); + + UE_SPACETIMEDB_STRUCT(FMessageType, Sender, Sent, Text); +} diff --git a/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Public/ModuleBindings/Types/UserType.g.h b/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Public/ModuleBindings/Types/UserType.g.h new file mode 100644 index 00000000000..06890176da4 --- /dev/null +++ b/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Public/ModuleBindings/Types/UserType.g.h @@ -0,0 +1,55 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Optionals/QuickstartChatOptionalString.g.h" +#include "Types/Builtins.h" +#include "UserType.g.generated.h" + +USTRUCT(BlueprintType) +struct QUICKSTARTCHAT_API FUserType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBIdentity Identity; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FQuickstartChatOptionalString Name; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + bool Online; + + FORCEINLINE bool operator==(const FUserType& Other) const + { + return Identity == Other.Identity && Name == Other.Name && Online == Other.Online; + } + + FORCEINLINE bool operator!=(const FUserType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FUserType. + * Combines the hashes of all fields that are compared in operator==. + * @param UserType The FUserType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FUserType& UserType) +{ + uint32 Hash = GetTypeHash(UserType.Identity); + Hash = HashCombine(Hash, GetTypeHash(UserType.Name)); + Hash = HashCombine(Hash, GetTypeHash(UserType.Online)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FUserType); + + UE_SPACETIMEDB_STRUCT(FUserType, Identity, Name, Online); +} diff --git a/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Public/QuickstartChat.h b/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Public/QuickstartChat.h new file mode 100644 index 00000000000..90aad9e7e22 --- /dev/null +++ b/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/Public/QuickstartChat.h @@ -0,0 +1,6 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" + diff --git a/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/QuickstartChat.Build.cs b/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/QuickstartChat.Build.cs new file mode 100644 index 00000000000..0848d7aa4d8 --- /dev/null +++ b/sdks/unreal/examples/QuickstartChat/Source/QuickstartChat/QuickstartChat.Build.cs @@ -0,0 +1,24 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +using System.IO; +using UnrealBuildTool; + +public class QuickstartChat : ModuleRules +{ + public QuickstartChat(ReadOnlyTargetRules Target) : base(Target) + { + // This module is used to demonstrate the SpacetimeDb SDK in Unreal Engine. + PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; + + PublicDependencyModuleNames.AddRange(new string[] + { + "Core", + "CoreUObject", + "Engine", + "InputCore", + "SpacetimeDbSdk" // Ensure the SpacetimeDb SDK is included as a dependency + }); + + PrivateDependencyModuleNames.AddRange(new string[] { }); + } +} diff --git a/sdks/unreal/examples/QuickstartChat/Source/QuickstartChatEditor.Target.cs b/sdks/unreal/examples/QuickstartChat/Source/QuickstartChatEditor.Target.cs new file mode 100644 index 00000000000..ec14bcb912c --- /dev/null +++ b/sdks/unreal/examples/QuickstartChat/Source/QuickstartChatEditor.Target.cs @@ -0,0 +1,15 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +using UnrealBuildTool; +using System.Collections.Generic; + +public class QuickstartChatEditorTarget : TargetRules +{ + public QuickstartChatEditorTarget(TargetInfo Target) : base(Target) + { + Type = TargetType.Editor; + DefaultBuildSettings = BuildSettingsVersion.V5; + + ExtraModuleNames.AddRange( new string[] { "QuickstartChat" } ); + } +} diff --git a/sdks/unreal/examples/README.md b/sdks/unreal/examples/README.md new file mode 100644 index 00000000000..e46bb47eb57 --- /dev/null +++ b/sdks/unreal/examples/README.md @@ -0,0 +1,27 @@ +## Quickstart Chat Module Version +This quickstart chat Client is built on from the [C# Module Quickstart](https://spacetimedb.com/docs/modules/c-sharp/quickstart). \ +If you have started with the [Rust Module Quickstart](https://spacetimedb.com/docs/modules/rust/quickstart) the reducer names will differ, send_message instead of SendMessage and set_name instead of SetName. / + + + +## How to Use the Quickstart Chat Example + +1. Follow the instructions in `Develop.md` in in "sdk-unreal" directory to integrate the `SpacetimeDbSdk` plugin into your project. +2. Launch the project in Unreal Engine. +3. Create a new level. Press add in the Content Browser, then select "Level" to create a new level. + - Alternatively, you can open an existing level if you already have one. +4. In the Content Browser, locate the `BP` folder. Inside, you’ll find an actor named `BP_ChatClientActor`. + +### Using the Blueprint Version + +- Drag `BP_ChatClientActor` into your level. +- Press the Play button to start the game. +- `BP_ChatClientActor` actor connects to `localhost` and uses the module name `quickstart-chat`. +- It automatically subscribes to all tables. +- In the Details panel, you can manually call functions to start/end subscriptions and invoke reducers, only while game is running. + +### Using the C++ Version + +- Click "Quickly add to Project" button (cube with a plus icon), select `ChatClientActor`, and add it to the level. +- Press the Play button to start the game. +- This actor provides the same functionality as the Blueprint version but is implemented in C++. diff --git a/sdks/unreal/src/SpacetimeDbSdk/Resources/Icon128.png b/sdks/unreal/src/SpacetimeDbSdk/Resources/Icon128.png new file mode 100644 index 00000000000..13d0acec044 Binary files /dev/null and b/sdks/unreal/src/SpacetimeDbSdk/Resources/Icon128.png differ diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Private/Connection/Callback.cpp b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Private/Connection/Callback.cpp new file mode 100644 index 00000000000..2a5ff4efc18 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Private/Connection/Callback.cpp @@ -0,0 +1 @@ +#include "Connection/Callback.h" diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Private/Connection/Credentials.cpp b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Private/Connection/Credentials.cpp new file mode 100644 index 00000000000..f2f4a0d4236 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Private/Connection/Credentials.cpp @@ -0,0 +1,50 @@ +#include "Connection/Credentials.h" +#include "Misc/Paths.h" +#include "Misc/ConfigCacheIni.h" + +FString UCredentials::Token; +FString UCredentials::StoredKey; + +void UCredentials::Init(const FString& InFilename) +{ + StoredKey = InFilename; + LoadToken(); +} + +FString UCredentials::LoadToken() +{ + FString LoadedValue; + if (StoredKey.IsEmpty()) + { + UE_LOG(LogTemp, Warning, TEXT("UCredentials::Init has not been called before LoadToken.")); + return Token; + } + + if (GConfig->GetString(TEXT("SpacetimeDB"), *StoredKey, LoadedValue, GGameUserSettingsIni)) + { + Token = LoadedValue; + UE_LOG(LogTemp, Verbose, TEXT("UCredentials::Credentials loaded for key %s from %s."), *StoredKey, *FPaths::GetCleanFilename(GGameUserSettingsIni)); + } + else + { + UE_LOG(LogTemp, Verbose, TEXT("UCredentials::No stored credentials found for key %s."), *StoredKey); + } + + return Token; +} + +void UCredentials::SaveToken(const FString& InToken) +{ + Token = InToken; + + if (StoredKey.IsEmpty()) + { + UE_LOG(LogTemp, Warning, TEXT("UCredentials::Init has not been called before SaveToken.")); + return; + } + + GConfig->SetString(TEXT("SpacetimeDB"), *StoredKey, *Token, GGameUserSettingsIni); + + // This call writes the in-memory changes to the GGameUserSettingsIni file on the disk. + GConfig->Flush(false, GGameUserSettingsIni); +} diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Private/Connection/DbConnectionBase.cpp b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Private/Connection/DbConnectionBase.cpp new file mode 100644 index 00000000000..b9dfddceb42 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Private/Connection/DbConnectionBase.cpp @@ -0,0 +1,659 @@ +#include "Connection/DbConnectionBase.h" +#include "Connection/DbConnectionBuilder.h" +#include "Connection/Credentials.h" +#include "ModuleBindings/Types/ClientMessageType.g.h" +#include "ModuleBindings/Types/SubscribeMultiType.g.h" +#include "ModuleBindings/Types/UnsubscribeMultiType.g.h" +#include "ModuleBindings/Types/SubscribeMultiAppliedType.g.h" +#include "ModuleBindings/Types/UnsubscribeMultiAppliedType.g.h" +#include "ModuleBindings/Types/SubscriptionErrorType.g.h" +#include "ModuleBindings/Types/DatabaseUpdateType.g.h" +#include "ModuleBindings/Types/CompressableQueryUpdateType.g.h" +#include "Misc/Compression.h" +#include "Misc/ScopeLock.h" +#include "Async/Async.h" +#include "BSATN/UEBSATNHelpers.h" + +UDbConnectionBase::UDbConnectionBase(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) +{ + NextRequestId = 1; + NextSubscriptionId = 1; +} + +void UDbConnectionBase::Disconnect() +{ + if (WebSocket) + { + WebSocket->Disconnect(); + } +} + +bool UDbConnectionBase::IsActive() const +{ + return WebSocket && WebSocket->IsConnected(); +} + + +bool UDbConnectionBase::TryGetIdentity(FSpacetimeDBIdentity& OutIdentity) const +{ + if (bIsIdentitySet) + { + OutIdentity = Identity; + return true; + } + + UE_LOG(LogTemp, Warning, TEXT("TryGetIdentity called before identity was set")); + return false; +} + +FSpacetimeDBConnectionId UDbConnectionBase::GetConnectionId() const +{ + return ConnectionId; +} + +bool UDbConnectionBase::SendRawMessage(const FString& Message) +{ + return WebSocket && WebSocket->SendMessage(Message); +} + +bool UDbConnectionBase::SendRawMessage(const TArray& Message) +{ + return WebSocket && WebSocket->SendMessage(Message); +} + +USubscriptionBuilderBase* UDbConnectionBase::SubscriptionBuilderBase() +{ + return NewObject(); +} + +void UDbConnectionBase::HandleWSError(const FString& Error) +{ + if (OnConnectErrorDelegate.IsBound()) + { + OnConnectErrorDelegate.Execute(Error); + } +} + +void UDbConnectionBase::HandleWSClosed(int32 /*StatusCode*/, const FString& Reason, bool /*bWasClean*/) +{ + if (OnDisconnectBaseDelegate.IsBound()) + { + OnDisconnectBaseDelegate.Execute(this, Reason); + } +} + +void UDbConnectionBase::HandleWSBinaryMessage(const TArray& Message) +{ + //tag for arrival order + const int32 Id = NextPreprocessId.GetValue(); + NextPreprocessId.Increment(); + + //do expensive work off-thread + TWeakObjectPtr WeakThis(this); + Async(EAsyncExecution::Thread, [WeakThis, Message, Id]() + { + if (!WeakThis.IsValid()) + { + return; + } + UDbConnectionBase* This = WeakThis.Get(); + + //parse the message, decompress if needed + FServerMessageType Parsed = This->PreProcessMessage(Message); + + //queue: re-order buffer + TArray Ready; + { + FScopeLock Lock(&This->PreprocessMutex); + // Move the parsed message into the map to avoid copying + This->PreprocessedMessages.Add(Id, MoveTemp(Parsed)); + //check if we can release any messages in order + while (This->PreprocessedMessages.Contains(This->NextReleaseId)) + { + Ready.Add(This->PreprocessedMessages.FindAndRemoveChecked(This->NextReleaseId)); + ++This->NextReleaseId; + } + } + //if we have any ready messages, append them to the pending messages list that is processed in Tick + if (Ready.Num() > 0) + { + FScopeLock Lock(&This->PendingMessagesMutex); + This->PendingMessages.Append(MoveTemp(Ready)); + } + }); +} + +void UDbConnectionBase::FrameTick() +{ + TArray Local; + { + FScopeLock Lock(&PendingMessagesMutex); + if (PendingMessages.Num() == 0) + { + //nothing to process, return early + return; + } + //move pending messages to local array for processing + Local = MoveTemp(PendingMessages); + PendingMessages.Empty(); + } + + //process all messages in the local array + for (const FServerMessageType& Msg : Local) + { + //process the message, this will call DbUpdate or trigger subscription events as needed + ProcessServerMessage(Msg); + } +} +void UDbConnectionBase::Tick(float DeltaTime) +{ + if (bIsAutoTicking) + { + FrameTick(); + } +} + +TStatId UDbConnectionBase::GetStatId() const +{ + // This is used by the engine to track tickables, we return a unique stat ID for this class + RETURN_QUICK_DECLARE_CYCLE_STAT(UMyTickableObject, STATGROUP_Tickables); +} + +bool UDbConnectionBase::IsTickable() const +{ + return bIsAutoTicking; +} + +bool UDbConnectionBase::IsTickableInEditor() const +{ + return bIsAutoTicking; +} + + +void UDbConnectionBase::ProcessServerMessage(const FServerMessageType& Message) +{ + bool bIsValid = false; + switch (Message.Tag) + { + case EServerMessageTag::InitialSubscription: + { + //@Note: This is a legacy tag, used implemented in current server version + break; + } + case EServerMessageTag::TransactionUpdate: + { + // Process a transaction update message + const FTransactionUpdateType Payload = Message.GetAsTransactionUpdate(); + + // Create a status object based on the transaction status + FSpacetimeDBStatus StatusObj; + bool bSuccess = false; + FString ErrorMessage; + if (Payload.Status.IsCommitted()) + { + bSuccess = true; + StatusObj = FSpacetimeDBStatus::Committed(FSpacetimeDBUnit()); + } + else if (Payload.Status.IsFailed()) + { + ErrorMessage = Payload.Status.GetAsFailed(); + StatusObj = FSpacetimeDBStatus::Failed(ErrorMessage); + } + else if (Payload.Status.IsOutOfEnergy()) + { + Payload.Status.GetAsOutOfEnergy(); + StatusObj = FSpacetimeDBStatus::OutOfEnergy(FSpacetimeDBUnit()); + ErrorMessage = TEXT("Out of energy"); + } + + // Process the transaction update and create a reducer event + FReducerEvent RedEvent; + RedEvent.Timestamp = Payload.Timestamp; + RedEvent.Status = StatusObj; + RedEvent.CallerIdentity = Payload.CallerIdentity; + RedEvent.CallerConnectionId = Payload.CallerConnectionId; + RedEvent.EnergyConsumed = Payload.EnergyQuantaUsed; + RedEvent.ReducerCall = Payload.ReducerCall; + + // If the status is committed, we update the database + if (bSuccess) + { + DbUpdate(Payload.Status.GetAsCommitted(), FSpacetimeDBEvent::Reducer(RedEvent)); // Update table and trigger insert/update/delete + ReducerEvent(RedEvent); // Trigger the reducer event + } + else + { + ReducerEvent(RedEvent); // Trigger the reducer event + ReducerEventFailed(RedEvent, ErrorMessage); + } + break; + } + case EServerMessageTag::TransactionUpdateLight: + { + // Process a light transaction update message + const FTransactionUpdateLightType Payload = Message.GetAsTransactionUpdateLight(); + + //@TODO: Implement light update fully + DbUpdate(Payload.Update, FSpacetimeDBEvent::UnknownTransaction(FSpacetimeDBUnit())); + + break; + } + case EServerMessageTag::IdentityToken: + { + // Process an identity token message + const FIdentityTokenType Payload = Message.GetAsIdentityToken(); + + Token = Payload.Token; + UCredentials::SaveToken(Token); + Identity = Payload.Identity; + bIsIdentitySet = true; + UE_LOG(LogTemp, Verbose, TEXT("IdentityToken: Identity set to: %s"), *Identity.ToHex()); + ConnectionId = Payload.ConnectionId; + if (OnConnectBaseDelegate.IsBound()) + { + OnConnectBaseDelegate.Execute(this, Identity, Token); + } + break; + } + case EServerMessageTag::OneOffQueryResponse: + { + //@Note: Not implemented in Rust version, skip for now here aswell + break; + } + case EServerMessageTag::SubscribeApplied: + { + //@Note: This is a legacy tag, not implemented in current server version + break; + } + case EServerMessageTag::UnsubscribeApplied: + { + //@Note: This is a legacy tag, not implemented in current server version + break; + } + case EServerMessageTag::SubscriptionError: + { + // Process a subscription error message + const FSubscriptionErrorType Payload = Message.GetAsSubscriptionError(); + if (TObjectPtr Handle = *ActiveSubscriptions.Find(Payload.QueryId.Value)) + { + if (!Handle) + { + UE_LOG(LogTemp, Error, TEXT("SubscriptionError: Null handle for QueryId %u. Error: %s"), + Payload.QueryId.Value, + *Payload.Error); + return; + } + FErrorContextBase Ctx; Ctx.Error = Payload.Error; + Handle->TriggerError(Ctx); + ActiveSubscriptions.Remove(Payload.QueryId.Value); + } + break; + } + case EServerMessageTag::SubscribeMultiApplied: + { + // Process a multi-subscription applied message + const FSubscribeMultiAppliedType Payload = Message.GetAsSubscribeMultiApplied(); + // Update the database with the subscription applied event + DbUpdate(Payload.Update, FSpacetimeDBEvent::SubscribeApplied(FSpacetimeDBUnit())); + + if (TObjectPtr Handle = *ActiveSubscriptions.Find(Payload.QueryId.Id)) + { + if (!Handle) + { + UE_LOG(LogTemp, Error, TEXT("SubscriptionError: Null handle for QueryId %u."), Payload.QueryId.Id); + return; + } + FSubscriptionEventContextBase Ctx; Ctx.Event = FSpacetimeDBEvent::SubscribeApplied(FSpacetimeDBUnit()); + Handle->TriggerApplied(Ctx); + } + + break; + } + case EServerMessageTag::UnsubscribeMultiApplied: + { + // Process a multi-unsubscription applied message + const FUnsubscribeMultiAppliedType Payload = Message.GetAsUnsubscribeMultiApplied(); + + // Update the database with the unsubscription applied event + DbUpdate(Payload.Update, FSpacetimeDBEvent::UnsubscribeApplied(FSpacetimeDBUnit())); + if (TObjectPtr Handle = *ActiveSubscriptions.Find(Payload.QueryId.Id)) + { + if (!Handle) + { + UE_LOG(LogTemp, Error, TEXT("UnsubscribeMultiApplied: Null handle for QueryId %u."), Payload.QueryId.Id); + return; + } + Handle->bEnded = true; + Handle->bActive = false; + Handle->bUnsubscribeCalled = true; + FSubscriptionEventContextBase Ctx; Ctx.Event = FSpacetimeDBEvent::UnsubscribeApplied(FSpacetimeDBUnit()); + if (Handle->EndDelegate.IsBound()) + { + Handle->EndDelegate.Execute(Ctx); + } + ActiveSubscriptions.Remove(Payload.QueryId.Id); + } + break; + } + default: + // Unknown tag - bail out + UE_LOG(LogTemp, Warning, TEXT("Unknown server-message tag")); + break; + } +} + +bool UDbConnectionBase::DecompressBrotli(const TArray& InData, TArray& OutData) +{ + UE_LOG(LogTemp, Error, TEXT("Brotli decompression unavilable")); + return false; +} + +bool UDbConnectionBase::DecompressGzip(const TArray& InData, TArray& OutData) +{ + if (InData.Num() < 4) + { + UE_LOG(LogTemp, Error, TEXT("Gzip data too small")); + return false; + } + + // Gzip data ends with 4 bytes indicating the uncompressed size + const uint8* SizePtr = InData.GetData() + InData.Num() - 4; + uint32 OutSize = SizePtr[0] | (SizePtr[1] << 8) | (SizePtr[2] << 16) | (SizePtr[3] << 24); + + // Validate the output size + OutData.SetNumUninitialized(OutSize); + // Attempt to decompress the Gzip data + if (!FCompression::UncompressMemory(NAME_Gzip, OutData.GetData(), OutSize, InData.GetData(), InData.Num())) + { + UE_LOG(LogTemp, Error, TEXT("Gzip decompression failed")); + return false; + } + + OutData.SetNum(OutSize); + return true; +} + +bool UDbConnectionBase::DecompressPayload(ECompressableQueryUpdateTag Variant, const TArray& In, TArray& Out) +{ + switch (Variant) + { + case ECompressableQueryUpdateTag::Uncompressed: + // No compression, just copy the data + Out = In; + return true; + case ECompressableQueryUpdateTag::Brotli: + return DecompressBrotli(In, Out); + case ECompressableQueryUpdateTag::Gzip: + return DecompressGzip(In, Out); + default: + UE_LOG(LogTemp, Error, TEXT("Unknown compression variant")); + return false; + } +} + +void UDbConnectionBase::PreProcessDatabaseUpdate(const FDatabaseUpdateType& Update) +{ + for (const FTableUpdateType& TableUpdate : Update.Tables) + { + TArray UncompressedCQUs; + for (const FCompressableQueryUpdateType& CQU : TableUpdate.Updates) + { + + // Uncompress the CQU based on its tag + FQueryUpdateType UncompressedUpdate; + switch (CQU.Tag) + { + case ECompressableQueryUpdateTag::Uncompressed: + UncompressedUpdate = CQU.GetAsUncompressed(); + break; + case ECompressableQueryUpdateTag::Brotli: + { + TArray Data = CQU.GetAsBrotli(); + TArray Dec; + if (DecompressBrotli(Data, Dec)) + { + //@Note: This will never trigger until Brotli decompression is implemented + UncompressedUpdate = UE::SpacetimeDB::Deserialize(Dec); + } + break; + } + case ECompressableQueryUpdateTag::Gzip: + { + TArray Data = CQU.GetAsGzip(); + TArray Dec; + if (DecompressGzip(Data, Dec)) + { + UncompressedUpdate = UE::SpacetimeDB::Deserialize(Dec); + } + break; + } + default: + UE_LOG(LogTemp, Error, TEXT("Unknown compression variant in CQU")); + break; + } + UncompressedCQUs.Add(FCompressableQueryUpdateType::Uncompressed(UncompressedUpdate)); + UE_LOG(LogTemp, Verbose, TEXT("Table %s Inserts:%d Deletes:%d"), *TableUpdate.TableName, UncompressedUpdate.Inserts.RowsData.Num(), UncompressedUpdate.Deletes.RowsData.Num()); + } + + // After ensuring all updates are uncompressed, attempt to deserialize rows + TSharedPtr Deserializer; + { + // Find the deserializer for this table + FScopeLock Lock(&TableDeserializersMutex); + if (TSharedPtr* Found = TableDeserializers.Find(TableUpdate.TableName)) + { + // If found, use the deserializer + Deserializer = *Found; + } + else + { + UE_LOG(LogTemp, Error, TEXT("No deserializer found for table %s"), *TableUpdate.TableName); + } + } + if (Deserializer) + { + // Preprocess the table data using the deserializer + TSharedPtr Data = Deserializer->PreProcess(UncompressedCQUs, TableUpdate.TableName); + if (Data.IsValid()) + { + // Store the preprocessed data in the mutex-protected map + FScopeLock Lock(&PreprocessedDataMutex); + FPreprocessedTableKey Key(TableUpdate.TableId, TableUpdate.TableName); + TArray>& Queue = PreprocessedTableData.FindOrAdd(Key); + Queue.Add(Data); + } + } + else + { + UE_LOG(LogTemp, Error, TEXT("Skipping table %s updates due to missing deserializer"), *TableUpdate.TableName); + } + } +} + +FServerMessageType UDbConnectionBase::PreProcessMessage(const TArray& Message) +{ + if (Message.Num() == 0) + { + UE_LOG(LogTemp, Error, TEXT("Empty message recived from server, ignored")); + return FServerMessageType{}; + } + // Check if the first byte is a valid compression tag + ECompressableQueryUpdateTag Compression = static_cast(Message[0]); + TArray CompressedPayload; + CompressedPayload.Append(Message.GetData() + 1, Message.Num() - 1); + + // Decompress the payload based on the compression tag + TArray Decompressed; + if (!DecompressPayload(Compression, CompressedPayload, Decompressed)) + { + UE_LOG(LogTemp, Error, TEXT("Failed to decompress incoming message")); + return FServerMessageType{}; + } + + // Deserialize the decompressed data into a UServerMessageType object + FServerMessageType Parsed = UE::SpacetimeDB::Deserialize(Decompressed); + + // Process it based on its tag. Messages containing rows will be deserialized into rows based on registered type and table name. + bool bValid = false; + switch (Parsed.Tag) + { + case EServerMessageTag::InitialSubscription: + { + const FInitialSubscriptionType Payload = Parsed.GetAsInitialSubscription(); + // PreProcess the initial subscription payload + PreProcessDatabaseUpdate(Payload.DatabaseUpdate); + break; + } + case EServerMessageTag::TransactionUpdate: + { + + const FTransactionUpdateType Payload = Parsed.GetAsTransactionUpdate(); + if (Payload.Status.IsCommitted()) + { + // PreProcess the database update with the committed status + PreProcessDatabaseUpdate(Payload.Status.GetAsCommitted()); + } + break; + } + case EServerMessageTag::TransactionUpdateLight: + { + //@Note: Light tag in not implemented as an option in connection builder, this will never trigger but we keep this for future compatibility + const FTransactionUpdateLightType Payload = Parsed.GetAsTransactionUpdateLight(); + // PreProcess the light transaction update + PreProcessDatabaseUpdate(Payload.Update); + break; + } + case EServerMessageTag::SubscribeMultiApplied: + { + const FSubscribeMultiAppliedType Payload = Parsed.GetAsSubscribeMultiApplied(); + PreProcessDatabaseUpdate(Payload.Update); + break; + } + case EServerMessageTag::UnsubscribeMultiApplied: + { + const FUnsubscribeMultiAppliedType Payload = Parsed.GetAsUnsubscribeMultiApplied(); + PreProcessDatabaseUpdate(Payload.Update); + break; + } + default: + break; + } + return Parsed; +} + + +int32 UDbConnectionBase::GetNextRequestId() +{ + return NextRequestId++; +} + +int32 UDbConnectionBase::GetNextSubscriptionId() +{ + return NextSubscriptionId++; +} + +void UDbConnectionBase::StartSubscription(USubscriptionHandleBase* Handle) +{ + if (!Handle) + { + UE_LOG(LogTemp, Error, TEXT("StartSubscription called with null handle")); + return; + } + + if (Handle->QuerySqls.Num() == 0) + { + UE_LOG(LogTemp, Error, TEXT("StartSubscription called with empty query list")); + return; + } + + const int32 QueryId = GetNextSubscriptionId(); + Handle->QueryId = QueryId; + Handle->ConnInternal = this; + ActiveSubscriptions.Add(QueryId, Handle); + + FSubscribeMultiType SubMsg; + SubMsg.QueryStrings = Handle->QuerySqls; + SubMsg.RequestId = GetNextRequestId(); + SubMsg.QueryId.Id = QueryId; + + FClientMessageType Msg = FClientMessageType::SubscribeMulti(SubMsg); + TArray Data = UE::SpacetimeDB::Serialize(Msg); + SendRawMessage(Data); +} + +void UDbConnectionBase::UnsubscribeInternal(USubscriptionHandleBase* Handle) +{ + if (!Handle || Handle->bEnded) + { + return; + } + + const int32 QueryId = Handle->QueryId; + FUnsubscribeMultiType MsgData; + MsgData.RequestId = GetNextRequestId(); + MsgData.QueryId.Id = QueryId; + + FClientMessageType Msg = FClientMessageType::UnsubscribeMulti(MsgData); + TArray Data = UE::SpacetimeDB::Serialize(Msg); + SendRawMessage(Data); +} + +void UDbConnectionBase::InternalCallReducer(const FString& Reducer, TArray Args, USetReducerFlagsBase* Flags) +{ + + if (!WebSocket || !WebSocket->IsConnected()) + { + UE_LOG(LogTemp, Error, TEXT("Cannot call reducer, not connected to server!")); + return; + } + + uint8 FlagToUse = 0; // Default to FullUpdate + if (Flags && Flags->FlagMap.Contains(Reducer)) + { + //Select flag if set by user + ECallReducerFlags FlagFound = *Flags->FlagMap.Find(Reducer); + FlagToUse = static_cast(FlagFound); + } + + FCallReducerType MsgData; + MsgData.Reducer = Reducer; + MsgData.Args = Args; + MsgData.RequestId = GetNextRequestId(); + MsgData.Flags = FlagToUse; + + FClientMessageType Msg = FClientMessageType::CallReducer(MsgData); + TArray Data = UE::SpacetimeDB::Serialize(Msg); + SendRawMessage(Data); + +} + +void UDbConnectionBase::ApplyRegisteredTableUpdates(const FDatabaseUpdateType& Update, void* Context) +{ + // Ensure we have a valid context for the update + TArray> Handlers; + for (const FTableUpdateType& TableUpdate : Update.Tables) + { + TSharedPtr Handler; + { + // Find the handler for this table update + FScopeLock Lock(&RegisteredTablesMutex); + if (TSharedPtr* Found = RegisteredTables.Find(TableUpdate.TableName)) + { + Handler = *Found; + } + } + if (Handler.IsValid()) + { + // Update the cache for the handler with the table update and context + Handler->UpdateCache(this, TableUpdate, Context); + Handlers.Add(Handler); + } + } + + for (TSharedPtr& Handler : Handlers) + { + // Broadcast the diff for each handler + Handler->BroadcastDiff(this, Context); + } +} \ No newline at end of file diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Private/Connection/DbConnectionBuilder.cpp b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Private/Connection/DbConnectionBuilder.cpp new file mode 100644 index 00000000000..669e0a26102 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Private/Connection/DbConnectionBuilder.cpp @@ -0,0 +1,125 @@ +#include "Connection/DbConnectionBuilder.h" +#include "Connection/Websocket.h" +#include "Connection/DbConnectionBase.h" + + +UDbConnectionBuilderBase* UDbConnectionBuilderBase::WithUriBase(const FString& InUri) +{ + // Check if the URI contains "localhost:" and replace it with adress + if (InUri.IsEmpty()) + { + UE_LOG(LogTemp, Warning, TEXT("WithUriBase called with empty URI, not allowed")); + return this; + } + if (InUri.Contains("localhost:")) + { + FString FixedUri = InUri.Replace(TEXT("localhost"), TEXT("127.0.0.1"), ESearchCase::IgnoreCase); + Uri = FixedUri; + } + else + { + Uri = InUri; + } + return this; +} + + +UDbConnectionBuilderBase* UDbConnectionBuilderBase::WithModuleNameBase(const FString& InName) +{ + if (InName.IsEmpty()) + { + UE_LOG(LogTemp, Warning, TEXT("WithModuleNameBase called with empty module name, not allowd")); + } + ModuleName = InName; + return this; +} + + +UDbConnectionBuilderBase* UDbConnectionBuilderBase::WithTokenBase(const FString& InToken) +{ + Token = InToken; + return this; +} + +UDbConnectionBuilderBase* UDbConnectionBuilderBase::WithCompressionBase(const ESpacetimeDBCompression& InCompression) +{ + if (InCompression == ESpacetimeDBCompression::Brotli) + { + UE_LOG(LogTemp, Warning, TEXT("Brotli compression is not available in this version of SDK. Defaulting to Gzip.")); + Compression = ESpacetimeDBCompression::Gzip; + } + else + { + Compression = InCompression; + } + bCompressionSet = true; + return this; +} + +UDbConnectionBuilderBase* UDbConnectionBuilderBase::OnConnectBase(FOnConnectBaseDelegate Callback) +{ + OnConnectCallback = Callback; + return this; +} + +UDbConnectionBuilderBase* UDbConnectionBuilderBase::OnConnectErrorBase(FOnConnectErrorDelegate Callback) +{ + OnConnectErrorCallback = Callback; + return this; +} + +UDbConnectionBuilderBase* UDbConnectionBuilderBase::OnDisconnectBase(FOnDisconnectBaseDelegate Callback) +{ + OnDisconnectCallback = Callback; + return this; +} + +UDbConnectionBase* UDbConnectionBuilderBase::BuildConnection(UDbConnectionBase* Connection) +{ + + if (!Connection) + { + UE_LOG(LogTemp, Error, TEXT("BuildConnection called with null connection object")); + return nullptr; + } + + if (Uri.IsEmpty() || ModuleName.IsEmpty()) + { + UE_LOG(LogTemp, Error, TEXT("BuildConnection missing required Uri or ModuleName")); + return nullptr; + } + + Connection->Uri = Uri; + Connection->ModuleName = ModuleName; + Connection->Token = Token; + Connection->OnConnectBaseDelegate = OnConnectCallback; + Connection->OnConnectErrorDelegate = OnConnectErrorCallback; + Connection->OnDisconnectBaseDelegate = OnDisconnectCallback; + + Connection->WebSocket = NewObject(Connection); + + //Default to Gzip compression if not set + if (!bCompressionSet) + { + Compression = ESpacetimeDBCompression::Gzip; + } + + const UEnum* CompressionEnum = StaticEnum(); + const FString CompressionName = CompressionEnum->GetNameStringByValue(static_cast(Compression)); + + // Construct the WebSocket URL using the provided URI, module name, and compression type + FString WebSocketUrl = FString::Printf(TEXT("ws://%s/v1/database/%s/subscribe?compression=%s"), + *Uri, + *ModuleName, + *CompressionName); + + Connection->WebSocket->OnConnectionError.AddDynamic(Connection, &UDbConnectionBase::HandleWSError); + Connection->WebSocket->OnClosed.AddDynamic(Connection, &UDbConnectionBase::HandleWSClosed); + Connection->WebSocket->OnBinaryMessageReceived.AddDynamic(Connection, &UDbConnectionBase::HandleWSBinaryMessage); + // Set the initialization token for the WebSocket connection + Connection->WebSocket->SetInitToken(Token); + // Connect the WebSocket to the constructed URL + Connection->WebSocket->Connect(WebSocketUrl); + + return Connection; +} \ No newline at end of file diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Private/Connection/Subscription.cpp b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Private/Connection/Subscription.cpp new file mode 100644 index 00000000000..a9de0f66edd --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Private/Connection/Subscription.cpp @@ -0,0 +1,110 @@ +#include "Connection/Subscription.h" +#include "Connection/DbConnectionBase.h" + +USubscriptionHandleBase::USubscriptionHandleBase() {} + +void USubscriptionHandleBase::Unsubscribe() +{ + if (bEnded ) + { + UE_LOG(LogTemp, Warning, TEXT("USubscriptionHandleBase::Unsubscribe called on an already ended handle. Not allowed")); + return; + } + if (bUnsubscribeCalled) + { + UE_LOG(LogTemp, Warning, TEXT("USubscriptionHandleBase::Unsubscribe called multiple times for the same handle. Not allowed")); + return; + } + + bUnsubscribeCalled = true; + + if (ConnInternal) + { + // If we have a connection, we will unsubscribe from it + ConnInternal->UnsubscribeInternal(this); + } + else + { + // If we don't have a connection, we just end the subscription + bEnded = true; + bActive = false; + if (EndDelegate.IsBound()) + { + FSubscriptionEventContextBase Ctx; + EndDelegate.Execute(Ctx); + } + } +} + +void USubscriptionHandleBase::UnsubscribeThen(FSubscriptionEventDelegate OnEnd) +{ + // If we have a connection, we will unsubscribe from it and call the end delegate when done + EndDelegate = OnEnd; + Unsubscribe(); +} + +void USubscriptionHandleBase::TriggerApplied(const FSubscriptionEventContextBase& Context) +{ + if (bEnded) + { + return; + } + bActive = true; + if (AppliedDelegate.IsBound()) + { + // If the subscription is active, we execute the applied delegate with the context + AppliedDelegate.Execute(Context); + } +} + +void USubscriptionHandleBase::TriggerError(const FErrorContextBase& Context) +{ + if (bEnded) + { + return; + } + bEnded = true; + bActive = false; + if (ErrorDelegate.IsBound()) + { + // If the subscription has an error, we execute the error delegate with the context + ErrorDelegate.Execute(Context); + } +} + +USubscriptionBuilderBase::USubscriptionBuilderBase() {} + +USubscriptionBuilderBase* USubscriptionBuilderBase::OnAppliedBase(FSubscriptionEventDelegate Callback) +{ + AppliedDelegate = Callback; + return this; +} + +USubscriptionBuilderBase* USubscriptionBuilderBase::OnErrorBase(FSubscriptionErrorDelegate Callback) +{ + ErrorDelegate = Callback; + return this; +} + +USubscriptionHandleBase* USubscriptionBuilderBase::SubscribeBase(const TArray& QuerySqls, USubscriptionHandleBase* Handle) +{ + if (!Handle) + { + UE_LOG(LogTemp, Error, TEXT("USubscriptionBuilderBase::SubscribeBase: Handle is null! Returning null handle.")); + return Handle; + } + + if (QuerySqls.Num() == 0) + { + UE_LOG(LogTemp, Warning, TEXT("SubscribeBase called with no query strings")); + } + + Handle->AppliedDelegate = AppliedDelegate; + Handle->ErrorDelegate = ErrorDelegate; + Handle->QuerySqls = QuerySqls; + // Reset delegates so builder can be reused safely + AppliedDelegate.Unbind(); + ErrorDelegate.Unbind(); + Handle->bActive = false; + return Handle; +} \ No newline at end of file diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Private/Connection/Websocket.cpp b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Private/Connection/Websocket.cpp new file mode 100644 index 00000000000..ab499d7d087 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Private/Connection/Websocket.cpp @@ -0,0 +1,220 @@ + +#include "Connection/Websocket.h" +#include "WebSocketsModule.h" // Required for FWebSocketsModule +#include "SpacetimeDbSdk/Public/BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Types/ServerMessageType.g.h" +#include "ModuleBindings/Types/CompressableQueryUpdateType.g.h" +#include "Misc/Compression.h" + +#include "Dom/JsonObject.h" +#include "Serialization/JsonWriter.h" +#include "Serialization/JsonSerializer.h" + +static void LogIdentityTokenHex(const FIdentityTokenType& InToken, const TCHAR* TagName) +{ + // Logs the identity token in a structured format for debugging purposes. + TSharedRef Obj = MakeShared(); + Obj->SetStringField(TEXT("__identity__"), InToken.Identity.ToHex()); + Obj->SetStringField(TEXT("token"), InToken.Token); + Obj->SetStringField(TEXT("__connection_id__"), InToken.ConnectionId.ToHex()); + + FString Json; + TSharedRef> Writer = TJsonWriterFactory<>::Create(&Json); + FJsonSerializer::Serialize(Obj, Writer); + UE_LOG(LogTemp, Log, TEXT("[%s] %s"), TagName, *Json); +} + +UWebsocketManager::UWebsocketManager() +{ + // Ensure the WebSockets module is loaded. + FModuleManager::LoadModuleChecked(TEXT("WebSockets")); +} + +void UWebsocketManager::BeginDestroy() +{ + UE_LOG(LogTemp, Log, TEXT("UWebsocketManager::BeginDestroy: Cleaning up WebSocket.")); + if (!HasAnyFlags(RF_ClassDefaultObject)) + { + Disconnect(); + } + Super::BeginDestroy(); +} + +void UWebsocketManager::Connect(const FString& ServerUrl) +{ + if (IsConnected()) + { + UE_LOG(LogTemp, Warning, TEXT("UWebsocketManager::Connect: Already connected. Disconnect first.")); + return; + } + + if (ServerUrl.IsEmpty()) + { + UE_LOG(LogTemp, Error, TEXT("UWebsocketManager::Connect called with empty URL")); + OnConnectionError.Broadcast(TEXT("Invalid server URL")); + return; + } + + // append InitToken to the connection headers if provided + TMap UpgradeHeaders; + if (!InitToken.IsEmpty()) + { + FString HeaderToken = FString::Printf(TEXT("Bearer %s"), + *InitToken); + UpgradeHeaders.Add("Authorization", HeaderToken); + } + + // using the v1.bsatn.spacetimedb protocol for WebSocket connections + const FString Protocol = "v1.bsatn.spacetimedb"; // @TODO: Implement JSON alternative, v1.json.spacetimedb + + // Create the WebSocket connection + WebSocket = FWebSocketsModule::Get().CreateWebSocket(ServerUrl, Protocol, UpgradeHeaders); + + if (!WebSocket.IsValid()) + { + UE_LOG(LogTemp, Error, TEXT("UWebsocketManager::Connect: Failed to create WebSocket connection to %s."), *ServerUrl); + OnConnectionError.Broadcast(TEXT("Failed to create WebSocket.")); + return; + } + + // Bind event handlers + WebSocket->OnConnected().AddUObject(this, &UWebsocketManager::HandleConnected); + WebSocket->OnConnectionError().AddUObject(this, &UWebsocketManager::HandleConnectionError); + WebSocket->OnMessage().AddUObject(this, &UWebsocketManager::HandleMessageReceived); + WebSocket->OnRawMessage().AddUObject(this, &UWebsocketManager::HandleBinaryMessageReceived); + WebSocket->OnClosed().AddUObject(this, &UWebsocketManager::HandleClosed); + + UE_LOG(LogTemp, Log, TEXT("UWebsocketManager::Connect: Connecting to %s..."), *ServerUrl); + // Start the connection process + WebSocket->Connect(); +} + +void UWebsocketManager::Disconnect() +{ + if (!WebSocket.IsValid()) + { + return; + } + + if (IsConnected()) + { + UE_LOG(LogTemp, Log, TEXT("UWebsocketManager::Disconnect: Closing WebSocket connection.")); + WebSocket->Close(); + } + + // Reset the WebSocket to allow for reconnection attempts + WebSocket.Reset(); +} + +bool UWebsocketManager::SendMessage(const FString& Message) +{ + if (!IsConnected()) + { + UE_LOG(LogTemp, Warning, TEXT("UWebsocketManager::SendMessage: WebSocket is not connected.")); + return false; + } + + if (!WebSocket.IsValid()) + { + UE_LOG(LogTemp, Error, TEXT("UWebsocketManager::SendMessage: WebSocket is not valid.")); + return false; + } + + // send the message as a UTF-8 encoded string + WebSocket->Send(Message); + return true; +} + +bool UWebsocketManager::SendMessage(const TArray& Data) +{ + if (!IsConnected()) + { + UE_LOG(LogTemp, Warning, TEXT("UWebsocketManager::SendMessage: WebSocket is not connected.")); + return false; + } + + if (!WebSocket.IsValid()) + { + UE_LOG(LogTemp, Error, TEXT("UWebsocketManager::SendMessage: WebSocket is not valid.")); + return false; + } + + // send the data as a binary message + WebSocket->Send(Data.GetData(), Data.Num(), true); + return true; +} + +bool UWebsocketManager::IsConnected() const +{ + return WebSocket.IsValid() && WebSocket->IsConnected(); +} + +void UWebsocketManager::SetInitToken(FString Token) +{ + InitToken = Token; +} + +void UWebsocketManager::HandleConnected() +{ + UE_LOG(LogTemp, Log, TEXT("UWebsocketManager: WebSocket Connected.")); + OnConnected.Broadcast(); +} + +void UWebsocketManager::HandleConnectionError(const FString& Error) +{ + UE_LOG(LogTemp, Error, TEXT("UWebsocketManager: WebSocket Connection Error: %s"), *Error); + OnConnectionError.Broadcast(Error); + // Reset on error to allow reconnection attempts + WebSocket.Reset(); +} + +void UWebsocketManager::HandleMessageReceived(const FString& Message) +{ + OnMessageReceived.Broadcast(Message); +} + +void UWebsocketManager::HandleBinaryMessageReceived(const void* Data, SIZE_T Size, SIZE_T BytesRemaining) +{ + if (Size == 0) + { + return; + } + + // Handle binary messages, which may be fragmented + const uint8* Bytes = static_cast(Data); + + if (IncompleteMessage.Num() > 0 && !bAwaitingBinaryFragments) + { + UE_LOG(LogTemp, Error, TEXT("Received binary fragment while previous data pending")); + } + + // Append new incoming bytes to any incomplete message + IncompleteMessage.Append(Bytes, Size); + + if (BytesRemaining > 0) + { + // Still expecting more fragments + bAwaitingBinaryFragments = true; + return; + } + + // Final fragment received, reset and process + bAwaitingBinaryFragments = false; + + TArray MessageBytes = IncompleteMessage; + IncompleteMessage.Reset(); + + // Forward the complete binary payload to listeners. + OnBinaryMessageReceived.Broadcast(MessageBytes); + +} + +void UWebsocketManager::HandleClosed(int32 StatusCode, const FString& Reason, bool bWasClean) +{ + UE_LOG(LogTemp, Log, TEXT("UWebsocketManager: WebSocket Closed. Status: %d, Reason: %s, Clean: %s"), + StatusCode, *Reason, bWasClean ? TEXT("true") : TEXT("false")); + // Notify listeners about the closure + OnClosed.Broadcast(StatusCode, Reason, bWasClean); + // Reset on close to allow reconnection attempts + WebSocket.Reset(); +} \ No newline at end of file diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Private/SpacetimeDbSdk.cpp b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Private/SpacetimeDbSdk.cpp new file mode 100644 index 00000000000..c304862e58f --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Private/SpacetimeDbSdk.cpp @@ -0,0 +1,20 @@ +#include "SpacetimeDbSdk.h" + + +#define LOCTEXT_NAMESPACE "FSpacetimeDbSdkModule" + +void FSpacetimeDbSdkModule::StartupModule() +{ + // This code will execute after your module is loaded into memory; the exact timing is specified in the .uplugin file per-module + +} + +void FSpacetimeDbSdkModule::ShutdownModule() +{ + // This function may be called during shutdown to clean up your module. For modules that support dynamic reloading, + // we call this function before unloading the module. +} + +#undef LOCTEXT_NAMESPACE + +IMPLEMENT_MODULE(FSpacetimeDbSdkModule, SpacetimeDbSdk) \ No newline at end of file diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Private/Tests/SpacetimeDBBSATNTestOrg.cpp b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Private/Tests/SpacetimeDBBSATNTestOrg.cpp new file mode 100644 index 00000000000..e64359717f5 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Private/Tests/SpacetimeDBBSATNTestOrg.cpp @@ -0,0 +1,450 @@ +/** + * BSATN round-trip test-suite (Simple Automation Test) + */ + +#include "Tests/SpacetimeDBBSATNTestOrg.h" + +#include "Types/LargeIntegers.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/BsatnRowListType.g.h" +#include "ModuleBindings/Types/CallReducerType.g.h" +#include "ModuleBindings/Types/ClientMessageType.g.h" +#include "ModuleBindings/Types/CompressableQueryUpdateType.g.h" +#include "ModuleBindings/Types/DatabaseUpdateType.g.h" +#include "ModuleBindings/Types/EnergyQuantaType.g.h" +#include "ModuleBindings/Types/IdentityTokenType.g.h" +#include "ModuleBindings/Types/InitialSubscriptionType.g.h" +#include "ModuleBindings/Types/OneOffQueryResponseType.g.h" +#include "ModuleBindings/Types/OneOffQueryType.g.h" +#include "ModuleBindings/Types/OneOffTableType.g.h" +#include "ModuleBindings/Types/QueryIdType.g.h" +#include "ModuleBindings/Types/QueryUpdateType.g.h" +#include "ModuleBindings/Types/ReducerCallInfoType.g.h" +#include "ModuleBindings/Types/RowSizeHintType.g.h" +#include "ModuleBindings/Types/ServerMessageType.g.h" +#include "ModuleBindings/Types/SubscribeAppliedType.g.h" +#include "ModuleBindings/Types/SubscribeMultiAppliedType.g.h" +#include "ModuleBindings/Types/SubscribeMultiType.g.h" +#include "ModuleBindings/Types/SubscribeRowsType.g.h" +#include "ModuleBindings/Types/SubscribeSingleType.g.h" +#include "ModuleBindings/Types/SubscribeType.g.h" +#include "ModuleBindings/Types/SubscriptionErrorType.g.h" +#include "ModuleBindings/Types/TableUpdateType.g.h" +#include "ModuleBindings/Types/TransactionUpdateLightType.g.h" +#include "ModuleBindings/Types/TransactionUpdateType.g.h" +#include "ModuleBindings/Types/UnsubscribeAppliedType.g.h" +#include "ModuleBindings/Types/UnsubscribeMultiAppliedType.g.h" +#include "ModuleBindings/Types/UnsubscribeMultiType.g.h" +#include "ModuleBindings/Types/UnsubscribeType.g.h" +#include "ModuleBindings/Types/UpdateStatusType.g.h" + + +// ────────────────────────────────────────────────────────────────────────────── +// Simple Automation Test entry-point +// ────────────────────────────────────────────────────────────────────────────── +IMPLEMENT_SIMPLE_AUTOMATION_TEST( + FBSATNSerializationTest, + "SpacetimeDB.Serialization.RoundTrip", + EAutomationTestFlags::EditorContext | EAutomationTestFlags::ProductFilter) + + bool FBSATNSerializationTest::RunTest(const FString& /*Parameters*/) +{ + // Primitive types + LOG_Category("Primitive types"); + TEST_ROUNDTRIP(bool, true, "bool true"); + TEST_ROUNDTRIP(bool, false, "bool false"); + TEST_ROUNDTRIP(uint8, 255, "uint8 max"); + TEST_ROUNDTRIP(uint16, 65535, "uint16 max"); + TEST_ROUNDTRIP(uint32, 4294967295u, "uint32 max"); + TEST_ROUNDTRIP(uint64, 18446744073709551615ull, "uint64 max"); + TEST_ROUNDTRIP(int8, -128, "int8 min"); + TEST_ROUNDTRIP(int16, -32768, "int16 min"); + TEST_ROUNDTRIP(int32, -2147483648, "int32 min"); + TEST_ROUNDTRIP(int64, INT64_MIN, "int64 min"); + TEST_ROUNDTRIP(float, 3.14159f, "float π"); + TEST_ROUNDTRIP(double, 2.718281828459045, "double e"); + + // Strings & names + LOG_Category("Strings & names"); + TEST_ROUNDTRIP(FString, FString(""), "FString empty"); + TEST_ROUNDTRIP(FString, FString("Hello, World!"), "FString ascii"); + TEST_ROUNDTRIP(FString, FString("Hello, 世界! 🚀"), "FString unicode"); + TEST_ROUNDTRIP(FString, FString("Line1\nLine2\tTab"), "FString special"); + TEST_ROUNDTRIP(FName, FName("PlayerController"), "FName normal"); + TEST_ROUNDTRIP(FName, FName(""), "FName empty"); + + // Large Integers + LOG_Category("Large Integers"); + TEST_ROUNDTRIP(FSpacetimeDBUInt128, FSpacetimeDBUInt128(0, 0), "u128 zero"); + TEST_ROUNDTRIP(FSpacetimeDBUInt128, FSpacetimeDBUInt128(MAX_uint64, MAX_uint64), "u128 max"); + TEST_ROUNDTRIP(FSpacetimeDBUInt128, FSpacetimeDBUInt128(1234567890, 9876543210), "u128 value"); + TEST_ROUNDTRIP(FSpacetimeDBInt128, FSpacetimeDBInt128(0, 0), "i128 zero"); + TEST_ROUNDTRIP(FSpacetimeDBInt128, FSpacetimeDBInt128(static_cast(INT64_MAX), MAX_uint64), "i128 max positive"); + TEST_ROUNDTRIP(FSpacetimeDBInt128, FSpacetimeDBInt128(MAX_uint64, MAX_uint64), "i128 -1"); + TEST_ROUNDTRIP(FSpacetimeDBInt128, FSpacetimeDBInt128(1ULL << 63, 0), "i128 min"); + TEST_ROUNDTRIP(FSpacetimeDBUInt256, FSpacetimeDBUInt256(), "u256 zero"); + TEST_ROUNDTRIP(FSpacetimeDBUInt256, FSpacetimeDBUInt256(FSpacetimeDBUInt128(MAX_uint64, MAX_uint64), FSpacetimeDBUInt128(MAX_uint64, MAX_uint64)), "u256 max"); + TEST_ROUNDTRIP(FSpacetimeDBUInt256, FSpacetimeDBUInt256(FSpacetimeDBUInt128(1, 2), FSpacetimeDBUInt128(3, 4)), "u256 value"); + TEST_ROUNDTRIP(FSpacetimeDBInt256, FSpacetimeDBInt256(), "i256 zero"); + const FSpacetimeDBUInt128 MaxInt256Upper(static_cast(INT64_MAX), MAX_uint64); + const FSpacetimeDBUInt128 MaxInt256Lower(MAX_uint64, MAX_uint64); + TEST_ROUNDTRIP(FSpacetimeDBInt256, FSpacetimeDBInt256(MaxInt256Upper, MaxInt256Lower), "i256 max positive"); + const FSpacetimeDBUInt128 MinInt256Upper(1ULL << 63, 0); + const FSpacetimeDBUInt128 MinInt256Lower(0, 0); + TEST_ROUNDTRIP(FSpacetimeDBInt256, FSpacetimeDBInt256(MinInt256Upper, MinInt256Lower), "i256 min"); + + // Spacetime Special types + LOG_Category("Spacetime Special types"); + TEST_ROUNDTRIP(FSpacetimeDBIdentity, FSpacetimeDBIdentity(FSpacetimeDBUInt256(FSpacetimeDBUInt128(4, 3), FSpacetimeDBUInt128(2, 1))), "Identity"); + TEST_ROUNDTRIP(FSpacetimeDBConnectionId, FSpacetimeDBConnectionId(FSpacetimeDBUInt128(1234567890, 9876543210)), "ConnectionId"); + TEST_ROUNDTRIP(FSpacetimeDBTimestamp, FSpacetimeDBTimestamp(0), "Timestamp zero"); + FSpacetimeDBTimestamp DBTimestamp = FSpacetimeDBTimestamp::FromFDateTime(FDateTime(2025, 6, 23, 15, 2, 24)); + TEST_ROUNDTRIP(FSpacetimeDBTimestamp, DBTimestamp, "Timestamp from FDateTime"); + TEST_ROUNDTRIP(FSpacetimeDBTimeDuration, FSpacetimeDBTimeDuration(0), "TimeDuration zero"); + FSpacetimeDBTimeDuration TimeDuration = FSpacetimeDBTimeDuration(123456789LL); + TEST_ROUNDTRIP(FSpacetimeDBTimeDuration, TimeDuration, "TimeDuration with microseconds"); + FSpacetimeDBScheduleAt ScheduleAtTimestamp = FSpacetimeDBScheduleAt::Time(DBTimestamp); + TEST_ROUNDTRIP(FSpacetimeDBScheduleAt, ScheduleAtTimestamp, "ScheduleAt as Timestamp"); + FSpacetimeDBScheduleAt ScheduleAtTimeDuration = FSpacetimeDBScheduleAt::Interval(TimeDuration); + TEST_ROUNDTRIP(FSpacetimeDBScheduleAt, ScheduleAtTimeDuration, "ScheduleAt as TimeDuration"); + + // Containers & optionals + LOG_Category("Containers & optionals"); + TEST_ROUNDTRIP(TArray, TArray{}, "Empty int array"); + TEST_ROUNDTRIP(TArray, (TArray{1, 2, 3, 4, 5}), "Int array"); + TEST_ROUNDTRIP(TArray, (TArray{"One", "Two", "Three"}), "String array"); + TEST_ROUNDTRIP(FSpacetimeDbSdkOptionalUInt32, FSpacetimeDbSdkOptionalUInt32(100), "Custom Optional"); + TEST_ROUNDTRIP(FSpacetimeDbSdkOptionalUInt32, FSpacetimeDbSdkOptionalUInt32(), "Empty Custom Optional"); + + + // IDs & time @Note: Not really needed, Guid will not be used and we will be using spacial types for time + LOG_Category("IDs & time"); + TEST_ROUNDTRIP(FDateTime, FDateTime(), "FDateTime zero"); + TEST_ROUNDTRIP(FDateTime, FDateTime::FromUnixTimestamp(1700000000), "FDateTime"); + TEST_ROUNDTRIP(FTimespan, FTimespan(), "FTimespan zero"); + TEST_ROUNDTRIP(FTimespan, FTimespan::FromMicroseconds(123456789), "FTimespan"); + + // Complex struct + LOG_Category("Complex struct"); + FPlayerData Player; + Player.PlayerName = "TestPlayer123"; + Player.Level = 42; + Player.Inventory = { "Sword","Shield","Potion" }; + TEST_ROUNDTRIP(FPlayerData, Player, "FPlayerData"); + FNpc Npc; + Npc.Type = "SadGoblin"; + TEST_ROUNDTRIP(FNpc, Npc, "FNpc"); + + // Edge cases + LOG_Category("Edge cases"); + { + TArray Large; + Large.Reserve(1000); + for (uint32 i = 0; i < 1000; ++i) + { + Large.Add(i); + } + TEST_ROUNDTRIP(TArray, Large, "Large array"); + + FString Long; + for (int32 i = 0; i < 100; ++i) + { + Long.Append("Hello World! "); + } + TEST_ROUNDTRIP(FString, Long, "Long string"); + } + + //Enum + LOG_Category("Enum"); + ESpaceTimeDBTestEnum1 TestEnum1 = ESpaceTimeDBTestEnum1::First; + TEST_ROUNDTRIP(ESpaceTimeDBTestEnum1, TestEnum1, "Enum ESpaceTimeDBTestEnum1"); + ECharacterTypeTag TestEnum2 = ECharacterTypeTag::PlayerData; + TEST_ROUNDTRIP(ECharacterTypeTag, TestEnum2, "Enum ECharacterTypeTag"); + + //Tagged Enum + LOG_Category("Tagged Enum"); + FCharacterType OrgPlayerChar = FCharacterType::PlayerData(Player); + TEST_ROUNDTRIP(FCharacterType, OrgPlayerChar, "FCharacterType::Player Tagged Enum"); + FCharacterType OrgNpcChar = FCharacterType::Npc(Npc); + TEST_ROUNDTRIP(FCharacterType, OrgNpcChar, "FCharacterType::Npc Tagged Enum"); + FCharacterThing ChartactarThingOrg; + ChartactarThingOrg.Active = true; + ChartactarThingOrg.Type = OrgNpcChar; + TEST_ROUNDTRIP(FCharacterThing, ChartactarThingOrg, "FCharacterThing struct with Tagged Enum"); + + //Cliant API + LOG_Category("Cliant API"); + //QueryIdType + FQueryIdType QueryId; + QueryId.Id = 100; + TEST_ROUNDTRIP(FQueryIdType, QueryId, "FQueryId"); + + // SubscribeMultiType + FSubscribeMultiType SubscribeMulti; + SubscribeMulti.QueryStrings.Add("SELECT * FROM players"); + SubscribeMulti.QueryStrings.Add("SELECT * FROM guilds WHERE region = 'EU'"); + SubscribeMulti.RequestId = 500; + SubscribeMulti.QueryId = QueryId; + TEST_ROUNDTRIP(FSubscribeMultiType, SubscribeMulti, "FSubscribeMultiType"); + + // RowSizeHintType + FRowSizeHintType FixedSizeHint = FRowSizeHintType::FixedSize(static_cast(128)); + TEST_ROUNDTRIP(FRowSizeHintType, FixedSizeHint, "FRowSizeHintType::FixedSize Variant"); + TArray RowOffsetsArray; // keep empty like before (or add offsets if you want) + FRowSizeHintType RowOffsetsHint = FRowSizeHintType::RowOffsets(RowOffsetsArray); + TEST_ROUNDTRIP(FRowSizeHintType, RowOffsetsHint, "FRowSizeHintType::RowOffsets Variant"); + + // BsatnRowListType + FBsatnRowListType BsatnRowList; + BsatnRowList.SizeHint = FixedSizeHint; + BsatnRowList.RowsData.Init(0xAB, 10); + TEST_ROUNDTRIP(FBsatnRowListType, BsatnRowList, "FBsatnRowListType with FixedSize hint"); + + // CallReducerType + FCallReducerType CallReducer; + CallReducer.Reducer = "MyGameReducer"; + CallReducer.Args.Init(0xDE, 20); + CallReducer.RequestId = 200; + CallReducer.Flags = 0; + TEST_ROUNDTRIP(FCallReducerType, CallReducer, "FCallReducerType"); + + // SubscribeType + FSubscribeType Subscribe; + Subscribe.QueryStrings.Add("SELECT * FROM users WHERE status = 'online'"); + Subscribe.QueryStrings.Add("SELECT item_name FROM inventory WHERE owner_id = 32"); + Subscribe.RequestId = 300; + TEST_ROUNDTRIP(FSubscribeType, Subscribe, "FSubscribeType"); + + // OneOffQueryType + FOneOffQueryType OneOffQuery; + OneOffQuery.MessageId.Init(0xCC, 16); + OneOffQuery.QueryString = "SELECT * FROM game_settings"; + TEST_ROUNDTRIP(FOneOffQueryType, OneOffQuery, "FOneOffQueryType"); + + // SubscribeSingleType + FSubscribeSingleType SubscribeSingle; + SubscribeSingle.Query = "SELECT * FROM player_data WHERE player_id = 33"; + SubscribeSingle.RequestId = 400; + SubscribeSingle.QueryId = QueryId; + TEST_ROUNDTRIP(FSubscribeSingleType, SubscribeSingle, "FSubscribeSingleType"); + + // UnsubscribeType + FUnsubscribeType Unsubscribe; + Unsubscribe.RequestId = 600; + Unsubscribe.QueryId = QueryId; + TEST_ROUNDTRIP(FUnsubscribeType, Unsubscribe, "FUnsubscribeType"); + + // UnsubscribeMultiType + FUnsubscribeMultiType UnsubscribeMulti; + UnsubscribeMulti.RequestId = 700; + UnsubscribeMulti.QueryId = QueryId; + TEST_ROUNDTRIP(FUnsubscribeMultiType, UnsubscribeMulti, "FUnsubscribeMultiType"); + + // CallReducer variant + FClientMessageType ClientMessageCallReducer = FClientMessageType::CallReducer(CallReducer); + TEST_ROUNDTRIP(FClientMessageType, ClientMessageCallReducer, "FClientMessageType::CallReducer Variant"); + FClientMessageType ClientMessageSubscribe = FClientMessageType::Subscribe(Subscribe); + TEST_ROUNDTRIP(FClientMessageType, ClientMessageSubscribe, "FClientMessageType::Subscribe Variant"); + FClientMessageType ClientMessageOneOffQuery = FClientMessageType::OneOffQuery(OneOffQuery); + TEST_ROUNDTRIP(FClientMessageType, ClientMessageOneOffQuery, "FClientMessageType::OneOffQuery Variant"); + FClientMessageType ClientMessageSubscribeSingle = FClientMessageType::SubscribeSingle(SubscribeSingle); + TEST_ROUNDTRIP(FClientMessageType, ClientMessageSubscribeSingle, "FClientMessageType::SubscribeSingle Variant"); + FClientMessageType ClientMessageSubscribeMulti = FClientMessageType::SubscribeMulti(SubscribeMulti); + TEST_ROUNDTRIP(FClientMessageType, ClientMessageSubscribeMulti, "FClientMessageType::SubscribeMulti Variant"); + FClientMessageType ClientMessageUnsubscribe = FClientMessageType::Unsubscribe(Unsubscribe); + TEST_ROUNDTRIP(FClientMessageType, ClientMessageUnsubscribe, "FClientMessageType::Unsubscribe Variant"); + FClientMessageType ClientMessageUnsubscribeMulti = FClientMessageType::UnsubscribeMulti(UnsubscribeMulti); + TEST_ROUNDTRIP(FClientMessageType, ClientMessageUnsubscribeMulti, "FClientMessageType::UnsubscribeMulti Variant"); + + + // BsatnRowListType + FBsatnRowListType BsatnRowList1; + BsatnRowList1.SizeHint = FixedSizeHint; + BsatnRowList1.RowsData.Init(0xAB, 10); + TEST_ROUNDTRIP(FBsatnRowListType, BsatnRowList1, "FBsatnRowListType with FixedSize hint"); + FBsatnRowListType BsatnRowList2; + BsatnRowList2.SizeHint = RowOffsetsHint; + BsatnRowList2.RowsData.Init(0xAB, 10); + TEST_ROUNDTRIP(FBsatnRowListType, BsatnRowList2, "FBsatnRowListType with RowOffsets hint"); + + // QueryUpdateType + FQueryUpdateType QueryUpdate; + QueryUpdate.Deletes = BsatnRowList1; + QueryUpdate.Inserts = BsatnRowList2; + TEST_ROUNDTRIP(FQueryUpdateType, QueryUpdate, "FQueryUpdateType"); + + // CompressableQueryUpdateType + FCompressableQueryUpdateType UncompressedUpdate =FCompressableQueryUpdateType::Uncompressed(QueryUpdate); + TEST_ROUNDTRIP(FCompressableQueryUpdateType, UncompressedUpdate, "FCompressableQueryUpdateType::Uncompressed Variant"); + TArray BrotliData; + BrotliData.Add(0x11); + BrotliData.Add(0x22); + FCompressableQueryUpdateType BrotliUpdate =FCompressableQueryUpdateType::Brotli(BrotliData); + TEST_ROUNDTRIP(FCompressableQueryUpdateType, BrotliUpdate, "FCompressableQueryUpdateType::Brotli Variant"); + TArray GzipData; + GzipData.Add(0xA1); + GzipData.Add(0xB2); + FCompressableQueryUpdateType GzipUpdate = FCompressableQueryUpdateType::Gzip(GzipData); + TEST_ROUNDTRIP(FCompressableQueryUpdateType, GzipUpdate, "FCompressableQueryUpdateType::Gzip Variant"); + + // TableUpdateType + FTableUpdateType TableUpdate; + TableUpdate.TableId = 1; + TableUpdate.TableName = "PlayerStats"; + TableUpdate.NumRows = 100; + TableUpdate.Updates.Add(UncompressedUpdate); + TableUpdate.Updates.Add(BrotliUpdate); + TableUpdate.Updates.Add(GzipUpdate); + TEST_ROUNDTRIP(FTableUpdateType, TableUpdate, "FTableUpdateType"); + + // DatabaseUpdateType + FDatabaseUpdateType DatabaseUpdate; + DatabaseUpdate.Tables.Add(TableUpdate); + TEST_ROUNDTRIP(FDatabaseUpdateType, DatabaseUpdate, "FDatabaseUpdateType"); + + // EnergyQuantaType + FEnergyQuantaType EnergyQuanta; + EnergyQuanta.Quanta = FSpacetimeDBUInt128(1000, 500); + TEST_ROUNDTRIP(FEnergyQuantaType, EnergyQuanta, "FEnergyQuantaType"); + + // IdentityTokenType + FIdentityTokenType IdentityToken; + IdentityToken.Identity = FSpacetimeDBIdentity(FSpacetimeDBUInt256(FSpacetimeDBUInt128(10, 9), FSpacetimeDBUInt128(8, 7))); + IdentityToken.Token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9"; + IdentityToken.ConnectionId = FSpacetimeDBConnectionId(FSpacetimeDBUInt128(12345, 67890)); + TEST_ROUNDTRIP(FIdentityTokenType, IdentityToken, "FIdentityTokenType"); + + // InitialSubscriptionType + FInitialSubscriptionType InitialSubscription; + InitialSubscription.DatabaseUpdate = DatabaseUpdate; + InitialSubscription.RequestId = 101; + InitialSubscription.TotalHostExecutionDuration = FSpacetimeDBTimeDuration(500000); + TEST_ROUNDTRIP(FInitialSubscriptionType, InitialSubscription, "FInitialSubscriptionType"); + + + // OneOffTableType + FOneOffTableType OneOffTable; + OneOffTable.TableName = "GameScores"; + OneOffTable.Rows = BsatnRowList1; + TEST_ROUNDTRIP(FOneOffTableType, OneOffTable, "FOneOffTableType"); + + + // OneOffQueryResponseType + FOneOffQueryResponseType OneOffQueryResponse; + OneOffQueryResponse.MessageId.Init(0xDD, 16); + FSpacetimeDbSdkOptionalString SdkOptionalStringError; + SdkOptionalStringError.bHasValue = true; + SdkOptionalStringError.Value = "Error text"; + OneOffQueryResponse.Tables.Add(OneOffTable); + OneOffQueryResponse.TotalHostExecutionDuration = FSpacetimeDBTimeDuration(123456); + TEST_ROUNDTRIP(FOneOffQueryResponseType, OneOffQueryResponse, "FOneOffQueryResponseType"); + + // ReducerCallInfoType + FReducerCallInfoType ReducerCallInfo; + ReducerCallInfo.ReducerName = "UpdatePlayerScore"; + ReducerCallInfo.ReducerId = 123; + ReducerCallInfo.Args.Init(0xAB, 10); + ReducerCallInfo.RequestId = 789; + TEST_ROUNDTRIP(FReducerCallInfoType, ReducerCallInfo, "FReducerCallInfoType"); + + // UpdateStatusType + FUpdateStatusType StatusCommitted = FUpdateStatusType::Committed(DatabaseUpdate); + TEST_ROUNDTRIP(FUpdateStatusType, StatusCommitted, "FUpdateStatusType::Committed Variant"); + FString FailedMsg = TEXT("Reducer execution failed due to invalid input."); + FUpdateStatusType StatusFailed = FUpdateStatusType::Failed(FailedMsg); + TEST_ROUNDTRIP(FUpdateStatusType, StatusFailed, "FUpdateStatusType::Failed Variant"); + FSpacetimeDBUnit UnitValue{}; + FUpdateStatusType StatusOutOfEnergy = FUpdateStatusType::OutOfEnergy(UnitValue); + TEST_ROUNDTRIP(FUpdateStatusType, StatusOutOfEnergy, "FUpdateStatusType::OutOfEnergy Variant"); + + // TransactionUpdateType + FTransactionUpdateType TransactionUpdate; + TransactionUpdate.Status = StatusCommitted; + TransactionUpdate.Timestamp = FSpacetimeDBTimestamp::FromFDateTime(FDateTime(2025, 6, 25, 9, 33, 0)); + TransactionUpdate.CallerIdentity = FSpacetimeDBIdentity(FSpacetimeDBUInt256(FSpacetimeDBUInt128(1, 2), FSpacetimeDBUInt128(3, 4))); + TransactionUpdate.CallerConnectionId = FSpacetimeDBConnectionId(FSpacetimeDBUInt128(98765, 43210)); + TransactionUpdate.ReducerCall = ReducerCallInfo; + TransactionUpdate.EnergyQuantaUsed = EnergyQuanta; + TransactionUpdate.TotalHostExecutionDuration = FSpacetimeDBTimeDuration(75000); + TEST_ROUNDTRIP(FTransactionUpdateType, TransactionUpdate, "FTransactionUpdateType"); + + // SubscribeRowsType + FSubscribeRowsType SubscribeRows; + SubscribeRows.TableId = 10; + SubscribeRows.TableName = "ConfigData"; + SubscribeRows.TableRows = TableUpdate; + TEST_ROUNDTRIP(FSubscribeRowsType, SubscribeRows, "FSubscribeRowsType"); + + // SubscribeAppliedType + FSubscribeAppliedType SubscribeApplied; + SubscribeApplied.RequestId = 12345; + SubscribeApplied.TotalHostExecutionDurationMicros = 250000; + SubscribeApplied.QueryId = QueryId; + SubscribeApplied.Rows = SubscribeRows; + TEST_ROUNDTRIP(FSubscribeAppliedType, SubscribeApplied, "FSubscribeAppliedType"); + + // SubscribeMultiAppliedType + FSubscribeMultiAppliedType SubscribeMultiApplied; + SubscribeMultiApplied.RequestId = 54321; + SubscribeMultiApplied.TotalHostExecutionDurationMicros = 300000; + SubscribeMultiApplied.QueryId = QueryId; + SubscribeMultiApplied.Update = DatabaseUpdate; + TEST_ROUNDTRIP(FSubscribeMultiAppliedType, SubscribeMultiApplied, "FSubscribeMultiAppliedType"); + + // SubscriptionErrorType + FSubscriptionErrorType SubscriptionError; + SubscriptionError.TotalHostExecutionDurationMicros = 50000; + SubscriptionError.RequestId = FSpacetimeDbSdkOptionalUInt32(1001); + SubscriptionError.QueryId = FSpacetimeDbSdkOptionalUInt32(201); + SubscriptionError.TableId = FSpacetimeDbSdkOptionalUInt32(301); + SubscriptionError.Error = "SQL syntax error in subscription query."; + TEST_ROUNDTRIP(FSubscriptionErrorType, SubscriptionError, "FSubscriptionErrorType"); + + // TransactionUpdateLightType + FTransactionUpdateLightType TransactionUpdateLight; + TransactionUpdateLight.RequestId = 2000; + TransactionUpdateLight.Update = DatabaseUpdate; + TEST_ROUNDTRIP(FTransactionUpdateLightType, TransactionUpdateLight, "FTransactionUpdateLightType"); + + + // UnsubscribeAppliedType + FUnsubscribeAppliedType UnsubscribeApplied; + UnsubscribeApplied.RequestId = 3000; + UnsubscribeApplied.TotalHostExecutionDurationMicros = 80000; + UnsubscribeApplied.QueryId = QueryId; + UnsubscribeApplied.Rows = SubscribeRows; + TEST_ROUNDTRIP(FUnsubscribeAppliedType, UnsubscribeApplied, "FUnsubscribeAppliedType"); + + // UnsubscribeMultiAppliedType + FUnsubscribeMultiAppliedType UnsubscribeMultiApplied; + UnsubscribeMultiApplied.RequestId = 4000; + UnsubscribeMultiApplied.TotalHostExecutionDurationMicros = 100000; + UnsubscribeMultiApplied.QueryId = QueryId; + UnsubscribeMultiApplied.Update = DatabaseUpdate; + TEST_ROUNDTRIP(FUnsubscribeMultiAppliedType, UnsubscribeMultiApplied, "FUnsubscribeMultiAppliedType"); + + + // UServerMessageType + FServerMessageType MessageInitialSubscription = FServerMessageType::InitialSubscription(InitialSubscription); + TEST_ROUNDTRIP(FServerMessageType, MessageInitialSubscription, "FServerMessageType::InitialSubscription Variant"); + FServerMessageType MessageTransactionUpdate = FServerMessageType::TransactionUpdate(TransactionUpdate); + TEST_ROUNDTRIP(FServerMessageType, MessageTransactionUpdate, "FServerMessageType::TransactionUpdate Variant"); + FServerMessageType MessageTransactionUpdateLight = FServerMessageType::TransactionUpdateLight(TransactionUpdateLight); + TEST_ROUNDTRIP(FServerMessageType, MessageTransactionUpdateLight, "FServerMessageType::TransactionUpdateLight Variant"); + FServerMessageType MessageIdentityToken = FServerMessageType::IdentityToken(IdentityToken); + TEST_ROUNDTRIP(FServerMessageType, MessageIdentityToken, "FServerMessageType::IdentityToken Variant"); + FServerMessageType MessageOneOffQueryResponse = FServerMessageType::OneOffQueryResponse(OneOffQueryResponse); + TEST_ROUNDTRIP(FServerMessageType, MessageOneOffQueryResponse, "FServerMessageType::OneOffQueryResponse Variant"); + FServerMessageType MessageSubscribeApplied = FServerMessageType::SubscribeApplied(SubscribeApplied); + TEST_ROUNDTRIP(FServerMessageType, MessageSubscribeApplied, "FServerMessageType::SubscribeApplied Variant"); + FServerMessageType MessageUnsubscribeApplied = FServerMessageType::UnsubscribeApplied(UnsubscribeApplied); + TEST_ROUNDTRIP(FServerMessageType, MessageUnsubscribeApplied, "FServerMessageType::UnsubscribeApplied Variant"); + FServerMessageType MessageSubscriptionError = FServerMessageType::SubscriptionError(SubscriptionError); + TEST_ROUNDTRIP(FServerMessageType, MessageSubscriptionError, "FServerMessageType::SubscriptionError Variant"); + FServerMessageType MessageSubscribeMultiApplied = FServerMessageType::SubscribeMultiApplied(SubscribeMultiApplied); + TEST_ROUNDTRIP(FServerMessageType, MessageSubscribeMultiApplied, "FServerMessageType::SubscribeMultiApplied Variant"); + FServerMessageType MessageUnsubscribeMultiApplied = FServerMessageType::UnsubscribeMultiApplied(UnsubscribeMultiApplied); + TEST_ROUNDTRIP(FServerMessageType, MessageUnsubscribeMultiApplied, "FServerMessageType::UnsubscribeMultiApplied Variant"); + + return true; +} diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/DEVELOP.md b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/DEVELOP.md new file mode 100644 index 00000000000..36c57e621b3 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/DEVELOP.md @@ -0,0 +1,7 @@ +# Core bsatn library + +These files here are being used by both the Unreal C++ Client SDK and the Module Library. +These files are noy the main files. The SDK do not use these files directly becouse a user might move the SDK plugin to the unreal engine plugin direcory or the unreal project directory. +Make all changed in the core library and copy them here. + +Core path: "crates\bindings-cpp\include\spacetimedb\bsatn" \ No newline at end of file diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/README.md b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/README.md new file mode 100644 index 00000000000..8cf27f5389b --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/README.md @@ -0,0 +1,58 @@ +# BSATN C++ Library + +This directory contains a self-contained C++ implementation of BSATN (Binary SpacetimeDB Algebraic Type Notation) serialization. + +## For C++ Client Usage + +The BSATN library can be used independently for serialization/deserialization without any SpacetimeDB module dependencies. + +### What you need: +- All headers in this directory +- Standard C++ library (C++20) +- No external dependencies + +### What you DON'T need: +- `ITypeRegistrar.h` - This is only for modules, not clients +- Type registration functionality +- Any files from outside this directory + +### Basic usage: + +```cpp +#include "bsatn/bsatn.h" + +// Define your struct +struct MyData { + uint32_t id; + std::string name; +}; + +// Define serialization traits +SPACETIMEDB_STRUCT(MyData, id, name) + +// Serialize +MyData data{42, "example"}; +std::vector buffer; +SpacetimeDb::bsatn::Writer writer(buffer); +SpacetimeDb::bsatn::serialize(writer, data); + +// Deserialize +SpacetimeDb::bsatn::Reader reader(buffer); +auto result = SpacetimeDb::bsatn::deserialize(reader); +``` + +## Architecture Notes + +- **ITypeRegistrar.h**: Interface for optional type registration. Clients can ignore this - it's only used by SpacetimeDB modules. The interface is kept here to avoid circular dependencies while maintaining clean architecture. + +- **No external dependencies**: All files only include other BSATN headers or standard C++ library headers. + +- **Special types**: The library includes SpacetimeDB special types (Identity, ConnectionId, Timestamp, TimeDuration) that serialize with specific tags for compatibility. + +## File Structure + +- Core: `reader.h`, `writer.h`, `serialization.h` +- Type system: `algebraic_type.h`, `traits.h`, `primitive_traits.h` +- Special types: `types.h`, `timestamp.h`, `time_duration.h`, `special_types.h` +- Utilities: `size_calculator.h`, `sum_type.h` +- Module-only: `ITypeRegistrar.h` (can be ignored by clients) \ No newline at end of file diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/algebraic_type.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/algebraic_type.h new file mode 100644 index 00000000000..7cf8db1545a --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/algebraic_type.h @@ -0,0 +1,508 @@ +#ifndef SPACETIMEDB_BSATN_ALGEBRAIC_TYPE_H +#define SPACETIMEDB_BSATN_ALGEBRAIC_TYPE_H + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace SpacetimeDb::bsatn { + +// Forward declarations +class AlgebraicType; +struct SumTypeSchema; +struct ProductType; +struct ProductTypeElement; +struct SumTypeVariant; +struct ArrayType; + +/** + * Represents the tag for different algebraic types in SpacetimeDB's type system. + * This mirrors the Rust/C# implementation for compatibility. + */ +enum class AlgebraicTypeTag : uint8_t { + Ref = 0, // Reference to another type + Sum = 1, // Sum type (tagged union/enum) + Product = 2, // Product type (struct/tuple) + Array = 3, // Array type + String = 4, // UTF-8 string + Bool = 5, // Boolean + I8 = 6, // Signed 8-bit integer + U8 = 7, // Unsigned 8-bit integer + I16 = 8, // Signed 16-bit integer + U16 = 9, // Unsigned 16-bit integer + I32 = 10, // Signed 32-bit integer + U32 = 11, // Unsigned 32-bit integer + I64 = 12, // Signed 64-bit integer + U64 = 13, // Unsigned 64-bit integer + I128 = 14, // Signed 128-bit integer + U128 = 15, // Unsigned 128-bit integer + I256 = 16, // Signed 256-bit integer + U256 = 17, // Unsigned 256-bit integer + F32 = 18, // 32-bit floating point + F64 = 19 // 64-bit floating point +}; + +// ============================================================================ +// HELPER TEMPLATE FOR DEEP COPYING UNIQUE_PTR MEMBERS +// ============================================================================ + +/** + * RAII helper for deep copying unique_ptr members. + * Eliminates duplicate copy constructor patterns. + */ +template +std::unique_ptr deep_copy_ptr(const std::unique_ptr& ptr) { + return ptr ? ptr->copy() : nullptr; +} + +// ============================================================================ +// TYPE ELEMENT STRUCTURES +// ============================================================================ + +/** + * Represents an element in a ProductType. + * Stores a complete AlgebraicType object to eliminate ambiguity. + */ +struct ProductTypeElement { + std::optional name; + std::unique_ptr algebraic_type; + + ProductTypeElement(std::optional n, AlgebraicType type); + ProductTypeElement(const ProductTypeElement& other); + ProductTypeElement(ProductTypeElement&& other) = default; + ProductTypeElement& operator=(const ProductTypeElement& other); + ProductTypeElement& operator=(ProductTypeElement&& other) = default; +}; + +/** + * Represents a variant in a SumType. + * Stores a complete AlgebraicType object to eliminate ambiguity. + */ +struct SumTypeVariant { + std::string name; + std::unique_ptr algebraic_type; + + SumTypeVariant(std::string n, AlgebraicType type); + SumTypeVariant(const SumTypeVariant& other); + SumTypeVariant(SumTypeVariant&& other) = default; + SumTypeVariant& operator=(const SumTypeVariant& other); + SumTypeVariant& operator=(SumTypeVariant&& other) = default; +}; + +/** + * Represents a sum type (tagged union/enum). + * Each variant has a name and can contain data. + */ +struct SumTypeSchema { + std::vector variants; + + explicit SumTypeSchema(std::vector v) : variants(std::move(v)) {} +}; + +/** + * Represents a product type (struct/tuple). + * Contains ordered elements (fields). + */ +struct ProductType { + std::vector elements; + + explicit ProductType(std::vector elems) + : elements(std::move(elems)) {} + + // Helper to create a product type for a C++ struct + template + static ProductType make(); +}; + +/** + * Represents an array type. + * Contains the complete type of elements in the array. + */ +struct ArrayType { + std::unique_ptr element_type; + + explicit ArrayType(AlgebraicType elem_type); + ArrayType(const ArrayType& other); + ArrayType(ArrayType&& other) = default; + ArrayType& operator=(const ArrayType& other); + ArrayType& operator=(ArrayType&& other) = default; +}; + +// ============================================================================ +// MAIN ALGEBRAIC TYPE CLASS +// ============================================================================ + +/** + * @brief The main algebraic type representation for SpacetimeDB's type system. + * + * AlgebraicType is a tagged union that represents all possible types in SpacetimeDB. + * It supports both primitive types (integers, floats, strings, etc.) and composite + * types (products/structs, sums/enums, arrays, and references). + * + * This type system is designed to be: + * - Compatible with multiple languages (Rust, C#, C++) + * - Serializable via BSATN (Binary Sparse Algebraic Type Notation) + * - Type-safe with compile-time verification + * + * @example Creating primitive types: + * @code + * auto int_type = AlgebraicType::primitive(); + * auto string_type = AlgebraicType::primitive(); + * @endcode + * + * @example Creating composite types: + * @code + * // Create an array type + * auto array_type = AlgebraicType::Array(AlgebraicType::primitive()); + * @endcode + */ +class AlgebraicType { +public: + /** + * Internal data storage for type-specific information. + */ + using DataType = std::variant< + uint32_t, // Ref - type reference + std::unique_ptr, // Sum type + std::unique_ptr, // Product type + std::unique_ptr, // Array type + std::monostate // Primitive types (no additional data) + >; + +private: + AlgebraicTypeTag tag_; + DataType data_; + +public: + // Constructor accessible for copy operations and internal use + AlgebraicType(AlgebraicTypeTag tag, DataType data) : tag_(tag), data_(std::move(data)) {} + // ------------------------------------------------------------------------- + // PRIMITIVE TYPE FACTORY (TEMPLATED - REPLACES 16 INDIVIDUAL METHODS) + // ------------------------------------------------------------------------- + + /** + * Template factory for primitive types. + * Replaces all individual primitive factory methods (Bool(), I8(), etc.) + * + * @tparam Tag The AlgebraicTypeTag for the primitive type + * @return AlgebraicType instance for the specified primitive + * + * @example + * auto bool_type = AlgebraicType::primitive(); + * auto int_type = AlgebraicType::primitive(); + */ + template + static AlgebraicType primitive() { + static_assert( + static_cast(Tag) >= static_cast(AlgebraicTypeTag::String), + "primitive() can only be used for primitive types" + ); + return AlgebraicType(Tag, std::monostate{}); + } + + // Convenience aliases for ALL primitives (required by other files) + static AlgebraicType Bool() { return primitive(); } + static AlgebraicType I8() { return primitive(); } + static AlgebraicType U8() { return primitive(); } + static AlgebraicType I16() { return primitive(); } + static AlgebraicType U16() { return primitive(); } + static AlgebraicType I32() { return primitive(); } + static AlgebraicType U32() { return primitive(); } + static AlgebraicType I64() { return primitive(); } + static AlgebraicType U64() { return primitive(); } + static AlgebraicType I128() { return primitive(); } + static AlgebraicType U128() { return primitive(); } + static AlgebraicType I256() { return primitive(); } + static AlgebraicType U256() { return primitive(); } + static AlgebraicType F32() { return primitive(); } + static AlgebraicType F64() { return primitive(); } + static AlgebraicType String() { return primitive(); } + + // ------------------------------------------------------------------------- + // COMPOSITE TYPE FACTORIES + // ------------------------------------------------------------------------- + + static AlgebraicType Ref(uint32_t type_id) { + return AlgebraicType(AlgebraicTypeTag::Ref, type_id); + } + + static AlgebraicType make_ref(uint32_t type_id) { + return Ref(type_id); + } + + static AlgebraicType make_product(std::unique_ptr product_type) { + return AlgebraicType(AlgebraicTypeTag::Product, std::move(product_type)); + } + + static AlgebraicType make_sum(std::unique_ptr sum_type) { + return AlgebraicType(AlgebraicTypeTag::Sum, std::move(sum_type)); + } + + static AlgebraicType Array(AlgebraicType elem_type) { + return AlgebraicType(AlgebraicTypeTag::Array, + std::make_unique(std::move(elem_type))); + } + + /** + * Creates a unit type (empty product). + * This represents std::monostate or Rust's () unit type. + */ + static AlgebraicType Unit() { + return make_product(std::make_unique(std::vector{})); + } + + /** + * Creates an Option type with simplified logic. + * Represents a sum type with "some" and "none" variants. + */ + static AlgebraicType Option(uint32_t some_type_ref) { + if (some_type_ref == 0xFFFFFFFF) { + return create_unit_option(); + } + return create_typed_option(some_type_ref); + } + + static AlgebraicType Product(std::vector> fields) { + std::vector elements; + elements.reserve(fields.size()); + for (auto& [name, type_ref] : fields) { + elements.emplace_back(std::move(name), Ref(type_ref)); + } + return make_product(std::make_unique(std::move(elements))); + } + + // ------------------------------------------------------------------------- + // ACCESSORS AND TYPE CHECKING + // ------------------------------------------------------------------------- + + AlgebraicTypeTag tag() const { return tag_; } + const DataType& data() const { return data_; } + + /** + * Template-based type checking. + * Replaces all individual is_*() methods with a single template. + * + * @tparam Tag The AlgebraicTypeTag to check against + * @return true if this type has the specified tag + * + * @example + * if (type.is()) { ... } + * if (type.is()) { ... } + */ + template + bool is() const { return tag_ == Tag; } + + // Convenience methods for most common checks + bool is_ref() const { return is(); } + bool is_sum() const { return is(); } + bool is_product() const { return is(); } + bool is_array() const { return is(); } + bool is_primitive() const { + return static_cast(tag_) >= static_cast(AlgebraicTypeTag::String); + } + + // ------------------------------------------------------------------------- + // DATA ACCESSOR METHODS + // ------------------------------------------------------------------------- + + uint32_t as_ref() const { + if (!is_ref()) std::abort(); // Type is not a Ref + return std::get(data_); + } + + const SumTypeSchema& as_sum() const { + if (!is_sum()) std::abort(); // Type is not a Sum + return *std::get>(data_); + } + + const ProductType& as_product() const { + if (!is_product()) std::abort(); // Type is not a Product + return *std::get>(data_); + } + + const ArrayType& as_array() const { + if (!is_array()) std::abort(); // Type is not an Array + return *std::get>(data_); + } + + // ------------------------------------------------------------------------- + // COPY METHOD (SIMPLIFIED WITH VISITOR PATTERN) + // ------------------------------------------------------------------------- + + std::unique_ptr copy() const { + return std::visit([this](const auto& data) -> std::unique_ptr { + using DataT = std::decay_t; + + if constexpr (std::is_same_v) { + // Primitive types + return std::make_unique(tag_, std::monostate{}); + } else if constexpr (std::is_same_v) { + // Ref types + return std::make_unique(Ref(data)); + } else if constexpr (std::is_same_v>) { + // Sum types + std::vector new_variants; + new_variants.reserve(data->variants.size()); + for (const auto& variant : data->variants) { + new_variants.push_back(variant); // Uses copy constructor + } + return std::make_unique(AlgebraicType( + AlgebraicTypeTag::Sum, + std::make_unique(std::move(new_variants)) + )); + } else if constexpr (std::is_same_v>) { + // Product types + std::vector new_elements; + new_elements.reserve(data->elements.size()); + for (const auto& elem : data->elements) { + new_elements.push_back(elem); // Uses copy constructor + } + return std::make_unique(AlgebraicType( + AlgebraicTypeTag::Product, + std::make_unique(std::move(new_elements)) + )); + } else if constexpr (std::is_same_v>) { + // Array types + return std::make_unique(AlgebraicType( + AlgebraicTypeTag::Array, + std::make_unique(*data) // Uses copy constructor + )); + } + }, data_); + } + +private: + // Helper methods for Option factory + static AlgebraicType create_unit_option() { + std::vector variants; + variants.emplace_back("some", Unit()); + variants.emplace_back("none", Unit()); + return make_sum(std::make_unique(std::move(variants))); + } + + static AlgebraicType create_typed_option(uint32_t some_type_ref) { + std::vector variants; + variants.emplace_back("some", Ref(some_type_ref)); + variants.emplace_back("none", Unit()); + return make_sum(std::make_unique(std::move(variants))); + } +}; + +// ============================================================================ +// ALGEBRAIC TYPE TRAITS +// ============================================================================ + +/** + * Trait for getting the AlgebraicType of a C++ type. + * Specialized for primitive and container types. + * + * @example + * auto type = algebraic_type_of::get(); + * auto array_type = algebraic_type_of>::get(); + */ +template +struct algebraic_type_of { + static AlgebraicType get(); +}; + +// Helper macro to reduce repetitive primitive type specializations +#define SPACETIMEDB_DEFINE_ALGEBRAIC_TYPE(cpp_type, tag_value) \ + template<> struct algebraic_type_of { \ + static AlgebraicType get() { return AlgebraicType::primitive(); } \ + } + +// Primitive type specializations +SPACETIMEDB_DEFINE_ALGEBRAIC_TYPE(bool, Bool); +SPACETIMEDB_DEFINE_ALGEBRAIC_TYPE(char, U8); +SPACETIMEDB_DEFINE_ALGEBRAIC_TYPE(int8_t, I8); +SPACETIMEDB_DEFINE_ALGEBRAIC_TYPE(int16_t, I16); +SPACETIMEDB_DEFINE_ALGEBRAIC_TYPE(int32_t, I32); +SPACETIMEDB_DEFINE_ALGEBRAIC_TYPE(int64_t, I64); +SPACETIMEDB_DEFINE_ALGEBRAIC_TYPE(uint8_t, U8); +SPACETIMEDB_DEFINE_ALGEBRAIC_TYPE(uint16_t, U16); +SPACETIMEDB_DEFINE_ALGEBRAIC_TYPE(uint32_t, U32); +SPACETIMEDB_DEFINE_ALGEBRAIC_TYPE(uint64_t, U64); +SPACETIMEDB_DEFINE_ALGEBRAIC_TYPE(float, F32); +SPACETIMEDB_DEFINE_ALGEBRAIC_TYPE(double, F64); +SPACETIMEDB_DEFINE_ALGEBRAIC_TYPE(std::string, String); + +#undef SPACETIMEDB_DEFINE_ALGEBRAIC_TYPE + +// Container type specializations (properly implemented, no TODOs) +template +struct algebraic_type_of> { + static AlgebraicType get() { + return AlgebraicType::Array(algebraic_type_of::get()); + } +}; + +template +struct algebraic_type_of> { + static AlgebraicType get() { + // Create proper Option type with the inner type + AlgebraicType inner_type = algebraic_type_of::get(); + + std::vector variants; + variants.emplace_back("some", std::move(inner_type)); + variants.emplace_back("none", AlgebraicType::Unit()); + + return AlgebraicType::make_sum(std::make_unique(std::move(variants))); + } +}; + +// ============================================================================ +// INLINE IMPLEMENTATIONS +// ============================================================================ + +// ProductTypeElement implementations +inline ProductTypeElement::ProductTypeElement(std::optional n, AlgebraicType type) + : name(std::move(n)), algebraic_type(std::make_unique(std::move(type))) {} + +inline ProductTypeElement::ProductTypeElement(const ProductTypeElement& other) + : name(other.name), algebraic_type(deep_copy_ptr(other.algebraic_type)) {} + +inline ProductTypeElement& ProductTypeElement::operator=(const ProductTypeElement& other) { + if (this != &other) { + name = other.name; + algebraic_type = deep_copy_ptr(other.algebraic_type); + } + return *this; +} + +// SumTypeVariant implementations +inline SumTypeVariant::SumTypeVariant(std::string n, AlgebraicType type) + : name(std::move(n)), algebraic_type(std::make_unique(std::move(type))) {} + +inline SumTypeVariant::SumTypeVariant(const SumTypeVariant& other) + : name(other.name), algebraic_type(deep_copy_ptr(other.algebraic_type)) {} + +inline SumTypeVariant& SumTypeVariant::operator=(const SumTypeVariant& other) { + if (this != &other) { + name = other.name; + algebraic_type = deep_copy_ptr(other.algebraic_type); + } + return *this; +} + +// ArrayType implementations +inline ArrayType::ArrayType(AlgebraicType elem_type) + : element_type(std::make_unique(std::move(elem_type))) {} + +inline ArrayType::ArrayType(const ArrayType& other) + : element_type(deep_copy_ptr(other.element_type)) {} + +inline ArrayType& ArrayType::operator=(const ArrayType& other) { + if (this != &other) { + element_type = deep_copy_ptr(other.element_type); + } + return *this; +} + +} // namespace SpacetimeDb::bsatn + +#endif // SPACETIMEDB_BSATN_ALGEBRAIC_TYPE_H \ No newline at end of file diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/algebraic_type.h.backup b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/algebraic_type.h.backup new file mode 100644 index 00000000000..ca8d2e5b645 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/algebraic_type.h.backup @@ -0,0 +1,657 @@ +#ifndef SPACETIMEDB_BSATN_ALGEBRAIC_TYPE_H +#define SPACETIMEDB_BSATN_ALGEBRAIC_TYPE_H + +#include +#include +#include +#include +#include +#include +#include + +namespace SpacetimeDb::bsatn { + +// Forward declarations +class AlgebraicType; +struct SumTypeSchema; +struct ProductType; +struct ProductTypeElement; +struct SumTypeVariant; +struct ArrayType; + +/** + * Represents the tag for different algebraic types in SpacetimeDB's type system. + * This mirrors the Rust/C# implementation for compatibility. + */ +enum class AlgebraicTypeTag : uint8_t { + Ref = 0, // Reference to another type + Sum = 1, // Sum type (tagged union/enum) + Product = 2, // Product type (struct/tuple) + Array = 3, // Array type + String = 4, // UTF-8 string + Bool = 5, // Boolean + I8 = 6, // Signed 8-bit integer + U8 = 7, // Unsigned 8-bit integer + I16 = 8, // Signed 16-bit integer + U16 = 9, // Unsigned 16-bit integer + I32 = 10, // Signed 32-bit integer + U32 = 11, // Unsigned 32-bit integer + I64 = 12, // Signed 64-bit integer + U64 = 13, // Unsigned 64-bit integer + I128 = 14, // Signed 128-bit integer + U128 = 15, // Unsigned 128-bit integer + I256 = 16, // Signed 256-bit integer + U256 = 17, // Unsigned 256-bit integer + F32 = 18, // 32-bit floating point + F64 = 19 // 64-bit floating point +}; + +/** + * Represents an element in a ProductType. + * Renamed from AggregateElement to match Rust/C# conventions. + * + * Stores a complete AlgebraicType object to eliminate ambiguity between + * primitive tags and registry indices. + */ +struct ProductTypeElement { + std::optional name; + std::unique_ptr algebraic_type; // Complete type information + + // Constructor taking AlgebraicType by value and moving to unique_ptr + ProductTypeElement(std::optional n, AlgebraicType type); + + // Copy constructor (deep copy of AlgebraicType) + ProductTypeElement(const ProductTypeElement& other); + + // Move constructor + ProductTypeElement(ProductTypeElement&& other) = default; + + // Assignment operators + ProductTypeElement& operator=(const ProductTypeElement& other); + ProductTypeElement& operator=(ProductTypeElement&& other) = default; +}; + +/** + * Represents a variant in a SumType. + * Renamed for consistency with Rust/C# naming. + * + * Stores a complete AlgebraicType object to eliminate ambiguity. + */ +struct SumTypeVariant { + std::string name; + std::unique_ptr algebraic_type; // Complete type information + + // Constructor taking AlgebraicType by value and moving to unique_ptr + SumTypeVariant(std::string n, AlgebraicType type); + + // Copy constructor (deep copy of AlgebraicType) + SumTypeVariant(const SumTypeVariant& other); + + // Move constructor + SumTypeVariant(SumTypeVariant&& other) = default; + + // Assignment operators + SumTypeVariant& operator=(const SumTypeVariant& other); + SumTypeVariant& operator=(SumTypeVariant&& other) = default; +}; + +/** + * Represents a sum type (tagged union/enum). + * Each variant has a name and can contain data. + * Aligned with Rust/C# naming conventions. + */ +struct SumTypeSchema { + std::vector variants; + + explicit SumTypeSchema(std::vector v) : variants(std::move(v)) {} +}; + +/** + * Represents a product type (struct/tuple). + * Contains ordered elements (fields). + * Aligned with Rust/C# naming conventions. + */ +struct ProductType { + std::vector elements; + + explicit ProductType(std::vector elems) + : elements(std::move(elems)) {} + + // Helper to create a product type for a C++ struct + template + static ProductType make(); +}; + +/** + * Represents an array type. + * Contains the complete type of elements in the array. + */ +struct ArrayType { + std::unique_ptr element_type; // Complete element type information + + // Constructor taking AlgebraicType by value + explicit ArrayType(AlgebraicType elem_type); + + // Copy constructor (deep copy) + ArrayType(const ArrayType& other); + + // Move constructor + ArrayType(ArrayType&& other) = default; + + // Assignment operators + ArrayType& operator=(const ArrayType& other); + ArrayType& operator=(ArrayType&& other) = default; +}; + +/** + * @brief The main algebraic type representation for SpacetimeDB's type system. + * + * AlgebraicType is a tagged union that represents all possible types in SpacetimeDB. + * It supports both primitive types (integers, floats, strings, etc.) and composite + * types (products/structs, sums/enums, arrays, and references). + * + * This type system is designed to be: + * - Compatible with multiple languages (Rust, C#, C++) + * - Serializable via BSATN (Binary Sparse Algebraic Type Notation) + * - Type-safe with compile-time verification + * + * @example Creating primitive types: + * @code + * auto int_type = AlgebraicType::I32(); + * auto string_type = AlgebraicType::String(); + * @endcode + * + * @example Creating composite types: + * @code + * // Create a struct type with name and age fields + * auto person_type = AlgebraicType::Product({ + * {"name", string_type_id}, + * {"age", int_type_id} + * }); + * + * // Create an enum type (Result) + * auto result_type = AlgebraicType::Sum({ + * {"Ok", ok_type_id}, + * {"Err", err_type_id} + * }); + * @endcode + */ +class AlgebraicType { +public: + /** + * @brief Internal data storage for type-specific information. + * + * The variant holds different data depending on the AlgebraicTypeTag: + * - Ref: uint32_t (type ID in the registry) + * - Sum: SumTypeSchema (enum/union definition) + * - Product: ProductType (struct definition) + * - Array: ArrayType (element type information) + * - Primitives: std::monostate (no additional data needed) + */ + using DataType = std::variant< + uint32_t, // Ref - type reference + std::unique_ptr, // Sum type + std::unique_ptr, // Product type + std::unique_ptr, // Array type + std::monostate // Primitive types (no additional data) + >; + +private: + AlgebraicTypeTag tag_; + DataType data_; + +public: + // Template factory for primitive types (reduces repetition) + template + static AlgebraicType make_primitive() { + static_assert( + static_cast(Tag) >= static_cast(AlgebraicTypeTag::String), + "make_primitive can only be used for primitive types" + ); + return AlgebraicType(Tag, std::monostate{}); + } + + // Constructors for complex types + static AlgebraicType make_ref(uint32_t type_id) { + return AlgebraicType(AlgebraicTypeTag::Ref, type_id); + } + + static AlgebraicType make_sum(std::unique_ptr sum) { + return AlgebraicType(AlgebraicTypeTag::Sum, std::move(sum)); + } + + static AlgebraicType make_product(std::unique_ptr product) { + return AlgebraicType(AlgebraicTypeTag::Product, std::move(product)); + } + + static AlgebraicType make_array(std::unique_ptr array) { + return AlgebraicType(AlgebraicTypeTag::Array, std::move(array)); + } + + + // Accessors + AlgebraicTypeTag tag() const { return tag_; } + const DataType& data() const { return data_; } + + // ------------------------------------------------------------------------- + // Type Checking Methods + // ------------------------------------------------------------------------- + /** + * @brief Check if this type is a reference to another type. + * @return true if this is a Ref type + */ + bool is_ref() const { return tag_ == AlgebraicTypeTag::Ref; } + + /** + * @brief Check if this type is a sum type (enum/tagged union). + * @return true if this is a Sum type + */ + bool is_sum() const { return tag_ == AlgebraicTypeTag::Sum; } + + /** + * @brief Check if this type is a product type (struct/tuple). + * @return true if this is a Product type + */ + bool is_product() const { return tag_ == AlgebraicTypeTag::Product; } + + /** + * @brief Check if this type is an array type. + * @return true if this is an Array type + */ + bool is_array() const { return tag_ == AlgebraicTypeTag::Array; } + + /** + * @brief Check if this type is a primitive type. + * Primitive types include all numeric types, booleans, and strings. + * @return true if this is a primitive type + */ + bool is_primitive() const { + return static_cast(tag_) >= static_cast(AlgebraicTypeTag::String); + } + + // Specific primitive type checks for convenience + bool is_bool() const { return tag_ == AlgebraicTypeTag::Bool; } + bool is_i8() const { return tag_ == AlgebraicTypeTag::I8; } + bool is_u8() const { return tag_ == AlgebraicTypeTag::U8; } + bool is_i16() const { return tag_ == AlgebraicTypeTag::I16; } + bool is_u16() const { return tag_ == AlgebraicTypeTag::U16; } + bool is_i32() const { return tag_ == AlgebraicTypeTag::I32; } + bool is_u32() const { return tag_ == AlgebraicTypeTag::U32; } + bool is_i64() const { return tag_ == AlgebraicTypeTag::I64; } + bool is_u64() const { return tag_ == AlgebraicTypeTag::U64; } + bool is_i128() const { return tag_ == AlgebraicTypeTag::I128; } + bool is_u128() const { return tag_ == AlgebraicTypeTag::U128; } + bool is_i256() const { return tag_ == AlgebraicTypeTag::I256; } + bool is_u256() const { return tag_ == AlgebraicTypeTag::U256; } + bool is_f32() const { return tag_ == AlgebraicTypeTag::F32; } + bool is_f64() const { return tag_ == AlgebraicTypeTag::F64; } + bool is_string() const { return tag_ == AlgebraicTypeTag::String; } + + // ------------------------------------------------------------------------- + // Data Accessor Methods + // ------------------------------------------------------------------------- + /** + * @brief Get the referenced type ID for a Ref type. + * @return The type ID this reference points to + * @throws std::runtime_error if this is not a Ref type + */ + uint32_t as_ref() const { + if (!is_ref()) throw std::runtime_error("Type is not a Ref"); + return std::get(data_); + } + + /** + * @brief Get the sum type schema for a Sum type. + * @return Reference to the SumTypeSchema containing variant definitions + * @throws std::runtime_error if this is not a Sum type + */ + const SumTypeSchema& as_sum() const { + if (!is_sum()) throw std::runtime_error("Type is not a Sum"); + return *std::get>(data_); + } + + /** + * @brief Get the product type definition for a Product type. + * @return Reference to the ProductType containing field definitions + * @throws std::runtime_error if this is not a Product type + */ + const ProductType& as_product() const { + if (!is_product()) throw std::runtime_error("Type is not a Product"); + return *std::get>(data_); + } + + /** + * @brief Get the array type definition for an Array type. + * @return Reference to the ArrayType containing element type info + * @throws std::runtime_error if this is not an Array type + */ + const ArrayType& as_array() const { + if (!is_array()) throw std::runtime_error("Type is not an Array"); + return *std::get>(data_); + } + + // ------------------------------------------------------------------------- + // Factory Methods for Primitive Types + // ------------------------------------------------------------------------- + // These methods provide a convenient API for creating primitive types. + // They are used extensively in code generation and manual type construction. + + // Boolean type + static AlgebraicType Bool() { return make_primitive(); } + + // Signed integer types + static AlgebraicType I8() { return make_primitive(); } + static AlgebraicType I16() { return make_primitive(); } + static AlgebraicType I32() { return make_primitive(); } + static AlgebraicType I64() { return make_primitive(); } + static AlgebraicType I128() { return make_primitive(); } + static AlgebraicType I256() { return make_primitive(); } + + // Unsigned integer types + static AlgebraicType U8() { return make_primitive(); } + static AlgebraicType U16() { return make_primitive(); } + static AlgebraicType U32() { return make_primitive(); } + static AlgebraicType U64() { return make_primitive(); } + static AlgebraicType U128() { return make_primitive(); } + static AlgebraicType U256() { return make_primitive(); } + + // Floating point types + static AlgebraicType F32() { return make_primitive(); } + static AlgebraicType F64() { return make_primitive(); } + + // String type + static AlgebraicType String() { return make_primitive(); } + + /** + * Creates a unit type (empty product). + * This represents std::monostate or Rust's () unit type. + * Used for variants with no data, like None in Option. + */ + static AlgebraicType Unit() { + return make_product(std::make_unique(std::vector{})); + } + // ------------------------------------------------------------------------- + // Copy method for deep copying + std::unique_ptr copy() const; + + // Factory Methods for Composite Types + // ------------------------------------------------------------------------- + + /** + * Creates a reference type pointing to another type. + * @param type_id The ID of the referenced type in the type registry + */ + static AlgebraicType Ref(uint32_t type_id) { + return make_ref(type_id); + } + + /** + * Creates an array type with elements of the specified type. + * @param elem_type The complete type of array elements + */ + static AlgebraicType Array(AlgebraicType elem_type) { + return make_array(std::make_unique(std::move(elem_type))); + } + + /** + * Creates an Option type (similar to Rust's Option or C++'s std::optional). + * This is represented as a sum type with two variants: None and Some(T). + * + * IMPORTANT: Order must match serialization in traits.h: + * - Tag 0: "none" (no data) + * - Tag 1: "some" (contains inner type) + * + * CRITICAL WASM FIX: The root cause of the crash is that during static initialization + * (when TABLE macros run), creating std::string objects can cause WASM traps. + * + * However, we can't always defer Option creation because some code paths need + * the actual AlgebraicType::Sum. So we try to create it normally, and if that + * would crash (detected by checking a global flag), we return a deferred marker. + * + * @param some_type_ref The type reference (registry index or primitive tag) for the Some variant's value + */ + static AlgebraicType Option(uint32_t some_type_ref) { + // CRITICAL: Handle sentinel value for types that should be inlined + if (some_type_ref == 0xFFFFFFFF) { + // This should never happen - Options themselves should be inlined + // Return a safe fallback (Option) to avoid crashes + std::vector variants; + auto unit_some = make_product(std::make_unique(std::vector{})); + auto unit_none = make_product(std::make_unique(std::vector{})); + variants.emplace_back("some", std::move(unit_some)); + variants.emplace_back("none", std::move(unit_none)); + return make_sum(std::make_unique(std::move(variants))); + } + + // Create the Option structure directly without markers + // This is a Sum type with "some" and "none" variants + std::vector variants; + + // Create the "some" variant with the inner type + // CRITICAL FIX: We cannot assume indices 4-19 are primitive types! + // They could be references to complex types in the typespace. + // Since this is a type_ref, it's ALWAYS a reference to a type. + variants.emplace_back("some", make_ref(some_type_ref)); + + // Create the "none" variant as Unit (empty Product) + auto unit = make_product(std::make_unique(std::vector{})); + variants.emplace_back("none", std::move(unit)); + + return make_sum(std::make_unique(std::move(variants))); + } + + + /** + * Creates a product type (struct) with named fields. + * @param fields Vector of field name and type ID pairs + * @example Product({{"name", 1}, {"age", 2}}) creates a struct with two fields + */ + static AlgebraicType Product(std::vector> fields) { + std::vector elements; + elements.reserve(fields.size()); + for (const auto& [name, type_id] : fields) { + elements.emplace_back(name, AlgebraicType::Ref(type_id)); + } + return make_product(std::make_unique(std::move(elements))); + } + + /** + * Creates a sum type (tagged union) with named variants. + * @param variants Vector of variant name and type ID pairs + * @example Sum({{"Ok", 1}, {"Err", 2}}) creates a Result-like type + */ + static AlgebraicType Sum(std::vector> variants) { + std::vector sum_variants; + sum_variants.reserve(variants.size()); + for (const auto& [name, type_id] : variants) { + sum_variants.emplace_back(name, AlgebraicType::Ref(type_id)); + } + return make_sum(std::make_unique(std::move(sum_variants))); + } + +private: + template + AlgebraicType(AlgebraicTypeTag tag, T&& data) + : tag_(tag), data_(std::forward(data)) {} +}; + +// ========================================================================= +// Type Trait for C++ to AlgebraicType Mapping +// ========================================================================= + +/** + * @brief Type trait to get the AlgebraicType representation for C++ types. + * + * This trait provides a mapping from C++ types to their corresponding + * AlgebraicType representation. Specialize this trait for custom types. + * + * @tparam T The C++ type to map + * + * @example Custom type specialization: + * @code + * template<> + * struct algebraic_type_of { + * static AlgebraicType get() { + * return AlgebraicType::Product({ + * {"field1", type_id_1}, + * {"field2", type_id_2} + * }); + * } + * }; + * @endcode + */ +template +struct algebraic_type_of { + static AlgebraicType get(); +}; + +// Helper macro to reduce repetitive primitive type specializations +#define SPACETIMEDB_DEFINE_ALGEBRAIC_TYPE(cpp_type, factory_method) \ + template<> struct algebraic_type_of { \ + static AlgebraicType get() { return AlgebraicType::factory_method(); } \ + } + +// Primitive type specializations +SPACETIMEDB_DEFINE_ALGEBRAIC_TYPE(bool, Bool); +SPACETIMEDB_DEFINE_ALGEBRAIC_TYPE(char, U8); // char treated as U8 +SPACETIMEDB_DEFINE_ALGEBRAIC_TYPE(int8_t, I8); +SPACETIMEDB_DEFINE_ALGEBRAIC_TYPE(int16_t, I16); +SPACETIMEDB_DEFINE_ALGEBRAIC_TYPE(int32_t, I32); +SPACETIMEDB_DEFINE_ALGEBRAIC_TYPE(int64_t, I64); +SPACETIMEDB_DEFINE_ALGEBRAIC_TYPE(uint8_t, U8); +SPACETIMEDB_DEFINE_ALGEBRAIC_TYPE(uint16_t, U16); +SPACETIMEDB_DEFINE_ALGEBRAIC_TYPE(uint32_t, U32); +SPACETIMEDB_DEFINE_ALGEBRAIC_TYPE(uint64_t, U64); +SPACETIMEDB_DEFINE_ALGEBRAIC_TYPE(float, F32); +SPACETIMEDB_DEFINE_ALGEBRAIC_TYPE(double, F64); +SPACETIMEDB_DEFINE_ALGEBRAIC_TYPE(std::string, String); + +#undef SPACETIMEDB_DEFINE_ALGEBRAIC_TYPE + +// Container type specializations +template struct algebraic_type_of> { + static AlgebraicType get() { + // TODO: This needs V9TypeRegistration integration to get proper element type ID + return AlgebraicType::Array(AlgebraicType::Ref(0)); // Placeholder + } +}; + +template struct algebraic_type_of> { + static AlgebraicType get() { + // For optional types, we need the type reference of the inner type + // For primitive types, this will be their tag value (4-19) + // For complex types, this needs to be resolved by the V9TypeRegistration system + // This is a limitation - we can't create proper Option types for complex T without V9TypeRegistration + + // Get the inner type + AlgebraicType inner_type = algebraic_type_of::get(); + + // If it's a primitive type, use its tag as the type reference + if (inner_type.tag() >= AlgebraicTypeTag::String && + inner_type.tag() <= AlgebraicTypeTag::F64) { + return AlgebraicType::Option(static_cast(inner_type.tag())); + } else { + // For complex types, we can't determine the correct type reference + // without V9TypeRegistration. Use 0 as placeholder which will need to be + // resolved during type registration. + return AlgebraicType::Option(0); + } + } +}; + +// TODO: Add specializations for I128, I256, U128, U256 when those types are properly defined + +// ========================================================================= +// Inline implementations (after AlgebraicType is complete) +// ========================================================================= + +// ProductTypeElement implementations +inline ProductTypeElement::ProductTypeElement(std::optional n, AlgebraicType type) + : name(std::move(n)), algebraic_type(std::make_unique(std::move(type))) {} + +inline ProductTypeElement::ProductTypeElement(const ProductTypeElement& other) + : name(other.name), + algebraic_type(other.algebraic_type ? other.algebraic_type->copy() : nullptr) {} + +inline ProductTypeElement& ProductTypeElement::operator=(const ProductTypeElement& other) { + if (this != &other) { + name = other.name; + algebraic_type = other.algebraic_type ? other.algebraic_type->copy() : nullptr; + } + return *this; +} + +// SumTypeVariant implementations +inline SumTypeVariant::SumTypeVariant(std::string n, AlgebraicType type) + : name(std::move(n)), algebraic_type(std::make_unique(std::move(type))) {} + +inline SumTypeVariant::SumTypeVariant(const SumTypeVariant& other) + : name(other.name), + algebraic_type(other.algebraic_type ? other.algebraic_type->copy() : nullptr) {} + +inline SumTypeVariant& SumTypeVariant::operator=(const SumTypeVariant& other) { + if (this != &other) { + name = other.name; + algebraic_type = other.algebraic_type ? other.algebraic_type->copy() : nullptr; + } + return *this; +} + +// ArrayType implementations +inline ArrayType::ArrayType(AlgebraicType elem_type) + : element_type(std::make_unique(std::move(elem_type))) {} + +inline ArrayType::ArrayType(const ArrayType& other) + : element_type(other.element_type ? other.element_type->copy() : nullptr) {} + +inline ArrayType& ArrayType::operator=(const ArrayType& other) { + if (this != &other) { + element_type = other.element_type ? other.element_type->copy() : nullptr; + } + return *this; +} + +// AlgebraicType copy implementation +inline std::unique_ptr AlgebraicType::copy() const { + switch (tag_) { + case AlgebraicTypeTag::Ref: + return std::make_unique(make_ref(std::get(data_))); + + case AlgebraicTypeTag::Sum: { + const auto& sum = *std::get>(data_); + std::vector new_variants; + for (const auto& variant : sum.variants) { + new_variants.push_back(variant); // Uses copy constructor + } + return std::make_unique( + make_sum(std::make_unique(std::move(new_variants))) + ); + } + + case AlgebraicTypeTag::Product: { + const auto& prod = *std::get>(data_); + std::vector new_elements; + for (const auto& elem : prod.elements) { + new_elements.push_back(elem); // Uses copy constructor + } + return std::make_unique( + make_product(std::make_unique(std::move(new_elements))) + ); + } + + case AlgebraicTypeTag::Array: { + const auto& arr = *std::get>(data_); + return std::make_unique( + make_array(std::make_unique(arr)) // Uses copy constructor + ); + } + + default: + // Primitive types - create directly with tag and monostate + return std::make_unique(AlgebraicType(tag_, std::monostate{})); + } +} + +} // namespace SpacetimeDb::bsatn + +#endif // SPACETIMEDB_BSATN_ALGEBRAIC_TYPE_H \ No newline at end of file diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/bsatn.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/bsatn.h new file mode 100644 index 00000000000..81d5760c45c --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/bsatn.h @@ -0,0 +1,64 @@ +#ifndef SPACETIMEDB_BSATN_MAIN_H // Changed guard to avoid conflict if old bsatn.h was somehow included +#define SPACETIMEDB_BSATN_MAIN_H + +/** + * @file bsatn.h + * @brief Main include file for the BSATN (Binary SpacetimeDB Abstract Type Notation) library components. + * @details This file includes the core components for BSATN serialization and deserialization: + * - bsatn::Reader + * - bsatn::Writer + * - Placeholder types for 128-bit integers. + * - Generic bsatn::serialize and bsatn::deserialize free function templates and their overloads/specializations. + * - Algebraic type system for type metadata + * - Serialization traits and interfaces + * - Type registry for managing types + * - Sum type support for discriminated unions + */ + +// Forward declarations +namespace SpacetimeDb { + namespace bsatn { + class Reader; + class Writer; + } +} + +// Core includes +#include "reader.h" // Defines Reader for deserialization +#include "writer.h" // Defines Writer for serialization +#include "algebraic_type.h" // AlgebraicType system (matches Rust/C#) +#include "type_extensions.h" // Extended and special types (merged from special_types.h and extended_types.h) - must come before traits.h +#include "traits.h" // Serialization traits and interfaces (includes struct macros) +#include "primitive_traits.h" // Primitive type specializations (bool, int, float, string) +#include "serialization.h" // Main serialize/deserialize functions with C++20 concepts +#include "sum_type.h" // SumType and Option (renamed from Sum) +#include "size_calculator.h" // Size calculation without serialization +#include "types_impl.h" // Implementation of BSATN methods for SpacetimeDB types + +// BSATN (Binary SpacetimeDB Algebraic Type Notation) C++ Implementation +// +// This provides a complete serialization system compatible with Rust and C#: +// +// 🔹 Core Types: +// - AlgebraicType: Type metadata system +// - ProductType: Structs/tuples (renamed elements for consistency) +// - SumType: Discriminated unions (renamed from Sum) +// - Option: Optional values +// +// 🔹 Usage: +// serialize(writer, value); // Serialize any supported type +// auto obj = deserialize(reader); // Deserialize to specific type +// SPACETIMEDB_STRUCT(MyType, field1, field2); // Enable struct serialization +// +// 🔹 Features: +// ✅ All primitive types (bool, integers, floats, string) +// ✅ Containers (vector, optional) +// ✅ User-defined structs via macro +// ✅ Sum types and discriminated unions +// ✅ Special SpacetimeDB types (Identity, Timestamp, etc.) +// ✅ Type registry for metadata +// ✅ Cross-language compatibility +// +// Note: Legacy SpacetimeDb::bsatn namespace is available for backward compatibility. + +#endif // SPACETIMEDB_BSATN_MAIN_H diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/monostate_traits.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/monostate_traits.h new file mode 100644 index 00000000000..c1b3421a44e --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/monostate_traits.h @@ -0,0 +1,46 @@ +#ifndef SPACETIMEDB_BSATN_MONOSTATE_TRAITS_H +#define SPACETIMEDB_BSATN_MONOSTATE_TRAITS_H + +#include +#include "traits.h" +#include "writer.h" +#include "reader.h" +#include "algebraic_type.h" + +namespace SpacetimeDb { +namespace bsatn { + +/** + * BSATN traits specialization for std::monostate + * + * std::monostate represents a unit type (empty product with 0 fields) + * This is equivalent to Rust's () unit type. + * + * Serialization: Writes nothing (0 bytes) + * Deserialization: Reads nothing, returns std::monostate{} + * Algebraic type: Product with 0 fields (unit type) + */ +template<> +struct bsatn_traits { + static void serialize(Writer&, const std::monostate&) { + // Unit type serializes to nothing (0 bytes) + // This matches BSATN spec for empty products + } + + static std::monostate deserialize(Reader&) { + // Unit type deserializes from nothing + // Just return a default-constructed monostate + return std::monostate{}; + } + + static AlgebraicType algebraic_type() { + // Unit is represented as an empty product (struct with 0 fields) + // This matches how Rust's () is serialized + return AlgebraicType::make_product({}); + } +}; + +} // namespace bsatn +} // namespace SpacetimeDb + +#endif // SPACETIMEDB_BSATN_MONOSTATE_TRAITS_H \ No newline at end of file diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/primitive_traits.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/primitive_traits.h new file mode 100644 index 00000000000..6c4aaf3ddff --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/primitive_traits.h @@ -0,0 +1,275 @@ +#ifndef SPACETIMEDB_BSATN_PRIMITIVE_TRAITS_H +#define SPACETIMEDB_BSATN_PRIMITIVE_TRAITS_H + +/** + * @file primitive_traits.h + * @brief BSATN trait specializations for primitive types + * + * This file provides bsatn_traits specializations for all primitive types + * supported by SpacetimeDB. These specializations delegate to the existing + * serialize functions in writer.h and deserializer struct in reader.h. + */ + +#include "traits.h" +#include "reader.h" +#include "writer.h" +#include "algebraic_type.h" +#include +#include + +namespace SpacetimeDb::bsatn { + +// Forward declarations of serialize functions from writer.h +inline void serialize(Writer& w, bool value); +inline void serialize(Writer& w, uint8_t value); +inline void serialize(Writer& w, uint16_t value); +inline void serialize(Writer& w, uint32_t value); +inline void serialize(Writer& w, uint64_t value); +inline void serialize(Writer& w, int8_t value); +inline void serialize(Writer& w, int16_t value); +inline void serialize(Writer& w, int32_t value); +inline void serialize(Writer& w, int64_t value); +inline void serialize(Writer& w, float value); +inline void serialize(Writer& w, double value); +inline void serialize(Writer& w, const std::string& value); + +// ========================================================================= +// Boolean Type +// ========================================================================= + +template<> +struct bsatn_traits { + static void serialize(Writer& writer, bool value) { + writer.write_bool(value); + } + + static bool deserialize(Reader& reader) { + return reader.read_bool(); + } + + static AlgebraicType algebraic_type() { + return AlgebraicType::Bool(); + } +}; + +// ========================================================================= +// Signed Integer Types +// ========================================================================= + +template<> +struct bsatn_traits { + static void serialize(Writer& writer, int8_t value) { + writer.write_i8(value); + } + + static int8_t deserialize(Reader& reader) { + return reader.read_i8(); + } + + static AlgebraicType algebraic_type() { + return AlgebraicType::I8(); + } +}; + +template<> +struct bsatn_traits { + static void serialize(Writer& writer, int16_t value) { + writer.write_i16_le(value); + } + + static int16_t deserialize(Reader& reader) { + return reader.read_i16_le(); + } + + static AlgebraicType algebraic_type() { + return AlgebraicType::I16(); + } +}; + +template<> +struct bsatn_traits { + static void serialize(Writer& writer, int32_t value) { + writer.write_i32_le(value); + } + + static int32_t deserialize(Reader& reader) { + return reader.read_i32_le(); + } + + static AlgebraicType algebraic_type() { + return AlgebraicType::I32(); + } +}; + +template<> +struct bsatn_traits { + static void serialize(Writer& writer, int64_t value) { + writer.write_i64_le(value); + } + + static int64_t deserialize(Reader& reader) { + return reader.read_i64_le(); + } + + static AlgebraicType algebraic_type() { + return AlgebraicType::I64(); + } +}; + +// ========================================================================= +// Unsigned Integer Types +// ========================================================================= + +template<> +struct bsatn_traits { + static void serialize(Writer& writer, uint8_t value) { + writer.write_u8(value); + } + + static uint8_t deserialize(Reader& reader) { + return reader.read_u8(); + } + + static AlgebraicType algebraic_type() { + return AlgebraicType::U8(); + } +}; + +template<> +struct bsatn_traits { + static void serialize(Writer& writer, uint16_t value) { + writer.write_u16_le(value); + } + + static uint16_t deserialize(Reader& reader) { + return reader.read_u16_le(); + } + + static AlgebraicType algebraic_type() { + return AlgebraicType::U16(); + } +}; + +template<> +struct bsatn_traits { + static void serialize(Writer& writer, uint32_t value) { + writer.write_u32_le(value); + } + + static uint32_t deserialize(Reader& reader) { + return reader.read_u32_le(); + } + + static AlgebraicType algebraic_type() { + return AlgebraicType::U32(); + } +}; + +template<> +struct bsatn_traits { + static void serialize(Writer& writer, uint64_t value) { + writer.write_u64_le(value); + } + + static uint64_t deserialize(Reader& reader) { + return reader.read_u64_le(); + } + + static AlgebraicType algebraic_type() { + return AlgebraicType::U64(); + } +}; + +// ========================================================================= +// Floating Point Types +// ========================================================================= + +template<> +struct bsatn_traits { + static void serialize(Writer& writer, float value) { + writer.write_f32_le(value); + } + + static float deserialize(Reader& reader) { + return reader.read_f32_le(); + } + + static AlgebraicType algebraic_type() { + return AlgebraicType::F32(); + } +}; + +template<> +struct bsatn_traits { + static void serialize(Writer& writer, double value) { + writer.write_f64_le(value); + } + + static double deserialize(Reader& reader) { + return reader.read_f64_le(); + } + + static AlgebraicType algebraic_type() { + return AlgebraicType::F64(); + } +}; + +// ========================================================================= +// String Type +// ========================================================================= + +template<> +struct bsatn_traits { + static void serialize(Writer& writer, const std::string& value) { + writer.write_string(value); + } + + static std::string deserialize(Reader& reader) { + return reader.read_string(); + } + + static AlgebraicType algebraic_type() { + return AlgebraicType::String(); + } +}; + +// Note: Platform-specific type aliases (like 'int' vs 'int32_t') are handled +// by the existing type system. On most platforms, 'int' is an alias for 'int32_t' +// and 'unsigned int' is an alias for 'uint32_t', so they use the same specializations. + +// ========================================================================= +// Generic Enum Type Support +// ========================================================================= + +/** + * Generic enum trait specialization that works for any enum type. + * Enums are serialized as their underlying type (typically uint32_t). + * + * Usage: + * enum class MyEnum : uint8_t { Zero, One, Two }; + * // Automatically supported for BSATN serialization + */ +template +requires std::is_enum_v +struct bsatn_traits { + static void serialize(Writer& writer, const T& value) { + using underlying = std::underlying_type_t; + // Delegate to the underlying type's serialization + bsatn_traits::serialize(writer, static_cast(value)); + } + + static T deserialize(Reader& reader) { + using underlying = std::underlying_type_t; + // Delegate to the underlying type's deserialization + return static_cast(bsatn_traits::deserialize(reader)); + } + + static AlgebraicType algebraic_type() { + using underlying = std::underlying_type_t; + return bsatn_traits::algebraic_type(); + } +}; + +} // namespace SpacetimeDb::bsatn + +#endif // SPACETIMEDB_BSATN_PRIMITIVE_TRAITS_H \ No newline at end of file diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/reader.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/reader.h new file mode 100644 index 00000000000..e52a3d002d4 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/reader.h @@ -0,0 +1,268 @@ +#ifndef SPACETIMEDB_BSATN_READER_H +#define SPACETIMEDB_BSATN_READER_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +// uint128_placeholder.h removed - types are in spacetimedb/types.h +#include "types.h" + +namespace SpacetimeDb::bsatn { + + class Reader; + template T deserialize(Reader& r); + template struct bsatn_traits; + + // Helper traits + template struct is_std_optional : std::false_type {}; + template struct is_std_optional> : std::true_type {}; + template constexpr bool is_std_optional_v = is_std_optional::value; + + template struct is_std_vector : std::false_type {}; + template struct is_std_vector> : std::true_type {}; + template constexpr bool is_std_vector_v = is_std_vector::value; + + class Reader { + public: + // Constructors - using uint8_t consistently + Reader(const uint8_t* data, size_t size) : current_ptr(data), end_ptr(data + size) {} + Reader(std::span data) : current_ptr(data.data()), end_ptr(data.data() + data.size()) {} + Reader(const std::vector& data) : current_ptr(data.data()), end_ptr(data.data() + data.size()) {} + + + // Template method for reading primitive types (reduces implementation duplication) + template + T read_primitive_le() { + static_assert(std::is_arithmetic_v, "read_primitive_le only works with arithmetic types"); + check_available(sizeof(T)); + T val; + std::memcpy(&val, current_ptr, sizeof(T)); + advance(sizeof(T)); + return val; + } + + // Public API methods (delegates to template where possible) + inline bool read_bool() { + check_available(1); + uint8_t val = *current_ptr; + advance(1); + if (val > 1) { + std::abort(); // Invalid bool value in BSATN deserialization + } + return val != 0; + } + inline uint8_t read_u8() { + check_available(1); + uint8_t val = *current_ptr; + advance(1); + return val; + } + uint16_t read_u16_le() { return read_primitive_le(); } + uint32_t read_u32_le() { return read_primitive_le(); } + uint64_t read_u64_le() { return read_primitive_le(); } + inline SpacetimeDb::u128 read_u128_le() { + uint64_t low = read_u64_le(); + uint64_t high = read_u64_le(); + return SpacetimeDb::u128(high, low); + } + inline SpacetimeDb::u256_placeholder read_u256_le() { + check_available(32); + SpacetimeDb::u256_placeholder val; + std::memcpy(val.data.data(), current_ptr, 32); + advance(32); + return val; + } + + int8_t read_i8() { return static_cast(read_u8()); } + int16_t read_i16_le() { return static_cast(read_u16_le()); } + int32_t read_i32_le() { return static_cast(read_u32_le()); } + int64_t read_i64_le() { return static_cast(read_u64_le()); } + inline SpacetimeDb::i128 read_i128_le() { + uint64_t low = read_u64_le(); + int64_t high = static_cast(read_u64_le()); + return SpacetimeDb::i128(high, low); + } + inline SpacetimeDb::i256_placeholder read_i256_le() { + check_available(32); + SpacetimeDb::i256_placeholder val; + std::memcpy(val.data.data(), current_ptr, 32); + advance(32); + return val; + } + + float read_f32_le() { return read_primitive_le(); } + double read_f64_le() { return read_primitive_le(); } + + inline std::string read_string() { + uint32_t len = read_u32_le(); + check_available(len); + std::string result(reinterpret_cast(current_ptr), len); + advance(len); + return result; + } + inline std::vector read_bytes() { + uint32_t len = read_u32_le(); + check_available(len); + std::vector result(current_ptr, current_ptr + len); + advance(len); + return result; + } + inline std::vector read_fixed_bytes(size_t count) { + check_available(count); + std::vector result(current_ptr, current_ptr + count); + advance(count); + return result; + } + + template + std::optional read_optional() { + uint8_t tag = read_u8(); + if (tag == 0) { + return std::nullopt; + } else if (tag == 1) { + return SpacetimeDb::bsatn::deserialize(*this); + } else { + std::abort(); // Invalid optional tag in BSATN deserialization + } + } + + template + std::vector read_vector() { + uint32_t size = read_u32_le(); + std::vector result; + result.reserve(size); + for (uint32_t i = 0; i < size; ++i) { + result.push_back(SpacetimeDb::bsatn::deserialize(*this)); + } + return result; + } + + inline std::vector read_vector_byte() { + return read_bytes(); + } + + // Deserialize a type using C++20 concepts for better error messages + template + requires requires(Reader& r) { SpacetimeDb::bsatn::deserialize(r); } + T deserialize_type() { + return SpacetimeDb::bsatn::deserialize(*this); + } + + inline bool is_eos() const { + return current_ptr >= end_ptr; + } + inline size_t remaining_bytes() const { + return (current_ptr <= end_ptr) ? (end_ptr - current_ptr) : 0; + } + + private: + inline void check_available(size_t num_bytes) const { + if (current_ptr + num_bytes > end_ptr) { + std::abort(); // BSATN Reader: Not enough bytes remaining + } + } + inline void advance(size_t num_bytes) { + current_ptr += num_bytes; + } + + const uint8_t* current_ptr; + const uint8_t* end_ptr; + }; + + // Type trait for deserializing types - primary template + template + struct deserializer { + static T deserialize(Reader& r) { + // Default: try bsatn_traits + return bsatn_traits::deserialize(r); + } + }; + + // Specializations for primitive types + template<> struct deserializer { + static bool deserialize(Reader& r) { return r.read_bool(); } + }; + template<> struct deserializer { + static uint8_t deserialize(Reader& r) { return r.read_u8(); } + }; + template<> struct deserializer { + static uint16_t deserialize(Reader& r) { return r.read_u16_le(); } + }; + template<> struct deserializer { + static uint32_t deserialize(Reader& r) { return r.read_u32_le(); } + }; + template<> struct deserializer { + static uint64_t deserialize(Reader& r) { return r.read_u64_le(); } + }; + template<> struct deserializer { + static int8_t deserialize(Reader& r) { return r.read_i8(); } + }; + template<> struct deserializer { + static int16_t deserialize(Reader& r) { return r.read_i16_le(); } + }; + template<> struct deserializer { + static int32_t deserialize(Reader& r) { return r.read_i32_le(); } + }; + template<> struct deserializer { + static int64_t deserialize(Reader& r) { return r.read_i64_le(); } + }; + template<> struct deserializer { + static float deserialize(Reader& r) { return r.read_f32_le(); } + }; + template<> struct deserializer { + static double deserialize(Reader& r) { return r.read_f64_le(); } + }; + template<> struct deserializer { + static std::string deserialize(Reader& r) { return r.read_string(); } + }; + template<> struct deserializer> { + static std::vector deserialize(Reader& r) { return r.read_bytes(); } + }; + + // Specializations for container types + template + struct deserializer> { + static std::optional deserialize(Reader& r) { + return r.read_optional(); + } + }; + + template + struct deserializer, std::enable_if_t>> { + static std::vector deserialize(Reader& r) { + return r.read_vector(); + } + }; + + // Specializations for SpacetimeDB types + template<> struct deserializer { + static SpacetimeDb::Identity deserialize(Reader& r) { + SpacetimeDb::Identity id; + id.bsatn_deserialize(r); + return id; + } + }; + template<> struct deserializer { + static SpacetimeDb::ConnectionId deserialize(Reader& r) { + SpacetimeDb::ConnectionId conn; + conn.bsatn_deserialize(r); + return conn; + } + }; + + // Generic deserialize function - now much cleaner! + template + inline T deserialize(Reader& r) { + return deserializer::deserialize(r); + } + +} // namespace SpacetimeDB::bsatn + +#endif // SPACETIMEDB_BSATN_READER_H \ No newline at end of file diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/schedule_at.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/schedule_at.h new file mode 100644 index 00000000000..5d8e2120ea9 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/schedule_at.h @@ -0,0 +1,166 @@ +#ifndef SPACETIMEDB_BSATN_SCHEDULE_AT_H +#define SPACETIMEDB_BSATN_SCHEDULE_AT_H + +#include "timestamp.h" +#include "time_duration.h" +#include + +namespace SpacetimeDb { + +/** + * ScheduleAt represents when a scheduled reducer should execute. + * This is a sum type with two variants: + * - Interval(TimeDuration): Execute at regular intervals + * - Time(Timestamp): Execute at a specific time + * + * Special type matching Rust's ScheduleAt enum. + * This enables scheduled reducers functionality in SpacetimeDB. + */ +class ScheduleAt { +public: + enum class Variant : uint8_t { + Interval = 0, // Regular interval (TimeDuration) + Time = 1 // Specific time (Timestamp) + }; + +private: + Variant variant; + union { + TimeDuration interval_value; + Timestamp time_value; + }; + +public: + // Constructors + ScheduleAt() : variant(Variant::Interval), interval_value(TimeDuration::from_seconds(0)) {} + + ScheduleAt(const TimeDuration& dur) + : variant(Variant::Interval), interval_value(dur) {} + + ScheduleAt(const Timestamp& ts) + : variant(Variant::Time), time_value(ts) {} + + // Copy constructor + ScheduleAt(const ScheduleAt& other) : variant(other.variant) { + switch (variant) { + case Variant::Interval: + new (&interval_value) TimeDuration(other.interval_value); + break; + case Variant::Time: + new (&time_value) Timestamp(other.time_value); + break; + } + } + + // Assignment operator + ScheduleAt& operator=(const ScheduleAt& other) { + if (this != &other) { + this->~ScheduleAt(); // Destroy current value + variant = other.variant; + switch (variant) { + case Variant::Interval: + new (&interval_value) TimeDuration(other.interval_value); + break; + case Variant::Time: + new (&time_value) Timestamp(other.time_value); + break; + } + } + return *this; + } + + // Move constructor + ScheduleAt(ScheduleAt&& other) noexcept : variant(other.variant) { + switch (variant) { + case Variant::Interval: + new (&interval_value) TimeDuration(std::move(other.interval_value)); + break; + case Variant::Time: + new (&time_value) Timestamp(std::move(other.time_value)); + break; + } + } + + // Move assignment + ScheduleAt& operator=(ScheduleAt&& other) noexcept { + if (this != &other) { + this->~ScheduleAt(); + variant = other.variant; + switch (variant) { + case Variant::Interval: + new (&interval_value) TimeDuration(std::move(other.interval_value)); + break; + case Variant::Time: + new (&time_value) Timestamp(std::move(other.time_value)); + break; + } + } + return *this; + } + + // Destructor + ~ScheduleAt() { + switch (variant) { + case Variant::Interval: + interval_value.~TimeDuration(); + break; + case Variant::Time: + time_value.~Timestamp(); + break; + } + } + + // Accessors + Variant get_variant() const { return variant; } + bool is_interval() const { return variant == Variant::Interval; } + bool is_time() const { return variant == Variant::Time; } + + const TimeDuration& get_interval() const { + if (variant != Variant::Interval) { + static TimeDuration default_duration; + return default_duration; + } + return interval_value; + } + + const Timestamp& get_time() const { + if (variant != Variant::Time) { + static Timestamp default_timestamp; + return default_timestamp; + } + return time_value; + } + + // Static factory methods + static ScheduleAt interval(const TimeDuration& dur) { + return ScheduleAt(dur); + } + + static ScheduleAt time(const Timestamp& ts) { + return ScheduleAt(ts); + } + + // Comparison operators + bool operator==(const ScheduleAt& other) const { + if (variant != other.variant) return false; + switch (variant) { + case Variant::Interval: + return interval_value == other.interval_value; + case Variant::Time: + return time_value == other.time_value; + } + return false; + } + + bool operator!=(const ScheduleAt& other) const { + return !(*this == other); + } + + // BSATN serialization (implemented below) + void bsatn_serialize(::SpacetimeDb::bsatn::Writer& writer) const; + void bsatn_deserialize(::SpacetimeDb::bsatn::Reader& reader); +}; + +} // namespace SpacetimeDb + +#endif // SPACETIMEDB_BSATN_SCHEDULE_AT_H \ No newline at end of file diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/schedule_at_impl.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/schedule_at_impl.h new file mode 100644 index 00000000000..efc26d25393 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/schedule_at_impl.h @@ -0,0 +1,135 @@ +#ifndef SPACETIMEDB_BSATN_SCHEDULE_AT_IMPL_H +#define SPACETIMEDB_BSATN_SCHEDULE_AT_IMPL_H + +#include "schedule_at.h" +#include "reader.h" +#include "writer.h" +#include "traits.h" +#include "type_extensions.h" // For special type constants + +namespace SpacetimeDb { + +// ScheduleAt BSATN implementation +inline void ScheduleAt::bsatn_serialize(::SpacetimeDb::bsatn::Writer& writer) const { + // Write variant tag (as u8) + writer.write_u8(static_cast(variant)); + + // Write payload based on variant + switch (variant) { + case Variant::Interval: + interval_value.bsatn_serialize(writer); + break; + case Variant::Time: + time_value.bsatn_serialize(writer); + break; + } +} + +inline void ScheduleAt::bsatn_deserialize(::SpacetimeDb::bsatn::Reader& reader) { + // Read variant tag + uint8_t variant_tag = reader.read_u8(); + + // Destroy current union content + this->~ScheduleAt(); + + // Initialize based on variant + switch (variant_tag) { + case 0: // Interval + variant = Variant::Interval; + new (&interval_value) TimeDuration(); + interval_value.bsatn_deserialize(reader); + break; + case 1: // Time + variant = Variant::Time; + new (&time_value) Timestamp(); + time_value.bsatn_deserialize(reader); + break; + default: + // Default to Interval variant with 0 duration + variant = Variant::Interval; + new (&interval_value) TimeDuration(); + } +} + +} // namespace SpacetimeDb + +namespace SpacetimeDb::bsatn { + +// Explicit specialization for ScheduleAt to handle BSATN serialization +template<> +struct bsatn_traits<::SpacetimeDb::ScheduleAt> { + static void serialize(Writer& writer, const ::SpacetimeDb::ScheduleAt& value) { + value.bsatn_serialize(writer); + } + + static ::SpacetimeDb::ScheduleAt deserialize(Reader& reader) { + ::SpacetimeDb::ScheduleAt result; // Default constructor + result.bsatn_deserialize(reader); + return result; + } + + static AlgebraicType algebraic_type() { + // ScheduleAt is a special Sum type with Interval and Time variants + // Use the existing TimeDuration and Timestamp algebraic_type specializations + // to ensure proper inlining like the legacy path + + std::vector variants; + + // Interval variant: Use TimeDuration's algebraic_type() for proper inlining + AlgebraicType interval_type = bsatn_traits<::SpacetimeDb::TimeDuration>::algebraic_type(); + variants.emplace_back("Interval", std::move(interval_type)); + + // Time variant: Use Timestamp's algebraic_type() for proper inlining + AlgebraicType time_type = bsatn_traits<::SpacetimeDb::Timestamp>::algebraic_type(); + variants.emplace_back("Time", std::move(time_type)); + + auto sum_type = std::make_unique(std::move(variants)); + return AlgebraicType::make_sum(std::move(sum_type)); + } +}; + +} // namespace SpacetimeDb::bsatn + +// BSATN serializer template specialization for ScheduleAt +namespace SpacetimeDb { + +// ScheduleAt serialization - sum type with variant tag + payload +template<> +struct BsatnSerializer { + static void serialize(std::vector& buffer, const ScheduleAt& value) { + // Write variant tag + buffer.push_back(static_cast(value.get_variant())); + + // Write payload based on variant + switch (value.get_variant()) { + case ScheduleAt::Variant::Interval: + BsatnSerializer::serialize(buffer, value.get_interval()); + break; + case ScheduleAt::Variant::Time: + BsatnSerializer::serialize(buffer, value.get_time()); + break; + } + } + + static ScheduleAt deserialize(const uint8_t* data, size_t& offset) { + // Read variant tag + uint8_t variant_tag = data[offset++]; + + switch (variant_tag) { + case 0: { // Interval + TimeDuration dur = BsatnSerializer::deserialize(data, offset); + return ScheduleAt::interval(dur); + } + case 1: { // Time + Timestamp ts = BsatnSerializer::deserialize(data, offset); + return ScheduleAt::time(ts); + } + default: + return ScheduleAt::interval(TimeDuration::from_seconds(0)); + } + } +}; + +} // namespace SpacetimeDb + +#endif // SPACETIMEDB_BSATN_SCHEDULE_AT_IMPL_H \ No newline at end of file diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/serialization.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/serialization.h new file mode 100644 index 00000000000..e9f3aadf21f --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/serialization.h @@ -0,0 +1,148 @@ +#ifndef SPACETIMEDB_BSATN_SERIALIZATION_H +#define SPACETIMEDB_BSATN_SERIALIZATION_H + +/** + * @file serialization.h + * @brief Core serialization and deserialization functions for BSATN + * + * This header provides the main entry points for BSATN serialization + * using C++20 concepts for better type safety and error messages. + */ + +#include "traits.h" +#include "reader.h" +#include "writer.h" +#include "size_calculator.h" +#include +#include + +namespace SpacetimeDb::bsatn { + +/** + * @brief Concept for types that can be serialized to BSATN + */ +template +concept Serializable = requires(Writer& w, const T& v) { + bsatn_traits::serialize(w, v); +}; + +/** + * @brief Concept for types that can be deserialized from BSATN + */ +template +concept Deserializable = requires(Reader& r) { + { bsatn_traits::deserialize(r) } -> std::same_as; +}; + +/** + * @brief Serialize a value to BSATN format + * + * @tparam T Type to serialize (must satisfy Serializable concept) + * @param writer The writer to serialize to + * @param value The value to serialize + * + * @example + * @code + * Writer writer; + * MyStruct data{42, "hello"}; + * serialize(writer, data); + * auto bytes = writer.take_buffer(); + * @endcode + */ +template +inline void serialize(Writer& writer, const T& value) { + bsatn_traits::serialize(writer, value); +} + +/** + * @brief Deserialize a value from BSATN format + * + * @tparam T Type to deserialize (must satisfy Deserializable concept) + * @param reader The reader to deserialize from + * @return The deserialized value + * + * @example + * @code + * Reader reader(bytes); + * auto data = deserialize(reader); + * @endcode + */ +template +inline T deserialize(Reader& reader) { + return bsatn_traits::deserialize(reader); +} + +/** + * @brief Serialize multiple values at once + * + * Uses C++20 parameter packs with concepts for type safety. + * + * @example + * @code + * Writer writer; + * serialize_all(writer, 42, "hello", true, 3.14); + * @endcode + */ +template + requires (Serializable && ...) +inline void serialize_all(Writer& writer, const Args&... args) { + (serialize(writer, args), ...); +} + +/** + * @brief Helper to serialize to a byte vector + * + * @tparam T Type to serialize + * @param value The value to serialize + * @return Vector of bytes containing serialized data + */ +template +inline std::vector to_bytes(const T& value) { + Writer writer; + serialize(writer, value); + return writer.take_buffer(); +} + +/** + * @brief Helper to deserialize from a byte vector + * + * @tparam T Type to deserialize + * @param bytes The byte vector to deserialize from + * @return The deserialized value + */ +template +inline T from_bytes(const std::vector& bytes) { + Reader reader(bytes); + return deserialize(reader); +} + +// Note: size_calculator.h must be included for these concepts to work +// It defines has_static_size and static_size_v + +/** + * @brief Concept for types that have a static size + * + * This requires that size_calculator.h has been included to provide + * the has_static_size template. + */ +template +concept HasStaticSize = requires { + typename std::enable_if_t>>; + { has_static_size::value } -> std::convertible_to; +} && has_static_size::value == true; + +/** + * @brief Get the static BSATN size of a type at compile time + * + * @tparam T Type with static size + * @return The size in bytes + */ +template + requires HasStaticSize +consteval size_t static_bsatn_size() { + return has_static_size::value; +} + +} // namespace SpacetimeDb::bsatn + +#endif // SPACETIMEDB_BSATN_SERIALIZATION_H \ No newline at end of file diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/size_calculator.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/size_calculator.h new file mode 100644 index 00000000000..0bdcbebd7d3 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/size_calculator.h @@ -0,0 +1,255 @@ +#ifndef SPACETIMEDB_BSATN_SIZE_CALCULATOR_H +#define SPACETIMEDB_BSATN_SIZE_CALCULATOR_H + +#include +#include +#include +#include +#include +#include +#include +#include "writer.h" // For Writer + +namespace SpacetimeDb::bsatn { + +// Forward declaration +template struct bsatn_traits; + +/** + * A Writer-compatible class that only counts bytes without storing them. + * Used for size calculation via bsatn_traits::serialize(). + */ +class SizeWriter { +private: + size_t size_ = 0; + +public: + size_t size() const { return size_; } + + // Writer interface implementation + void write_u8(uint8_t) { size_ += 1; } + void write_u16_le(uint16_t) { size_ += 2; } + void write_u32_le(uint32_t) { size_ += 4; } + void write_u64_le(uint64_t) { size_ += 8; } + void write_u128_le(const std::array&) { size_ += 16; } + void write_u256_le(const std::array&) { size_ += 32; } + + void write_i8(int8_t) { size_ += 1; } + void write_i16_le(int16_t) { size_ += 2; } + void write_i32_le(int32_t) { size_ += 4; } + void write_i64_le(int64_t) { size_ += 8; } + void write_i128_le(const std::array&) { size_ += 16; } + void write_i256_le(const std::array&) { size_ += 32; } + + void write_f32_le(float) { size_ += 4; } + void write_f64_le(double) { size_ += 8; } + + void write_bool(bool) { size_ += 1; } + + void write_string(const std::string& s) { + size_ += 4 + s.length(); // Length prefix + data + } + + void write_bytes(const std::vector& bytes) { + size_ += 4 + bytes.size(); // Length prefix + data + } + + void write_bytes(const void*, size_t len) { + size_ += 4 + len; // Length prefix + data + } + + // No-op methods for size calculation + std::vector take_buffer() { return {}; } + void clear() { size_ = 0; } +}; + +/** + * Calculate the serialized size of values without actually serializing. + * This matches Rust's CountWriter functionality. + */ +class SizeCalculator { +private: + size_t size_ = 0; + +public: + size_t size() const { return size_; } + + void add_bool() { size_ += 1; } + void add_u8() { size_ += 1; } + void add_u16() { size_ += 2; } + void add_u32() { size_ += 4; } + void add_u64() { size_ += 8; } + void add_u128() { size_ += 16; } + void add_u256() { size_ += 32; } + + void add_i8() { size_ += 1; } + void add_i16() { size_ += 2; } + void add_i32() { size_ += 4; } + void add_i64() { size_ += 8; } + void add_i128() { size_ += 16; } + void add_i256() { size_ += 32; } + + void add_f32() { size_ += 4; } + void add_f64() { size_ += 8; } + + void add_string(const std::string& s) { + size_ += 4 + s.length(); // Length prefix + data + } + + void add_bytes(size_t len) { + size_ += 4 + len; // Length prefix + data + } + + template + void add_vector(const std::vector& vec) { + size_ += 4; // Length prefix + for (const auto& item : vec) { + add_value(item); + } + } + + template + void add_optional(const std::optional& opt) { + size_ += 1; // Tag byte + if (opt.has_value()) { + add_value(*opt); + } + } + + // Generic value addition + template + void add_value(const T& value); +}; + +/** + * Trait to determine if a type has a static (compile-time known) size. + * This matches Rust's static_bsatn_size functionality. + */ +template +struct has_static_size : std::false_type {}; + +template<> struct has_static_size : std::true_type { static constexpr size_t value = 1; }; +template<> struct has_static_size : std::true_type { static constexpr size_t value = 1; }; +template<> struct has_static_size : std::true_type { static constexpr size_t value = 2; }; +template<> struct has_static_size : std::true_type { static constexpr size_t value = 4; }; +template<> struct has_static_size : std::true_type { static constexpr size_t value = 8; }; +template<> struct has_static_size : std::true_type { static constexpr size_t value = 1; }; +template<> struct has_static_size : std::true_type { static constexpr size_t value = 2; }; +template<> struct has_static_size : std::true_type { static constexpr size_t value = 4; }; +template<> struct has_static_size : std::true_type { static constexpr size_t value = 8; }; +template<> struct has_static_size : std::true_type { static constexpr size_t value = 4; }; +template<> struct has_static_size : std::true_type { static constexpr size_t value = 8; }; + +template +inline constexpr bool has_static_size_v = has_static_size::value; + +template +inline constexpr size_t static_size_v = has_static_size::value; + +/** + * Calculate the BSATN serialized size of a value. + * Similar to Rust's to_len() function. + */ +template +size_t bsatn_len(const T& value) { + if constexpr (has_static_size_v) { + return static_size_v; + } else { + SizeCalculator calc; + calc.add_value(value); + return calc.size(); + } +} + +/** + * Optimized serialization that pre-allocates the exact size needed. + * Similar to Rust's to_bsatn_vec(). + */ +template +std::vector to_bsatn_vec(const T& value) { + size_t size = bsatn_len(value); + std::vector result; + result.reserve(size); + + // Use existing Writer to serialize + Writer writer; + serialize(writer, value); + return writer.take_buffer(); +} + +/** + * Extend an existing vector with BSATN data. + * Similar to Rust's to_bsatn_extend(). + */ +template +void to_bsatn_extend(std::vector& vec, const T& value) { + size_t old_size = vec.size(); + size_t add_size = bsatn_len(value); + vec.reserve(old_size + add_size); + + // Serialize directly into the vector + // (Would need custom Writer that appends to existing vector) + auto temp = to_bsatn_vec(value); + vec.insert(vec.end(), temp.begin(), temp.end()); +} + +/** + * Type trait to check if a type is primitive (no padding). + * Similar to Rust's IsPrimitiveType. + */ +template +struct is_primitive_type : std::false_type {}; + +template<> struct is_primitive_type : std::true_type {}; +template<> struct is_primitive_type : std::true_type {}; +template<> struct is_primitive_type : std::true_type {}; +template<> struct is_primitive_type : std::true_type {}; +template<> struct is_primitive_type : std::true_type {}; +template<> struct is_primitive_type : std::true_type {}; +template<> struct is_primitive_type : std::true_type {}; +template<> struct is_primitive_type : std::true_type {}; +template<> struct is_primitive_type : std::true_type {}; +template<> struct is_primitive_type : std::true_type {}; +template<> struct is_primitive_type : std::true_type {}; + +template +inline constexpr bool is_primitive_type_v = is_primitive_type::value; + +// Implementation of SizeCalculator::add_value +template +void SizeCalculator::add_value(const T& value) { + if constexpr (std::is_same_v) { + add_bool(); + } else if constexpr (std::is_same_v) { + add_u8(); + } else if constexpr (std::is_same_v) { + add_u16(); + } else if constexpr (std::is_same_v) { + add_u32(); + } else if constexpr (std::is_same_v) { + add_u64(); + } else if constexpr (std::is_same_v) { + add_i8(); + } else if constexpr (std::is_same_v) { + add_i16(); + } else if constexpr (std::is_same_v) { + add_i32(); + } else if constexpr (std::is_same_v) { + add_i64(); + } else if constexpr (std::is_same_v) { + add_f32(); + } else if constexpr (std::is_same_v) { + add_f64(); + } else if constexpr (std::is_same_v) { + add_string(value); + } else { + // For custom types, use a SizeWriter to calculate size via bsatn_traits + SizeWriter size_writer; + bsatn_traits::serialize(size_writer, value); + size_ += size_writer.size(); + } +} + +} // namespace SpacetimeDb::bsatn + +#endif // SPACETIMEDB_BSATN_SIZE_CALCULATOR_H \ No newline at end of file diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/sum_type.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/sum_type.h new file mode 100644 index 00000000000..9f6bec90524 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/sum_type.h @@ -0,0 +1,181 @@ +#ifndef SPACETIMEDB_BSATN_SUM_TYPE_H +#define SPACETIMEDB_BSATN_SUM_TYPE_H + +#include +#include +#include +#include "traits.h" +#include "reader.h" +#include "writer.h" +#include "algebraic_type.h" + +namespace SpacetimeDb { +namespace bsatn { + +/** + * @brief A sum type (tagged union) implementation for BSATN serialization + * + * This class wraps std::variant to provide a sum type that can be serialized + * and deserialized using BSATN format. It's similar to Rust's enum types + * with data payloads. + * + * @tparam Ts... The types that can be stored in this sum type + */ +template +class SumType { +public: + using VariantType = std::variant; + +private: + VariantType value_; + +public: + // Constructors + SumType() = default; + + template + SumType(T&& val) : value_(std::forward(val)) {} + + // Assignment operators + template + SumType& operator=(T&& val) { + value_ = std::forward(val); + return *this; + } + + // Get the current tag (variant index) + uint8_t tag() const { + return static_cast(value_.index()); + } + + // Check if the sum type holds a specific type + template + bool is() const { + return std::holds_alternative(value_); + } + + // Get the value as a specific type (throws if wrong type) + template + T& get() { + return std::get(value_); + } + + template + const T& get() const { + return std::get(value_); + } + + // Get the value as a specific type (returns nullptr if wrong type) + template + T* get_if() { + return std::get_if(&value_); + } + + template + const T* get_if() const { + return std::get_if(&value_); + } + + // Visit the sum type with a visitor + template + auto visit(Visitor&& vis) { + return std::visit(std::forward(vis), value_); + } + + template + auto visit(Visitor&& vis) const { + return std::visit(std::forward(vis), value_); + } + + // Access the underlying variant + VariantType& variant() { return value_; } + const VariantType& variant() const { return value_; } +}; + +// Helper to serialize a variant value at a specific index +template +void serialize_variant_at_index(Writer& writer, const std::variant& var) { + if constexpr (I < sizeof...(Ts)) { + if (var.index() == I) { + serialize(writer, std::get(var)); + } else { + serialize_variant_at_index(writer, var); + } + } +} + +// Helper to deserialize a variant value at a specific index +template +void deserialize_variant_at_index(Reader& reader, std::variant& var, uint8_t tag) { + if constexpr (I < sizeof...(Ts)) { + if (tag == I) { + using T = std::variant_alternative_t>; + var = deserialize(reader); + } else { + deserialize_variant_at_index(reader, var, tag); + } + } else { + std::abort(); // Invalid sum type tag + } +} + +// BSATN traits specialization for SumType +template +struct bsatn_traits> { + using sum_type = SumType; + + static AlgebraicType algebraic_type() { + // For now, return a string type as placeholder + // TODO: Implement proper sum type registration in V9TypeRegistration system + return AlgebraicType::String(); + } +}; + +// Serialization for SumType +template +void serialize(Writer& writer, const SumType& value) { + // Write the tag byte + writer.write_u8(value.tag()); + + // Write the variant data + serialize_variant_at_index<0>(writer, value.variant()); +} + +// Deserialization for SumType +template +SumType deserialize(Reader& reader, std::type_identity>) { + // Read the tag byte + uint8_t tag = reader.read_u8(); + + // Check tag is valid + if (tag >= sizeof...(Ts)) { + std::abort(); // Invalid sum type tag + } + + // Deserialize the appropriate variant + SumType result; + deserialize_variant_at_index<0>(reader, result.variant(), tag); + + return result; +} + +} // namespace bsatn + +// Result type helper (like Rust's Result) +template +using Result = bsatn::SumType; + +// Factory functions for Result +template +Result Ok(T&& value) { + return Result(std::forward(value)); +} + +template +Result Err(E&& error) { + return Result(std::forward(error)); +} + +} // namespace SpacetimeDb + +#endif // SPACETIMEDB_BSATN_SUM_TYPE_H \ No newline at end of file diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/time_duration.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/time_duration.h new file mode 100644 index 00000000000..966588ef1ee --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/time_duration.h @@ -0,0 +1,134 @@ +#pragma once + +#include +#include + +// Forward declarations for BSATN +namespace SpacetimeDb { +namespace bsatn { + class Writer; + class Reader; +} +} + +namespace SpacetimeDb { + +/** + * Represents a duration of time with microsecond precision. + * This corresponds to SpacetimeDB's TimeDuration type. + */ +class TimeDuration { +private: + int64_t micros_; + +public: + // Constructors + explicit TimeDuration(int64_t micros = 0) : micros_(micros) {} + + // Factory methods + static TimeDuration from_micros(int64_t micros) { return TimeDuration(micros); } + static TimeDuration from_millis(int64_t millis) { return TimeDuration(millis * 1000); } + static TimeDuration from_seconds(int64_t seconds) { return TimeDuration(seconds * 1000000); } + static TimeDuration from_minutes(int64_t minutes) { return TimeDuration(minutes * 60000000); } + static TimeDuration from_hours(int64_t hours) { return TimeDuration(hours * 3600000000); } + + // Conversion from std::chrono + template + static TimeDuration from_chrono(std::chrono::duration duration) { + auto micros = std::chrono::duration_cast(duration).count(); + return TimeDuration(static_cast(micros)); + } + + // Getters + int64_t micros() const { return micros_; } + int64_t millis() const { return micros_ / 1000; } + int64_t seconds() const { return micros_ / 1000000; } + + // Conversion to std::chrono + std::chrono::microseconds to_chrono() const { + return std::chrono::microseconds(micros_); + } + + // Arithmetic operations + TimeDuration operator+(const TimeDuration& other) const { + return TimeDuration(micros_ + other.micros_); + } + + TimeDuration operator-(const TimeDuration& other) const { + return TimeDuration(micros_ - other.micros_); + } + + TimeDuration operator*(int64_t scalar) const { + return TimeDuration(micros_ * scalar); + } + + TimeDuration operator/(int64_t scalar) const { + return TimeDuration(micros_ / scalar); + } + + // Comparison operators + bool operator==(const TimeDuration& other) const { return micros_ == other.micros_; } + bool operator!=(const TimeDuration& other) const { return micros_ != other.micros_; } + bool operator<(const TimeDuration& other) const { return micros_ < other.micros_; } + bool operator<=(const TimeDuration& other) const { return micros_ <= other.micros_; } + bool operator>(const TimeDuration& other) const { return micros_ > other.micros_; } + bool operator>=(const TimeDuration& other) const { return micros_ >= other.micros_; } + + // Absolute value + TimeDuration abs() const { + return TimeDuration(micros_ >= 0 ? micros_ : -micros_); + } + + // Convert to string representation (to match Rust TimeDuration::Display format exactly) + std::string to_string() const { + // Rust format: "{sign}{seconds}.{microseconds:06}" + // Always includes sign prefix: "+" for positive, "-" for negative + + int64_t micros = micros_; + const char* sign = (micros < 0) ? "-" : "+"; + int64_t pos_micros = (micros < 0) ? -micros : micros; + + int64_t seconds = pos_micros / 1000000; + int64_t remaining_micros = pos_micros % 1000000; + + char buffer[32]; + snprintf(buffer, sizeof(buffer), "%s%lld.%06lld", + sign, (long long)seconds, (long long)remaining_micros); + + return std::string(buffer); + } + + // BSATN serialization (implemented in time_duration_bsatn.h) + void bsatn_serialize(SpacetimeDb::bsatn::Writer& writer) const; + static TimeDuration bsatn_deserialize(SpacetimeDb::bsatn::Reader& reader); +}; + +// Convenience functions +inline TimeDuration operator*(int64_t scalar, const TimeDuration& duration) { + return duration * scalar; +} + +} // namespace SpacetimeDb + +// ============================================================================= +// BSATN Implementation +// ============================================================================= + +#include "writer.h" +#include "reader.h" + +namespace SpacetimeDb { + +// TimeDuration BSATN implementation +inline void TimeDuration::bsatn_serialize(bsatn::Writer& writer) const { + writer.write_u64_le(static_cast(micros_)); +} + +inline TimeDuration TimeDuration::bsatn_deserialize(bsatn::Reader& reader) { + uint64_t micros = reader.read_u64_le(); + return TimeDuration(static_cast(micros)); +} + +} // namespace SpacetimeDb + + diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/timestamp.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/timestamp.h new file mode 100644 index 00000000000..7d9485b812a --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/timestamp.h @@ -0,0 +1,178 @@ +#pragma once + +#include +#include +#include +#include +#include "time_duration.h" + +// Forward declarations +namespace SpacetimeDb { +namespace bsatn { + class Writer; + class Reader; +} + +/** + * Represents a point in time as microseconds since the Unix epoch. + * This corresponds to SpacetimeDB's Timestamp type. + */ +class Timestamp { +private: + int64_t micros_since_epoch_; + +public: + // Constructors + explicit Timestamp(int64_t micros_since_epoch = 0) : micros_since_epoch_(micros_since_epoch) {} + + // Factory methods + static Timestamp from_micros_since_epoch(int64_t micros) { + return Timestamp(micros); + } + + static Timestamp from_millis_since_epoch(int64_t millis) { + return Timestamp(millis * 1000); + } + + static Timestamp from_seconds_since_epoch(int64_t seconds) { + return Timestamp(seconds * 1000000); + } + + // Get current timestamp + static Timestamp now() { + auto now = std::chrono::system_clock::now(); + auto duration = now.time_since_epoch(); + auto micros = std::chrono::duration_cast(duration).count(); + return Timestamp(micros); + } + + // Unix epoch (January 1, 1970 00:00:00 UTC) + static Timestamp unix_epoch() { + return Timestamp(0); + } + + // Conversion from std::chrono + static Timestamp from_chrono(std::chrono::system_clock::time_point tp) { + auto duration = tp.time_since_epoch(); + auto micros = std::chrono::duration_cast(duration).count(); + return Timestamp(micros); + } + + // Getters + int64_t micros_since_epoch() const { return micros_since_epoch_; } + int64_t millis_since_epoch() const { return micros_since_epoch_ / 1000; } + int64_t seconds_since_epoch() const { return micros_since_epoch_ / 1000000; } + + // Conversion to std::chrono + std::chrono::system_clock::time_point to_chrono() const { + return std::chrono::system_clock::time_point( + std::chrono::microseconds(micros_since_epoch_) + ); + } + + // Arithmetic operations + Timestamp operator+(const TimeDuration& duration) const { + return Timestamp(micros_since_epoch_ + duration.micros()); + } + + Timestamp operator-(const TimeDuration& duration) const { + return Timestamp(micros_since_epoch_ - duration.micros()); + } + + TimeDuration operator-(const Timestamp& other) const { + return TimeDuration::from_micros(micros_since_epoch_ - other.micros_since_epoch_); + } + + // Comparison operators + bool operator==(const Timestamp& other) const { return micros_since_epoch_ == other.micros_since_epoch_; } + bool operator!=(const Timestamp& other) const { return micros_since_epoch_ != other.micros_since_epoch_; } + bool operator<(const Timestamp& other) const { return micros_since_epoch_ < other.micros_since_epoch_; } + bool operator<=(const Timestamp& other) const { return micros_since_epoch_ <= other.micros_since_epoch_; } + bool operator>(const Timestamp& other) const { return micros_since_epoch_ > other.micros_since_epoch_; } + bool operator>=(const Timestamp& other) const { return micros_since_epoch_ >= other.micros_since_epoch_; } + + // Duration since another timestamp + TimeDuration duration_since(const Timestamp& earlier) const { + if (*this < earlier) { + return TimeDuration::from_micros(0); // Return zero for negative durations + } + return TimeDuration::from_micros(micros_since_epoch_ - earlier.micros_since_epoch_); + } + + // Convert to string representation (ISO 8601 format to match Rust) + std::string to_string() const { + // Convert microseconds to seconds and fractional microseconds + std::time_t seconds = micros_since_epoch_ / 1000000; + int64_t remaining_micros = micros_since_epoch_ % 1000000; + + // Handle negative timestamps + if (micros_since_epoch_ < 0 && remaining_micros != 0) { + seconds -= 1; + remaining_micros = 1000000 + remaining_micros; + } + + // Convert to UTC time +#if defined(_MSC_VER) && !defined(__EMSCRIPTEN__) + // Use gmtime_s on Windows (not available in Emscripten) + std::tm utc_time_buf; + errno_t err = gmtime_s(&utc_time_buf, &seconds); + std::tm* utc_time = (err == 0) ? &utc_time_buf : nullptr; +#else + // Use standard gmtime for WASM/Emscripten and other platforms + std::tm* utc_time = std::gmtime(&seconds); +#endif + if (!utc_time) { + // Fallback for invalid timestamps + return "1970-01-01T00:00:00.000000+00:00"; + } + + // Format as ISO 8601 with microseconds + char buffer[64]; + std::strftime(buffer, sizeof(buffer), "%Y-%m-%dT%H:%M:%S", utc_time); + + // Add microseconds and timezone + std::string result(buffer); + char micros_buffer[16]; + snprintf(micros_buffer, sizeof(micros_buffer), ".%06lld+00:00", (long long)remaining_micros); + result += micros_buffer; + + return result; + } + + // BSATN serialization + void bsatn_serialize(SpacetimeDb::bsatn::Writer& writer) const; + static Timestamp bsatn_deserialize(SpacetimeDb::bsatn::Reader& reader); +}; + +// Convenience operators +inline Timestamp operator+(const TimeDuration& duration, const Timestamp& timestamp) { + return timestamp + duration; +} + +} // namespace SpacetimeDb + +// ============================================================================= +// BSATN Implementation +// ============================================================================= + +#include "writer.h" +#include "reader.h" +#include "traits.h" +#include "algebraic_type.h" + +namespace SpacetimeDb { + +// Timestamp BSATN implementation +inline void Timestamp::bsatn_serialize(SpacetimeDb::bsatn::Writer& writer) const { + writer.write_i64_le(micros_since_epoch_); +} + +inline Timestamp Timestamp::bsatn_deserialize(SpacetimeDb::bsatn::Reader& reader) { + int64_t micros = reader.read_i64_le(); + return Timestamp(micros); +} + +} // namespace SpacetimeDb + +// Note: bsatn_traits specialization for Timestamp is defined in type_extensions.h +// to ensure consistent handling with other special types like TimeDuration \ No newline at end of file diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/traits.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/traits.h new file mode 100644 index 00000000000..e677ec58433 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/traits.h @@ -0,0 +1,300 @@ +#ifndef SPACETIMEDB_BSATN_TRAITS_H +#define SPACETIMEDB_BSATN_TRAITS_H + +#include +#include +#include +#include +#include +#include +#include + +// Then custom headers +#include "algebraic_type.h" +#include "reader.h" +#include "writer.h" +#include "types.h" // For u128, u256, i128, i256 +#include "type_extensions.h" // For special type constants + +namespace SpacetimeDb::bsatn { + +// ============================================================================ +// CORE TYPES AND CONCEPTS +// ============================================================================ + +/** + * Concepts for types that can be serialized with BSATN + */ +template +concept HasMemberSerialize = requires(const T& t, Writer& w) { + { t.bsatn_serialize(w) } -> std::same_as; +}; + +template +concept HasStaticDeserialize = requires(Reader& r) { + { T::bsatn_deserialize(r) } -> std::same_as; +}; + +template +concept HasAlgebraicType = requires { + { algebraic_type_of::get() } -> std::same_as; +}; + +/** + * Primary template for BSATN serialization traits. + * Specialize this for your types to enable serialization. + * + * The default implementation will: + * - Call member function bsatn_serialize() if available + * - Call static function T::bsatn_deserialize() if available + * - Use algebraic_type_of for type information + */ +template +struct bsatn_traits { + static void serialize(Writer& writer, const T& value) { + if constexpr (HasMemberSerialize) { + value.bsatn_serialize(writer); + } else { + static_assert(sizeof(T) == 0, "Type must implement bsatn_serialize or specialize bsatn_traits"); + } + } + + static T deserialize(Reader& reader) { + if constexpr (HasStaticDeserialize) { + return T::bsatn_deserialize(reader); + } else { + static_assert(sizeof(T) == 0, "Type must implement bsatn_deserialize or specialize bsatn_traits"); + } + } + + static AlgebraicType algebraic_type() { + if constexpr (HasAlgebraicType) { + return SpacetimeDb::bsatn::algebraic_type_of::get(); + } else { + static_assert(sizeof(T) == 0, "Type must have algebraic_type_of specialization"); + } + } +}; + +// Primitive type specializations are in primitive_traits.h +// Special types (u128, u256, i128, i256, Identity, etc.) are in type_extensions.h + +// ============================================================================ +// BUILDER HELPERS +// ============================================================================ + +/** + * Helper for building product types with named fields. + * Only used by SPACETIMEDB_STRUCT macro. + */ +class ProductTypeBuilder { +private: + std::vector elements_; + +public: + template + ProductTypeBuilder& with_field(const std::string& name) { + elements_.emplace_back(name, bsatn_traits::algebraic_type()); + return *this; + } + + std::unique_ptr build() { + return std::make_unique(std::move(elements_)); + } +}; + +/** + * Simplified helper for building sum types (enums). + * Only used by SPACETIMEDB_ENUM macro. + */ +class SumTypeBuilder { +private: + std::vector variants_; + +public: + SumTypeBuilder& with_unit_variant(const std::string& name) { + variants_.emplace_back(name, AlgebraicType::Unit()); + return *this; + } + + std::unique_ptr build() { + return std::make_unique(std::move(variants_)); + } +}; + +// Special type detection is in type_extensions.h + +// ============================================================================ +// CONTAINER TYPE TRAITS +// ============================================================================ + +/** + * BSATN traits for std::vector (all vectors including bytes) + */ +template +struct bsatn_traits> { + static void serialize(Writer& writer, const std::vector& value) { + writer.write_u32_le(static_cast(value.size())); + for (const auto& item : value) { + SpacetimeDb::bsatn::serialize(writer, item); + } + } + + static std::vector deserialize(Reader& reader) { + uint32_t len = reader.read_u32_le(); + std::vector result; + result.reserve(len); + for (uint32_t i = 0; i < len; ++i) { + result.push_back(bsatn_traits::deserialize(reader)); + } + return result; + } + + static AlgebraicType algebraic_type() { + // Arrays are ALWAYS inlined, never registered in typespace + auto elem_type = bsatn_traits::algebraic_type(); + + // Special types should always be inlined + if (is_special_type(elem_type)) { + return AlgebraicType::Array(std::move(elem_type)); + } + + // Return Array type INLINE - matches Rust behavior + return AlgebraicType::Array(std::move(elem_type)); + } +}; + +/** + * BSATN traits for std::optional + * + * IMPORTANT: SpacetimeDB uses a non-standard Option serialization: + * - Some(value) = discriminant 0 (not 1 as in standard Rust enums) + * - None = discriminant 1 (not 0 as in standard Rust enums) + */ +template +struct bsatn_traits> { + static void serialize(Writer& writer, const std::optional& value) { + if (value.has_value()) { + writer.write_u8(0); // Some = 0 (SpacetimeDB convention) + bsatn_traits::serialize(writer, *value); + } else { + writer.write_u8(1); // None = 1 (SpacetimeDB convention) + } + } + + static std::optional deserialize(Reader& reader) { + uint8_t tag = reader.read_u8(); + if (tag == 0) { // Some + return bsatn_traits::deserialize(reader); + } else if (tag == 1) { // None + return std::nullopt; + } else { + std::abort(); // Invalid optional tag in BSATN deserialization + } + } + + static AlgebraicType algebraic_type() { + // Options are ALWAYS inlined, never registered as separate types + auto inner_type = bsatn_traits::algebraic_type(); + + // Create Option variants: Some(T) and None + std::vector variants; + variants.emplace_back("some", std::move(inner_type)); + variants.emplace_back("none", AlgebraicType::Unit()); + + return AlgebraicType::make_sum( + std::make_unique(std::move(variants)) + ); + } +}; + +// ============================================================================ +// VARIANT TYPE TRAITS +// ============================================================================ + +// Forward declaration for variant index_sequence helper +template +struct variant_index_of; + +template +struct variant_index_of, T, Index> + : variant_index_of, T, Index + 1> {}; + +template +struct variant_index_of, T, Index> + : std::integral_constant {}; + +/** + * BSATN traits for std::variant + */ +template +struct bsatn_traits> { + using variant_t = std::variant; + + static void serialize(Writer& writer, const variant_t& value) { + writer.write_u8(static_cast(value.index())); + std::visit([&writer](const auto& v) { + using value_type = std::decay_t; + if constexpr (!std::is_same_v) { + SpacetimeDb::bsatn::serialize(writer, v); + } + }, value); + } + + static variant_t deserialize(Reader& reader) { + uint8_t tag = reader.read_u8(); + return deserialize_variant<0>(reader, tag); + } + + static AlgebraicType algebraic_type() { + std::vector variants; + build_variants<0, Ts...>(variants); + return AlgebraicType::make_sum( + std::make_unique(std::move(variants)) + ); + } + +private: + template + static variant_t deserialize_variant(Reader& reader, uint8_t tag) { + if constexpr (Index < sizeof...(Ts)) { + if (tag == Index) { + using type = std::variant_alternative_t; + if constexpr (std::is_same_v) { + return type{}; + } else { + return SpacetimeDb::bsatn::deserialize(reader); + } + } + return deserialize_variant(reader, tag); + } else { + std::abort(); // Invalid variant tag + } + } + + template + static void build_variants(std::vector& variants) { + if constexpr (std::is_same_v) { + variants.emplace_back("variant_" + std::to_string(Index), AlgebraicType::Unit()); + } else { + variants.emplace_back("variant_" + std::to_string(Index), bsatn_traits::algebraic_type()); + } + if constexpr (sizeof...(Rest) > 0) { + build_variants(variants); + } + } +}; + +// ============================================================================ +// FIELD REGISTRATION HELPERS +// ============================================================================ + +// Helper to get the AlgebraicType for field types +template +inline AlgebraicType get_field_algebraic_type() { + return bsatn_traits::algebraic_type(); +} + +} // namespace SpacetimeDb::bsatn + +#endif // SPACETIMEDB_BSATN_TRAITS_H \ No newline at end of file diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/type_extensions.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/type_extensions.h new file mode 100644 index 00000000000..4c506549d39 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/type_extensions.h @@ -0,0 +1,503 @@ +#ifndef SPACETIMEDB_BSATN_TYPE_EXTENSIONS_H +#define SPACETIMEDB_BSATN_TYPE_EXTENSIONS_H + +/** + * @file type_extensions.h + * @brief Extended type support for SpacetimeDB BSATN serialization + * + * This header combines functionality from special_types.h and extended_types.h + * It provides: + * - Special type tags and identification functions + * - BSATN trait specializations for extended types + * - Support for large integers, container types, and SpacetimeDB core types + */ + +namespace SpacetimeDb::bsatn { + +// ============================================================================= +// SPECIAL TYPE CONSTANTS - Must be defined early for use in other headers +// ============================================================================= + +// Special type field tags +constexpr const char* IDENTITY_TAG = "__identity__"; +constexpr const char* CONNECTION_ID_TAG = "__connection_id__"; +constexpr const char* TIMESTAMP_TAG = "__timestamp_micros_since_unix_epoch__"; +constexpr const char* TIME_DURATION_TAG = "__time_duration_micros__"; + +} // namespace SpacetimeDb::bsatn + +// Now include headers that may use these constants +#include "algebraic_type.h" +#include "types.h" +#include "timestamp.h" +#include "time_duration.h" +#include +#include +#include +#include + +namespace SpacetimeDb::bsatn { + +// Forward declarations +class Reader; +class Writer; +template struct bsatn_traits; + +// Helper to detect optional types +template +struct is_optional : std::false_type {}; +template +struct is_optional> : std::true_type {}; + +// Helper to detect vector types +template +struct is_vector : std::false_type {}; +template +struct is_vector> : std::true_type {}; + +// Helper to get primitive type tags +template +constexpr uint32_t get_primitive_type_tag() { + if constexpr (std::is_same_v) { + return static_cast(AlgebraicTypeTag::Bool); + } else if constexpr (std::is_same_v) { + return static_cast(AlgebraicTypeTag::U8); + } else if constexpr (std::is_same_v) { + return static_cast(AlgebraicTypeTag::U16); + } else if constexpr (std::is_same_v) { + return static_cast(AlgebraicTypeTag::U32); + } else if constexpr (std::is_same_v) { + return static_cast(AlgebraicTypeTag::U64); + } else if constexpr (std::is_same_v) { + return static_cast(AlgebraicTypeTag::I8); + } else if constexpr (std::is_same_v) { + return static_cast(AlgebraicTypeTag::I16); + } else if constexpr (std::is_same_v) { + return static_cast(AlgebraicTypeTag::I32); + } else if constexpr (std::is_same_v) { + return static_cast(AlgebraicTypeTag::I64); + } else if constexpr (std::is_same_v) { + return static_cast(AlgebraicTypeTag::F32); + } else if constexpr (std::is_same_v) { + return static_cast(AlgebraicTypeTag::F64); + } else if constexpr (std::is_same_v) { + return static_cast(AlgebraicTypeTag::String); + } else { + return 0; // Not a primitive type + } +} + +// ============================================================================= +// SPECIAL TYPE TAGS AND IDENTIFICATION +// ============================================================================= + +/** + * Special type tags used by SpacetimeDB to identify built-in types. + * These match the Rust implementation exactly. + * Note: Constants are defined at the top of this file before includes. + */ + +/** + * Enumeration of special types recognized by SpacetimeDB. + */ +enum class SpecialTypeKind { + None, + Identity, + ConnectionId, + Timestamp, + TimeDuration, + Unit, // Empty Product type + Never, // Empty Sum type + ScheduleAt, // Sum with Interval and Time variants + Option // Sum with some and none variants +}; + +/** + * Check if a ProductType represents a special SpacetimeDB type. + * Special types include field-tagged types and structural types. + */ +inline bool is_special_product_type(const ProductType& product) { + // Unit type: empty product + if (product.elements.size() == 0) { + return true; + } + + // Field-tagged special types + if (product.elements.size() == 1 && product.elements[0].name.has_value()) { + const std::string& tag = *product.elements[0].name; + return tag == IDENTITY_TAG || + tag == CONNECTION_ID_TAG || + tag == TIMESTAMP_TAG || + tag == TIME_DURATION_TAG; + } + + return false; +} + +/** + * Check if a SumType represents a special SpacetimeDB type. + */ +inline bool is_special_sum_type(const SumTypeSchema& sum) { + // Never type: empty sum + if (sum.variants.size() == 0) { + return true; + } + + // Two-variant sum types: ScheduleAt and Option + if (sum.variants.size() == 2) { + bool has_interval = false, has_time = false; + bool has_some = false, has_none = false; + + for (const auto& variant : sum.variants) { + if (variant.name == "Interval") has_interval = true; + else if (variant.name == "Time") has_time = true; + else if (variant.name == "some") has_some = true; + else if (variant.name == "none") has_none = true; + } + + // ScheduleAt type: sum with Interval and Time variants + if (has_interval && has_time) { + return true; + } + + // Option type: sum with some and none variants + if (has_some && has_none) { + return true; + } + } + + return false; +} + +/** + * Check if an AlgebraicType represents a special SpacetimeDB type. + */ +inline bool is_special_type(const AlgebraicType& type) { + if (type.tag() == AlgebraicTypeTag::Product) { + return is_special_product_type(type.as_product()); + } else if (type.tag() == AlgebraicTypeTag::Sum) { + return is_special_sum_type(type.as_sum()); + } + return false; +} + + +/** + * Get the kind of special type represented by an AlgebraicType. + */ +inline SpecialTypeKind get_special_type_kind(const AlgebraicType& type) { + if (type.tag() == AlgebraicTypeTag::Product) { + const auto& product = type.as_product(); + + // Unit type + if (product.elements.size() == 0) { + return SpecialTypeKind::Unit; + } + + // Field-tagged types + if (product.elements.size() == 1 && product.elements[0].name.has_value()) { + const std::string& tag = *product.elements[0].name; + // Use string_view comparison for more robust matching + if (tag == IDENTITY_TAG) return SpecialTypeKind::Identity; + if (tag == CONNECTION_ID_TAG) return SpecialTypeKind::ConnectionId; + if (tag == TIMESTAMP_TAG) return SpecialTypeKind::Timestamp; + if (tag == TIME_DURATION_TAG) return SpecialTypeKind::TimeDuration; + + // Fallback: Check for exact field name matches in case of string issues + if (tag == "__identity__") return SpecialTypeKind::Identity; + if (tag == "__connection_id__") return SpecialTypeKind::ConnectionId; + if (tag == "__timestamp_micros_since_unix_epoch__") return SpecialTypeKind::Timestamp; + if (tag == "__time_duration_micros__") return SpecialTypeKind::TimeDuration; + } + } else if (type.tag() == AlgebraicTypeTag::Sum) { + const auto& sum = type.as_sum(); + + // Never type + if (sum.variants.size() == 0) { + return SpecialTypeKind::Never; + } + + // Two-variant sum types: ScheduleAt and Option + if (sum.variants.size() == 2) { + bool has_interval = false, has_time = false; + bool has_some = false, has_none = false; + + for (const auto& variant : sum.variants) { + if (variant.name == "Interval") has_interval = true; + else if (variant.name == "Time") has_time = true; + else if (variant.name == "some") has_some = true; + else if (variant.name == "none") has_none = true; + } + + // ScheduleAt type + if (has_interval && has_time) { + return SpecialTypeKind::ScheduleAt; + } + + // Option type + if (has_some && has_none) { + return SpecialTypeKind::Option; + } + } + } + + return SpecialTypeKind::None; +} + +/** + * Create a special type ProductType with the given tag and data type. + */ +inline std::unique_ptr make_special_type(const char* tag, AlgebraicType data_type) { + std::vector elements; + elements.emplace_back(tag, std::move(data_type)); + return std::make_unique(std::move(elements)); +} + +/** + * @brief Factory functions for SpacetimeDB special types. + * + * These types are represented as ProductTypes with a single specially-tagged field. + * The tag identifies the semantic meaning of the type. + */ +namespace special_types { + + /** + * @brief Create an Identity type (256-bit identifier). + * + * Identity is represented as an array of 32 bytes (U8[32]). + * + * @return AlgebraicType representing an Identity + * @todo Integrate with type registry for proper type indexing + */ + inline AlgebraicType identity() { + // Identity uses U256 as inner type (matches Rust implementation) + // CRITICAL: Pass the actual U256 type, not a Ref to it - special types are inlined! + auto product = make_special_type(IDENTITY_TAG, AlgebraicType::U256()); + return AlgebraicType::make_product(std::move(product)); + } + + /** + * @brief Create a ConnectionId type (64-bit connection identifier). + * + * @return AlgebraicType representing a ConnectionId + * @todo Integrate with type registry for proper type indexing + */ + inline AlgebraicType connection_id() { + // ConnectionId uses U128 as inner type (matches Rust implementation) + // CRITICAL: Pass the actual U128 type, not a Ref to it - special types are inlined! + auto product = make_special_type(CONNECTION_ID_TAG, AlgebraicType::U128()); + return AlgebraicType::make_product(std::move(product)); + } + + /** + * @brief Create a Timestamp type (microseconds since Unix epoch). + * + * @return AlgebraicType representing a Timestamp + * @todo Integrate with type registry for proper type indexing + */ + inline AlgebraicType timestamp() { + // Timestamp uses I64 as inner type (matches Rust implementation) + // CRITICAL: Pass the actual I64 type, not a Ref to it - special types are inlined! + auto product = make_special_type(TIMESTAMP_TAG, AlgebraicType::I64()); + return AlgebraicType::make_product(std::move(product)); + } + + /** + * @brief Create a TimeDuration type (duration in microseconds). + * + * @return AlgebraicType representing a TimeDuration + * @todo Integrate with type registry for proper type indexing + */ + inline AlgebraicType time_duration() { + // TimeDuration uses I64 as inner type (matches Rust implementation) + // CRITICAL: Pass the actual I64 type, not a Ref to it - special types are inlined! + auto product = make_special_type(TIME_DURATION_TAG, AlgebraicType::I64()); + return AlgebraicType::make_product(std::move(product)); + } + +} // namespace special_types + +// ============================================================================= +// LARGE INTEGER TYPES (u128, i128) +// ============================================================================= + +/** + * BSATN serialization for 128-bit unsigned integer + */ +template<> +struct bsatn_traits<::SpacetimeDb::u128> { + static void serialize(Writer& writer, const ::SpacetimeDb::u128& value) { + // Serialize as 16 bytes in little-endian order + writer.write_u64_le(value.low); + writer.write_u64_le(value.high); + } + + static ::SpacetimeDb::u128 deserialize(Reader& reader) { + uint64_t low = reader.read_u64_le(); + uint64_t high = reader.read_u64_le(); + return ::SpacetimeDb::u128(high, low); + } + + static AlgebraicType algebraic_type() { + return AlgebraicType::U128(); + } +}; + +/** + * BSATN serialization for 128-bit signed integer + */ +template<> +struct bsatn_traits<::SpacetimeDb::i128> { + static void serialize(Writer& writer, const ::SpacetimeDb::i128& value) { + // Serialize as 16 bytes in little-endian order + writer.write_u64_le(value.low); + writer.write_u64_le(static_cast(value.high)); + } + + static ::SpacetimeDb::i128 deserialize(Reader& reader) { + uint64_t low = reader.read_u64_le(); + uint64_t high = reader.read_u64_le(); + return ::SpacetimeDb::i128(static_cast(high), low); + } + + static AlgebraicType algebraic_type() { + return AlgebraicType::I128(); + } +}; + +// u256 and i256 also need bsatn_traits specializations that call their methods + +/** + * BSATN serialization for 256-bit unsigned integer + */ +template<> +struct bsatn_traits<::SpacetimeDb::u256> { + static void serialize(Writer& writer, const ::SpacetimeDb::u256& value) { + value.bsatn_serialize(writer); + } + + static ::SpacetimeDb::u256 deserialize(Reader& reader) { + ::SpacetimeDb::u256 result; + result.bsatn_deserialize(reader); + return result; + } + + static AlgebraicType algebraic_type() { + return AlgebraicType::U256(); + } +}; + +/** + * BSATN serialization for 256-bit signed integer + */ +template<> +struct bsatn_traits<::SpacetimeDb::i256> { + static void serialize(Writer& writer, const ::SpacetimeDb::i256& value) { + value.bsatn_serialize(writer); + } + + static ::SpacetimeDb::i256 deserialize(Reader& reader) { + ::SpacetimeDb::i256 result; + result.bsatn_deserialize(reader); + return result; + } + + static AlgebraicType algebraic_type() { + return AlgebraicType::I256(); + } +}; + +// ============================================================================= +// SPACETIMEDB CORE TYPES (Identity, ConnectionId, Timestamp, TimeDuration) +// ============================================================================= + +/** + * BSATN serialization for Identity + */ +template<> +struct bsatn_traits<::SpacetimeDb::Identity> { + static void serialize(Writer& writer, const ::SpacetimeDb::Identity& value) { + value.bsatn_serialize(writer); + } + + static ::SpacetimeDb::Identity deserialize(Reader& reader) { + ::SpacetimeDb::Identity result; + result.bsatn_deserialize(reader); + return result; + } + + static AlgebraicType algebraic_type() { + return special_types::identity(); + } +}; + +/** + * BSATN serialization for ConnectionId + */ +template<> +struct bsatn_traits<::SpacetimeDb::ConnectionId> { + static void serialize(Writer& writer, const ::SpacetimeDb::ConnectionId& value) { + value.bsatn_serialize(writer); + } + + static ::SpacetimeDb::ConnectionId deserialize(Reader& reader) { + ::SpacetimeDb::ConnectionId result; + result.bsatn_deserialize(reader); + return result; + } + + static AlgebraicType algebraic_type() { + return special_types::connection_id(); + } +}; + +/** + * BSATN serialization for Timestamp + */ +template<> +struct bsatn_traits<::SpacetimeDb::Timestamp> { + static void serialize(Writer& writer, const ::SpacetimeDb::Timestamp& value) { + value.bsatn_serialize(writer); + } + + static ::SpacetimeDb::Timestamp deserialize(Reader& reader) { + return ::SpacetimeDb::Timestamp::bsatn_deserialize(reader); + } + + static AlgebraicType algebraic_type() { + return special_types::timestamp(); + } +}; + +/** + * BSATN serialization for TimeDuration + */ +template<> +struct bsatn_traits<::SpacetimeDb::TimeDuration> { + static void serialize(Writer& writer, const ::SpacetimeDb::TimeDuration& value) { + value.bsatn_serialize(writer); + } + + static ::SpacetimeDb::TimeDuration deserialize(Reader& reader) { + return ::SpacetimeDb::TimeDuration::bsatn_deserialize(reader); + } + + static AlgebraicType algebraic_type() { + return special_types::time_duration(); + } +}; + +// ============================================================================= +// CONTAINER TYPES +// ============================================================================= + +// Note: bsatn_traits specializations for std::optional and std::vector +// are now defined in traits.h (as of this consolidation fix). +// This file contains the special type trait definitions and helpers. + +// Convenience type aliases for SpacetimeDB vectors +using VecTimeDuration = std::vector<::SpacetimeDb::TimeDuration>; + +} // namespace SpacetimeDb::bsatn + +#endif // SPACETIMEDB_BSATN_TYPE_EXTENSIONS_H \ No newline at end of file diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/types.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/types.h new file mode 100644 index 00000000000..2b413270896 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/types.h @@ -0,0 +1,894 @@ +#pragma once + +/** + * SpacetimeDB C++ SDK - Extended Type System + * + * This header provides complete support for all SpacetimeDB types including: + * - Special types: Identity, ConnectionId, Timestamp, TimeDuration (✅ COMPLETE) + * - Large integers: u128, i128, u256, i256 (✅ COMPLETE) + * - Container types: Option, Vec (✅ COMPLETE) + * - BSATN serialization for all types (✅ COMPLETE) + * + * All four SpacetimeDB special types are fully implemented and tested: + * - Identity: U256 with __identity__ tag + * - ConnectionId: U128 with __connection_id__ tag + * - Timestamp: I64 with __timestamp_micros_since_unix_epoch__ tag + * - TimeDuration: I64 with __time_duration_micros__ tag + */ + +#include +#include +#include +#include +#include +#include +#include +#include // For std::runtime_error +#include // For std::copy +#include // For std::ostringstream +#include // For std::hex, std::setfill, std::setw + +// Forward declarations for BSATN +namespace SpacetimeDb { +namespace bsatn { + class Writer; + class Reader; +} + +// Forward declarations +class Timestamp; +class TimeDuration; +struct u128; + +// ============================================================================= +// IDENTITY TYPE +// ============================================================================= + +#define IDENTITY_SIZE 32 + +class Identity { +public: + static constexpr size_t SIZE = IDENTITY_SIZE; + using ByteArray = std::array; + +private: + std::array value; + +public: + // Constructors + Identity(); + Identity(const std::array& bytes); + + // Accessors + const std::array& get_bytes() const; + const ByteArray& to_byte_array() const { return value; } + std::string to_hex_string() const; + + // Convert to string (using hex representation) + std::string to_string() const { + return to_hex_string(); + } + + // Operators + bool operator==(const Identity& other) const; + bool operator!=(const Identity& other) const; + bool operator<(const Identity& other) const; + + // BSATN serialization (implemented below) + void bsatn_serialize(::SpacetimeDb::bsatn::Writer& writer) const; + void bsatn_deserialize(::SpacetimeDb::bsatn::Reader& reader); +}; + + +// ============================================================================= +// TYPE ALIASES FOR COMMON SPACETIMEDB TYPES +// ============================================================================= + +// Option is just std::optional with some helper methods +template +class Option : public std::optional { +public: + using std::optional::optional; + + // Helper static methods for clarity + static Option some(const T& value) { + return Option(value); + } + + static Option none() { + return Option(std::nullopt); + } + + // Allow implicit conversion from std::optional + Option(const std::optional& opt) : std::optional(opt) {} + Option(std::optional&& opt) : std::optional(std::move(opt)) {} +}; + +// Vec is just std::vector +template +using Vec = std::vector; + +// ============================================================================= +// LARGE INTEGER TYPES +// ============================================================================= + +// 128-bit unsigned integer +struct u128 { + uint64_t low; + uint64_t high; + + u128() : low(0), high(0) {} + u128(uint64_t l) : low(l), high(0) {} + u128(uint64_t h, uint64_t l) : low(l), high(h) {} + + // Factory method for clarity (high, low parameter order) + static u128 from_u64(uint64_t high, uint64_t low) { + return u128(high, low); + } + + bool operator==(const u128& other) const { + return low == other.low && high == other.high; + } + + bool operator!=(const u128& other) const { + return !(*this == other); + } + + // Convert to string using proper decimal conversion + std::string to_string() const { + if (high == 0) { + return std::to_string(low); + } + + // Convert u128 to decimal string using byte-level long division + // Treat the u128 as a 16-byte array in little-endian order + uint8_t bytes[16]; + std::memcpy(bytes, &low, 8); + std::memcpy(bytes + 8, &high, 8); + + std::string result; + + // Repeatedly divide by 10 + while (true) { + int remainder = 0; + bool all_zero = true; + + // Divide the 16-byte number by 10 (from most significant to least significant) + for (int i = 15; i >= 0; --i) { + int temp = remainder * 256 + bytes[i]; + bytes[i] = temp / 10; + remainder = temp % 10; + if (bytes[i] != 0) all_zero = false; + } + + // Add the remainder digit to result (building in reverse) + result = static_cast('0' + remainder) + result; + + if (all_zero) break; + } + + return result; + } + + // BSATN serialization + static void serialize(std::vector& buffer, const u128& value) { + // Little-endian serialization + for (int i = 0; i < 8; ++i) { + buffer.push_back((value.low >> (i * 8)) & 0xFF); + } + for (int i = 0; i < 8; ++i) { + buffer.push_back((value.high >> (i * 8)) & 0xFF); + } + } + + static u128 deserialize(const uint8_t* data) { + u128 result; + result.low = 0; + result.high = 0; + for (int i = 0; i < 8; ++i) { + result.low |= static_cast(data[i]) << (i * 8); + } + for (int i = 0; i < 8; ++i) { + result.high |= static_cast(data[8 + i]) << (i * 8); + } + return result; + } +}; + +// 128-bit signed integer +struct i128 { + uint64_t low; + int64_t high; + + i128() : low(0), high(0) {} + i128(int64_t l) : low(static_cast(l)), high(l < 0 ? -1 : 0) {} + i128(int64_t h, uint64_t l) : low(l), high(h) {} + + // Factory method for clarity (high, low parameter order) + static i128 from_i64(int64_t high, uint64_t low) { + return i128(high, low); + } + + bool operator==(const i128& other) const { + return low == other.low && high == other.high; + } + + bool operator!=(const i128& other) const { + return !(*this == other); + } + + // Convert to string using proper decimal conversion + std::string to_string() const { + // Handle negative values by converting to positive and adding minus sign + bool is_negative = (high < 0); + + // Convert to unsigned for calculation + u128 abs_value; + if (is_negative) { + // Two's complement: flip bits and add 1 + abs_value.low = ~low + 1; + abs_value.high = ~static_cast(high); + if (abs_value.low == 0) { + abs_value.high++; // Handle carry + } + } else { + abs_value.low = low; + abs_value.high = static_cast(high); + } + + std::string result = abs_value.to_string(); + return is_negative ? "-" + result : result; + } + + // BSATN serialization + static void serialize(std::vector& buffer, const i128& value) { + // Little-endian serialization + for (int i = 0; i < 8; ++i) { + buffer.push_back((value.low >> (i * 8)) & 0xFF); + } + for (int i = 0; i < 8; ++i) { + buffer.push_back((value.high >> (i * 8)) & 0xFF); + } + } + + static i128 deserialize(const uint8_t* data) { + i128 result; + result.low = 0; + result.high = 0; + for (int i = 0; i < 8; ++i) { + result.low |= static_cast(data[i]) << (i * 8); + } + uint64_t high_unsigned = 0; + for (int i = 0; i < 8; ++i) { + high_unsigned |= static_cast(data[8 + i]) << (i * 8); + } + result.high = static_cast(high_unsigned); + return result; + } +}; + +// 256-bit unsigned integer +struct u256 { + std::array data; + + u256() { data.fill(0); } + + explicit u256(const uint8_t* bytes) { + std::memcpy(data.data(), bytes, 32); + } + + // Constructor from 4 uint64_t values (big-endian order: word3 is most significant) + u256(uint64_t word3, uint64_t word2, uint64_t word1, uint64_t word0) { + // Store in little-endian byte order + for (int i = 0; i < 8; ++i) { + data[i] = (word0 >> (i * 8)) & 0xFF; + data[8 + i] = (word1 >> (i * 8)) & 0xFF; + data[16 + i] = (word2 >> (i * 8)) & 0xFF; + data[24 + i] = (word3 >> (i * 8)) & 0xFF; + } + } + + bool operator==(const u256& other) const { + return data == other.data; + } + + bool operator!=(const u256& other) const { + return !(*this == other); + } + + // Convert to string using arbitrary precision decimal conversion + std::string to_string() const { + // Simple approach: use byte-by-byte division by 10 + // Make a copy of the data for manipulation + std::array temp_data = data; + std::string result; + + // Check if all zeros + bool all_zero = true; + for (int i = 0; i < 32; ++i) { + if (temp_data[i] != 0) { + all_zero = false; + break; + } + } + if (all_zero) return "0"; + + // Repeatedly divide by 10 + while (true) { + // Divide the 256-bit number by 10 + int remainder = 0; + bool all_zero_now = true; + + // Process from most significant byte to least significant + for (int i = 31; i >= 0; --i) { + int temp = remainder * 256 + temp_data[i]; + temp_data[i] = temp / 10; + remainder = temp % 10; + if (temp_data[i] != 0) all_zero_now = false; + } + + // Add the remainder digit to result (in reverse) + result = std::to_string(remainder) + result; + + if (all_zero_now) break; + } + + return result; + } + + // BSATN serialization (already in little-endian) + static void serialize(std::vector& buffer, const u256& value) { + buffer.insert(buffer.end(), value.data.begin(), value.data.end()); + } + + static u256 deserialize(const uint8_t* bytes) { + return u256(bytes); + } + + // BSATN methods (implemented in types_bsatn.h) + void bsatn_serialize(::SpacetimeDb::bsatn::Writer& writer) const; + void bsatn_deserialize(::SpacetimeDb::bsatn::Reader& reader); +}; + +// 256-bit signed integer +struct i256 { + std::array data; + + i256() { data.fill(0); } + + explicit i256(const uint8_t* bytes) { + std::memcpy(data.data(), bytes, 32); + } + + // Constructor from 4 uint64_t values (big-endian order: word3 is most significant) + i256(uint64_t word3, uint64_t word2, uint64_t word1, uint64_t word0) { + // Store in little-endian byte order + for (int i = 0; i < 8; ++i) { + data[i] = (word0 >> (i * 8)) & 0xFF; + data[8 + i] = (word1 >> (i * 8)) & 0xFF; + data[16 + i] = (word2 >> (i * 8)) & 0xFF; + data[24 + i] = (word3 >> (i * 8)) & 0xFF; + } + } + + bool operator==(const i256& other) const { + return data == other.data; + } + + bool operator!=(const i256& other) const { + return !(*this == other); + } + + // Convert to string using arbitrary precision decimal conversion + std::string to_string() const { + // Check if this is a negative number (MSB set) + bool is_negative = (data[31] & 0x80) != 0; + + if (is_negative) { + // Create positive version using two's complement + i256 positive_version; + int carry = 1; + for (int i = 0; i < 32; ++i) { + int temp = (~data[i] & 0xFF) + carry; + positive_version.data[i] = temp & 0xFF; + carry = temp >> 8; + } + + // Convert positive version to string and add minus sign + u256 as_u256; + std::copy(positive_version.data.begin(), positive_version.data.end(), as_u256.data.begin()); + return "-" + as_u256.to_string(); + } else { + // Convert as unsigned + u256 as_u256; + std::copy(data.begin(), data.end(), as_u256.data.begin()); + return as_u256.to_string(); + } + } + + // BSATN serialization (already in little-endian) + static void serialize(std::vector& buffer, const i256& value) { + buffer.insert(buffer.end(), value.data.begin(), value.data.end()); + } + + static i256 deserialize(const uint8_t* bytes) { + return i256(bytes); + } + + // BSATN methods (implemented in types_bsatn.h) + void bsatn_serialize(::SpacetimeDb::bsatn::Writer& writer) const; + void bsatn_deserialize(::SpacetimeDb::bsatn::Reader& reader); +}; + +// Type aliases with uppercase names for compatibility +using U128 = u128; +using I128 = i128; +using U256 = u256; +using I256 = i256; + +// ============================================================================= +// CONNECTION ID TYPE (defined after u128) +// ============================================================================= + +/** + * ConnectionId represents a connection identifier in SpacetimeDB. + * + * IMPORTANT: ConnectionId uses u128 type to match Rust implementation. + * This was fixed from the previous uint64_t implementation that caused + * runtime serialization crashes. + * + * Special type tag: "__connection_id__" + * Underlying type: U128 (AlgebraicTypeTag = 15) + * Serialization: write_u128_le/read_u128_le + */ +struct ConnectionId { + u128 id; + + ConnectionId() : id() {} + explicit ConnectionId(uint64_t connection_id) : id(connection_id) {} + explicit ConnectionId(const u128& connection_id) : id(connection_id) {} + + bool operator==(const ConnectionId& other) const { return id == other.id; } + bool operator!=(const ConnectionId& other) const { return id != other.id; } + bool operator<(const ConnectionId& other) const { + return (id.high < other.id.high) || (id.high == other.id.high && id.low < other.id.low); + } + + // Convert to string as hex representation (32 hex chars for 16 bytes) + std::string to_string() const { + std::ostringstream oss; + oss << std::hex << std::setfill('0'); + + // Output as 32-character hex string (little-endian byte order) + // Convert low 64 bits first + for (int i = 0; i < 8; ++i) { + uint8_t byte = (id.low >> (i * 8)) & 0xFF; + oss << std::setw(2) << static_cast(byte); + } + + // Convert high 64 bits + for (int i = 0; i < 8; ++i) { + uint8_t byte = (id.high >> (i * 8)) & 0xFF; + oss << std::setw(2) << static_cast(byte); + } + + return oss.str(); + } + + // BSATN serialization (implemented below) + void bsatn_serialize(::SpacetimeDb::bsatn::Writer& writer) const; + void bsatn_deserialize(::SpacetimeDb::bsatn::Reader& reader); +}; + +// Placeholder type aliases for BSATN compatibility +using u256_placeholder = u256; +using i256_placeholder = i256; + +// Address is an alias for Identity in the current implementation +class Identity; // Forward declaration +using Address = Identity; + +// ============================================================================= +// SCHEDULE AT TYPE FORWARD DECLARATION +// ============================================================================= + +// ScheduleAt is defined in schedule_at.h to avoid circular dependencies +class ScheduleAt; + +// ============================================================================= +// TIME DURATION TYPE +// ============================================================================= + +// Time duration is defined in time_duration.h +/* +struct TimeDuration { + uint64_t micros; + + TimeDuration() : micros(0) {} + explicit TimeDuration(uint64_t us) : micros(us) {} + + // Constructor from seconds and nanoseconds + TimeDuration(uint64_t seconds, uint32_t nanos) + : micros(seconds * 1000000 + nanos / 1000) {} + + static TimeDuration from_micros(uint64_t us) { return TimeDuration(us); } + static TimeDuration from_millis(uint64_t ms) { return TimeDuration(ms * 1000); } + static TimeDuration from_seconds(uint64_t s) { return TimeDuration(s * 1000000); } + + uint64_t to_micros() const { return micros; } + uint64_t to_millis() const { return micros / 1000; } + uint64_t to_seconds() const { return micros / 1000000; } + + TimeDuration operator+(const TimeDuration& other) const { + return TimeDuration(micros + other.micros); + } + + TimeDuration operator-(const TimeDuration& other) const { + return TimeDuration(micros - other.micros); + } + + bool operator==(const TimeDuration& other) const { + return micros == other.micros; + } + + bool operator!=(const TimeDuration& other) const { + return !(*this == other); + } + + bool operator<(const TimeDuration& other) const { + return micros < other.micros; + } + + // BSATN serialization (as u64) + static void serialize(std::vector& buffer, const TimeDuration& value) { + for (int i = 0; i < 8; ++i) { + buffer.push_back((value.micros >> (i * 8)) & 0xFF); + } + } + + static TimeDuration deserialize(const uint8_t* data) { + uint64_t micros = 0; + for (int i = 0; i < 8; ++i) { + micros |= static_cast(data[i]) << (i * 8); + } + return TimeDuration(micros); + } + + // BSATN serialization methods (for schedule_reducer.h) + // These will be provided as free functions when BSATN is available + // void bsatn_serialize(SpacetimeDb::bsatn::Writer& writer) const; + // static TimeDuration bsatn_deserialize(SpacetimeDb::bsatn::Reader& reader); +}; +*/ + +// Timestamp operations with TimeDuration are already defined in timestamp.h +// We'll use the existing Timestamp class operations + +// ============================================================================= +// BSATN SERIALIZATION TRAITS +// ============================================================================= + +// Primary template for BSATN serialization +template +struct BsatnSerializer { + static void serialize(std::vector& buffer, const T& value); + static T deserialize(const uint8_t* data, size_t& offset); +}; + +// Specializations for primitive types +template<> +struct BsatnSerializer { + static void serialize(std::vector& buffer, const uint8_t& value) { + buffer.push_back(value); + } + + static uint8_t deserialize(const uint8_t* data, size_t& offset) { + return data[offset++]; + } +}; + +template<> +struct BsatnSerializer { + static void serialize(std::vector& buffer, const uint16_t& value) { + buffer.push_back(value & 0xFF); + buffer.push_back((value >> 8) & 0xFF); + } + + static uint16_t deserialize(const uint8_t* data, size_t& offset) { + uint16_t value = data[offset] | (data[offset + 1] << 8); + offset += 2; + return value; + } +}; + +template<> +struct BsatnSerializer { + static void serialize(std::vector& buffer, const uint32_t& value) { + for (int i = 0; i < 4; ++i) { + buffer.push_back((value >> (i * 8)) & 0xFF); + } + } + + static uint32_t deserialize(const uint8_t* data, size_t& offset) { + uint32_t value = 0; + for (int i = 0; i < 4; ++i) { + value |= static_cast(data[offset++]) << (i * 8); + } + return value; + } +}; + +template<> +struct BsatnSerializer { + static void serialize(std::vector& buffer, const uint64_t& value) { + for (int i = 0; i < 8; ++i) { + buffer.push_back((value >> (i * 8)) & 0xFF); + } + } + + static uint64_t deserialize(const uint8_t* data, size_t& offset) { + uint64_t value = 0; + for (int i = 0; i < 8; ++i) { + value |= static_cast(data[offset++]) << (i * 8); + } + return value; + } +}; + +// Signed integers +template<> +struct BsatnSerializer { + static void serialize(std::vector& buffer, const int8_t& value) { + buffer.push_back(static_cast(value)); + } + + static int8_t deserialize(const uint8_t* data, size_t& offset) { + return static_cast(data[offset++]); + } +}; + +template<> +struct BsatnSerializer { + static void serialize(std::vector& buffer, const int16_t& value) { + BsatnSerializer::serialize(buffer, static_cast(value)); + } + + static int16_t deserialize(const uint8_t* data, size_t& offset) { + return static_cast(BsatnSerializer::deserialize(data, offset)); + } +}; + +template<> +struct BsatnSerializer { + static void serialize(std::vector& buffer, const int32_t& value) { + BsatnSerializer::serialize(buffer, static_cast(value)); + } + + static int32_t deserialize(const uint8_t* data, size_t& offset) { + return static_cast(BsatnSerializer::deserialize(data, offset)); + } +}; + +template<> +struct BsatnSerializer { + static void serialize(std::vector& buffer, const int64_t& value) { + BsatnSerializer::serialize(buffer, static_cast(value)); + } + + static int64_t deserialize(const uint8_t* data, size_t& offset) { + return static_cast(BsatnSerializer::deserialize(data, offset)); + } +}; + +// Boolean +template<> +struct BsatnSerializer { + static void serialize(std::vector& buffer, const bool& value) { + buffer.push_back(value ? 1 : 0); + } + + static bool deserialize(const uint8_t* data, size_t& offset) { + return data[offset++] != 0; + } +}; + +// Floating point +template<> +struct BsatnSerializer { + static void serialize(std::vector& buffer, const float& value) { + uint32_t bits; + std::memcpy(&bits, &value, sizeof(float)); + BsatnSerializer::serialize(buffer, bits); + } + + static float deserialize(const uint8_t* data, size_t& offset) { + uint32_t bits = BsatnSerializer::deserialize(data, offset); + float value; + std::memcpy(&value, &bits, sizeof(float)); + return value; + } +}; + +template<> +struct BsatnSerializer { + static void serialize(std::vector& buffer, const double& value) { + uint64_t bits; + std::memcpy(&bits, &value, sizeof(double)); + BsatnSerializer::serialize(buffer, bits); + } + + static double deserialize(const uint8_t* data, size_t& offset) { + uint64_t bits = BsatnSerializer::deserialize(data, offset); + double value; + std::memcpy(&value, &bits, sizeof(double)); + return value; + } +}; + +// String +template<> +struct BsatnSerializer { + static void serialize(std::vector& buffer, const std::string& value) { + BsatnSerializer::serialize(buffer, static_cast(value.length())); + buffer.insert(buffer.end(), value.begin(), value.end()); + } + + static std::string deserialize(const uint8_t* data, size_t& offset) { + uint32_t len = BsatnSerializer::deserialize(data, offset); + std::string result(reinterpret_cast(data + offset), len); + offset += len; + return result; + } +}; + +// Large integers +template<> +struct BsatnSerializer { + static void serialize(std::vector& buffer, const u128& value) { + u128::serialize(buffer, value); + } + + static u128 deserialize(const uint8_t* data, size_t& offset) { + u128 result = u128::deserialize(data + offset); + offset += 16; + return result; + } +}; + +template<> +struct BsatnSerializer { + static void serialize(std::vector& buffer, const i128& value) { + i128::serialize(buffer, value); + } + + static i128 deserialize(const uint8_t* data, size_t& offset) { + i128 result = i128::deserialize(data + offset); + offset += 16; + return result; + } +}; + +template<> +struct BsatnSerializer { + static void serialize(std::vector& buffer, const u256& value) { + u256::serialize(buffer, value); + } + + static u256 deserialize(const uint8_t* data, size_t& offset) { + u256 result = u256::deserialize(data + offset); + offset += 32; + return result; + } +}; + +template<> +struct BsatnSerializer { + static void serialize(std::vector& buffer, const i256& value) { + i256::serialize(buffer, value); + } + + static i256 deserialize(const uint8_t* data, size_t& offset) { + i256 result = i256::deserialize(data + offset); + offset += 32; + return result; + } +}; + +// TimeDuration serializer commented out since TimeDuration is defined in time_duration.h +/* +template<> +struct BsatnSerializer { + static void serialize(std::vector& buffer, const TimeDuration& value) { + TimeDuration::serialize(buffer, value); + } + + static TimeDuration deserialize(const uint8_t* data, size_t& offset) { + TimeDuration result = TimeDuration::deserialize(data + offset); + offset += 8; + return result; + } +}; +*/ + +// Identity and ConnectionId serializers are already defined in their respective headers + +// Option serialization (handles both Option and std::optional) +template +struct BsatnSerializer> { + static void serialize(std::vector& buffer, const std::optional& value) { + if (value.has_value()) { + buffer.push_back(0); // Some tag + BsatnSerializer::serialize(buffer, *value); + } else { + buffer.push_back(1); // None tag + } + } + + static std::optional deserialize(const uint8_t* data, size_t& offset) { + uint8_t tag = data[offset++]; + if (tag == 0) { + return BsatnSerializer::deserialize(data, offset); + } else { + return std::nullopt; + } + } +}; + +// Option serialization (forward to std::optional) +template +struct BsatnSerializer> { + static void serialize(std::vector& buffer, const Option& value) { + BsatnSerializer>::serialize(buffer, value); + } + + static Option deserialize(const uint8_t* data, size_t& offset) { + return Option(BsatnSerializer>::deserialize(data, offset)); + } +}; + +// Vec serialization +template +struct BsatnSerializer> { + static void serialize(std::vector& buffer, const std::vector& value) { + BsatnSerializer::serialize(buffer, static_cast(value.size())); + for (const auto& item : value) { + BsatnSerializer::serialize(buffer, item); + } + } + + static std::vector deserialize(const uint8_t* data, size_t& offset) { + uint32_t len = BsatnSerializer::deserialize(data, offset); + std::vector result; + result.reserve(len); + for (uint32_t i = 0; i < len; ++i) { + result.push_back(BsatnSerializer::deserialize(data, offset)); + } + return result; + } +}; + +// ScheduleAt serialization is defined in schedule_at_impl.h + +// ============================================================================= +// TYPE REGISTRATION FOR EXTENDED TYPES +// ============================================================================= + +// Type registration for large integers and time types will be handled in +// the AlgebraicType system. Option and Vec need special handling. + +// ============================================================================= +// INLINE IMPLEMENTATIONS THAT REQUIRE COMPLETE TYPES +// ============================================================================= + +// TimeDuration BSATN methods will be provided as free functions in a separate header +// that includes both types.h and bsatn.h + +} // namespace SpacetimeDb + +// ============================================================================= +// BSATN Implementation +// ============================================================================= +// The implementation of BSATN serialization methods has been moved to types_impl.h +// to avoid circular dependencies with reader.h and writer.h. +// Include spacetimedb/bsatn/types_impl.h after including reader.h and writer.h +// to get the implementations. \ No newline at end of file diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/types_impl.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/types_impl.h new file mode 100644 index 00000000000..f96ad4ce9ca --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/types_impl.h @@ -0,0 +1,112 @@ +#ifndef SPACETIMEDB_BSATN_TYPES_IMPL_H +#define SPACETIMEDB_BSATN_TYPES_IMPL_H + +// This file contains the implementation of BSATN serialization methods +// for SpacetimeDB types. It must be included after reader.h and writer.h +// to avoid circular dependencies. + +#include "types.h" +#include "reader.h" +#include "writer.h" +#include // For std::ostringstream +#include // For std::hex, std::setfill, std::setw + +namespace SpacetimeDb { + +// Identity method implementations +inline Identity::Identity() { + value.fill(0); +} + +inline Identity::Identity(const std::array& bytes) : value(bytes) { +} + +inline const std::array& Identity::get_bytes() const { + return value; +} + +inline std::string Identity::to_hex_string() const { + std::ostringstream oss; + oss << std::hex << std::setfill('0'); + + for (size_t i = 0; i < IDENTITY_SIZE; ++i) { + oss << std::setw(2) << static_cast(value[i]); + } + + return oss.str(); +} + +inline bool Identity::operator==(const Identity& other) const { + return value == other.value; +} + +inline bool Identity::operator!=(const Identity& other) const { + return !(*this == other); +} + +inline bool Identity::operator<(const Identity& other) const { + return value < other.value; +} + +// Identity BSATN implementation +inline void Identity::bsatn_serialize(::SpacetimeDb::bsatn::Writer& writer) const { + // Write raw bytes without length prefix for fixed-size Identity + for (size_t i = 0; i < this->value.size(); ++i) { + writer.write_u8(this->value[i]); + } +} + +inline void Identity::bsatn_deserialize(::SpacetimeDb::bsatn::Reader& reader) { + std::vector bytes = reader.read_fixed_bytes(IDENTITY_SIZE); + if (bytes.size() == IDENTITY_SIZE) { + std::copy(bytes.begin(), bytes.end(), this->value.data()); + } else { + std::abort(); + } +} + +// ConnectionId BSATN implementation +inline void ConnectionId::bsatn_serialize(::SpacetimeDb::bsatn::Writer& writer) const { + writer.write_u128_le(this->id); +} + +inline void ConnectionId::bsatn_deserialize(::SpacetimeDb::bsatn::Reader& reader) { + this->id = reader.read_u128_le(); +} + +// u256 BSATN implementation +inline void u256::bsatn_serialize(::SpacetimeDb::bsatn::Writer& writer) const { + writer.write_u256_le(*this); +} + +inline void u256::bsatn_deserialize(::SpacetimeDb::bsatn::Reader& reader) { + std::vector bytes = reader.read_fixed_bytes(sizeof(this->data)); + if (bytes.size() == sizeof(this->data)) { + std::copy(bytes.begin(), bytes.end(), this->data.data()); + } else { + std::abort(); + } +} + +// i256 BSATN implementation +inline void i256::bsatn_serialize(::SpacetimeDb::bsatn::Writer& writer) const { + writer.write_i256_le(*this); +} + +inline void i256::bsatn_deserialize(::SpacetimeDb::bsatn::Reader& reader) { + std::vector bytes = reader.read_fixed_bytes(sizeof(this->data)); + if (bytes.size() == sizeof(this->data)) { + std::copy(bytes.begin(), bytes.end(), this->data.data()); + } else { + std::abort(); + } +} + +// ScheduleAt BSATN implementation is in schedule_at_impl.h + +// Note: u128 and i128 have their own serialize/deserialize static methods in types.h, +// not bsatn_serialize/deserialize member functions + +} // namespace SpacetimeDb + +#endif // SPACETIMEDB_BSATN_TYPES_IMPL_H \ No newline at end of file diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/writer.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/writer.h new file mode 100644 index 00000000000..277fe522676 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/Core/writer.h @@ -0,0 +1,254 @@ +#ifndef SPACETIMEDB_BSATN_WRITER_H +#define SPACETIMEDB_BSATN_WRITER_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +// uint128_placeholder.h removed - types are in spacetimedb/types.h +#include "types.h" + +namespace SpacetimeDb::bsatn { + + // Forward declarations + template struct bsatn_traits; + template void serialize(class Writer& w, const T& value); + + class Writer { + private: + std::vector buffer; // Internal buffer when not using external + std::vector* buffer_; // Pointer to external buffer (if any) + + public: + Writer() : buffer_(nullptr) {} + explicit Writer(std::vector& buffer) : buffer_(&buffer) {} + + // Template method for writing primitive types using C++20 concepts + template + requires (std::is_arithmetic_v && sizeof(T) > 1) + void write_primitive_le(T value) { + write_bytes_raw(&value, sizeof(T)); + } + + // Public API methods (delegates to template where possible) + inline void write_bool(bool value) { + auto& target_buffer = buffer_ ? *buffer_ : buffer; + target_buffer.push_back(value ? 1 : 0); + } + inline void write_u8(uint8_t value) { + auto& target_buffer = buffer_ ? *buffer_ : buffer; + target_buffer.push_back(value); + } + void write_u16_le(uint16_t value) { write_primitive_le(value); } + void write_u32_le(uint32_t value) { write_primitive_le(value); } + void write_u64_le(uint64_t value) { write_primitive_le(value); } + inline void write_u128_le(const SpacetimeDb::u128& value) { + write_u64_le(value.low); + write_u64_le(value.high); + } + void write_u256_le(const SpacetimeDb::u256_placeholder& value) { + write_bytes_raw(value.data.data(), value.data.size()); + } + + void write_i8(int8_t value) { write_u8(static_cast(value)); } + void write_i16_le(int16_t value) { write_u16_le(static_cast(value)); } + void write_i32_le(int32_t value) { write_u32_le(static_cast(value)); } + void write_i64_le(int64_t value) { write_u64_le(static_cast(value)); } + inline void write_i128_le(const SpacetimeDb::i128& value) { + write_u64_le(value.low); + write_u64_le(static_cast(value.high)); + } + void write_i256_le(const SpacetimeDb::i256_placeholder& value) { + write_bytes_raw(value.data.data(), value.data.size()); + } + + void write_f32_le(float value) { write_primitive_le(value); } + void write_f64_le(double value) { write_primitive_le(value); } + + inline void write_string(const std::string& value) { + write_u32_le(static_cast(value.size())); + write_bytes_raw(value.data(), value.size()); + } + inline void write_bytes(const std::vector& value) { + write_u32_le(static_cast(value.size())); + write_bytes_raw(value.data(), value.size()); + } + + template + void write_optional(const std::optional& opt_value) { + // SpacetimeDB uses non-standard Option discriminants: + // Some = 0, None = 1 (reversed from standard Rust) + if (opt_value.has_value()) { + write_u8(0); // Some = 0 (SpacetimeDB convention) + serialize(*this, *opt_value); + } + else { + write_u8(1); // None = 1 (SpacetimeDB convention) + } + } + + template + void write_vector(const std::vector& vec) { + write_u32_le(static_cast(vec.size())); + for (const auto& item : vec) { + serialize(*this, item); + } + } + + inline void write_vector_byte(const std::vector& vec) { + write_bytes(vec); + } + + // Generic serialize member function + template + void serialize_member(const T& value) { + serialize(*this, value); + } + + void write_vec_len(size_t len) { + // Write length as varint + write_u32_le(static_cast(len)); + } + + const std::vector& get_buffer() const { + return buffer_ ? *buffer_ : buffer; + } + + std::vector&& take_buffer() { + return std::move(buffer_ ? *buffer_ : buffer); + } + + // Public method to write raw bytes without length prefix + // This is needed for already-serialized data that has its own length encoding + inline void write_raw_bytes(const std::vector& data) { + auto& target_buffer = buffer_ ? *buffer_ : buffer; + target_buffer.insert(target_buffer.end(), data.begin(), data.end()); + } + + inline void write_raw_bytes(const uint8_t* data, size_t size) { + auto& target_buffer = buffer_ ? *buffer_ : buffer; + target_buffer.insert(target_buffer.end(), data, data + size); + } + + private: + inline void write_bytes_raw(const void* data, size_t size) { + const uint8_t* bytes = static_cast(data); + auto& target_buffer = buffer_ ? *buffer_ : buffer; + target_buffer.insert(target_buffer.end(), bytes, bytes + size); + } + }; + + // Helper to detect if type has bsatn_serialize method + template + struct has_bsatn_serialize : std::false_type {}; + + template + struct has_bsatn_serialize().bsatn_serialize(std::declval()))>> + : std::true_type {}; + + // Generic serialize implementation for types with bsatn_serialize + template + inline void serialize(Writer& w, const T& value) { + if constexpr (has_bsatn_serialize::value) { + value.bsatn_serialize(w); + } else { + // Fall back to bsatn_traits + bsatn_traits::serialize(w, value); + } + } + + // Inline implementations of serialize functions + inline void serialize(Writer& w, bool value) { + w.write_bool(value); + } + + inline void serialize(Writer& w, uint8_t value) { + w.write_u8(value); + } + + inline void serialize(Writer& w, uint16_t value) { + w.write_u16_le(value); + } + + inline void serialize(Writer& w, uint32_t value) { + w.write_u32_le(value); + } + + inline void serialize(Writer& w, uint64_t value) { + w.write_u64_le(value); + } + + inline void serialize(Writer& w, const SpacetimeDb::u128& value) { + w.write_u128_le(value); + } + + inline void serialize(Writer& w, const SpacetimeDb::u256_placeholder& value) { + w.write_u256_le(value); + } + + inline void serialize(Writer& w, int8_t value) { + w.write_i8(value); + } + + inline void serialize(Writer& w, int16_t value) { + w.write_i16_le(value); + } + + inline void serialize(Writer& w, int32_t value) { + w.write_i32_le(value); + } + + inline void serialize(Writer& w, int64_t value) { + w.write_i64_le(value); + } + + inline void serialize(Writer& w, const SpacetimeDb::i128& value) { + w.write_i128_le(value); + } + + inline void serialize(Writer& w, const SpacetimeDb::i256_placeholder& value) { + w.write_i256_le(value); + } + + inline void serialize(Writer& w, float value) { + w.write_f32_le(value); + } + + inline void serialize(Writer& w, double value) { + w.write_f64_le(value); + } + + inline void serialize(Writer& w, const std::string& value) { + w.write_string(value); + } + + inline void serialize(Writer& w, const std::vector& value) { + w.write_bytes(value); + } + + inline void serialize(Writer&, std::monostate) { + // Nothing to serialize for monostate + } + + // SDK type serialization - removed to avoid circular dependency + // Types with bsatn_serialize methods will be handled by the generic serialize function + + template + inline void serialize(Writer& w, const std::optional& opt_value) { + w.write_optional(opt_value); + } + + template + inline void serialize(Writer& w, const std::vector& vec) { + w.write_vector(vec); + } + +} // namespace SpacetimeDB::bsatn + +#endif // SPACETIMEDB_BSATN_WRITER_H \ No newline at end of file diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/FEATURES.md b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/FEATURES.md new file mode 100644 index 00000000000..f137d8deffd --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/FEATURES.md @@ -0,0 +1,23 @@ +# Unreal BSATN Package Features + +This document lists the main capabilities provided by the Unreal BSATN +integration. + +## Supported Types + +### Complete Type Support +- Primitive integers and floats +- `FString` and `FName` +- `TArray` and `TOptional` +- `FVector`, `FRotator`, `FTransform` +- `FGuid`, `FDateTime`, `FTimespan` +- SpacetimeDB specific types (see `UNREAL_BSATN_ADDITIONS.md`) + +## API Highlights +- `UE_SPACETIMEDB_STRUCT` – enable struct serialization (up to 10 fields) +- `UE_SPACETIMEDB_ENABLE_TARRAY(T)` – allow `TArray` of custom types +- `UE_SPACETIMEDB_ENABLE_TOPTIONAL(T)` – allow `TOptional` of custom types +- `Serialize(value)` / `Deserialize(bytes)` convenience helpers + +The implementation is header only and can be compiled outside Unreal using +`MockCoreMinimal.h`. \ No newline at end of file diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/MockCoreMinimal.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/MockCoreMinimal.h new file mode 100644 index 00000000000..94637a84bfc --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/MockCoreMinimal.h @@ -0,0 +1,210 @@ +/** + * @file MockCoreMinimal.h + * @brief Mock Unreal Engine types for testing/examples + * + * This file provides minimal mock implementations of Unreal Engine types + * for testing the BSATN wrapper without requiring the full Unreal Engine. + * In a real UE project, use the actual CoreMinimal.h instead. + */ + +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Mock implementation of core UE types +#define TEXT(x) x +#define TCHAR char +#define FTCHARToUTF8 MockFTCHARToUTF8 +#define UTF8_TO_TCHAR(x) x + +// Mock UTF8 converter +struct MockFTCHARToUTF8 { + const char* str; + MockFTCHARToUTF8(const char* s) : str(s) {} + const char* Get() const { return str; } + size_t Length() const { return strlen(str); } +}; + +// TArray - Dynamic array similar to std::vector +template> +class TArray : public std::vector { +public: + using std::vector::vector; + + int32_t Num() const { return static_cast(this->size()); } + void Add(const T& item) { this->push_back(item); } + void Add(T&& item) { this->push_back(std::move(item)); } + void Reserve(int32_t count) { this->reserve(count); } + T* GetData() { return this->data(); } + const T* GetData() const { return this->data(); } +}; + +// TOptional - Optional value similar to std::optional +template +class TOptional : public std::optional { +public: + using std::optional::optional; + + bool IsSet() const { return this->has_value(); } + const T& GetValue() const { return this->value(); } + T& GetValue() { return this->value(); } +}; + +// FString - String class +class FString : public std::string { +public: + using std::string::string; + FString() = default; + FString(const char* str) : std::string(str) {} + FString(const std::string& str) : std::string(str) {} + + const char* operator*() const { return c_str(); } + bool operator==(const FString& other) const { + return static_cast(*this) == static_cast(other); + } + bool operator==(const char* other) const { + return static_cast(*this) == other; + } + + // Static Printf method + template + static FString Printf(const char* format, Args... args) { + char buffer[512]; + std::snprintf(buffer, sizeof(buffer), format, args...); + return FString(buffer); + } + + // String concatenation + FString& operator+=(const char* str) { + static_cast(*this) += str; + return *this; + } +}; + +// FName - Immutable name/identifier +class FName { + FString name; +public: + FName() = default; + FName(const FString& str) : name(str) {} + FName(const char* str) : name(str) {} + + FString ToString() const { return name; } + bool operator==(const FName& other) const { return name == other.name; } +}; + +// FVector - 3D vector +struct FVector { + float X, Y, Z; + + FVector() : X(0), Y(0), Z(0) {} + FVector(float x, float y, float z) : X(x), Y(y), Z(z) {} + + bool operator==(const FVector& other) const { + return std::abs(X - other.X) < 0.0001f && + std::abs(Y - other.Y) < 0.0001f && + std::abs(Z - other.Z) < 0.0001f; + } +}; + +// FRotator - Rotation +struct FRotator { + float Pitch, Yaw, Roll; + + FRotator() : Pitch(0), Yaw(0), Roll(0) {} + FRotator(float pitch, float yaw, float roll) : Pitch(pitch), Yaw(yaw), Roll(roll) {} + + bool operator==(const FRotator& other) const { + return std::abs(Pitch - other.Pitch) < 0.0001f && + std::abs(Yaw - other.Yaw) < 0.0001f && + std::abs(Roll - other.Roll) < 0.0001f; + } +}; + +// FTransform - Transform (position, rotation, scale) +struct FTransform { + FVector Translation; + FRotator Rotation; + FVector Scale3D; + + FTransform() : Scale3D(1, 1, 1) {} + FTransform(const FVector& trans, const FRotator& rot, const FVector& scale) + : Translation(trans), Rotation(rot), Scale3D(scale) {} +}; + +// FGuid - Globally unique identifier +struct FGuid { + uint32_t A, B, C, D; + + FGuid() : A(0), B(0), C(0), D(0) {} + FGuid(uint32_t a, uint32_t b, uint32_t c, uint32_t d) : A(a), B(b), C(c), D(d) {} + + bool operator==(const FGuid& other) const { + return A == other.A && B == other.B && C == other.C && D == other.D; + } + + // Simple mock NewGuid - not truly unique, just for testing + static FGuid NewGuid() { + static uint32_t counter = 1; + return FGuid(counter++, counter++, counter++, counter++); + } + + FString ToString() const { + char buffer[64]; + std::snprintf(buffer, sizeof(buffer), "%08X-%08X-%08X-%08X", A, B, C, D); + return FString(buffer); + } +}; + +// FDateTime - Date and time +class FDateTime { + int64_t ticks; +public: + FDateTime() : ticks(0) {} + explicit FDateTime(int64_t t) : ticks(t) {} + + int64_t GetTicks() const { return ticks; } + + // Simple mock Now - just returns incrementing value + static FDateTime Now() { + static int64_t counter = 637890123456789; + return FDateTime(counter++); + } +}; + +// FTimespan - Time duration +class FTimespan { + int64_t ticks; +public: + FTimespan() : ticks(0) {} + explicit FTimespan(int64_t t) : ticks(t) {} + + int64_t GetTicks() const { return ticks; } +}; + +// Common type aliases +using uint8 = uint8_t; +using int32 = int32_t; +using uint32 = uint32_t; +using int64 = int64_t; +using uint64 = uint64_t; + +// SpacetimeDB type aliases for UE compatibility +namespace SpacetimeDb { + class u128; + class i128; + class u256; + class i256; + class Identity; + class ConnectionId; + class Timestamp; + class TimeDuration; +} \ No newline at end of file diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/README.md b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/README.md new file mode 100644 index 00000000000..211126f6c7a --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/README.md @@ -0,0 +1,37 @@ +# BSATN + +This directory ships the header‑only implementation of SpacetimeDB's BSATN +serializer used by the Unreal client SDK. The code mirrors the server side +library and enables serializing common Unreal Engine types to the BSATN wire +format. + +## Contents + +- `Core/` – Cross‑platform serialization library copied from + `crates/bindings-cpp/include/spacetimedb/bsatn`. +- `MockCoreMinimal.h` – Minimal stand‑ins for a handful of engine types when + compiling outside of Unreal. +- `UEBSATNHelpers.h` – Helper macros for registering UE types and containers. +- `UESpacetimeDB.h` – Umbrella header that exposes `Serialize` and `Deserialize` + functions and the `UE_SPACETIMEDB_STRUCT` macro. +- `FEATURES.md` – Summary of supported types. +- `UNREAL_BSATN_ADDITIONS.md` – Extra serialization helpers for the client. +- +## Usage + +Include `UESpacetimeDB.h` in your project and call the helper functions: + +```cpp +TArray Bytes = UE::SpacetimeDB::Serialize(MyStruct); +MyStruct Restored = UE::SpacetimeDB::Deserialize(Bytes); +``` + +Custom structs opt in via `UE_SPACETIMEDB_STRUCT`. The library has no runtime +dependencies and consists solely of header files. + + +## Implementation Notes + +- No runtime type registration is required +- Binary layout matches the server implementation +- All multi-byte values use little-endian encoding \ No newline at end of file diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/UEBSATNHelpers.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/UEBSATNHelpers.h new file mode 100644 index 00000000000..b31efce382e --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/UEBSATNHelpers.h @@ -0,0 +1,157 @@ +#pragma once + +#include "CoreMinimal.h" +#include "ModuleBindings/Types/TableUpdateType.g.h" +#include "ModuleBindings/Types/QueryUpdateType.g.h" +#include "ModuleBindings/Types/CompressableQueryUpdateType.g.h" +#include "DBCache/WithBsatn.h" + +/** Helper utilities for working with BSATN encoded row data in Unreal. */ + +namespace UE::SpacetimeDB +{ + + /** Parse a single row list based on its size hint and retain BSATN bytes */ + template + static void ParseRowListWithBsatn( + const FBsatnRowListType& List, + TArray>& OutRows + ) + { + // If the size hint is fixed size, parse the rows based on the fixed size + if (List.SizeHint.IsFixedSize()) + { + // Get the fixed size from the size hint + uint16 Size = List.SizeHint.GetAsFixedSize(); + if (Size > 0) + { + // If the size is valid, parse the rows based on the fixed size + int32 Count = List.RowsData.Num() / Size; + for (int32 i = 0; i < Count; ++i) + { + // Create a slice of the row data based on the fixed size + TArray Slice; + Slice.Append(List.RowsData.GetData() + i * Size, Size); + // Deserialize the row from the slice + RowType Row = UE::SpacetimeDB::Deserialize(Slice); + // Add the row with its BSATN bytes to the output array + OutRows.Add(FWithBsatn(Slice, Row)); + } + return; + } + } + // If the size hint is row offsets, parse the rows based on the offsets + else if (List.SizeHint.IsRowOffsets()) + { + // Get the offsets from the size hint + TArray Offsets = List.SizeHint.GetAsRowOffsets(); + if (Offsets.Num() > 0) + { + // If the offsets are valid, parse the rows based on the offsets + UEReader Reader(List.RowsData); + for (int32 i = 0; i < Offsets.Num(); ++i) + { + // If this is the last offset, read until the end of the data + int64 Start = Offsets[i]; + int64 End = (i + 1 < Offsets.Num()) ? Offsets[i + 1] : List.RowsData.Num(); + int64 Length = End - Start; + TArray Slice; + Slice.Append(List.RowsData.GetData() + Start, Length); + + // Deserialize the row from the slice + UEReader SliceReader(Slice); + RowType Row = deserialize(SliceReader); + + // Add the row with its BSATN bytes to the output array + OutRows.Add(FWithBsatn(Slice, Row)); + } + } + } + } + + /** Parse a query update into row arrays */ + template + static void ParseQueryUpdateWithBsatn( + const FQueryUpdateType& Query, + TArray>& OutInserts, + TArray>& OutDeletes) + { + // Parse inserts and deletes from the query update, retaining BSATN bytes + ParseRowListWithBsatn(Query.Inserts, OutInserts); + ParseRowListWithBsatn(Query.Deletes, OutDeletes); + } + + /** Apply a table update keeping BSATN bytes */ + template + void ProcessTableUpdateWithBsatn( + const FTableUpdateType& TableUpdate, + TArray>& Inserts, + TArray>& Deletes) + { + for (FCompressableQueryUpdateType CQU : TableUpdate.Updates) + { + FQueryUpdateType QueryUpdate; + //Should be uncompressed at this point + if (CQU.IsUncompressed()) + { + QueryUpdate = CQU.GetAsUncompressed(); + } + else + { + UE_LOG(LogTemp, Error, TEXT("Compresstion state for row in table %s not uncompressed at parsing step"), *TableUpdate.TableName); + continue; + } + ParseQueryUpdateWithBsatn(QueryUpdate, Inserts, Deletes); + } + } + + /** Base class for preprocessed table data. Used to store inserts and deletes for a specific row type. */ + struct FPreprocessedTableDataBase + { + virtual ~FPreprocessedTableDataBase() {} + }; + + /** A wrapper for a row type that includes its bsatn value. Used to store rows with their bsatn values. */ + template + struct TPreprocessedTableData : FPreprocessedTableDataBase + { + // The type of the row being processed + TArray> Inserts; + TArray> Deletes; + }; + + /** Interface for deserializing table rows from a database update. Allows for different row types to be processed in SDK. */ + class ITableRowDeserializer + { + public: + virtual ~ITableRowDeserializer() {} + /** Preprocess the table update and return a shared pointer to preprocessed data. */ + virtual TSharedPtr PreProcess(const TArray& Updates, const FString TableName) const = 0; + }; + + /** Specialization of ITableRowDeserializer for a specific row type not defined in SDK. Used to deserialize rows of a specific type from a database update. */ + template + class TTableRowDeserializer : public ITableRowDeserializer + { + public: + virtual TSharedPtr PreProcess(const TArray& Updates, const FString TableName) const override + { + // Create a new preprocessed table data object for the specific row type + TSharedPtr> Result = MakeShared>(); + // Process each compressable query update in the table update + for (const FCompressableQueryUpdateType& CQU : Updates) + { + if (!CQU.IsUncompressed()) + { + UE_LOG(LogTemp, Error, TEXT("Compresstion state for row in table %s not uncompressed at parsing step"), *TableName); + continue; + } + // Get the uncompressed query update from the compressable query update + FQueryUpdateType Query = CQU.GetAsUncompressed(); + // Parse the query update into inserts and deletes, retaining BSATN bytes + ParseQueryUpdateWithBsatn(Query, Result->Inserts, Result->Deletes); + } + return Result; + } + }; +} \ No newline at end of file diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/UESpacetimeDB.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/UESpacetimeDB.h new file mode 100644 index 00000000000..2afc6b5313a --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/UESpacetimeDB.h @@ -0,0 +1,1281 @@ +/** + * @file UESpacetimeDB.h + * @brief BSATN Serialization Wrapper for Unreal Engine Types + * + * This header provides a compatibility layer between SpacetimeDB's BSATN + * (Binary SpacetimeDB Abstract Type Notation) serialization system and + * Unreal Engine's type system. It enables seamless serialization and + * deserialization of UE data structures for use with SpacetimeDB. + * + * Key Features: + * - Zero-copy serialization where possible + * - Support for all common UE types (FString, TArray, FVector, etc.) + * - Simple macro-based API for custom structs + * - Type-safe compile-time serialization + * + * Usage Example: + * @code + * // Serialize a UE type + * FVector position(100, 200, 300); + * TArray serialized = UE::SpacetimeDB::Serialize(position); + * + * // Deserialize back + * FVector deserialized = UE::SpacetimeDB::Deserialize(serialized); + * @endcode + */ + +#pragma once + +#include "Core/bsatn.h" + +#include "CoreMinimal.h" +#include "Math/Quat.h" +#include "Types/LargeIntegers.h" + +#include +#include +#include + +namespace UE::SpacetimeDB { + + // ============================================================================= + // Forward Declarations + // ============================================================================= + + class UEWriter; + class UEReader; + template void serialize(UEWriter& w, const T& value); + template T deserialize(UEReader& r); + + // ============================================================================= + // UEWriter - BSATN Writer Wrapper for Unreal Engine + // ============================================================================= + + /** + * @class UEWriter + * @brief Wrapper around SpacetimeDB's BSATN Writer for Unreal Engine types + * + * This class provides a UE-friendly interface to the BSATN serialization system, + * handling conversions between UE types (FString, TArray) and standard C++ types. + * + * The writer maintains an internal buffer that accumulates serialized data. + * Use take_buffer() to extract the final result. + */ + class UEWriter { + private: + ::SpacetimeDb::bsatn::Writer core_writer; ///< Underlying BSATN writer + + public: + UEWriter() = default; + + // ------------------------------------------------------------------------- + // Primitive Type Writers + // ------------------------------------------------------------------------- + + /** @name Boolean and Integer Writers + * Write primitive integer types to the buffer + */ + ///@{ + void write_bool(bool value) { core_writer.write_bool(value); } + void write_u8(uint8_t value) { core_writer.write_u8(value); } + void write_u16(uint16_t value) { core_writer.write_u16_le(value); } + void write_u32(uint32_t value) { core_writer.write_u32_le(value); } + void write_u64(uint64_t value) { core_writer.write_u64_le(value); } + void write_i8(int8_t value) { core_writer.write_i8(value); } + void write_i16(int16_t value) { core_writer.write_i16_le(value); } + void write_i32(int32_t value) { core_writer.write_i32_le(value); } + void write_i64(int64_t value) { core_writer.write_i64_le(value); } + ///@} + + /** @name Floating Point Writers + * Write floating point values to the buffer + */ + ///@{ + void write_f32(float value) { core_writer.write_f32_le(value); } + void write_f64(double value) { core_writer.write_f64_le(value); } + ///@} + + // ------------------------------------------------------------------------- + // UE-Specific Type Writers + // ------------------------------------------------------------------------- + + /** + * Write a UE FString as UTF-8 encoded string + * @param str The FString to serialize + */ + void write_string(const FString& str) { + FTCHARToUTF8 converter(*str); + core_writer.write_string(std::string(converter.Get(), converter.Length())); + } + + /** + * Write a TArray as raw bytes with length prefix + * @param arr The byte array to serialize + */ + void write_array_u8(const TArray& arr) { + core_writer.write_u32_le(static_cast(arr.Num())); + if (arr.Num() > 0) { + core_writer.write_bytes(std::vector(arr.GetData(), arr.GetData() + arr.Num())); + } + } + + /** + * Write a generic TArray with length prefix + * @tparam T The element type + * @param arr The array to serialize + * @note Implementation is defined after serialize() declarations + */ + template + void write_array(const TArray& arr); + + // ------------------------------------------------------------------------- + // Buffer Management + // ------------------------------------------------------------------------- + + /** + * Extract the serialized buffer as a UE TArray + * @return TArray containing the serialized data + * @note This consumes the writer (move semantics) + */ + TArray take_buffer()&& { + auto std_buffer = std::move(core_writer).take_buffer(); + TArray ue_buffer; + ue_buffer.Reserve(static_cast(std_buffer.size())); + for (auto byte : std_buffer) { + ue_buffer.Add(byte); + } + return ue_buffer; + } + + /** + * Get a reference to the internal buffer (for compatibility) + * @return Reference to the internal std::vector buffer + */ + const std::vector& get_std_buffer() const { + return core_writer.get_buffer(); + } + }; + + // ============================================================================= + // UEReader - BSATN Reader Wrapper for Unreal Engine + // ============================================================================= + + /** + * @class UEReader + * @brief Wrapper around SpacetimeDB's BSATN Reader for Unreal Engine types + * + * This class provides a UE-friendly interface for deserializing BSATN data, + * handling conversions between standard C++ types and UE types. + * + * The reader stores a copy of the input data to prevent lifetime issues + * that could occur if the original TArray is destroyed. + */ + class UEReader { + private: + std::vector stored_data; ///< Local copy of data to ensure lifetime + ::SpacetimeDb::bsatn::Reader core_reader; ///< Underlying BSATN reader + + public: + /** + * Construct a reader from a UE byte array + * @param data The TArray containing serialized BSATN data + * @note Makes a copy of the data to prevent lifetime issues + */ + explicit UEReader(const TArray& data) + : stored_data(data.GetData(), data.GetData() + data.Num()), + core_reader(stored_data) { + // Debug output (can be removed in production) + if (data.Num() > 0) { + //std::cout << " UEReader initialized with data[0] = " << std::hex << (int)data[0] << std::dec << std::endl; + } + } + + /** + * Construct a reader from a standard vector + * @param data The vector containing serialized BSATN data + */ + explicit UEReader(const std::vector& data) + : stored_data(data), + core_reader(stored_data) {} + + // ------------------------------------------------------------------------- + // Primitive Type Readers + // ------------------------------------------------------------------------- + + /** @name Boolean and Integer Readers + * Read primitive integer types from the buffer + */ + ///@{ + bool read_bool() { + return core_reader.read_bool(); + } + + uint8_t read_u8() { return core_reader.read_u8(); } + uint16_t read_u16() { return core_reader.read_u16_le(); } + uint32_t read_u32() { return core_reader.read_u32_le(); } + uint64_t read_u64() { return core_reader.read_u64_le(); } + int8_t read_i8() { return core_reader.read_i8(); } + int16_t read_i16() { return core_reader.read_i16_le(); } + int32_t read_i32() { return core_reader.read_i32_le(); } + int64_t read_i64() { return core_reader.read_i64_le(); } + ///@} + + /** @name Floating Point Readers + * Read floating point values from the buffer + */ + ///@{ + float read_f32() { return core_reader.read_f32_le(); } + double read_f64() { return core_reader.read_f64_le(); } + ///@} + + // ------------------------------------------------------------------------- + // UE-Specific Type Readers + // ------------------------------------------------------------------------- + + /** + * Read a UTF-8 string and convert to FString + * @return FString containing the deserialized string + */ + FString read_string() { + auto std_str = core_reader.read_string(); + return FString(UTF8_TO_TCHAR(std_str.c_str())); + } + + /** + * Read a byte array with length prefix + * @return TArray containing the deserialized bytes + */ + TArray read_array_u8() { + uint32_t count = core_reader.read_u32_le(); + TArray result; + result.Reserve(count); + for (uint32_t i = 0; i < count; ++i) { + result.Add(core_reader.read_u8()); + } + return result; + } + + /** + * Read a generic TArray with length prefix + * @tparam T The element type + * @return TArray containing the deserialized elements + * @note Implementation is defined after deserialize() declarations + */ + template + TArray read_array(); + }; + + // ============================================================================= + // Primitive Type Serialization + // ============================================================================= + + /** + * @defgroup PrimitiveSerialization Primitive Type Serialization + * @brief Serialization functions for C++ primitive types + * @{ + */ + + inline void serialize(UEWriter& w, bool value) { w.write_bool(value); } + inline void serialize(UEWriter& w, uint8 value) { w.write_u8(value); } + inline void serialize(UEWriter& w, uint16 value) { w.write_u16(value); } + inline void serialize(UEWriter& w, uint32 value) { w.write_u32(value); } + inline void serialize(UEWriter& w, uint64 value) { w.write_u64(value); } + inline void serialize(UEWriter& w, int8 value) { w.write_i8(value); } + inline void serialize(UEWriter& w, int16 value) { w.write_i16(value); } + inline void serialize(UEWriter& w, int32 value) { w.write_i32(value); } + inline void serialize(UEWriter& w, int64 value) { w.write_i64(value); } + inline void serialize(UEWriter& w, float value) { w.write_f32(value); } + inline void serialize(UEWriter& w, double value) { w.write_f64(value); } + + /** @} */ // end of PrimitiveSerialization group + + // ============================================================================= + // Primitive Type Deserialization + // ============================================================================= + + /** + * @defgroup PrimitiveDeserialization Primitive Type Deserialization + * @brief Deserialization functions for C++ primitive types + * @{ + */ + + template<> inline bool deserialize(UEReader& r) { return r.read_bool(); } + template<> inline uint8 deserialize(UEReader& r) { return r.read_u8(); } + template<> inline uint16 deserialize(UEReader& r) { return r.read_u16(); } + template<> inline uint32 deserialize(UEReader& r) { return r.read_u32(); } + template<> inline uint64 deserialize(UEReader& r) { return r.read_u64(); } + template<> inline int8 deserialize(UEReader& r) { return r.read_i8(); } + template<> inline int16 deserialize(UEReader& r) { return r.read_i16(); } + template<> inline int32 deserialize(UEReader& r) { return r.read_i32(); } + template<> inline int64 deserialize(UEReader& r) { return r.read_i64(); } + template<> inline float deserialize(UEReader& r) { return r.read_f32(); } + template<> inline double deserialize(UEReader& r) { return r.read_f64(); } + + /** @} */ // end of PrimitiveDeserialization group + + // ============================================================================= + // UE Large Integer Type Serialization + // ============================================================================= + + /** + * @defgroup UELargeIntegerSerialization UE Large Integer Type Serialization + * @brief Serialization for FSpacetimeDB U/Int 128/256 types + * @{ + */ + + /** Serialize FSpacetimeDBUInt128 as two 64-bit integers, little-endian. */ + inline void serialize(UEWriter& w, const FSpacetimeDBUInt128& value) + { + w.write_u64(value.GetLower()); + w.write_u64(value.GetUpper()); + } + + /** Deserialize FSpacetimeDBUInt128. */ + template<> inline FSpacetimeDBUInt128 deserialize(UEReader& r) + { + uint64 Lower = r.read_u64(); + uint64 Upper = r.read_u64(); + return FSpacetimeDBUInt128(Upper, Lower); + } + + /** Serialize FSpacetimeDBInt128 as two 64-bit integers, little-endian. */ + inline void serialize(UEWriter& w, const FSpacetimeDBInt128& value) + { + w.write_u64(value.GetLower()); + w.write_u64(value.GetUpper()); + } + + /** Deserialize FSpacetimeDBInt128. */ + template<> inline FSpacetimeDBInt128 deserialize(UEReader& r) + { + uint64 Lower = r.read_u64(); + uint64 Upper = r.read_u64(); + return FSpacetimeDBInt128(Upper, Lower); + } + + /** Serialize FSpacetimeDBUInt256 as four 64-bit integers, little-endian. */ + inline void serialize(UEWriter& w, const FSpacetimeDBUInt256& value) + { + serialize(w, value.GetLower()); // This serializes the lower 128 bits + serialize(w, value.GetUpper()); // This serializes the upper 128 bits + } + + /** Deserialize FSpacetimeDBUInt256. */ + template<> inline FSpacetimeDBUInt256 deserialize(UEReader& r) + { + FSpacetimeDBUInt128 Lower = deserialize(r); + FSpacetimeDBUInt128 Upper = deserialize(r); + return FSpacetimeDBUInt256(Upper, Lower); + } + + /** Serialize FSpacetimeDBInt256 as four 64-bit integers, little-endian. */ + inline void serialize(UEWriter& w, const FSpacetimeDBInt256& value) + { + serialize(w, value.GetLower()); + serialize(w, value.GetUpper()); + } + + /** Deserialize FSpacetimeDBInt256. */ + template<> inline FSpacetimeDBInt256 deserialize(UEReader& r) + { + FSpacetimeDBUInt128 Lower = deserialize(r); + FSpacetimeDBUInt128 Upper = deserialize(r); + return FSpacetimeDBInt256(Upper, Lower); + } + + /** @} */ // end of UELargeIntegerSerialization group + + // ============================================================================= + // UE Object Pointer Serialization + // ============================================================================= + + /** + * @defgroup UEObjectPtrTypes Unreal Engine Object Pointer Types + * @brief Serialization for raw and smart UObject pointers + * @{ + */ + + /** Serialize a TObjectPtr by dereferencing and dispatching to the object serializer. */ + template + inline void serialize(UEWriter& w, const TObjectPtr& ObjPtr) + { + serialize(w, *ObjPtr); + } + + /** Serialize a raw UObject* pointer by dereferencing and dispatching to the object serializer.*/ + template + inline void serialize(UEWriter& w, T* const& Ptr) + { + if (!Ptr) { ensureMsgf(false, TEXT("Cannot serialize null pointer")); return; } + serialize(w, *Ptr); + } + + /** Convenience wrapper to deserialize any TObjectPtr from a byte array. */ + template + TObjectPtr DeserializePtr(const TArray& Bytes) + { + return Deserialize>(Bytes); + } + + /** @} */ // end of UEObjectPtrTypes group + + // ============================================================================= + // UE String Type Serialization + // ============================================================================= + + /** + * @defgroup UEStringTypes Unreal Engine String Types + * @brief Serialization for FString and FName + * @{ + */ + + /** Serialize FString as UTF-8 */ + inline void serialize(UEWriter& w, const FString& str) { + w.write_string(str); + } + + /** Deserialize FString from UTF-8 */ + template<> inline FString deserialize(UEReader& r) { + return r.read_string(); + } + + /** Serialize FName (converts to FString internally) */ + inline void serialize(UEWriter& w, const FName& name) { + serialize(w, name.ToString()); + } + + /** Deserialize FName (converts from FString internally) */ + template<> inline FName deserialize(UEReader& r) { + return FName(deserialize(r)); + } + + /** @} */ // end of UEStringTypes group + + // ============================================================================= + // Container Type Helpers + // ============================================================================= + + /** + * @defgroup ContainerHelpers Container Type Helper Structures + * @brief Internal helpers for container serialization + * @{ + */ + + /** + * @brief Helper trait to detect TArray types at compile time + */ + template + struct is_tarray_check : std::false_type {}; + + template + struct is_tarray_check> : std::true_type {}; + + /** + * @brief Helper for specialized deserialization of complex types + * + * This helper is used to handle deserialization of nested container types + * like TArray> or TOptional. + */ + template + struct DeserializeHelper { + static T deserialize(UEReader& r); + }; + + /** Specialization for TArray */ + template + struct DeserializeHelper> { + static TArray deserialize(UEReader& r) { + return r.read_array(); + } + }; + + /** @} */ // end of ContainerHelpers group + + // ============================================================================= + // Enum Serialization Support + // ============================================================================= + + /** + * @defgroup EnumSerialization Enum Serialization + * @brief Support for serializing enums as their underlying type + * @{ + */ + + /** + * @brief Serialize enum as its underlying type + * + * SpacetimeDB enums are serialized as their underlying integer type. + * This template handles any enum class automatically. + */ + + template + requires std::is_enum_v + inline void serialize(UEWriter& w, const Enum& value) + { + using Underlying = std::underlying_type_t; + serialize(w, static_cast(value)); + } + + /** + * @brief Deserialize enum from its underlying type + * + * Note: This needs explicit specialization for each enum type to avoid + * ambiguity with the generic template. Use the UE_SPACETIMEDB_ENUM macro. + */ + + template + requires std::is_enum_v + inline Enum deserialize(UEReader& r) + { + using Underlying = std::underlying_type_t; + return static_cast(deserialize(r)); + } + + /** @} */ // end of EnumSerialization group + + // ============================================================================= + // TArray Serialization + // ============================================================================= + + /** + * @defgroup TArraySerialization TArray Container Serialization + * @brief Serialization support for TArray containers + * @{ + */ + + /** + * Serialize a TArray with length prefix + * @tparam T Element type + * @param w Writer instance + * @param arr Array to serialize + */ + template + void serialize(UEWriter& w, const TArray& arr) { + w.write_array(arr); + } + + /** + * Helper function to deserialize TArray + * @tparam T Element type + * @param r Reader instance + * @return Deserialized array + */ + template + TArray deserialize_array(UEReader& r) { + return r.read_array(); + } + + /** @} */ // end of TArraySerialization group + + // ============================================================================= + // TOptional Serialization + // ============================================================================= + + /** + * @Note. TOptional not compatable with Blueprints, therefore we use a custom optional approach. But we keep this in case blueprints support is added in the future. + * @defgroup TOptionalSerialization TOptional Container Serialization + * @brief Serialization support for TOptional containers + * @{ + */ + + /** + * Serialize TOptional with tag byte + * @tparam T Value type + * @param w Writer instance + * @param opt Optional value to serialize + * @note Uses tag 0 for Some, tag 1 for None + */ + template + void serialize(UEWriter& w, const TOptional& opt) { + if (opt.IsSet()) { + w.write_u8(0); // Some tag + serialize(w, opt.GetValue()); + } + else { + w.write_u8(1); // None tag + } + } + + /** + * Helper function to deserialize TOptional + * @tparam T Value type + * @param r Reader instance + * @return Deserialized optional + */ + template + TOptional deserialize_optional(UEReader& r) { + uint8_t tag = r.read_u8(); + if (tag == 0) { + return TOptional(deserialize(r)); + } + else if (tag == 1) { + return TOptional(); + } + else { + ensureMsgf(false, TEXT("Invalid optional tag: %d"), tag); + return TOptional(); + } + } + + /** Specialization for TOptional */ + template + struct DeserializeHelper> { + static TOptional deserialize(UEReader& r) { + return deserialize_optional(r); + } + }; + + /** @} */ // end of TOptionalSerialization group + + // ============================================================================= + // Custom Optional struct Serialization + // ============================================================================= + /** + * @brief Helper macro to generate serialization for Blueprint compatible optionals + * @{ + * + * This macro creates serialize/deserialize specializations for a struct that + * mimics the behaviour of TOptional by exposing a value field and a boolean + * flag indicating if the value is set. + * + * @param StructType Name of the optional wrapper struct + * @param ValueField Name of the value member inside the struct + * @param IsSetField Name of the boolean member that signals if the value is present + * + * Example usage: + * @code + * USTRUCT(BlueprintType) + * struct FMyIntOptional { + * int32 Value; + * bool bIsSet; + * }; + * + * namespace UE::SpacetimeDB { + * UE_SPACETIMEDB_OPTIONAL(FMyIntOptional, Value, bIsSet); + * } + * @endcode + */ +#define UE_SPACETIMEDB_OPTIONAL(StructType, IsSetField, ValueField) \ + template<> inline void serialize(UEWriter& w, const StructType& value) { \ + if (value.IsSetField) { \ + w.write_u8(0); \ + serialize(w, value.ValueField); \ + } else { \ + w.write_u8(1); \ + } \ + } \ + template<> inline StructType deserialize(UEReader& r) { \ + StructType result; \ + uint8_t tag = r.read_u8(); \ + if (tag == 0) { \ + result.IsSetField = true; \ + result.ValueField = deserialize(r); \ + } else if (tag == 1) { \ + result.IsSetField = false; \ + } else { \ + ensureMsgf(false, TEXT("Invalid optional tag: %d"), tag); \ + return StructType(); \ + } \ + return result; \ + } + + /** @} */ // end of CustomOptionalStructSerialization group + + + // ============================================================================= + // UE Utility Type Serialization + // ============================================================================= + + /** Serialize FDateTime as ticks (int64) */ + inline void serialize(UEWriter& w, const FDateTime& dt) { + w.write_i64(dt.GetTicks()); + } + + /** Deserialize FDateTime from ticks */ + template<> inline FDateTime deserialize(UE::SpacetimeDB::UEReader& r) { + return FDateTime(r.read_i64()); + } + + /** Serialize FTimespan as ticks (int64) */ + inline void serialize(UEWriter& w, const FTimespan& ts) { + w.write_i64(ts.GetTicks()); + } + + /** Deserialize FTimespan from ticks */ + template<> inline FTimespan deserialize(UE::SpacetimeDB::UEReader& r) { + return FTimespan(r.read_i64()); + } + + /** @} */ // end of UEUtilityTypes group + + // ============================================================================= + // Template Method Implementations + // ============================================================================= + + /** + * @brief Implementation of generic TArray serialization + * + * Must be defined after serialize() declarations to allow proper template + * instantiation for element types. + */ + template + void UEWriter::write_array(const TArray& arr) { + // Write count as 32-bit length prefix + core_writer.write_u32_le(static_cast(arr.Num())); + + // Serialize each element + for (const auto& item : arr) { + serialize(*this, item); + } + } + + /** + * @brief Implementation of generic TArray deserialization + * + * Handles nested arrays properly by using DeserializeHelper for + * complex types like TArray>. + */ + template + TArray UEReader::read_array() { + // Read count from 32-bit length prefix + uint32_t count = core_reader.read_u32_le(); + + // Pre-allocate array + TArray result; + result.Reserve(count); + + // Deserialize each element + for (uint32_t i = 0; i < count; ++i) { + // Use DeserializeHelper for nested containers, direct deserialize for primitives + if constexpr (is_tarray_check::value) { + result.Add(DeserializeHelper::deserialize(*this)); + } + else { + result.Add(deserialize(*this)); + } + } + return result; + } + + // ============================================================================= + // High-Level Serialization API + // ============================================================================= + + /** + * @defgroup HighLevelAPI High-Level Serialization API + * @brief Simple functions for serializing/deserializing UE types + * @{ + */ + + /** + * @brief Type trait to detect TArray types + */ + template + struct is_tarray : std::false_type {}; + + template + struct is_tarray> : std::true_type {}; + + template + inline constexpr bool is_tarray_v = is_tarray::value; + + /** + * @brief Type trait to detect TOptional types + */ + template + struct is_toptional : std::false_type {}; + + template + struct is_toptional> : std::true_type {}; + + template + inline constexpr bool is_toptional_v = is_toptional::value; + + /** + * Serialize any supported UE type to a byte array + * @tparam T Type to serialize (automatically deduced) + * @param value The value to serialize + * @return TArray containing the serialized BSATN data + * + * @code + * FVector position(100, 200, 300); + * TArray data = UE::SpacetimeDB::Serialize(position); + * @endcode + */ + template + TArray Serialize(const T& value) { + UEWriter writer; + serialize(writer, value); + return std::move(writer).take_buffer(); + } + + /** + * Deserialize a byte array to a UE type + * @tparam T Type to deserialize to (must be explicitly specified) + * @param data The byte array containing BSATN data + * @return The deserialized value + * + * @code + * TArray data = GetSerializedData(); + * FString Name = UE::SpacetimeDB::Deserialize(data); + * @endcode + */ + template + T Deserialize(const TArray& data) { + + UEReader reader(data); + + // Use appropriate deserialization path based on type + + if constexpr (is_tarray_v) { + return DeserializeHelper::deserialize(reader); + } + else if constexpr (is_toptional_v) { + return DeserializeHelper::deserialize(reader); + } + else { + return deserialize(reader); + } + } + + /** @} */ // end of HighLevelAPI group + + // ============================================================================= + // Container Type Specialization Helpers + // ============================================================================= + + /** + * @defgroup ContainerMacros Container Type Helper Macros + * @brief Macros to enable serialization of custom types in containers + * @{ + */ + + /** + * @brief Helper macro to generate deserialize specialization for TArray + * + * Use this macro when you have structs with TArray fields of custom types. + * Place it in the UE::SpacetimeDB namespace before using UE_SPACETIMEDB_STRUCT. + * + * @code + * namespace UE::SpacetimeDB { + * UE_SPACETIMEDB_ENABLE_TARRAY(FMyCustomType) + * UE_SPACETIMEDB_STRUCT(MyStruct, field1, myArrayField) + * } + * @endcode + */ +#define UE_SPACETIMEDB_ENABLE_TARRAY(ElementType) \ + template<> inline TArray deserialize>(UEReader& r) { \ + return r.read_array(); \ + } + + // ============================================================================= + // TOptional Serialization + // ============================================================================= + + /** + * @brief Helper macro to generate deserialize specialization for TOptional + * + * Use this macro when you have structs with TOptional fields of custom types. + * + * @Note: We are not using TOptional directly becouse it is not compatable wiht blueprints. + * This macro is kept for future compatibility if things change on the Engine side. + * + * @code + * namespace UE::SpacetimeDB { + * UE_SPACETIMEDB_ENABLE_TOPTIONAL(FMyCustomType) + * UE_SPACETIMEDB_STRUCT(MyStruct, field1, myOptionalField) + * } + * @endcode + */ +#define UE_SPACETIMEDB_ENABLE_TOPTIONAL(ElementType) \ + template<> inline TOptional deserialize>(UEReader& r) { \ + return deserialize_optional(r); \ + } + + + + /** @} */ // end of TOptionalSerialization group + + // ============================================================================= + // Tagged Enum (Enum + TVariant) Macro + // ============================================================================= + + // Reuse the existing FOR_EACH machinery already defined above in this file: + // UE_FOR_EACH_PAIR(M, EnumTok, FieldTok, ...) + // It calls M(EnumTok, FieldTok, TagTok, TypeTok) for every (Tag, Type) pair. + + // Single-pair emitters for TVariant-based structs +#define UE_WRITE_CASE_TVARIANT(EnumTok, FieldTok, TagTok, TypeTok) \ + case EnumTok::TagTok: { \ + /* TVariant::Get() returns the value (or ref for ref-qualified variants) */ \ + const auto& _val = v.FieldTok.Get(); \ + serialize(w, _val); \ + break; \ + } + +#define UE_READ_CASE_TVARIANT(EnumTok, FieldTok, TagTok, TypeTok) \ + case EnumTok::TagTok: { \ + auto _tmp = deserialize(r); \ + out.FieldTok.Set(_tmp); \ + break; \ + } + +/** + * UE_SPACETIMEDB_TAGGED_ENUM + * Generates serialize/deserialize for a (USTRUCT-like) tagged enum that stores + * its payload in a TVariant field. + * + * @param Struct The USTRUCT type (value type, not UObject) + * @param Enum The UENUM tag type (e.g., EMyTag) + * @param Field The TVariant field name in Struct (e.g., MessageData) + * @param ... Repeated (Tag, Type) pairs, e.g.: Foo, int32, Bar, FString, ... + * + * Example: + * UE_SPACETIMEDB_TAGGED_ENUM( + * FMyTagged, EMyTag, Payload, + * Foo, int32, + * Bar, FString) + */ +#define UE_SPACETIMEDB_TAGGED_ENUM(Struct, Enum, Field, ...) \ + /* ---- serialize ---------------------------------------------------- */ \ + template<> inline void serialize(UEWriter& w, const Struct& v) \ + { \ + w.write_u8(static_cast(v.Tag)); \ + switch (v.Tag) { \ + UE_FOR_EACH_PAIR(UE_WRITE_CASE_TVARIANT, Enum, Field, __VA_ARGS__) \ + default: \ + ensureMsgf(false, TEXT("Unknown tag in %s::serialize"), TEXT(#Struct)); \ + break; \ + } \ + } \ + /* ---- deserialize -------------------------------------------------- */ \ + template<> inline Struct deserialize(UEReader& r) \ + { \ + Struct out{}; \ + const auto Tag = static_cast(r.read_u8()); \ + out.Tag = Tag; \ + switch (Tag) { \ + UE_FOR_EACH_PAIR(UE_READ_CASE_TVARIANT, Enum, Field, __VA_ARGS__) \ + default: \ + ensureMsgf(false, TEXT("Unknown tag in %s::deserialize"), TEXT(#Struct)); \ + /* out left default-initialized */ \ + break; \ + } \ + return out; \ + } + + + +// ──────────────────────────────────────────────────────────────────────────── +// 0. Force extra rescans so MSVC finishes the recursion +// ──────────────────────────────────────────────────────────────────────────── +#define UE_EVAL0(...) __VA_ARGS__ +#define UE_EVAL1(...) UE_EVAL0(UE_EVAL0(__VA_ARGS__)) +#define UE_EVAL2(...) UE_EVAL1(UE_EVAL1(__VA_ARGS__)) +#define UE_EVAL3(...) UE_EVAL2(UE_EVAL2(__VA_ARGS__)) +#define UE_EVAL4(...) UE_EVAL3(UE_EVAL3(__VA_ARGS__)) +#define UE_EVAL5(...) UE_EVAL4(UE_EVAL4(__VA_ARGS__)) +#define UE_EVAL(...) UE_EVAL5(__VA_ARGS__) // 32 rescans → ~64 tokens (~32 pairs) + +#define UE_PARENS () // helper + +// ──────────────────────────────────────────────────────────────────────────── +// 1. FOR_EACH_2 that also carries Enum-token and Field-token +// M(EnumTok, FieldTok, TagTok, TypeTok) +// ──────────────────────────────────────────────────────────────────────────── +#define UE_FOR_EACH_PAIR(M, EnumTok, FieldTok, ...) \ + __VA_OPT__(UE_EVAL(UE_FOR_EACH_HELPER(M, EnumTok, FieldTok, __VA_ARGS__))) + +#define UE_FOR_EACH_HELPER(M, EnumTok, FieldTok, Tag, Type, ...) \ + M(EnumTok, FieldTok, Tag, Type) \ + __VA_OPT__(UE_FOR_EACH_AGAIN UE_PARENS (M, EnumTok, FieldTok, __VA_ARGS__)) + +#define UE_FOR_EACH_AGAIN() UE_FOR_EACH_HELPER + +// ──────────────────────────────────────────────────────────────────────────── +// 2. Emitters for a single (Tag,Type) pair +// ──────────────────────────────────────────────────────────────────────────── +#define UE_WRITE_CASE(EnumTok, FieldTok, TagTok, TypeTok) \ + case EnumTok::TagTok: \ + serialize(w, *v.FieldTok.GetPtr()); \ + break; + +#define UE_READ_CASE(EnumTok, FieldTok, TagTok, TypeTok) \ + case EnumTok::TagTok: { \ + auto tmp = deserialize(r); \ + obj->FieldTok.InitializeAs(tmp); \ + break; } + +// ──────────────────────────────────────────────────────────────────────────── +// 3. Master macro +// ──────────────────────────────────────────────────────────────────────────── +#define UE_SPACETIMEDB_TAGGED_VARIANT(Class, Enum, Field, ...) \ + /* ---- serialize ---------------------------------------------------- */ \ + template<> inline void serialize( \ + UEWriter& w, const Class& v) \ + { \ + w.write_u8(static_cast(v.Tag)); \ + switch (v.Tag) \ + { \ + UE_FOR_EACH_PAIR(UE_WRITE_CASE, Enum, Field, __VA_ARGS__) \ + default: ensureMsgf(false, TEXT("Unknown tag")); \ + } \ + } \ + /* ---- deserialize -------------------------------------------------- */ \ + template<> inline TObjectPtr \ + deserialize>(UEReader& r) \ + { \ + const auto Tag = static_cast(r.read_u8()); \ + Class* obj = NewObject(); \ + obj->Tag = Tag; \ + switch (Tag) \ + { \ + UE_FOR_EACH_PAIR(UE_READ_CASE, Enum, Field, __VA_ARGS__) \ + default: \ + ensureMsgf(false, TEXT("Unknown tag in %s"), TEXT(#Class)); \ + return nullptr; \ + } \ + return obj; \ + } + + +// ============================================================================= +// Struct Serialization Macro +// ============================================================================= + +/** + * @defgroup StructMacros Struct Serialization Macros + * @brief Macros for enabling serialization of custom structs + * @{ + */ + + /** + * @brief Enable BSATN serialization for a custom struct + * + * This macro generates serialize() and deserialize() functions for a struct + * by serializing each field in order. + * + * @param StructName The name of the struct + * @param ... Comma-separated list of field names (up to 10 fields) + * + * Example usage: + * @code + * struct FMyStruct { + * FString Name; + * int32 Value; + * FVector Position; + * }; + * + * // Enable serialization (place in UE::SpacetimeDB namespace) + * namespace UE::SpacetimeDB { + * UE_SPACETIMEDB_STRUCT(FMyStruct, Name, Value, Position) + * } + * @endcode + * + * @note Fields are serialized in the order specified + * @note The struct must have a default constructor + */ +#define UE_SPACETIMEDB_STRUCT(StructName, ...) \ + template<> inline void serialize(UEWriter& w, const StructName& value) { \ + UE_SPACETIMEDB_SERIALIZE_FIELDS(w, value, __VA_ARGS__) \ + } \ + template<> inline StructName deserialize(UEReader& r) { \ + StructName result; \ + UE_SPACETIMEDB_DESERIALIZE_FIELDS(r, result, __VA_ARGS__) \ + return result; \ + } + + // ----------------------------------------------------------------------------- + // Internal Helper Macros - Not for Direct Use + // ----------------------------------------------------------------------------- + + /** @cond INTERNAL */ + + // Field serialization/deserialization macros +#define UE_SPACETIMEDB_SERIALIZE_FIELD(obj, writer, field) \ + serialize(writer, obj.field); + +#define UE_SPACETIMEDB_DESERIALIZE_FIELD(obj, reader, field) \ + obj.field = deserialize(reader); + +// Expand macros for each field +#define UE_SPACETIMEDB_SERIALIZE_FIELDS(writer, obj, ...) \ + UE_SPACETIMEDB_FOR_EACH_ARG(UE_SPACETIMEDB_SERIALIZE_FIELD, obj, writer, __VA_ARGS__) + +#define UE_SPACETIMEDB_DESERIALIZE_FIELDS(reader, obj, ...) \ + UE_SPACETIMEDB_FOR_EACH_ARG(UE_SPACETIMEDB_DESERIALIZE_FIELD, obj, reader, __VA_ARGS__) + +// Macro utilities for variadic expansion (supports up to 10 fields) +#define UE_SPACETIMEDB_GET_MACRO( \ + _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, \ + _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, NAME, ...) NAME + + +#define UE_SPACETIMEDB_FOR_EACH_ARG(MACRO, obj, extra, ...) \ + UE_SPACETIMEDB_GET_MACRO(__VA_ARGS__, \ + UE_SPACETIMEDB_FE_30, UE_SPACETIMEDB_FE_29, UE_SPACETIMEDB_FE_28, UE_SPACETIMEDB_FE_27, UE_SPACETIMEDB_FE_26, \ + UE_SPACETIMEDB_FE_25, UE_SPACETIMEDB_FE_24, UE_SPACETIMEDB_FE_23, UE_SPACETIMEDB_FE_22, UE_SPACETIMEDB_FE_21, \ + UE_SPACETIMEDB_FE_20, UE_SPACETIMEDB_FE_19, UE_SPACETIMEDB_FE_18, UE_SPACETIMEDB_FE_17, UE_SPACETIMEDB_FE_16, \ + UE_SPACETIMEDB_FE_15, UE_SPACETIMEDB_FE_14, UE_SPACETIMEDB_FE_13, UE_SPACETIMEDB_FE_12, UE_SPACETIMEDB_FE_11, \ + UE_SPACETIMEDB_FE_10, UE_SPACETIMEDB_FE_9, UE_SPACETIMEDB_FE_8, UE_SPACETIMEDB_FE_7, UE_SPACETIMEDB_FE_6, \ + UE_SPACETIMEDB_FE_5, UE_SPACETIMEDB_FE_4, UE_SPACETIMEDB_FE_3, UE_SPACETIMEDB_FE_2, UE_SPACETIMEDB_FE_1) \ + (MACRO, obj, extra, __VA_ARGS__) + + +// Field expansion macros (1-30 fields) +#define UE_SPACETIMEDB_FE_1(MACRO, obj, extra, X) MACRO(obj, extra, X) +#define UE_SPACETIMEDB_FE_2(MACRO, obj, extra, X, ...) MACRO(obj, extra, X) UE_SPACETIMEDB_FE_1(MACRO, obj, extra, __VA_ARGS__) +#define UE_SPACETIMEDB_FE_3(MACRO, obj, extra, X, ...) MACRO(obj, extra, X) UE_SPACETIMEDB_FE_2(MACRO, obj, extra, __VA_ARGS__) +#define UE_SPACETIMEDB_FE_4(MACRO, obj, extra, X, ...) MACRO(obj, extra, X) UE_SPACETIMEDB_FE_3(MACRO, obj, extra, __VA_ARGS__) +#define UE_SPACETIMEDB_FE_5(MACRO, obj, extra, X, ...) MACRO(obj, extra, X) UE_SPACETIMEDB_FE_4(MACRO, obj, extra, __VA_ARGS__) +#define UE_SPACETIMEDB_FE_6(MACRO, obj, extra, X, ...) MACRO(obj, extra, X) UE_SPACETIMEDB_FE_5(MACRO, obj, extra, __VA_ARGS__) +#define UE_SPACETIMEDB_FE_7(MACRO, obj, extra, X, ...) MACRO(obj, extra, X) UE_SPACETIMEDB_FE_6(MACRO, obj, extra, __VA_ARGS__) +#define UE_SPACETIMEDB_FE_8(MACRO, obj, extra, X, ...) MACRO(obj, extra, X) UE_SPACETIMEDB_FE_7(MACRO, obj, extra, __VA_ARGS__) +#define UE_SPACETIMEDB_FE_9(MACRO, obj, extra, X, ...) MACRO(obj, extra, X) UE_SPACETIMEDB_FE_8(MACRO, obj, extra, __VA_ARGS__) +#define UE_SPACETIMEDB_FE_10(MACRO, obj, extra, X, ...) MACRO(obj, extra, X) UE_SPACETIMEDB_FE_9(MACRO, obj, extra, __VA_ARGS__) +#define UE_SPACETIMEDB_FE_11(MACRO, obj, extra, X, ...) MACRO(obj, extra, X) UE_SPACETIMEDB_FE_10(MACRO, obj, extra, __VA_ARGS__) +#define UE_SPACETIMEDB_FE_12(MACRO, obj, extra, X, ...) MACRO(obj, extra, X) UE_SPACETIMEDB_FE_11(MACRO, obj, extra, __VA_ARGS__) +#define UE_SPACETIMEDB_FE_13(MACRO, obj, extra, X, ...) MACRO(obj, extra, X) UE_SPACETIMEDB_FE_12(MACRO, obj, extra, __VA_ARGS__) +#define UE_SPACETIMEDB_FE_14(MACRO, obj, extra, X, ...) MACRO(obj, extra, X) UE_SPACETIMEDB_FE_13(MACRO, obj, extra, __VA_ARGS__) +#define UE_SPACETIMEDB_FE_15(MACRO, obj, extra, X, ...) MACRO(obj, extra, X) UE_SPACETIMEDB_FE_14(MACRO, obj, extra, __VA_ARGS__) +#define UE_SPACETIMEDB_FE_16(MACRO, obj, extra, X, ...) MACRO(obj, extra, X) UE_SPACETIMEDB_FE_15(MACRO, obj, extra, __VA_ARGS__) +#define UE_SPACETIMEDB_FE_17(MACRO, obj, extra, X, ...) MACRO(obj, extra, X) UE_SPACETIMEDB_FE_16(MACRO, obj, extra, __VA_ARGS__) +#define UE_SPACETIMEDB_FE_18(MACRO, obj, extra, X, ...) MACRO(obj, extra, X) UE_SPACETIMEDB_FE_17(MACRO, obj, extra, __VA_ARGS__) +#define UE_SPACETIMEDB_FE_19(MACRO, obj, extra, X, ...) MACRO(obj, extra, X) UE_SPACETIMEDB_FE_18(MACRO, obj, extra, __VA_ARGS__) +#define UE_SPACETIMEDB_FE_20(MACRO, obj, extra, X, ...) MACRO(obj, extra, X) UE_SPACETIMEDB_FE_19(MACRO, obj, extra, __VA_ARGS__) +#define UE_SPACETIMEDB_FE_21(MACRO, obj, extra, X, ...) MACRO(obj, extra, X) UE_SPACETIMEDB_FE_20(MACRO, obj, extra, __VA_ARGS__) +#define UE_SPACETIMEDB_FE_22(MACRO, obj, extra, X, ...) MACRO(obj, extra, X) UE_SPACETIMEDB_FE_21(MACRO, obj, extra, __VA_ARGS__) +#define UE_SPACETIMEDB_FE_23(MACRO, obj, extra, X, ...) MACRO(obj, extra, X) UE_SPACETIMEDB_FE_22(MACRO, obj, extra, __VA_ARGS__) +#define UE_SPACETIMEDB_FE_24(MACRO, obj, extra, X, ...) MACRO(obj, extra, X) UE_SPACETIMEDB_FE_23(MACRO, obj, extra, __VA_ARGS__) +#define UE_SPACETIMEDB_FE_25(MACRO, obj, extra, X, ...) MACRO(obj, extra, X) UE_SPACETIMEDB_FE_24(MACRO, obj, extra, __VA_ARGS__) +#define UE_SPACETIMEDB_FE_26(MACRO, obj, extra, X, ...) MACRO(obj, extra, X) UE_SPACETIMEDB_FE_25(MACRO, obj, extra, __VA_ARGS__) +#define UE_SPACETIMEDB_FE_27(MACRO, obj, extra, X, ...) MACRO(obj, extra, X) UE_SPACETIMEDB_FE_26(MACRO, obj, extra, __VA_ARGS__) +#define UE_SPACETIMEDB_FE_28(MACRO, obj, extra, X, ...) MACRO(obj, extra, X) UE_SPACETIMEDB_FE_27(MACRO, obj, extra, __VA_ARGS__) +#define UE_SPACETIMEDB_FE_29(MACRO, obj, extra, X, ...) MACRO(obj, extra, X) UE_SPACETIMEDB_FE_28(MACRO, obj, extra, __VA_ARGS__) +#define UE_SPACETIMEDB_FE_30(MACRO, obj, extra, X, ...) MACRO(obj, extra, X) UE_SPACETIMEDB_FE_29(MACRO, obj, extra, __VA_ARGS__) + +/** @endcond */ // end of INTERNAL + +// ============================================================================= +// Empty Struct Serialization Macro +// ============================================================================= + +/** + * @cond EmptyStructMacros Empty-Struct Serialization Macros + * @brief Helpers for treating UE structs with **no data members** as + * 0-byte “unit” types in BSATN. + * @{ + */ + + /** + * @brief Enable BSATN serialization for an *empty* struct. + * + * Expands to **no-op** `serialize` / `deserialize` specializations, so the + * struct neither writes nor reads any bytes. + * + * @param StructName The struct type to register. + * + * ### Example + * ```cpp + * USTRUCT(BlueprintType) + * struct FIdentityConnectedArgs + * { + * GENERATED_BODY() + * }; + * + * namespace UE::SpacetimeDB + * { + * UE_SPACETIMEDB_STRUCT_EMPTY(FIdentityConnectedArgs) + * } + * ``` + */ +#define UE_SPACETIMEDB_STRUCT_EMPTY(StructName) \ + template<> inline void serialize(UEWriter&, \ + const StructName&) \ + { /* intentionally empty */ } \ + \ + template<> inline StructName deserialize(UEReader&) \ + { return StructName(); } + + /** @endcond */ // EmptyStructMacros + +/** @} */ // end of StructMacros group + +// ============================================================================= +// Enum Serialization Macro +// ============================================================================= + +/** + * @defgroup EnumMacros Enum Serialization Macros + * @brief Macros for enabling serialization of enum types + * @{ + */ + + /** + * @brief Enable BSATN serialization for an enum type + * + * This macro generates a deserialize specialization for enum types. + * The serialize function is already handled by the generic template. + * + * @param EnumType The enum type to enable serialization for + * + * Example usage: + * @code + * enum class EGameState : uint8_t { + * Lobby = 0, + * InGame = 1, + * GameOver = 2 + * }; + * + * // Enable serialization + * namespace UE::SpacetimeDB { + * UE_SPACETIMEDB_ENUM(EGameState) + * } + * @endcode + */ +#define UE_SPACETIMEDB_ENUM(EnumType) \ + template<> inline EnumType deserialize(UEReader& r) { \ + return deserialize_enum(r); \ + } + + /** @} */ // end of EnumMacros group + + // ============================================================================= + // Common Container Specializations + // ============================================================================= + + /** + * @defgroup CommonSpecializations Common Container Specializations + * @brief Pre-defined specializations for frequently used container types + * @{ + */ + + // String containers + UE_SPACETIMEDB_ENABLE_TARRAY(FString) + UE_SPACETIMEDB_ENABLE_TARRAY(FName) + // Primitive containers + UE_SPACETIMEDB_ENABLE_TARRAY(int8) + UE_SPACETIMEDB_ENABLE_TARRAY(uint8) + UE_SPACETIMEDB_ENABLE_TARRAY(int16) + UE_SPACETIMEDB_ENABLE_TARRAY(uint16) + UE_SPACETIMEDB_ENABLE_TARRAY(int32) + UE_SPACETIMEDB_ENABLE_TARRAY(uint32) + UE_SPACETIMEDB_ENABLE_TARRAY(int64) + UE_SPACETIMEDB_ENABLE_TARRAY(uint64) + + UE_SPACETIMEDB_ENABLE_TARRAY(float) + UE_SPACETIMEDB_ENABLE_TARRAY(double) + + UE_SPACETIMEDB_ENABLE_TARRAY(bool) + + // Large integer type containers + UE_SPACETIMEDB_ENABLE_TARRAY(FSpacetimeDBUInt128) + UE_SPACETIMEDB_ENABLE_TARRAY(FSpacetimeDBUInt256) + UE_SPACETIMEDB_ENABLE_TARRAY(FSpacetimeDBInt128) + UE_SPACETIMEDB_ENABLE_TARRAY(FSpacetimeDBInt256) + + + /** @} */ // end of CommonSpecializations group + +} // namespace UE::SpacetimeDB \ No newline at end of file diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/UNREAL_BSATN_ADDITIONS.md b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/UNREAL_BSATN_ADDITIONS.md new file mode 100644 index 00000000000..403727eba29 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/BSATN/UNREAL_BSATN_ADDITIONS.md @@ -0,0 +1,24 @@ +# Unreal Engine BSATN Client Additions + +Additional helpers extend the core BSATN library so the Unreal client can +serialize every data type used by SpacetimeDB. + +## Special Types + +- `Identity`, `ConnectionId`, `Timestamp` and `TimeDuration` +- 128 bit and 256 bit integer wrappers + +## Sum Types and Enums + +- `TSumType` template for discriminated unions +- `UE_SPACETIMEDB_ENUM` macro for enum serialization + +## Container Support + +- Arrays and optionals of the above types + +## Implementation Notes + +- No runtime type registration is required +- Binary layout matches the server implementation +- All multi-byte values use little-endian encoding \ No newline at end of file diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/Connection/Callback.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/Connection/Callback.h new file mode 100644 index 00000000000..40d003211ed --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/Connection/Callback.h @@ -0,0 +1,457 @@ +#pragma once + +#include "CoreMinimal.h" +#include "ModuleBindings/Types/ServerMessageType.g.h" +#include "ModuleBindings/Types/TransactionUpdateType.g.h" +#include "ModuleBindings/Types/ReducerCallInfoType.g.h" +#include "ModuleBindings/Types/UpdateStatusType.g.h" +#include "ModuleBindings/Types/EnergyQuantaType.g.h" +#include "Types/Builtins.h" +#include "Types/UnitType.h" + +#include "Callback.generated.h" + +/** + * Types and helper utilities used by connection callbacks. + */ + + +//Forward declare +class UDbConnectionBase; + + +/** Termination status for a reducer event. */ +UENUM(BlueprintType) +enum class ESpacetimeDBStatusTag : uint8 +{ + /** Reducer committed successfully */ + Committed, + /** Reducer execution failed */ + Failed, + /** Reducer aborted due to energy limits */ + OutOfEnergy +}; + +USTRUCT(BlueprintType) +struct SPACETIMEDBSDK_API FSpacetimeDBStatus +{ + GENERATED_BODY() + +public: + FSpacetimeDBStatus() = default; + + // NOTE: order matches ESpacetimeDBStatusTag: Committed, Failed, OutOfEnergy + // Payloads: + // Committed -> FSpacetimeDBUnit + // Failed -> FString + // OutOfEnergy -> FSpacetimeDBUnit + TVariant MessageData; + + UPROPERTY(BlueprintReadOnly) + ESpacetimeDBStatusTag Tag = ESpacetimeDBStatusTag::Committed; + + // -- Static constructors ---------------------- + static FSpacetimeDBStatus Committed( const FSpacetimeDBUnit& SpacetimeDBUnit) + { + FSpacetimeDBStatus Obj; + Obj.Tag = ESpacetimeDBStatusTag::Committed; + Obj.MessageData.Set(SpacetimeDBUnit); + return Obj; + } + + static FSpacetimeDBStatus Failed(const FString& Error) + { + FSpacetimeDBStatus Obj; + Obj.Tag = ESpacetimeDBStatusTag::Failed; + Obj.MessageData.Set(Error); + return Obj; + } + + static FSpacetimeDBStatus OutOfEnergy(const FSpacetimeDBUnit& Value) + { + FSpacetimeDBStatus Obj; + Obj.Tag = ESpacetimeDBStatusTag::OutOfEnergy; + Obj.MessageData.Set(Value); + return Obj; + } + + // -- Query helpers ---------------------- + FORCEINLINE bool IsCommitted() const { return Tag == ESpacetimeDBStatusTag::Committed; } + FORCEINLINE bool IsFailed() const { return Tag == ESpacetimeDBStatusTag::Failed; } + FORCEINLINE bool IsOutOfEnergy() const { return Tag == ESpacetimeDBStatusTag::OutOfEnergy; } + + FORCEINLINE FSpacetimeDBUnit GetAsCommitted() const + { + ensureMsgf(IsCommitted(), TEXT("MessageData does not hold Committed!")); + return MessageData.Get(); + } + + FORCEINLINE FString GetAsFailed() const + { + ensureMsgf(IsFailed(), TEXT("MessageData does not hold Failed!")); + return MessageData.Get(); + } + + FORCEINLINE FSpacetimeDBUnit GetAsOutOfEnergy() const + { + ensureMsgf(IsOutOfEnergy(), TEXT("MessageData does not hold OutOfEnergy!")); + return MessageData.Get(); + } + + // -- Equality ---------------------- + FORCEINLINE bool operator==(const FSpacetimeDBStatus& Other) const + { + if (Tag != Other.Tag) return false; + + switch (Tag) + { + case ESpacetimeDBStatusTag::Committed: + return GetAsCommitted() == Other.GetAsCommitted(); + case ESpacetimeDBStatusTag::Failed: + return GetAsFailed() == Other.GetAsFailed(); + case ESpacetimeDBStatusTag::OutOfEnergy: + return GetAsOutOfEnergy() == Other.GetAsOutOfEnergy(); + default: + return false; + } + } + FORCEINLINE bool operator!=(const FSpacetimeDBStatus& Other) const { return !(*this == Other); } +}; + +FORCEINLINE uint32 GetTypeHash(const FSpacetimeDBStatus& Status) +{ + const uint32 TagHash = ::GetTypeHash(static_cast(Status.Tag)); + + switch (Status.Tag) + { + case ESpacetimeDBStatusTag::Committed: + return HashCombine(TagHash, ::GetTypeHash(Status.GetAsCommitted())); + case ESpacetimeDBStatusTag::Failed: + return HashCombine(TagHash, GetTypeHash(Status.GetAsFailed())); + case ESpacetimeDBStatusTag::OutOfEnergy: + return HashCombine(TagHash, ::GetTypeHash(Status.GetAsOutOfEnergy())); + default: + return TagHash; + } +} + +UCLASS() +class SPACETIMEDBSDK_API USpacetimeDBStatusBpLib : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() + +public: + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|SpacetimeDBStatus") + static FSpacetimeDBStatus Committed(const FSpacetimeDBUnit& InValue) + { + return FSpacetimeDBStatus::Committed(InValue); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|SpacetimeDBStatus") + static FSpacetimeDBStatus Failed(const FString& InValue) + { + return FSpacetimeDBStatus::Failed(InValue); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|SpacetimeDBStatus") + static FSpacetimeDBStatus OutOfEnergy(const FSpacetimeDBUnit& InValue) + { + return FSpacetimeDBStatus::OutOfEnergy(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|SpacetimeDBStatus") + static bool IsCommitted(const FSpacetimeDBStatus& Status) { return Status.IsCommitted(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|SpacetimeDBStatus") + static bool IsFailed(const FSpacetimeDBStatus& Status) { return Status.IsFailed(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|SpacetimeDBStatus") + static bool IsOutOfEnergy(const FSpacetimeDBStatus& Status) { return Status.IsOutOfEnergy(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|SpacetimeDBStatus") + static FSpacetimeDBUnit GetAsCommitted(const FSpacetimeDBStatus& Status) + { + return Status.GetAsCommitted(); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|SpacetimeDBStatus") + static FString GetAsFailed(const FSpacetimeDBStatus& Status) + { + return Status.GetAsFailed(); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|SpacetimeDBStatus") + static FSpacetimeDBUnit GetAsOutOfEnergy(const FSpacetimeDBStatus& Status) + { + return Status.GetAsOutOfEnergy(); + } +}; + + +/** Metadata describing a reducer run. */ +USTRUCT(BlueprintType) +struct SPACETIMEDBSDK_API FReducerEvent +{ + GENERATED_BODY() + + /** Timestamp for when the reducer executed */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBTimestamp Timestamp; + + /** Result status of the reducer */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBStatus Status; + + /** Identity that initiated the call */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBIdentity CallerIdentity; + + /** Connection ID for the caller */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBConnectionId CallerConnectionId; + + /** Energy consumed while executing */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FEnergyQuantaType EnergyConsumed; + + /** Detailed call information */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FReducerCallInfoType ReducerCall; + + FORCEINLINE bool operator==(const FReducerEvent& Other) const + { + return Status == Other.Status && Timestamp == Other.Timestamp && CallerIdentity == Other.CallerIdentity && + CallerConnectionId == Other.CallerConnectionId && EnergyConsumed == Other.EnergyConsumed && + ReducerCall == Other.ReducerCall; + } + FORCEINLINE bool operator!=(const FReducerEvent& Other) const + { + return !(*this == Other); + } +}; + +FORCEINLINE uint32 GetTypeHash(const FReducerEvent& ReducerEvent) +{ + uint32 Hash = GetTypeHash(ReducerEvent.Status); + Hash = HashCombine(Hash, GetTypeHash(ReducerEvent.Timestamp)); + Hash = HashCombine(Hash, GetTypeHash(ReducerEvent.CallerIdentity)); + Hash = HashCombine(Hash, GetTypeHash(ReducerEvent.CallerConnectionId)); + Hash = HashCombine(Hash, GetTypeHash(ReducerEvent.EnergyConsumed)); + Hash = HashCombine(Hash, GetTypeHash(ReducerEvent.ReducerCall)); + return Hash; +} + +/** High level event description used in callback contexts. */ +UENUM(BlueprintType) +enum class ESpacetimeDBEventTag : uint8 +{ + /** A reducer event */ + Reducer, + /** Subscription applied */ + SubscribeApplied, + /** Subscription removed */ + UnsubscribeApplied, + /** Connection lost */ + Disconnected, + /** Subscription error */ + SubscribeError, + /** Unknown transaction type */ + UnknownTransaction +}; + +USTRUCT(BlueprintType) +struct SPACETIMEDBSDK_API FSpacetimeDBEvent +{ + GENERATED_BODY() + +public: + FSpacetimeDBEvent() = default; + + TVariant< + FReducerEvent, // Reducer + FSpacetimeDBUnit, // SubscribeApplied, UnsubscribeApplied, Disconnected, UnknownTransaction + FString // SubscribeError + > MessageData; + + UPROPERTY(BlueprintReadOnly) + ESpacetimeDBEventTag Tag = ESpacetimeDBEventTag::UnknownTransaction; + + // Static factory methods + static FSpacetimeDBEvent Reducer(const FReducerEvent& Value) + { + FSpacetimeDBEvent Obj; + Obj.Tag = ESpacetimeDBEventTag::Reducer; + Obj.MessageData.Set(Value); + return Obj; + } + + static FSpacetimeDBEvent SubscribeApplied(const FSpacetimeDBUnit& Value) + { + FSpacetimeDBEvent Obj; + Obj.Tag = ESpacetimeDBEventTag::SubscribeApplied; + Obj.MessageData.Set(Value); + return Obj; + } + + static FSpacetimeDBEvent UnsubscribeApplied(const FSpacetimeDBUnit& Value) + { + FSpacetimeDBEvent Obj; + Obj.Tag = ESpacetimeDBEventTag::UnsubscribeApplied; + Obj.MessageData.Set(Value); + return Obj; + } + + static FSpacetimeDBEvent Disconnected(const FSpacetimeDBUnit& Value) + { + FSpacetimeDBEvent Obj; + Obj.Tag = ESpacetimeDBEventTag::Disconnected; + Obj.MessageData.Set(Value); + return Obj; + } + + static FSpacetimeDBEvent SubscribeError(const FString& InError) + { + FSpacetimeDBEvent Obj; + Obj.Tag = ESpacetimeDBEventTag::SubscribeError; + Obj.MessageData.Set(InError); + return Obj; + } + + static FSpacetimeDBEvent UnknownTransaction(const FSpacetimeDBUnit& Value) + { + FSpacetimeDBEvent Obj; + Obj.Tag = ESpacetimeDBEventTag::UnknownTransaction; + Obj.MessageData.Set(Value); + return Obj; + } + + // Tag checks + GetAs methods + FORCEINLINE bool IsReducer() const { return Tag == ESpacetimeDBEventTag::Reducer; } + FORCEINLINE FReducerEvent GetAsReducer() const + { + ensureMsgf(IsReducer(), TEXT("MessageData does not hold Reducer!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsSubscribeApplied() const { return Tag == ESpacetimeDBEventTag::SubscribeApplied; } + FORCEINLINE FSpacetimeDBUnit GetAsSubscribeApplied() const + { + ensureMsgf(IsSubscribeApplied(), TEXT("MessageData does not hold SubscribeApplied!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsUnsubscribeApplied() const { return Tag == ESpacetimeDBEventTag::UnsubscribeApplied; } + FORCEINLINE FSpacetimeDBUnit GetAsUnsubscribeApplied() const + { + ensureMsgf(IsUnsubscribeApplied(), TEXT("MessageData does not hold UnsubscribeApplied!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsDisconnected() const { return Tag == ESpacetimeDBEventTag::Disconnected; } + FORCEINLINE FSpacetimeDBUnit GetAsDisconnected() const + { + ensureMsgf(IsDisconnected(), TEXT("MessageData does not hold Disconnected!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsSubscribeError() const { return Tag == ESpacetimeDBEventTag::SubscribeError; } + FORCEINLINE FString GetAsSubscribeError() const + { + ensureMsgf(IsSubscribeError(), TEXT("MessageData does not hold SubscribeError!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsUnknownTransaction() const { return Tag == ESpacetimeDBEventTag::UnknownTransaction; } + FORCEINLINE FSpacetimeDBUnit GetAsUnknownTransaction() const + { + ensureMsgf(IsUnknownTransaction(), TEXT("MessageData does not hold UnknownTransaction!")); + return MessageData.Get(); + } + + // Equality operators + FORCEINLINE bool operator==(const FSpacetimeDBEvent& Other) const + { + if (Tag != Other.Tag) return false; + + switch (Tag) + { + case ESpacetimeDBEventTag::Reducer: + return GetAsReducer() == Other.GetAsReducer(); + case ESpacetimeDBEventTag::SubscribeApplied: + return GetAsSubscribeApplied() == Other.GetAsSubscribeApplied(); + case ESpacetimeDBEventTag::UnsubscribeApplied: + return GetAsUnsubscribeApplied() == Other.GetAsUnsubscribeApplied(); + case ESpacetimeDBEventTag::Disconnected: + return GetAsDisconnected() == Other.GetAsDisconnected(); + case ESpacetimeDBEventTag::SubscribeError: + return GetAsSubscribeError() == Other.GetAsSubscribeError(); + case ESpacetimeDBEventTag::UnknownTransaction: + return GetAsUnknownTransaction() == Other.GetAsUnknownTransaction(); + default: + return false; + } + } + + FORCEINLINE bool operator!=(const FSpacetimeDBEvent& Other) const + { + return !(*this == Other); + } +}; + +// Hash function +FORCEINLINE uint32 GetTypeHash(const FSpacetimeDBEvent& Event) +{ + const uint32 TagHash = GetTypeHash(static_cast(Event.Tag)); + switch (Event.Tag) + { + case ESpacetimeDBEventTag::Reducer: return HashCombine(TagHash, ::GetTypeHash(Event.GetAsReducer())); + case ESpacetimeDBEventTag::SubscribeApplied: return HashCombine(TagHash, ::GetTypeHash(Event.GetAsSubscribeApplied())); + case ESpacetimeDBEventTag::UnsubscribeApplied: return HashCombine(TagHash, ::GetTypeHash(Event.GetAsUnsubscribeApplied())); + case ESpacetimeDBEventTag::Disconnected: return HashCombine(TagHash, ::GetTypeHash(Event.GetAsDisconnected())); + case ESpacetimeDBEventTag::SubscribeError: return HashCombine(TagHash, GetTypeHash(Event.GetAsSubscribeError())); + case ESpacetimeDBEventTag::UnknownTransaction: return HashCombine(TagHash, ::GetTypeHash(Event.GetAsUnknownTransaction())); + default: return TagHash; + } +} + +/** + * Context passed to callbacks triggered by SpacetimeDB events. + * Contains a pointer back to the connection that produced the event + * and the raw server message that caused the callback. + */ +USTRUCT(BlueprintType) +struct SPACETIMEDBSDK_API FEventContextBase +{ + GENERATED_BODY() + + /** Description of the event that triggered this callback */ + UPROPERTY(BlueprintReadOnly, Category = "SpacetimeDB") + FSpacetimeDBEvent Event; +}; + + +/** + * Context used for subscription lifecycle callbacks (apply/unapply). + */ +USTRUCT(BlueprintType) +struct SPACETIMEDBSDK_API FSubscriptionEventContextBase +{ + GENERATED_BODY() + + /** Description of the subscription event */ + UPROPERTY(BlueprintReadOnly, Category = "SpacetimeDB") + FSpacetimeDBEvent Event; +}; + +/** + * Context used when reporting errors back to user callbacks. + */ +USTRUCT(BlueprintType) +struct SPACETIMEDBSDK_API FErrorContextBase +{ + GENERATED_BODY() + + /** Text describing the error */ + UPROPERTY(BlueprintReadOnly, Category = "SpacetimeDB") + FString Error; +}; \ No newline at end of file diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/Connection/Credentials.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/Connection/Credentials.h new file mode 100644 index 00000000000..9dfb4df7bc3 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/Connection/Credentials.h @@ -0,0 +1,42 @@ +#pragma once + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "Credentials.generated.h" + +//@TODO: Implement version where multiple tokens can be stored, e.g. for testing multiple play sesstions on same unreal instance. + + +/** + * Credentials class for managing authentication tokens in SpacetimeDB. + * This class provides methods to initialize the credential system, load a token, + * and save a token using Unreal Engine's Blueprint system. + */ +UCLASS() +class SPACETIMEDBSDK_API UCredentials : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() + +public: + /** + * Initialize the credential system. InFilename mimics the C# API but is + * used as a key within the config file rather than an actual filename. + */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Credentials") + static void Init(const FString& InFilename); + + /** Load a previously stored token. */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Credentials") + static FString LoadToken(); + + /** Persist a token for later retrieval. */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Credentials") + static void SaveToken(const FString& InToken); + + /** Currently loaded authentication token */ + static FString Token; + +private: + /** Key used when storing the token via the config system */ + static FString StoredKey; +}; diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/Connection/DbConnectionBase.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/Connection/DbConnectionBase.h new file mode 100644 index 00000000000..3259e8bea1f --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/Connection/DbConnectionBase.h @@ -0,0 +1,384 @@ +#pragma once + +#include "CoreMinimal.h" +#include "UObject/NoExportTypes.h" +#include "Types/Builtins.h" +#include "Websocket.h" +#include "Subscription.h" +#include "ModuleBindings/Types/ServerMessageType.g.h" +#include "DBCache/TableAppliedDiff.h" +#include "HAL/CriticalSection.h" +#include "Containers/Queue.h" +#include "HAL/ThreadSafeBool.h" +#include "BSATN/UEBSATNHelpers.h" +#include "Connection/SetReducerFlags.h" +#include "Connection/Callback.h" + +#include "DbConnectionBase.generated.h" + + + +class UDbConnectionBuilder; + +/** Macro for safae way to bind delegate without needing to write Function name as an FName. */ +#define BIND_DELEGATE_SAFE(DelegateVar, Object, ClassType, FunctionName) \ + DelegateVar.BindUFunction(Object, GET_FUNCTION_NAME_CHECKED(ClassType, FunctionName)) + +/** Macro for safe way to unbind delegate without needing to write Function name as an FName. */ +#define UNBIND_DELEGATE_SAFE(DelegateVar, Object, ClassType, FunctionName) \ + DelegateVar.Remove(Object, GET_FUNCTION_NAME_CHECKED(ClassType, FunctionName)) + +/** Delegate called when the connection attempt fails. */ +DECLARE_DYNAMIC_DELEGATE_OneParam( + FOnConnectErrorDelegate, + const FString&, ErrorMessage); + +/** Called when a connection is established. */ +DECLARE_DYNAMIC_DELEGATE_ThreeParams( + FOnConnectBaseDelegate, + UDbConnectionBase*, Connection, + FSpacetimeDBIdentity, Identity, + const FString&, Token); + +/** Called when a connection closes. */ +DECLARE_DYNAMIC_DELEGATE_TwoParams( + FOnDisconnectBaseDelegate, + UDbConnectionBase*, Connection, + const FString&, Error); + + +/** Key used to index preprocessed table data without relying on row addresses */ +struct FPreprocessedTableKey +{ + uint32 TableId; + FString TableName; + + FPreprocessedTableKey() : TableId(0) {} + FPreprocessedTableKey(uint32 InId, const FString& InName) + : TableId(InId), TableName(InName) { + } + + friend bool operator==(const FPreprocessedTableKey& A, const FPreprocessedTableKey& B) + { + return A.TableId == B.TableId && A.TableName == B.TableName; + } +}; + +FORCEINLINE uint32 GetTypeHash(const FPreprocessedTableKey& Key) +{ + return HashCombine(GetTypeHash(Key.TableId), GetTypeHash(Key.TableName)); +} + +UCLASS() +class SPACETIMEDBSDK_API UDbConnectionBase : public UObject, public FTickableGameObject +{ + GENERATED_BODY() + +public: + + /** The default constructor is private to prevent instantiation without using the builder. */ + explicit UDbConnectionBase(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get()); + + /** Disconnect from the server. */ + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void Disconnect(); + + /** Check if the underlying WebSocket is connected. */ + UFUNCTION(BlueprintPure, Category="SpacetimeDB") + bool IsActive() const; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void FrameTick(); + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void SetAutoTicking(bool bAutoTick) { bIsAutoTicking = bAutoTick; } + + /** Send a raw JSON message to the server. */ + bool SendRawMessage(const FString& Message); + /** Send a raw binary message to the server. */ + bool SendRawMessage(const TArray& Message); + + /** Get the current subscription builder. This is used to create subscriptions. */ + UFUNCTION() + USubscriptionBuilderBase* SubscriptionBuilderBase(); + + /** Get the current identity of the SpacetimeDB instance. This is used to identify the connection. */ + UFUNCTION(BlueprintPure, Category = "SpacetimeDB") + bool TryGetIdentity(FSpacetimeDBIdentity& OutIdentity) const; + + /** Get the current connection id. This is used to identify the connection. */ + UFUNCTION(BlueprintPure, Category = "SpacetimeDB") + FSpacetimeDBConnectionId GetConnectionId() const; + + // Typed reducer call helper: hides BSATN bytes from callers. + template + void CallReducerTyped(const FString& Reducer, const ArgsStruct& Args, USetReducerFlagsBase* Flags) + { + TArray Bytes = UE::SpacetimeDB::Serialize(Args); + InternalCallReducer(Reducer, MoveTemp(Bytes), Flags); + } + + template + void RegisterTable(const FString& TableName) + { + FScopeLock Lock(&TableDeserializersMutex); + TableDeserializers.Add(TableName, MakeShared>()); + } + + /** Internal interface for applying table updates generically */ + class ITableUpdateHandler + { + public: + virtual ~ITableUpdateHandler() {} + + /** Update the in-memory cache for the table and store the diff */ + virtual void UpdateCache(UDbConnectionBase* Conn, const FTableUpdateType& Update, void* Context) = 0; + + /** Broadcast the previously stored diff */ + virtual void BroadcastDiff(UDbConnectionBase* Conn, void* Context) = 0; + }; + + template + class TTableUpdateHandler : public ITableUpdateHandler + { + public: + explicit TTableUpdateHandler(TableClass* InTable) : Table(InTable) {} + + //** Update the in-memory cache for the table and store the diff */ + virtual void UpdateCache(UDbConnectionBase* Conn, const FTableUpdateType& Update, void* Context) override + { + // Attempt to take preprocessed data if available + TSharedPtr> Pre; + if (Conn->TakePreprocessedTableData(Update, Pre)) + { + // If preprocessed data is available, use it to update the table + LastDiff = Table->Update(Pre->Inserts, Pre->Deletes); + } + else + { + // If no preprocessed data, process the update directly. Backup + UE_LOG(LogTemp, Warning, TEXT("No preprocessed data for table update. Processing directly.")); + TArray> Inserts, Deletes; + UE::SpacetimeDB::ProcessTableUpdateWithBsatn(Update, Inserts, Deletes); + LastDiff = Table->Update(Inserts, Deletes); + } + } + //** Broadcast the last stored diff to the table's delegates */ + virtual void BroadcastDiff(UDbConnectionBase* Conn, void* Context) override + { + EventContext& Ctx = *reinterpret_cast(Context); + Conn->BroadcastDiff(Table, LastDiff, Ctx); + } + + private: + TableClass* Table; + FTableAppliedDiff LastDiff; + }; + //** Register a table with the connection. This will allow the connection to handle updates for the table. + template + void RegisterTable(const FString& TableName, TableClass* Table) + { + RegisterTable(TableName); + FScopeLock Lock(&RegisteredTablesMutex); + RegisteredTables.Add(TableName, MakeShared>(Table)); + } + //** Take preprocessed table row data. */ + template + bool TakePreprocessedTableData(const FTableUpdateType& Update, TSharedPtr>& OutData) + { + FScopeLock Lock(&PreprocessedDataMutex); + FPreprocessedTableKey Key(Update.TableId, Update.TableName); + if (TArray>* Found = PreprocessedTableData.Find(Key)) + { + if (Found->Num() > 0) + { + OutData = StaticCastSharedPtr>((*Found)[0]); + Found->RemoveAt(0); + if (Found->Num() == 0) + { + PreprocessedTableData.Remove(Key); + } + return OutData.IsValid(); + } + } + return false; + } + + +protected: + + friend class UDbConnectionBuilderBase; + friend class UDbConnectionBuilder; + friend class USubscriptionHandleBase; + friend class USubscriptionBuilder; + friend class URemoteReducers; + + /** Allow derived classes to override the delegates used when connecting */ + void SetOnConnectDelegate(const FOnConnectBaseDelegate& Delegate) { OnConnectBaseDelegate = Delegate; } + void SetOnDisconnectDelegate(const FOnDisconnectBaseDelegate& Delegate) { OnDisconnectBaseDelegate = Delegate; } + + UFUNCTION() + void HandleWSError(const FString& Error); + UFUNCTION() + void HandleWSClosed(int32 StatusCode, const FString& Reason, bool bWasClean); + UFUNCTION() + void HandleWSBinaryMessage(const TArray& Message); + + virtual void Tick(float DeltaTime) override; + + virtual TStatId GetStatId() const override; + + virtual bool IsTickable() const override; + + virtual bool IsTickableInEditor() const override; + + /** Internal handler that processes a single server message. */ + void ProcessServerMessage(const FServerMessageType& Message); + void PreProcessDatabaseUpdate(const FDatabaseUpdateType& Update); + /** Decompress and parse a raw message. */ + FServerMessageType PreProcessMessage(const TArray& Message); + bool DecompressPayload(ECompressableQueryUpdateTag Variant, const TArray& In, TArray& Out); + bool DecompressGzip(const TArray& InData, TArray& OutData); + bool DecompressBrotli(const TArray& InData, TArray& OutData); + + /** Pending messages awaiting processing on the game thread. */ + TArray PendingMessages; + + /** Mutex protecting access to PendingMessages. */ + FCriticalSection PendingMessagesMutex; + + /** Map of preprocessed messages keyed by their sequential id. */ + TMap PreprocessedMessages; + + /** Protects PreprocessedMessages and PendingMessages ordering state. */ + FCriticalSection PreprocessMutex; + + /** Counter for assigning ids to incoming messages. */ + FThreadSafeCounter NextPreprocessId; + + /** Id of the next message expected to be released. */ + int32 NextReleaseId = 0; + + // Map of table name to row deserializer + TMap> TableDeserializers; + FCriticalSection TableDeserializersMutex; + + // Map from table update pointer to preprocessed data + TMap>> PreprocessedTableData; + FCriticalSection PreprocessedDataMutex; + + // Map of table name to generic table update handler + TMap> RegisteredTables; + FCriticalSection RegisteredTablesMutex; + + + /** Start a subscription. This will add the subscription to the active list and send a subscribe message to the server. */ + void StartSubscription(USubscriptionHandleBase* Handle); + /** Unsubscribe from a subscription. This will remove the subscription from the active list and send an unsubscribe message to the server. */ + void UnsubscribeInternal(USubscriptionHandleBase* Handle); + + /** Call a reducer on the connected SpacetimeDB instance. */ + void InternalCallReducer(const FString& Reducer, TArray Args, USetReducerFlagsBase* Flags); + + /** + * Update function to apply database changes. + * Must be implemented by child classes. + * @param Update - Struct containing update data. + */ + virtual void DbUpdate(const FDatabaseUpdateType& Update, const FSpacetimeDBEvent& Event) {}; + + /** Event handler for reducer events. This can should overridden by child classes to handle specific reducer events. */ + virtual void ReducerEvent(const FReducerEvent& Event) {}; + + /** Event handler for reducer events. This can should overridden by child classes to handle specific reducer events. */ + virtual void ReducerEventFailed(const FReducerEvent& Event, const FString ErrorMessage) {}; + + /** Event handler for error events. This can should overridden by child classes to handle specific error events. */ + virtual void TriggerError(const FString& ErrorMessage) {}; + + /** Event handler for subscription events. This can should overridden by child classes to handle specific subscription events. */ + virtual void TriggerSubscription() {}; + + /** Apply updates for all registered tables using the provided context pointer */ + void ApplyRegisteredTableUpdates(const FDatabaseUpdateType& Update, void* Context); + + /** Called when a subscription is updated. */ + TMap> ActiveSubscriptions; + + /** Get the next request id for a message. This is used to track requests and responses. */ + int32 NextRequestId; + /** Get the next subscription id for a subscription. This is used to track subscriptions and their responses. */ + int32 NextSubscriptionId; + /** Get the next request id for a message. This is used to track requests and responses. */ + int32 GetNextRequestId(); + /** Get the next subscription id for a subscription. This is used to track subscriptions and their responses. */ + int32 GetNextSubscriptionId(); + + /** The WebSocket manager used to connect to the server. */ + UPROPERTY() + UWebsocketManager* WebSocket = nullptr; + + /** The URI of the SpacetimeDB server to connect to. */ + UPROPERTY() + FString Uri; + /** The module name to connect to. This is used to identify the SpacetimeDB instance. */ + UPROPERTY() + FString ModuleName; + /** The token used to authenticate the connection. */ + UPROPERTY() + FString Token; + + /** The identity of the SpacetimeDB instance. This is used to identify the connection. */ + UPROPERTY() + FSpacetimeDBIdentity Identity; + UPROPERTY() + /** Whether the identity has been set. This is used to prevent multiple identity sets. */ + bool bIsIdentitySet = false; + /** The connection id of the SpacetimeDB instance. This is used to identify the connection. */ + UPROPERTY() + FSpacetimeDBConnectionId ConnectionId; + + UPROPERTY() + bool bIsAutoTicking = false; + + FOnConnectErrorDelegate OnConnectErrorDelegate; + FOnDisconnectBaseDelegate OnDisconnectBaseDelegate; + FOnConnectBaseDelegate OnConnectBaseDelegate; + + /** Called when the connection is established. */ + template + void BroadcastDiff(TableClass* Table, const FTableAppliedDiff& Diff, const EventContext& Context) + { + if (!Table) return; + + // Broadcast the diff to the table's delegates + if (Table->OnInsert.IsBound()) + { + for (const TPair, RowType>& Pair : Diff.Inserts) + { + Table->OnInsert.Broadcast(Context, Pair.Value); + } + } + + // If the table has a delete delegate, broadcast deletes + if (Table->OnDelete.IsBound()) + { + for (const TPair, RowType>& Pair : Diff.Deletes) + { + Table->OnDelete.Broadcast(Context, Pair.Value); + } + } + + // If the table has an update delegate, broadcast updates + if (Table->OnUpdate.IsBound()) + { + int32 Count = FMath::Min(Diff.UpdateDeletes.Num(), Diff.UpdateInserts.Num()); + for (int32 Index = 0; Index < Count; ++Index) + { + const RowType& OldRow = Diff.UpdateDeletes[Index]; + const RowType& NewRow = Diff.UpdateInserts[Index]; + Table->OnUpdate.Broadcast(Context, OldRow, NewRow); + } + } + } +}; diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/Connection/DbConnectionBuilder.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/Connection/DbConnectionBuilder.h new file mode 100644 index 00000000000..23f7988a59d --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/Connection/DbConnectionBuilder.h @@ -0,0 +1,53 @@ +#pragma once + +#include "CoreMinimal.h" +#include "UObject/NoExportTypes.h" +#include "Connection/DbConnectionBase.h" +#include "ModuleBindings/Types/CompressableQueryUpdateType.g.h" +#include "DbConnectionBuilder.generated.h" + +UCLASS(BlueprintType) +class SPACETIMEDBSDK_API UDbConnectionBuilderBase : public UObject +{ + GENERATED_BODY() + +public: + + /** Set the websocket URI to connect to. */ + UDbConnectionBuilderBase* WithUriBase(const FString& InUri); + + /** Set the remote module/database name. */ + UDbConnectionBuilderBase* WithModuleNameBase(const FString& InName); + + /** Provide an authentication token if available. */ + UDbConnectionBuilderBase* WithTokenBase(const FString& InToken); + + /** Provide an specific compresstion method. Brotli not implemented, will default to Gzip */ + UDbConnectionBuilderBase* WithCompressionBase(const ESpacetimeDBCompression& InCompression); + + //@TODO: Add With Light Mode + //UDbConnectionBuilderBase* WithLightMode(const bool& bWithLightMode); + + /** Register a callback for successful connect. */ + UDbConnectionBuilderBase* OnConnectBase(FOnConnectBaseDelegate Callback); + + /** Register a callback for connection errors. */ + UDbConnectionBuilderBase* OnConnectErrorBase(FOnConnectErrorDelegate Callback); + + /** Register a callback for disconnect. */ + UDbConnectionBuilderBase* OnDisconnectBase(FOnDisconnectBaseDelegate Callback); + + /** Generic C++ helper for building child types (not visible to Blueprints) */ + UDbConnectionBase* BuildConnection(UDbConnectionBase* Connection); + +private: + FString Uri; + FString ModuleName; + FString Token; + ESpacetimeDBCompression Compression; + bool bCompressionSet = false; + + FOnConnectErrorDelegate OnConnectErrorCallback; + FOnConnectBaseDelegate OnConnectCallback; + FOnDisconnectBaseDelegate OnDisconnectCallback; +}; diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/Connection/README.md b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/Connection/README.md new file mode 100644 index 00000000000..806c02675fa --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/Connection/README.md @@ -0,0 +1,13 @@ +# Connection + +This folder contains the classes used to open and manage a connection to a SpacetimeDB server. They expose Blueprint friendly APIs for creating a websocket, authenticating and managing active subscriptions. + +## Files + +- `Callback.h` Defines `UStatus` and related enums used to report reducer results and statuses to the user. +- `Credentials.h` Static helper functions for persisting authentication tokens via Unreal's config system. +- `DbConnectionBase.h` Core connection object. Handles websocket events, table caches and reducer calls. Used as a base class for generated `DbConnection` class. +- `DbConnectionBuilder.h` Fluent builder used to configure a connection instance and bind event delegates. Used as a base class for generated `DbConnectionBuilder` class. +- `SetReducerFlags.h` Container for flags controlling reducer call behaviour (e.g. disabling/enabling success notifications). +- `Subscription.h` Classes for constructing and managing query subscriptions. +- `Websocket.h` Wrapper around UE's `IWebSocket` that sends/receives messages. \ No newline at end of file diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/Connection/SetReducerFlags.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/Connection/SetReducerFlags.h new file mode 100644 index 00000000000..27b8e26a93f --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/Connection/SetReducerFlags.h @@ -0,0 +1,31 @@ + +#pragma once + +#include "CoreMinimal.h" +#include "SetReducerFlags.generated.h" + + +/** Flags controlling reducer call behavior */ +UENUM(BlueprintType) +enum class ECallReducerFlags : uint8 +{ + /** Default behavior - server will send full update and success notification */ + FullUpdate UMETA(DisplayName = "FullUpdate"), + + /** Do not send success notification after reducer completes */ + NoSuccessNotify UMETA(DisplayName = "NoSuccessNotify"), +}; + +/** Container for per-reducer call flags */ +UCLASS(BlueprintType) +class SPACETIMEDBSDK_API USetReducerFlagsBase : public UObject +{ + GENERATED_BODY() + +protected: + + friend class UDbConnectionBase; + + UPROPERTY() + TMap FlagMap; +}; \ No newline at end of file diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/Connection/Subscription.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/Connection/Subscription.h new file mode 100644 index 00000000000..ba9096a22ee --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/Connection/Subscription.h @@ -0,0 +1,112 @@ +#pragma once + +#include "CoreMinimal.h" +#include "UObject/NoExportTypes.h" +#include "Connection/Callback.h" + +#include "Subscription.generated.h" + +class UDbConnectionBase; + +/** Delegate type used for subscription lifecycle events */ +DECLARE_DYNAMIC_DELEGATE_OneParam(FSubscriptionEventDelegate, const FSubscriptionEventContextBase&, Context); + +/** Delegate type used for subscription error events */ +DECLARE_DYNAMIC_DELEGATE_OneParam(FSubscriptionErrorDelegate, const FErrorContextBase&, Context); + +/** Handle returned from USubscriptionBuilder::Subscribe */ +UCLASS(BlueprintType) +class SPACETIMEDBSDK_API USubscriptionHandleBase : public UObject +{ + GENERATED_BODY() + +public: + USubscriptionHandleBase(); + + /** Immediately cancels the subscription */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void Unsubscribe(); + + /** Cancel the subscription and invoke the provided callback when complete */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void UnsubscribeThen(FSubscriptionEventDelegate OnEnd); + + /** True once the subscription has ended */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + bool IsEnded() const { return bEnded; } + + /** True while the subscription is active */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + bool IsActive() const { return bActive; } + + /** True if the unsubscibe has been called*/ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + bool IsUnsubscribeCalled() const { return bUnsubscribeCalled; } + + /** Get the SQL queries associated with this subscription */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray GetQuerySqls() const { return QuerySqls; } + + /** Internal API used by the connection to signal events */ + void TriggerApplied(const FSubscriptionEventContextBase& Context); + /** Internal API used by the connection to signal errors */ + void TriggerError(const FErrorContextBase& Context); + +private: + + // Whether the subscription has ended + bool bEnded = false; + // Whether the subscription is currently active + bool bActive = false; + // Whether the unsubscribe method has been called + bool bUnsubscribeCalled = false; + + /** Queries associated with this subscription */ + TArray QuerySqls; + + // Delegate callbacks for subscription events + FSubscriptionEventDelegate AppliedDelegate; + FSubscriptionErrorDelegate ErrorDelegate; + FSubscriptionEventDelegate EndDelegate; + + /** Identifier for this subscription */ + int32 QueryId = -1; + + friend class USubscriptionBuilderBase; + friend class UDbConnectionBase; + friend class USubscriptionBuilder; + + /** Owning connection used for subscribe/unsubscribe messages */ + UDbConnectionBase* ConnInternal = nullptr; +}; + +/** Builder used to construct subscription queries */ +UCLASS() +class SPACETIMEDBSDK_API USubscriptionBuilderBase : public UObject +{ + GENERATED_BODY() + +public: + USubscriptionBuilderBase(); + + +protected: + + /** Register a callback to run when the subscription is applied */ + UFUNCTION() + USubscriptionBuilderBase* OnAppliedBase(FSubscriptionEventDelegate Callback); + + /** Register a callback to run when the subscription fails */ + UFUNCTION() + USubscriptionBuilderBase* OnErrorBase(FSubscriptionErrorDelegate Callback); + + /** Subscribe to the provided SQL queries */ + UFUNCTION() + USubscriptionHandleBase* SubscribeBase(const TArray& QuerySqls, USubscriptionHandleBase* Handle); + + +private: + // Delegate callbacks for subscription events + FSubscriptionEventDelegate AppliedDelegate; + FSubscriptionErrorDelegate ErrorDelegate; +}; diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/Connection/Websocket.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/Connection/Websocket.h new file mode 100644 index 00000000000..b2020227d58 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/Connection/Websocket.h @@ -0,0 +1,174 @@ +#pragma once + +#include "CoreMinimal.h" +#include "IWebSocket.h" +#include "ModuleBindings/Types/ServerMessageType.g.h" +#include "ModuleBindings/Types/CompressableQueryUpdateType.g.h" +#include "JsonObjectConverter.h" // for JSON debugging helpers +#include "Async/Async.h" +#include "HAL/CriticalSection.h" +#include "Misc/ScopeLock.h" + + +#include "Websocket.generated.h" + +/** Delegate broadcast when a connection is successfully established */ +DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnWebSocketConnected); +/** Delegate broadcast on connection error */ +DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnWebSocketConnectionError, const FString&, ErrorMessage); +/** Delegate broadcast when a text message is received */ +DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnWebSocketMessageReceived, const FString&, Message); +/** Delegate broadcast when the socket closes */ +DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FOnWebSocketClosed, int32, StatusCode, const FString&, Reason, bool, bWasClean); +/** Delegate broadcast when binary data is received */ +DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnWebSocketBinaryMessageReceived, const TArray&, Data); + + +/** + * Manages the low-level WebSocket connection to the SpacetimeDB server. + * Handles connecting, disconnecting, sending messages, and receiving messages. + */ +UCLASS(BlueprintType) +class SPACETIMEDBSDK_API UWebsocketManager : public UObject +{ + GENERATED_BODY() + +public: + UWebsocketManager(); + + virtual void BeginDestroy() override; + + /** + * Connects to the WebSocket server at the given URL. + * @param ServerUrl The URL of the WebSocket server. + */ + void Connect(const FString& ServerUrl); + + /** + * Disconnects from the WebSocket server. + */ + void Disconnect(); + + /** + * Sends a message to the WebSocket server. + * @param Message The message to send. + * @return True if the message was sent successfully, false otherwise. + */ + bool SendMessage(const FString& Message); + + /** + * Sends binary data to the WebSocket server. + * @param Data The bytes to send. + * @return True if the message was sent successfully, false otherwise. + */ + bool SendMessage(const TArray& Data); + + /** + * Checks if the WebSocket connection is currently active. + * @return True if connected, false otherwise. + */ + bool IsConnected() const; + + /** + * Sets the initial auth token used when connecting. + * @param Token JWT or session token expected by the server. + */ + void SetInitToken(FString Token); + + /** Delegates for WebSocket events */ + UPROPERTY() + FOnWebSocketConnected OnConnected; + + /** Broadcast when a connection error occurs */ + UPROPERTY() + FOnWebSocketConnectionError OnConnectionError; + + /** Broadcast for text messages */ + UPROPERTY() + FOnWebSocketMessageReceived OnMessageReceived; + + /** Broadcast for binary payloads */ + UPROPERTY() + FOnWebSocketBinaryMessageReceived OnBinaryMessageReceived; + + /** Broadcast when the socket is closed */ + UPROPERTY() + FOnWebSocketClosed OnClosed; + +private: + /**Underlying WebSocket implementation */ + TSharedPtr WebSocket; + + /** Handler for successful connection */ + void HandleConnected(); + /** Handler for connection errors */ + void HandleConnectionError(const FString& Error); + /** Handler for incoming text messages */ + void HandleMessageReceived(const FString& Message); + /** Handler for incoming binary messages */ + void HandleBinaryMessageReceived(const void* Data, SIZE_T Size, SIZE_T BytesRemaining); + /** Handler for socket close */ + void HandleClosed(int32 StatusCode, const FString& Reason, bool bWasClean); + + /** Decompresses a payload based on compression variant */ + bool DecompressPayload(ECompressableQueryUpdateTag Variant, const TArray& In, TArray& Out); + /** GZip decompression helper */ + bool DecompressGzip(const TArray& InData, TArray& OutData); + /** Brotli decompression helper */ + bool DecompressBrotli(const TArray& InData, TArray& OutData); + + FString InitToken; + + /** Buffer used to accumulate binary fragments until a complete message + * is received. */ + TArray IncompleteMessage; + + /** Tracks if we are waiting for additional binary fragments. */ + bool bAwaitingBinaryFragments = false; + +}; + +// Helper function to log a struct as JSON, expanding any transient objects +template +static void LogAsJson(const StructType& InStruct, const TCHAR* TagName) +{ + FString Json; + if (!FJsonObjectConverter::UStructToJsonObjectString(InStruct, Json)) + { + UE_LOG(LogTemp, Warning, TEXT("[%s] Failed to serialize to JSON"), TagName); + return; + } + + // Print original JSON + UE_LOG(LogTemp, Log, TEXT("[%s] %s"), TagName, *Json); + + // Extract object paths like /Script/SpacetimeDbSdk.CompressableQueryUpdateType'/Engine/Transient.CompressableQueryUpdateType_0' + const FRegexPattern Pattern(TEXT(R"((\/Script\/SpacetimeDbSdk\.\w+)'\/Engine\/Transient\.(\w+))")); + FRegexMatcher Matcher(Pattern, Json); + + while (Matcher.FindNext()) + { + FString ClassName = Matcher.GetCaptureGroup(1); // e.g., /Script/SpacetimeDbSdk.CompressableQueryUpdateType + FString ObjectName = Matcher.GetCaptureGroup(2); // e.g., CompressableQueryUpdateType_0 + + // Find the object in memory + UObject* FoundObj = StaticFindObject(UObject::StaticClass(), GetTransientPackage(), *ObjectName); + if (FoundObj == nullptr) + { + UE_LOG(LogTemp, Warning, TEXT("[%s] Could not find object: %s"), TagName, *ObjectName); + continue; + } + + // Log its expanded contents + FString SubJson; + if (FJsonObjectConverter::UStructToJsonObjectString( + static_cast(FoundObj->GetClass()), FoundObj, SubJson)) + { + UE_LOG(LogTemp, Log, TEXT("[%s] %s: %s"), TagName, *ObjectName, *SubJson); + } + else + { + UE_LOG(LogTemp, Warning, TEXT("[%s] Failed to serialize object: %s"), TagName, *ObjectName); + } + } +} \ No newline at end of file diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/DBCache/BTreeUniqueIndex.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/DBCache/BTreeUniqueIndex.h new file mode 100644 index 00000000000..aabec276884 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/DBCache/BTreeUniqueIndex.h @@ -0,0 +1,77 @@ + +#pragma once +#include +#include "IUniqueIndex.h" + +// A multi-key index implementation that maps a key to one or more serialized row identifiers. +// This is typically used for non-unique indexing (one key → many rows) in the client table cache. +template +class FMultiKeyBTreeIndex : public IMultiKeyIndex +{ +public: + // Function that extracts the index key from a row instance. + // For example, given a FMessage row, it might return Msg.Sender or a tuple of fields. + TFunction ExtractKey; + + // Maps a key to one or more serialized primary keys (TArray) for rows that match. + // The serialized keys can then be used to retrieve full rows from the table cache. + TMultiMap> KeyToSerialized; + + // Temporary buffer to store found keys during a query. + // Mutable so that FindKeys (which is const) can reuse this array without reallocating each time. + mutable TArray> MutableFoundKeys; + + // Constructor — stores the key extraction function. + explicit FMultiKeyBTreeIndex(TFunction InExtractKey) + : ExtractKey(InExtractKey) + { + } + + /** + * Adds a row to the multi-key index by mapping its extracted key to the serialized primary key. + * + * @param SerializedKey Serialized representation of the row's primary key. + * @param Row Shared pointer to the row being added. + */ + virtual void AddRow(const TArray& SerializedKey, const TSharedPtr& Row) override + { + // Extract the key from the row and add an entry mapping it to the serialized key. + KeyToSerialized.Add(ExtractKey(*Row), SerializedKey); + } + + + /** + * Removes a single mapping from the multi-key index matching the extracted key and serialized key. + * + * @param SerializedKey Serialized representation of the row's primary key. + * @param Row Shared pointer to the row being removed. + */ + virtual void RemoveRow(const TArray& SerializedKey, const TSharedPtr& Row) override + { + // Remove one occurrence of the pair (extracted key, serialized key) from the index. + KeyToSerialized.RemoveSingle(ExtractKey(*Row), SerializedKey); + } + + + /** + * Finds all serialized keys associated with the given index key. + * + * @param KeyPtr Pointer to the key value (type-erased as void*). + * @return Pointer to an array of serialized keys matching the given key. + */ + virtual const TArray>* FindKeys(const void* KeyPtr) const override + { + // Cast the void pointer back to the actual key type. + const KeyType* TypedKey = static_cast(KeyPtr); + + // Clear the temporary array to store matching keys. + MutableFoundKeys.Reset(); + + // Retrieve all serialized keys mapped to the given index key. + KeyToSerialized.MultiFind(*TypedKey, MutableFoundKeys); + + // Return the pointer to the results array owned by this object. + return &MutableFoundKeys; + } + +}; \ No newline at end of file diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/DBCache/ClientCache.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/DBCache/ClientCache.h new file mode 100644 index 00000000000..d5e1ca9a0f7 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/DBCache/ClientCache.h @@ -0,0 +1,182 @@ +#pragma once +#include "CoreMinimal.h" +#include "TableCache.h" +#include "TableAppliedDiff.h" + +/* ============================================================================ * + * ClientCache.h (2025-05-28) + * ---------------------------------------------------------------------------- + * Owns a collection of FTableCache instances—one per subscribed table name. + * Provides helper to apply (insert/delete) diffs arriving from the network. + * ============================================================================ */ +template +class UClientCache +{ +public: + /** + * Shared pointer to the cached table data for this row type. + * Currently supports storing only one table instance per RowType. + * For multiple tables by name, consider using a map keyed by table name. + */ + TSharedPtr> Table; + + + /** + * Retrieves the existing table cache or creates a new one if none exists. + * + * @param Name The name of the table (used here for validation). + * @return Shared pointer to the table cache instance or nullptr if name is empty. + */ + TSharedPtr> GetOrAdd(const FString& Name) + { + if (Name.IsEmpty()) + { + UE_LOG(LogTemp, Warning, TEXT("GetOrAdd called with empty table name.")); + return nullptr; + } + + // If the table already exists, return it + if (Table.IsValid()) + { + return Table; + } + + // Otherwise, create a new table cache instance and store it + auto NewCache = MakeShared>(); + Table = NewCache; + return NewCache; + } + + /** + * Retrieves a const shared pointer to the table cache if it exists. + * + * @param Name The name of the table (used here for validation). + * @return Const shared pointer to the table cache or nullptr if not found/empty name. + */ + TSharedPtr> GetTable(const FString& Name) const + { + if (Name.IsEmpty()) + { + UE_LOG(LogTemp, Warning, TEXT("GetTable called with empty table name.")); + return nullptr; + } + + // Return the existing table if valid, otherwise nullptr + if (Table.IsValid()) + { + return Table; + } + return nullptr; + } + + + /** + * Apply Inserts + Deletes to the specified table. + * Inserts: increment refCount, add new entry when needed. + * Deletes: decrement refCount, remove when it reaches 0. + */ + FTableAppliedDiff ApplyDiff( + const FString& Name, + const TArray, RowType>>& Inserts, + const TArray>& Deletes) + { + if (Name.IsEmpty()) + { + UE_LOG(LogTemp, Error, TEXT("ApplyDiff called with empty table name.")); + return FTableAppliedDiff(); + } + + if (!Table.IsValid()) + { + UE_LOG(LogTemp, Error, TEXT("Failed to create or retrieve table: %s"), *Name); + return FTableAppliedDiff(); + } + + FTableAppliedDiff Diff; + + // Map of deleted SerializedBytes -> (Key, Row) + // The key type is now generic TArray + TMap, TPair, TSharedPtr>> DeletedEntries; + + // Phase 1: Pre-process Deletes + for (const TArray& Key : Deletes) + { + + FRowEntry* Entry = Table->Entries.Find(Key); + if (!Entry) continue; + + // Decrement refcount and store the entry if it's about to be deleted + if (--Entry->RefCount == 0) + { + DeletedEntries.Add(Key, TPair, TSharedPtr>(Key, Entry->Row)); + } + } + + // Phase 2: Process Inserts and Updates + for (const auto& Ins : Inserts) + { + const TArray& Key = Ins.Key; + const RowType& Row = Ins.Value; + + TSharedPtr NewRow = MakeShared(Row); + + // This is a new row or an update to an existing row that was not deleted. + FRowEntry* Entry = Table->Entries.Find(Key); + if (!Entry) + { + // True insert + Table->Entries.Add(Key, FRowEntry{NewRow, 1}); + } + else + { + // True update + Table->Entries.Add(Key, FRowEntry{NewRow, Entry->RefCount + 1}); + } + + Diff.Inserts.Add(Key, *NewRow); + } + + // Phase 3: Finalize Deletes and Update Indices + for (const auto& KeyValue : DeletedEntries) + { + // Add to diff before removal + Diff.Deletes.Add(KeyValue.Key, *KeyValue.Value.Value); + Table->Entries.Remove(KeyValue.Key); + } + + // Now, update all indices with the completed diff + for (const auto& DeletePair : Diff.Deletes) + { + for (auto& IndexPair : Table->UniqueIndices) + { + // Assuming RemoveRow takes the TSharedPtr directly + IndexPair.Value->RemoveRow(MakeShared(DeletePair.Value)); + } + } + + for (const auto& InsertPair : Diff.Inserts) + { + for (auto& IndexPair : Table->UniqueIndices) + { + // Assuming AddRow takes TSharedPtr directly + IndexPair.Value->AddRow(MakeShared(InsertPair.Value)); + } + } + + // And for BtreeIndices... + for (auto& Pair : Table->BTreeIndices) + { + for (const auto& DeletePair : Diff.Deletes) + { + Pair.Value->RemoveRow(DeletePair.Key, MakeShared(DeletePair.Value)); + } + + for (const auto& InsertPair : Diff.Inserts) + { + Pair.Value->AddRow(InsertPair.Key, MakeShared(InsertPair.Value)); + } + } + + return Diff; + } +}; diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/DBCache/IUniqueIndex.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/DBCache/IUniqueIndex.h new file mode 100644 index 00000000000..9830b499cc4 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/DBCache/IUniqueIndex.h @@ -0,0 +1,77 @@ +#pragma once +/* ============================================================================ * + * IUniqueIndex.h (2025-05-28) + * ---------------------------------------------------------------------------- + * Polymorphic interface replicating Rust's `UniqueIndexDyn` trait. + * + * • A unique index guarantees at most one row per key. + * • Implementations must be able to Add, Remove and Find rows based on the + * value of a particular column. + * ============================================================================ */ + +template +class IBaseIndex +{ +public: + virtual ~IBaseIndex() = default; + + /** + * Adds a row to the index. + * Implementation should extract the key from the row and store it for lookups. + * + * @param Row Shared pointer to the row being added. + */ + virtual void AddRow(TSharedPtr Row) = 0; + + /** + * Removes a row from the index. + * Implementation should remove any key mapping for this row. + * + * @param Row Shared pointer to the row being removed. + */ + virtual void RemoveRow(TSharedPtr Row) = 0; + + /** + * Finds a single row by the given key pointer. + * + * @param KeyPtr Pointer to the key value (cast to correct type inside the function). + * @return Shared pointer to the matching row, or nullptr if not found. + */ + virtual TSharedPtr FindRow(const void* KeyPtr) const = 0; + +}; + +template +class IMultiKeyIndex +{ +public: + virtual ~IMultiKeyIndex() = default; + + /** + * Adds a row to the index using its serialized key and the row's data. + * Implementations should map the extracted key to the serialized representation. + * + * @param SerializedKey Binary key representing the row in serialized form. + * @param Row Shared pointer to the row being added. + */ + virtual void AddRow(const TArray& SerializedKey, const TSharedPtr& Row) = 0; + + /** + * Removes a row from the index using its serialized key and the row's data. + * Implementations should ensure the mapping is cleaned up. + * + * @param SerializedKey Binary key representing the row in serialized form. + * @param Row Shared pointer to the row being removed. + */ + virtual void RemoveRow(const TArray& SerializedKey, const TSharedPtr& Row) = 0; + + /** + * Finds all serialized keys that match the given key pointer. + * + * @param KeyPtr Pointer to the key value (cast to the correct key type inside the function). + * @return Pointer to an array of serialized keys that match, or nullptr if none found. + */ + virtual const TArray>* FindKeys(const void* KeyPtr) const = 0; + +}; + diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/DBCache/README.md b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/DBCache/README.md new file mode 100644 index 00000000000..7ff0ed9ee3d --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/DBCache/README.md @@ -0,0 +1,129 @@ +# DBCache + +Utilities used to maintain a client side cache of database tables. These classes store rows received from the server and provide helpers for fast lookups. + +## Files + +- `BTreeUniqueIndex.h` – B-tree implementation of `IUniqueIndex` supporting range queries. +- `ClientCache.h` – Owns `FTableCache` objects and applies insert/delete diffs sent over the network. +- `IUniqueIndex.h` – Interface that unique index implementations conform to. +- `RowEntry.h` – Wrapper storing a row value with a reference count used by overlapping subscriptions. +- `TableAppliedDiff.h` – Describes the inserts, deletes and updates detected when applying a diff. +- `TableCache.h` – In-memory representation of a table and its unique indices. +- `TableHandle.h` – Lightweight helper exposing read only access to a cached table. +- `UniqueConstraintHandle.h` – Helper that allows typed lookups against a unique constraint. +- `UniqueIndex.h` – Hash map based implementation of a unique index. +- `WithBsatn.h` – Pairs a row with its serialized BSATN bytes for diff processing. + +# Client Cache / Table Cache System + +This module implements a **Client-Side Table Cache** for storing and querying rows efficiently using **Unique Constraints** and **B-Tree Multi-Key Indices**. +Designed for **Unreal Engine 5**, it supports **point queries**, **multi-key lookups**, and is optimized for high-performance client caching. + +--- + +## Features + +- **Primary Storage**: `TMap, FRowEntry>` for serialized keys. +- **Unique Constraints**: Enforce one-to-one mapping between a column and rows. +- **B-Tree Multi-Key Indices**: Allow one-to-many mapping between a key and rows. +- **Fast Lookups**: O(1) for unique index, O(log n) for B-Tree lookups. +- **Full Row Extraction**: Retrieve all cached rows in bulk. +- **Blueprint-ready**: The design is `TFunction`-based for easy integration with UE types. + +--- + +## Internal Usage + +### Add a Unique Constraint +```cpp +template +void AddUniqueConstraint( + const FString& Name, + TFunction ExtractColumn); +``` +- Must be called **before** populating `Entries`. +- Fails if the same constraint name is registered twice. + +--- + +### Add a Multi-Key B-Tree Index +```cpp +template +void AddMultiKeyBTreeIndex( + const FString& Name, + TFunction ExtractKey); +``` +- Supports multiple rows per key. +- Uses a B-Tree for efficient range and point queries. + +--- + +### Find by Unique Index +```cpp +template +const RowType* FindByUniqueIndex( + const FString& Name, + const KeyType& Key) const; +``` +- Returns a single row pointer or `nullptr` if not found. + +--- + +### Find by Multi-Key B-Tree Index +```cpp +template +void FindByMultiKeyBTreeIndex( + TArray& OutResults, + const FString& Name, + const KeyType& Key) const; +``` +- Uses serialized key lookups internally. +--- + +### Get All Values +```cpp +void GetValues(TArray& AllRows) const; +``` +- Fills `AllRows` with copies of every row in the cache. + +--- + +## Example Usage +```cpp +FTableCache Table; + +// Add indices before inserting data +Table->AddUniqueConstraint("sender", [](const FMessageType& Row) -> FSpacetimeDBIdentity { + return Row.Sender; + }); + +using FSenderTextKey = TTuple; +Table->AddMultiKeyBTreeIndex( + TEXT("sender_text"), + [](const FMessageType& Msg) { return MakeTuple(Msg.Sender, Msg.Text); } +); + +// Query examples +const FMessage* Found = Table.FindByUniqueIndex(TEXT("MessageID"), TEXT("abc-123")); + +using FSenderTextKey = TTuple; +TArray Results; +Table->FindByMultiKeyBTreeIndex( + Results, + TEXT("sender_text"), + MakeTuple(Sender, Message) +); + +// Retrieve all rows +TArray AllRows; +Table.GetValues(AllRows); +``` + +--- + +## Notes + +- `TArray` keys allow serialized identifiers (network-friendly). +- Adding indices after inserting rows is **not supported** without manual rebuild. +- B-Tree indices can later be extended for **range queries**.ed to a **single column** per call. \ No newline at end of file diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/DBCache/RowEntry.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/DBCache/RowEntry.h new file mode 100644 index 00000000000..668c07948e8 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/DBCache/RowEntry.h @@ -0,0 +1,43 @@ +#pragma once +#include "CoreMinimal.h" + +/* ============================================================================ * + * RowEntry.h (2025-05-28) + * ---------------------------------------------------------------------------- + * Mirrors the Rust `RowEntry` struct. + * + * • Stores a single deserialized row value (RowType). + * • Tracks a reference‑count so that multiple overlapping query subscriptions + * can reference the same row without duplicating memory. When the ref‑count + * drops to zero the row can be safely removed from the table cache. + * ============================================================================ */ + +//template +//struct FRowEntry +//{ +// /** The row value copied from the network payload or database layer. */ +// RowType Row; +// //TSharedPtr Row; +// +// /** How many active subscriptions currently reference this row. */ +// uint32 RefCount{0}; +// +// FRowEntry() = default; +// FRowEntry(const RowType& InRow, uint32 InRefCount = 0) +// : Row(InRow), RefCount(InRefCount) {} +//}; + +template +struct FRowEntry +{ + /** Shared row data (used by indices and cache) */ + TSharedPtr Row; + + /** Reference count for this row */ + int32 RefCount = 0; + + FRowEntry(const TSharedPtr& InRow, int32 InRefCount) + : Row(InRow), RefCount(InRefCount) + { + } +}; \ No newline at end of file diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/DBCache/TableAppliedDiff.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/DBCache/TableAppliedDiff.h new file mode 100644 index 00000000000..cc76786999e --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/DBCache/TableAppliedDiff.h @@ -0,0 +1,73 @@ +#pragma once +#include "CoreMinimal.h" + +/* ============================================================================ * + * TableAppliedDiff.h (2025-05-28) + * ---------------------------------------------------------------------------- + * Captures the semantic result of applying a low‑level diff (inserts/deletes) + * to a table cache. Rows that transition from dead→live are inserts, live→dead + * are deletes, and a delete+insert with the same primary‑key is surfaced as an + * update pair. + * ============================================================================ */ +template +struct FTableAppliedDiff +{ + // SerializedKey -> Row copy. Keeping the rows by value ensures + // the memory stays valid even if the underlying table reallocates + // or removes entries while this diff is alive. + TMap, RowType> Deletes; + TMap, RowType> Inserts; + + // Parallel arrays for (old, new) row update pairs. + TArray UpdateDeletes; + TArray UpdateInserts; + + bool IsEmpty() const + { + return Deletes.IsEmpty() && Inserts.IsEmpty() && + UpdateDeletes.IsEmpty() && UpdateInserts.IsEmpty(); + } + + /** + * Examine Inserts and Deletes, detect primary‑key matches and move them + * into Update* arrays. The key extractor returns a value type used for + * comparison. + */ + template + void DeriveUpdatesByPrimaryKey(TFunctionRef DerivePK) + { + if (Deletes.IsEmpty()) return; + + // Build PK->(key,row) map for deletes. + TMap, RowType>> DeletePK; + for (const auto& Pair : Deletes) + { + DeletePK.Add(DerivePK(Pair.Value), { Pair.Key, Pair.Value }); + } + + // Scan inserts for matching PKs. + TArray> DeleteKeys; + TArray> InsertKeys; + for (const auto& Pair : Inserts) + { + KeyType PK = DerivePK(Pair.Value); + if (const auto* Found = DeletePK.Find(PK)) + { + UpdateDeletes.Add(Found->Value); + UpdateInserts.Add(Pair.Value); + DeleteKeys.Add(Found->Key); + InsertKeys.Add(Pair.Key); + } + } + + // Remove update pairs from base maps. + for (const auto& K : DeleteKeys) + { + Deletes.Remove(K); + } + for (const auto& K : InsertKeys) + { + Inserts.Remove(K); + } + } +}; diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/DBCache/TableCache.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/DBCache/TableCache.h new file mode 100644 index 00000000000..769676a266a --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/DBCache/TableCache.h @@ -0,0 +1,186 @@ +#pragma once +#include "CoreMinimal.h" +#include "RowEntry.h" +#include "UniqueIndex.h" +#include "BTreeUniqueIndex.h" + +/* ============================================================================ * + * TableCache.h (2025-05-28) + * ---------------------------------------------------------------------------- + * An in‑memory mirror of a single database table. + * + * Keyed by serialized byte blobs (BSATN) so we can hash/compare cheaply even + * for row structs containing floats or other non‑hashable fields. + * ============================================================================ */ +template +class FTableCache +{ +public: + + /** + * Main storage of table rows keyed by their serialized primary key. + * TArray is used to allow arbitrary binary keys. + */ + TMap, FRowEntry> Entries; + + /** + * Map of unique index name -> unique index object. + * Each unique index enforces one-column uniqueness. + */ + TMap>> UniqueIndices; + + /** + * Map of multi-key B-Tree index name -> index object. + * Used for efficient lookups on non-unique columns or composite keys. + */ + TMap>> BTreeIndices; + + /* --------------------------------------------------------------------- */ + + /** + * Adds a unique constraint (unique index) to the table. + * + * This enforces that all values in the specified column are unique. + * Must be called before any entries are populated. + * + * @tparam ColType Type of the column used for uniqueness checks. + * @param Name Unique name for the constraint. + * @param ExtractColumn Function that extracts the column value from a given row. + */ + template + void AddUniqueConstraint( + const FString& Name, + TFunction ExtractColumn) + { + // Ensure this is called before data population + check(Entries.IsEmpty()); + + // Prevent duplicate unique constraints + if (UniqueIndices.Contains(Name)) + { + UE_LOG(LogTemp, Error, TEXT("Duplicate unique constraint: %s"), *Name); + return; + } + + // Create and store the unique index + UniqueIndices.Add(Name, + MakeShared>(ExtractColumn)); + } + + + /** + * Adds a new multi-key B-Tree index to the table. + * + * @tparam KeyType Type of the key to extract and store in the index. + * @param Name Unique name for the index. + * @param ExtractKey Function that extracts the key from a given row. + */ + template + void AddMultiKeyBTreeIndex( + const FString& Name, + TFunction ExtractKey) + { + // Prevent duplicate index names + if (BTreeIndices.Contains(Name)) + { + UE_LOG(LogTemp, Error, TEXT("Duplicate B-Tree index: %s"), *Name); + return; + } + + // Create the B-Tree index and register it + TSharedPtr> NewIndex = MakeShared>(ExtractKey); + BTreeIndices.Add(Name, NewIndex); + } + + + /** + * Finds a row by its unique index key. + * + * @tparam KeyType The type of the key to search for. + * @param Name The unique index name. + * @param Key The key value to find. + * @return Pointer to the matching row or nullptr if not found. + */ + template + const RowType* FindByUniqueIndex( + const FString& Name, + const KeyType& Key) const + { + // Look up the unique index by name + const auto* Ptr = UniqueIndices.Find(Name); + if (!Ptr || !Ptr->IsValid()) // If index missing or invalid, return nullptr + { + return nullptr; + } + + // The interface can't call templated FindRowEx, but it can call FindRow with a void* key. + // FindRow will internally static_cast the key pointer to the correct KeyType. + TSharedPtr FoundRowPtr = (*Ptr)->FindRow(&Key); + + // Return raw pointer; ownership remains internal + return FoundRowPtr.Get(); + } + + /** + * Finds all rows from a multi-key B-Tree index that match the given key. + * Uses output parameter pattern to avoid unnecessary copies. + * Works with any RowType - use pointer types (UClassName*) for UObject-derived classes. + * + * @tparam KeyType The type of the key to search for in the index. + * @param OutResults Output array that will be filled with matching rows. + * @param Name The name of the B-Tree index to query. + * @param Key The key value to search for. + */ + template + void FindByMultiKeyBTreeIndex(TArray& OutResults, const FString& Name, const KeyType& Key) const + { + // Clear output array first + OutResults.Reset(); + + // Find the index object by its name. + const auto* IndexPtr = BTreeIndices.Find(Name); + if (!IndexPtr || !(*IndexPtr)) // Return empty if index is missing or invalid. + { + return; + } + + // Retrieve all serialized keys that match the provided search key. + const TArray>* SerializedKeys = (*IndexPtr)->FindKeys(&Key); + if (!SerializedKeys) // Return empty if no matching keys found. + { + return; + } + + // Loop through each serialized key to find the corresponding row entry. + for (const TArray& SerializedKey : *SerializedKeys) + { + const FRowEntry* Entry = Entries.Find(SerializedKey); + if (Entry && Entry->Row.IsValid()) // If the entry exists, add copy to the results. + { + OutResults.Add(*Entry->Row); + } + } + } + + /** + * Retrieves all rows currently stored in the table cache. + * + * @param AllRows Output array to be filled with copies of all rows. + */ + void GetValues(TArray& AllRows) const + { + // Temporary array to hold all FRowEntry objects from the Entries map + TArray> TempRowEntries; + Entries.GenerateValueArray(TempRowEntries); + + // Clear the output array to ensure no old data remains + AllRows.Empty(); + + // Extract the actual Row objects from each FRowEntry and add them to AllRows + for (const FRowEntry& Entry : TempRowEntries) + { + AllRows.Add(Entry.Row); // Add by value; assumes FRowEntry.Row is RowType or convertible + } + } + +}; diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/DBCache/TableHandle.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/DBCache/TableHandle.h new file mode 100644 index 00000000000..3ff446eede2 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/DBCache/TableHandle.h @@ -0,0 +1,142 @@ +#pragma once +#include "CoreMinimal.h" +#include "ClientCache.h" + +/* ============================================================================ * + * TableHandle.h (2025-05-28) + * ---------------------------------------------------------------------------- + * Lightweight façade giving gameplay code easy, read‑only access to a table + * inside UClientCache without exposing internal maps. + * ============================================================================ */ +template +class FTableHandle +{ +public: + TSharedPtr> Cache; + FString TableName; + + FTableHandle(TSharedPtr> InCache, const FString& InName) + : Cache(InCache), TableName(InName) + { + bValid = true; + if (!InCache.IsValid()) + { + UE_LOG(LogTemp, Error, TEXT("FTableHandle: Invalid table data for '%s'"), *InName); + bValid = false; + } + + if (InName.IsEmpty()) + { + UE_LOG(LogTemp, Warning, TEXT("FTableHandle created with empty name.")); + bValid = false; + } + } + + bool IsValid() const + { + return bValid; + } + + /** O(1) row count. */ + int64 Count() const + { + auto T = Cache->GetTable(TableName); + return T.IsValid() ? T->Entries.Num() : 0; + } + + /** Copy all rows into an array. */ + TArray GetAllRows() const + { + TArray Out; + + auto T = Cache->GetTable(TableName); + UE_LOG(LogTemp, Warning, + TEXT("GetTable(%s) valid=%d"), + *TableName, T.IsValid()); + + if (T.IsValid()) + { + for (const auto& Pair : T->Entries) + { + // Dereference the shared pointer to get the RowType value + Out.Add(*Pair.Value.Row); + } + } + return Out; + } + + /** Blueprint friendly alias for iterating over all rows. */ + TArray Iter() const + { + return GetAllRows(); + } + + /** Find a row via a unique index. */ + const RowType* FindUnique(const FString& IndexName, const void* Key) const + { + auto T = Cache->GetTable(TableName); + return T.IsValid() ? T->FindByUniqueIndex(IndexName, Key) : nullptr; + } + +private: + bool bValid; +}; + +/** Helper functionss for testing.Can be removed on production state. */ + +/** Templated functions to get all rows from table by name */ +template +TArray GetAllRowsFromTable(TSharedPtr> Cache, const FString& TableName) +{ + TArray Result; + FTableHandle Handle(Cache, TableName); + if (Handle.IsValid()) + { + Result = Handle.GetAllRows(); + } + return Result; +} + +/** Templated functions to get row count from table by name */ +template +int32 GetRowCountFromTable(TSharedPtr> Cache, const FString& TableName) +{ + FTableHandle Handle(Cache, TableName); + if (Handle.IsValid()) + { + return Handle.Count(); + } + return 0; +} + +/** Template class for unique indexes */ +template +class FUniqueIndexHelper +{ +public: + TSharedPtr Cache; // Table cache (can be assigned externally) + FString UniqueIndexName; // The name of the unique index + + // Constructor to set the index name + FUniqueIndexHelper(FString InUniqueIndexName = "") + : UniqueIndexName(InUniqueIndexName) + { + } + + TRowType FindUniqueIndex(TKeyType Key) + { + if (Cache != nullptr) + { + check(Cache->UniqueIndices.Contains(UniqueIndexName)); + { + const TRowType* Data = Cache->FindByUniqueIndex(UniqueIndexName, Key); + if (Data != nullptr) + { + TRowType ResultData = *Data; + return ResultData; + } + } + } + return TRowType(); // Return a default-constructed object if not found + } +}; diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/DBCache/UniqueConstraintHandle.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/DBCache/UniqueConstraintHandle.h new file mode 100644 index 00000000000..82ab7bf5d24 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/DBCache/UniqueConstraintHandle.h @@ -0,0 +1,27 @@ +#pragma once +#include "CoreMinimal.h" +#include "TableHandle.h" + +/* ============================================================================ * + * UniqueConstraintHandle.h (2025-05-28) + * ---------------------------------------------------------------------------- + * Convenience helper to call Find() with a typed column value instead of the + * void* required by IUniqueIndex. + * ============================================================================ */ +template +class FUniqueConstraintHandle +{ +public: + FTableHandle Table; + FString Constraint; + + FUniqueConstraintHandle(const FTableHandle& T, const FString& C) + : Table(T), Constraint(C) { } + + /** Return the row (if any) matching Key wrapped in TOptional. */ + TOptional Find(const ColType& Key) const + { + const RowType* Found = Table.FindUnique(Constraint, &Key); + return Found ? TOptional(*Found) : TOptional(); + } +}; diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/DBCache/UniqueIndex.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/DBCache/UniqueIndex.h new file mode 100644 index 00000000000..1fd8f78dcc3 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/DBCache/UniqueIndex.h @@ -0,0 +1,128 @@ +#pragma once +#include "CoreMinimal.h" +#include "IUniqueIndex.h" + +/* ============================================================================ * + * UniqueIndex.h (2025-05-28) + * ---------------------------------------------------------------------------- + * Concrete implementation of IBaseIndex. + * + * Template Parameters + * ------------------- + * RowType : Struct representing a table row. + * ColType : Type of the unique column (e.g. FString, int32). + * + * Internally stores a TMap. Duplicate keys cause a fatal + * error (mimicking Rust's panic! on violation of a unique constraint). + * ============================================================================ */ + +#include "Containers/Map.h" +#include "Templates/SharedPointer.h" + +template +class FUniqueIndex : public IBaseIndex +{ +public: + // Maps unique column values to their corresponding row shared pointers. + // Enforces one-to-one relationship between column value and row. + TMap> Rows; + + // Function to extract the unique key from a row. + // Used when adding, removing, or searching rows. + TFunction GetKeyFunc; + + // Constructor accepting a key extraction function. + // Uses MoveTemp for efficient move semantics. + explicit FUniqueIndex(TFunction InGetKeyFunc) + : GetKeyFunc(MoveTemp(InGetKeyFunc)) + { + } + + // Default virtual destructor to allow proper cleanup in derived classes. + virtual ~FUniqueIndex() = default; + + + /** + * Adds a row to the unique index. + * If the key already exists, the existing entry is replaced. + * + * @param Row Shared pointer to the row being added. + */ + virtual void AddRow(TSharedPtr Row) override + { + // Extract the unique key from the row. + const ColType Key = GetKey(*Row); + + // Insert or update the map with the new row pointer. + Rows.FindOrAdd(Key) = Row; // Replaces existing entry if key exists. + } + + + /** + * Removes a row from the unique index based on its unique key. + * + * @param Row Shared pointer to the row being removed. + */ + virtual void RemoveRow(TSharedPtr Row) override + { + // Extract the unique key from the row. + const ColType Key = GetKey(*Row); + + // Remove the entry with this key from the map. + int32 Removed = Rows.Remove(Key); + } + + + /** + * Finds a row in the unique index by the given key. + * + * @param KeyPtr Pointer to the key (type-erased as void*). + * @return Shared pointer to the const matching row, or nullptr if not found. + */ + virtual TSharedPtr FindRow(const void* KeyPtr) const override + { + if (!KeyPtr) // Validate input pointer + { + return nullptr; + } + + // Cast the void pointer back to the actual key type + const ColType& Key = *static_cast(KeyPtr); + + // Search for the key in the map + const TSharedPtr* Found = Rows.Find(Key); + + // If found and valid, log and return the const shared pointer + if (Found && Found->IsValid()) + { + return StaticCastSharedPtr(*Found); + } + + // Return nullptr if not found or invalid + return nullptr; + } + + + /** + * Extracts the unique key from the given row using the stored key extraction function. + * + * @param Row The row to extract the key from. + * @return The extracted key of type ColType. + */ + virtual ColType GetKey(const RowType& Row) const + { + return GetKeyFunc(Row); + } + +}; + +/** + * Computes a hash for a byte array using CRC32. + * + * @param Bytes The byte array to hash. + * @return 32-bit hash value. + */ +FORCEINLINE uint32 GetTypeHash(const TArray& Bytes) +{ + return FCrc::MemCrc32(Bytes.GetData(), Bytes.Num()); +} diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/DBCache/WithBsatn.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/DBCache/WithBsatn.h new file mode 100644 index 00000000000..e4c2a405459 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/DBCache/WithBsatn.h @@ -0,0 +1,17 @@ +#pragma once +#include "CoreMinimal.h" + +/** Wrapper holding a row and its BSATN serialized bytes */ +template +struct FWithBsatn +{ + /** Serialized BSATN bytes for this row */ + TArray Bsatn; + /** Deserialized row value */ + RowType Row; + + FWithBsatn() = default; + FWithBsatn(const TArray& InBsatn, const RowType& InRow) + : Bsatn(InBsatn), Row(InRow) { + } +}; \ No newline at end of file diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Optionals/SpacetimeDbSdkOptionalString.g.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Optionals/SpacetimeDbSdkOptionalString.g.h new file mode 100644 index 00000000000..8f152dad9c3 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Optionals/SpacetimeDbSdkOptionalString.g.h @@ -0,0 +1,61 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "SpacetimeDbSdkOptionalString.g.generated.h" + +USTRUCT(BlueprintType) +struct SPACETIMEDBSDK_API FSpacetimeDbSdkOptionalString +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + bool bHasValue = false; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB", meta = (EditCondition = "bHasValue")) + FString Value; + + FSpacetimeDbSdkOptionalString() = default; + + explicit FSpacetimeDbSdkOptionalString(const FString& InValue) + : bHasValue(true), Value(InValue) {} + + bool IsSet() const { return bHasValue; } + void Reset() { bHasValue = false; } + + FORCEINLINE bool operator==(const FSpacetimeDbSdkOptionalString& Other) const + { + if (bHasValue != Other.bHasValue) return false; + return !bHasValue || Value == Other.Value; + } + + FORCEINLINE bool operator!=(const FSpacetimeDbSdkOptionalString& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FSpacetimeDbSdkOptionalString. + * Hashes the HasValue flag and the Value if present. + * @param Optional The FSpacetimeDbSdkOptionalString instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FSpacetimeDbSdkOptionalString& Optional) +{ + uint32 Hash = GetTypeHash(Optional.bHasValue); + if (Optional.bHasValue) + { + Hash = HashCombine(Hash, GetTypeHash(Optional.Value)); + } + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FSpacetimeDbSdkOptionalString); + + UE_SPACETIMEDB_OPTIONAL(FSpacetimeDbSdkOptionalString, bHasValue, Value); +} diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Optionals/SpacetimeDbSdkOptionalUInt32.g.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Optionals/SpacetimeDbSdkOptionalUInt32.g.h new file mode 100644 index 00000000000..b3534dbe67b --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Optionals/SpacetimeDbSdkOptionalUInt32.g.h @@ -0,0 +1,61 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "SpacetimeDbSdkOptionalUInt32.g.generated.h" + +USTRUCT(BlueprintType) +struct SPACETIMEDBSDK_API FSpacetimeDbSdkOptionalUInt32 +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + bool bHasValue = false; + + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 Value; + + FSpacetimeDbSdkOptionalUInt32() = default; + + explicit FSpacetimeDbSdkOptionalUInt32(const uint32& InValue) + : bHasValue(true), Value(InValue) {} + + bool IsSet() const { return bHasValue; } + void Reset() { bHasValue = false; } + + FORCEINLINE bool operator==(const FSpacetimeDbSdkOptionalUInt32& Other) const + { + if (bHasValue != Other.bHasValue) return false; + return !bHasValue || Value == Other.Value; + } + + FORCEINLINE bool operator!=(const FSpacetimeDbSdkOptionalUInt32& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FSpacetimeDbSdkOptionalUInt32. + * Hashes the HasValue flag and the Value if present. + * @param Optional The FSpacetimeDbSdkOptionalUInt32 instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FSpacetimeDbSdkOptionalUInt32& Optional) +{ + uint32 Hash = GetTypeHash(Optional.bHasValue); + if (Optional.bHasValue) + { + Hash = HashCombine(Hash, GetTypeHash(Optional.Value)); + } + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FSpacetimeDbSdkOptionalUInt32); + + UE_SPACETIMEDB_OPTIONAL(FSpacetimeDbSdkOptionalUInt32, bHasValue, Value); +} diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/BsatnRowListType.g.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/BsatnRowListType.g.h new file mode 100644 index 00000000000..0a14b2fea71 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/BsatnRowListType.g.h @@ -0,0 +1,50 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Types/RowSizeHintType.g.h" +#include "BsatnRowListType.g.generated.h" + +USTRUCT(BlueprintType) +struct SPACETIMEDBSDK_API FBsatnRowListType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FRowSizeHintType SizeHint; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + TArray RowsData; + + FORCEINLINE bool operator==(const FBsatnRowListType& Other) const + { + return SizeHint == Other.SizeHint && RowsData == Other.RowsData; + } + + FORCEINLINE bool operator!=(const FBsatnRowListType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FBsatnRowListType. + * Combines the hashes of all fields that are compared in operator==. + * @param BsatnRowListType The FBsatnRowListType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FBsatnRowListType& BsatnRowListType) +{ + uint32 Hash = GetTypeHash(BsatnRowListType.SizeHint); + Hash = HashCombine(Hash, GetTypeHash(BsatnRowListType.RowsData)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FBsatnRowListType); + + UE_SPACETIMEDB_STRUCT(FBsatnRowListType, SizeHint, RowsData); +} diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/CallReducerType.g.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/CallReducerType.g.h new file mode 100644 index 00000000000..cbb8900e9c8 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/CallReducerType.g.h @@ -0,0 +1,57 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "CallReducerType.g.generated.h" + +USTRUCT(BlueprintType) +struct SPACETIMEDBSDK_API FCallReducerType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FString Reducer; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + TArray Args; + + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 RequestId; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + uint8 Flags; + + FORCEINLINE bool operator==(const FCallReducerType& Other) const + { + return Reducer == Other.Reducer && Args == Other.Args && RequestId == Other.RequestId && Flags == Other.Flags; + } + + FORCEINLINE bool operator!=(const FCallReducerType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FCallReducerType. + * Combines the hashes of all fields that are compared in operator==. + * @param CallReducerType The FCallReducerType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FCallReducerType& CallReducerType) +{ + uint32 Hash = GetTypeHash(CallReducerType.Reducer); + Hash = HashCombine(Hash, GetTypeHash(CallReducerType.Args)); + Hash = HashCombine(Hash, GetTypeHash(CallReducerType.RequestId)); + Hash = HashCombine(Hash, GetTypeHash(CallReducerType.Flags)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FCallReducerType); + + UE_SPACETIMEDB_STRUCT(FCallReducerType, Reducer, Args, RequestId, Flags); +} diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/ClientMessageType.g.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/ClientMessageType.g.h new file mode 100644 index 00000000000..68c178785ea --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/ClientMessageType.g.h @@ -0,0 +1,337 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Types/SubscribeMultiType.g.h" +#include "ModuleBindings/Types/UnsubscribeMultiType.g.h" +#include "ModuleBindings/Types/OneOffQueryType.g.h" +#include "ModuleBindings/Types/SubscribeSingleType.g.h" +#include "ModuleBindings/Types/SubscribeType.g.h" +#include "ModuleBindings/Types/UnsubscribeType.g.h" +#include "ModuleBindings/Types/CallReducerType.g.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "ClientMessageType.g.generated.h" + +UENUM(BlueprintType) +enum class EClientMessageTag : uint8 +{ + CallReducer, + Subscribe, + OneOffQuery, + SubscribeSingle, + SubscribeMulti, + Unsubscribe, + UnsubscribeMulti +}; + +USTRUCT(BlueprintType) +struct SPACETIMEDBSDK_API FClientMessageType +{ + GENERATED_BODY() + +public: + FClientMessageType() = default; + + TVariant MessageData; + + UPROPERTY(BlueprintReadOnly) + EClientMessageTag Tag; + + static FClientMessageType CallReducer(const FCallReducerType& Value) + { + FClientMessageType Obj; + Obj.Tag = EClientMessageTag::CallReducer; + Obj.MessageData.Set(Value); + return Obj; + } + + static FClientMessageType Subscribe(const FSubscribeType& Value) + { + FClientMessageType Obj; + Obj.Tag = EClientMessageTag::Subscribe; + Obj.MessageData.Set(Value); + return Obj; + } + + static FClientMessageType OneOffQuery(const FOneOffQueryType& Value) + { + FClientMessageType Obj; + Obj.Tag = EClientMessageTag::OneOffQuery; + Obj.MessageData.Set(Value); + return Obj; + } + + static FClientMessageType SubscribeSingle(const FSubscribeSingleType& Value) + { + FClientMessageType Obj; + Obj.Tag = EClientMessageTag::SubscribeSingle; + Obj.MessageData.Set(Value); + return Obj; + } + + static FClientMessageType SubscribeMulti(const FSubscribeMultiType& Value) + { + FClientMessageType Obj; + Obj.Tag = EClientMessageTag::SubscribeMulti; + Obj.MessageData.Set(Value); + return Obj; + } + + static FClientMessageType Unsubscribe(const FUnsubscribeType& Value) + { + FClientMessageType Obj; + Obj.Tag = EClientMessageTag::Unsubscribe; + Obj.MessageData.Set(Value); + return Obj; + } + + static FClientMessageType UnsubscribeMulti(const FUnsubscribeMultiType& Value) + { + FClientMessageType Obj; + Obj.Tag = EClientMessageTag::UnsubscribeMulti; + Obj.MessageData.Set(Value); + return Obj; + } + + FORCEINLINE bool IsCallReducer() const { return Tag == EClientMessageTag::CallReducer; } + + FORCEINLINE FCallReducerType GetAsCallReducer() const + { + ensureMsgf(IsCallReducer(), TEXT("MessageData does not hold CallReducer!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsSubscribe() const { return Tag == EClientMessageTag::Subscribe; } + + FORCEINLINE FSubscribeType GetAsSubscribe() const + { + ensureMsgf(IsSubscribe(), TEXT("MessageData does not hold Subscribe!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsOneOffQuery() const { return Tag == EClientMessageTag::OneOffQuery; } + + FORCEINLINE FOneOffQueryType GetAsOneOffQuery() const + { + ensureMsgf(IsOneOffQuery(), TEXT("MessageData does not hold OneOffQuery!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsSubscribeSingle() const { return Tag == EClientMessageTag::SubscribeSingle; } + + FORCEINLINE FSubscribeSingleType GetAsSubscribeSingle() const + { + ensureMsgf(IsSubscribeSingle(), TEXT("MessageData does not hold SubscribeSingle!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsSubscribeMulti() const { return Tag == EClientMessageTag::SubscribeMulti; } + + FORCEINLINE FSubscribeMultiType GetAsSubscribeMulti() const + { + ensureMsgf(IsSubscribeMulti(), TEXT("MessageData does not hold SubscribeMulti!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsUnsubscribe() const { return Tag == EClientMessageTag::Unsubscribe; } + + FORCEINLINE FUnsubscribeType GetAsUnsubscribe() const + { + ensureMsgf(IsUnsubscribe(), TEXT("MessageData does not hold Unsubscribe!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsUnsubscribeMulti() const { return Tag == EClientMessageTag::UnsubscribeMulti; } + + FORCEINLINE FUnsubscribeMultiType GetAsUnsubscribeMulti() const + { + ensureMsgf(IsUnsubscribeMulti(), TEXT("MessageData does not hold UnsubscribeMulti!")); + return MessageData.Get(); + } + + // Inline equality operators + FORCEINLINE bool operator==(const FClientMessageType& Other) const + { + if (Tag != Other.Tag) return false; + + switch (Tag) + { + case EClientMessageTag::CallReducer: + return GetAsCallReducer() == Other.GetAsCallReducer(); + case EClientMessageTag::Subscribe: + return GetAsSubscribe() == Other.GetAsSubscribe(); + case EClientMessageTag::OneOffQuery: + return GetAsOneOffQuery() == Other.GetAsOneOffQuery(); + case EClientMessageTag::SubscribeSingle: + return GetAsSubscribeSingle() == Other.GetAsSubscribeSingle(); + case EClientMessageTag::SubscribeMulti: + return GetAsSubscribeMulti() == Other.GetAsSubscribeMulti(); + case EClientMessageTag::Unsubscribe: + return GetAsUnsubscribe() == Other.GetAsUnsubscribe(); + case EClientMessageTag::UnsubscribeMulti: + return GetAsUnsubscribeMulti() == Other.GetAsUnsubscribeMulti(); + default: + return false; + } + } + + FORCEINLINE bool operator!=(const FClientMessageType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FClientMessageType. + * Combines the hashes of all fields that are compared in operator==. + * @param ClientMessageType The FClientMessageType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FClientMessageType& ClientMessage) +{ + const uint32 TagHash = GetTypeHash(static_cast(ClientMessage.Tag)); + switch (ClientMessage.Tag) + { + case EClientMessageTag::CallReducer: return HashCombine(TagHash, ::GetTypeHash(ClientMessage.GetAsCallReducer())); + case EClientMessageTag::Subscribe: return HashCombine(TagHash, ::GetTypeHash(ClientMessage.GetAsSubscribe())); + case EClientMessageTag::OneOffQuery: return HashCombine(TagHash, ::GetTypeHash(ClientMessage.GetAsOneOffQuery())); + case EClientMessageTag::SubscribeSingle: return HashCombine(TagHash, ::GetTypeHash(ClientMessage.GetAsSubscribeSingle())); + case EClientMessageTag::SubscribeMulti: return HashCombine(TagHash, ::GetTypeHash(ClientMessage.GetAsSubscribeMulti())); + case EClientMessageTag::Unsubscribe: return HashCombine(TagHash, ::GetTypeHash(ClientMessage.GetAsUnsubscribe())); + case EClientMessageTag::UnsubscribeMulti: return HashCombine(TagHash, ::GetTypeHash(ClientMessage.GetAsUnsubscribeMulti())); + default: return TagHash; + } +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FClientMessageType); + + UE_SPACETIMEDB_TAGGED_ENUM( + FClientMessageType, + EClientMessageTag, + MessageData, + CallReducer, FCallReducerType, + Subscribe, FSubscribeType, + OneOffQuery, FOneOffQueryType, + SubscribeSingle, FSubscribeSingleType, + SubscribeMulti, FSubscribeMultiType, + Unsubscribe, FUnsubscribeType, + UnsubscribeMulti, FUnsubscribeMultiType + ); +} + +UCLASS() +class SPACETIMEDBSDK_API UClientMessageBpLib : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() + +private: + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|ClientMessage") + static FClientMessageType CallReducer(const FCallReducerType& InValue) + { + return FClientMessageType::CallReducer(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|ClientMessage") + static bool IsCallReducer(const FClientMessageType& InValue) { return InValue.IsCallReducer(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|ClientMessage") + static FCallReducerType GetAsCallReducer(const FClientMessageType& InValue) + { + return InValue.GetAsCallReducer(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|ClientMessage") + static FClientMessageType Subscribe(const FSubscribeType& InValue) + { + return FClientMessageType::Subscribe(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|ClientMessage") + static bool IsSubscribe(const FClientMessageType& InValue) { return InValue.IsSubscribe(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|ClientMessage") + static FSubscribeType GetAsSubscribe(const FClientMessageType& InValue) + { + return InValue.GetAsSubscribe(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|ClientMessage") + static FClientMessageType OneOffQuery(const FOneOffQueryType& InValue) + { + return FClientMessageType::OneOffQuery(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|ClientMessage") + static bool IsOneOffQuery(const FClientMessageType& InValue) { return InValue.IsOneOffQuery(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|ClientMessage") + static FOneOffQueryType GetAsOneOffQuery(const FClientMessageType& InValue) + { + return InValue.GetAsOneOffQuery(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|ClientMessage") + static FClientMessageType SubscribeSingle(const FSubscribeSingleType& InValue) + { + return FClientMessageType::SubscribeSingle(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|ClientMessage") + static bool IsSubscribeSingle(const FClientMessageType& InValue) { return InValue.IsSubscribeSingle(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|ClientMessage") + static FSubscribeSingleType GetAsSubscribeSingle(const FClientMessageType& InValue) + { + return InValue.GetAsSubscribeSingle(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|ClientMessage") + static FClientMessageType SubscribeMulti(const FSubscribeMultiType& InValue) + { + return FClientMessageType::SubscribeMulti(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|ClientMessage") + static bool IsSubscribeMulti(const FClientMessageType& InValue) { return InValue.IsSubscribeMulti(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|ClientMessage") + static FSubscribeMultiType GetAsSubscribeMulti(const FClientMessageType& InValue) + { + return InValue.GetAsSubscribeMulti(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|ClientMessage") + static FClientMessageType Unsubscribe(const FUnsubscribeType& InValue) + { + return FClientMessageType::Unsubscribe(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|ClientMessage") + static bool IsUnsubscribe(const FClientMessageType& InValue) { return InValue.IsUnsubscribe(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|ClientMessage") + static FUnsubscribeType GetAsUnsubscribe(const FClientMessageType& InValue) + { + return InValue.GetAsUnsubscribe(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|ClientMessage") + static FClientMessageType UnsubscribeMulti(const FUnsubscribeMultiType& InValue) + { + return FClientMessageType::UnsubscribeMulti(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|ClientMessage") + static bool IsUnsubscribeMulti(const FClientMessageType& InValue) { return InValue.IsUnsubscribeMulti(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|ClientMessage") + static FUnsubscribeMultiType GetAsUnsubscribeMulti(const FClientMessageType& InValue) + { + return InValue.GetAsUnsubscribeMulti(); + } + +}; diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/CompressableQueryUpdateType.g.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/CompressableQueryUpdateType.g.h new file mode 100644 index 00000000000..9b1fb55d7d7 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/CompressableQueryUpdateType.g.h @@ -0,0 +1,187 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Types/QueryUpdateType.g.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "CompressableQueryUpdateType.g.generated.h" + +UENUM(BlueprintType) +enum class ECompressableQueryUpdateTag : uint8 +{ + Uncompressed, + Brotli, + Gzip +}; + +USTRUCT(BlueprintType) +struct SPACETIMEDBSDK_API FCompressableQueryUpdateType +{ + GENERATED_BODY() + +public: + FCompressableQueryUpdateType() = default; + + TVariant, FQueryUpdateType> MessageData; + + UPROPERTY(BlueprintReadOnly) + ECompressableQueryUpdateTag Tag; + + static FCompressableQueryUpdateType Uncompressed(const FQueryUpdateType& Value) + { + FCompressableQueryUpdateType Obj; + Obj.Tag = ECompressableQueryUpdateTag::Uncompressed; + Obj.MessageData.Set(Value); + return Obj; + } + + static FCompressableQueryUpdateType Brotli(const TArray& Value) + { + FCompressableQueryUpdateType Obj; + Obj.Tag = ECompressableQueryUpdateTag::Brotli; + Obj.MessageData.Set>(Value); + return Obj; + } + + static FCompressableQueryUpdateType Gzip(const TArray& Value) + { + FCompressableQueryUpdateType Obj; + Obj.Tag = ECompressableQueryUpdateTag::Gzip; + Obj.MessageData.Set>(Value); + return Obj; + } + + FORCEINLINE bool IsUncompressed() const { return Tag == ECompressableQueryUpdateTag::Uncompressed; } + + FORCEINLINE FQueryUpdateType GetAsUncompressed() const + { + ensureMsgf(IsUncompressed(), TEXT("MessageData does not hold Uncompressed!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsBrotli() const { return Tag == ECompressableQueryUpdateTag::Brotli; } + + FORCEINLINE TArray GetAsBrotli() const + { + ensureMsgf(IsBrotli(), TEXT("MessageData does not hold Brotli!")); + return MessageData.Get>(); + } + + FORCEINLINE bool IsGzip() const { return Tag == ECompressableQueryUpdateTag::Gzip; } + + FORCEINLINE TArray GetAsGzip() const + { + ensureMsgf(IsGzip(), TEXT("MessageData does not hold Gzip!")); + return MessageData.Get>(); + } + + // Inline equality operators + FORCEINLINE bool operator==(const FCompressableQueryUpdateType& Other) const + { + if (Tag != Other.Tag) return false; + + switch (Tag) + { + case ECompressableQueryUpdateTag::Uncompressed: + return GetAsUncompressed() == Other.GetAsUncompressed(); + case ECompressableQueryUpdateTag::Brotli: + return GetAsBrotli() == Other.GetAsBrotli(); + case ECompressableQueryUpdateTag::Gzip: + return GetAsGzip() == Other.GetAsGzip(); + default: + return false; + } + } + + FORCEINLINE bool operator!=(const FCompressableQueryUpdateType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FCompressableQueryUpdateType. + * Combines the hashes of all fields that are compared in operator==. + * @param CompressableQueryUpdateType The FCompressableQueryUpdateType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FCompressableQueryUpdateType& CompressableQueryUpdate) +{ + const uint32 TagHash = GetTypeHash(static_cast(CompressableQueryUpdate.Tag)); + switch (CompressableQueryUpdate.Tag) + { + case ECompressableQueryUpdateTag::Uncompressed: return HashCombine(TagHash, ::GetTypeHash(CompressableQueryUpdate.GetAsUncompressed())); + case ECompressableQueryUpdateTag::Brotli: return HashCombine(TagHash, ::GetTypeHash(CompressableQueryUpdate.GetAsBrotli())); + case ECompressableQueryUpdateTag::Gzip: return HashCombine(TagHash, ::GetTypeHash(CompressableQueryUpdate.GetAsGzip())); + default: return TagHash; + } +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FCompressableQueryUpdateType); + + UE_SPACETIMEDB_TAGGED_ENUM( + FCompressableQueryUpdateType, + ECompressableQueryUpdateTag, + MessageData, + Uncompressed, FQueryUpdateType, + Brotli, TArray, + Gzip, TArray + ); +} + +UCLASS() +class SPACETIMEDBSDK_API UCompressableQueryUpdateBpLib : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() + +private: + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|CompressableQueryUpdate") + static FCompressableQueryUpdateType Uncompressed(const FQueryUpdateType& InValue) + { + return FCompressableQueryUpdateType::Uncompressed(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|CompressableQueryUpdate") + static bool IsUncompressed(const FCompressableQueryUpdateType& InValue) { return InValue.IsUncompressed(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|CompressableQueryUpdate") + static FQueryUpdateType GetAsUncompressed(const FCompressableQueryUpdateType& InValue) + { + return InValue.GetAsUncompressed(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|CompressableQueryUpdate") + static FCompressableQueryUpdateType Brotli(const TArray& InValue) + { + return FCompressableQueryUpdateType::Brotli(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|CompressableQueryUpdate") + static bool IsBrotli(const FCompressableQueryUpdateType& InValue) { return InValue.IsBrotli(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|CompressableQueryUpdate") + static TArray GetAsBrotli(const FCompressableQueryUpdateType& InValue) + { + return InValue.GetAsBrotli(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|CompressableQueryUpdate") + static FCompressableQueryUpdateType Gzip(const TArray& InValue) + { + return FCompressableQueryUpdateType::Gzip(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|CompressableQueryUpdate") + static bool IsGzip(const FCompressableQueryUpdateType& InValue) { return InValue.IsGzip(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|CompressableQueryUpdate") + static TArray GetAsGzip(const FCompressableQueryUpdateType& InValue) + { + return InValue.GetAsGzip(); + } + +}; diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/DatabaseUpdateType.g.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/DatabaseUpdateType.g.h new file mode 100644 index 00000000000..4342fde61d0 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/DatabaseUpdateType.g.h @@ -0,0 +1,46 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Types/TableUpdateType.g.h" +#include "DatabaseUpdateType.g.generated.h" + +USTRUCT(BlueprintType) +struct SPACETIMEDBSDK_API FDatabaseUpdateType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + TArray Tables; + + FORCEINLINE bool operator==(const FDatabaseUpdateType& Other) const + { + return Tables == Other.Tables; + } + + FORCEINLINE bool operator!=(const FDatabaseUpdateType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FDatabaseUpdateType. + * Combines the hashes of all fields that are compared in operator==. + * @param DatabaseUpdateType The FDatabaseUpdateType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FDatabaseUpdateType& DatabaseUpdateType) +{ + uint32 Hash = GetTypeHash(DatabaseUpdateType.Tables); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FDatabaseUpdateType); + + UE_SPACETIMEDB_STRUCT(FDatabaseUpdateType, Tables); +} diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/EnergyQuantaType.g.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/EnergyQuantaType.g.h new file mode 100644 index 00000000000..3183608322f --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/EnergyQuantaType.g.h @@ -0,0 +1,46 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "EnergyQuantaType.g.generated.h" + +USTRUCT(BlueprintType) +struct SPACETIMEDBSDK_API FEnergyQuantaType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBUInt128 Quanta; + + FORCEINLINE bool operator==(const FEnergyQuantaType& Other) const + { + return Quanta == Other.Quanta; + } + + FORCEINLINE bool operator!=(const FEnergyQuantaType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FEnergyQuantaType. + * Combines the hashes of all fields that are compared in operator==. + * @param EnergyQuantaType The FEnergyQuantaType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FEnergyQuantaType& EnergyQuantaType) +{ + uint32 Hash = GetTypeHash(EnergyQuantaType.Quanta); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FEnergyQuantaType); + + UE_SPACETIMEDB_STRUCT(FEnergyQuantaType, Quanta); +} diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/IdentityTokenType.g.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/IdentityTokenType.g.h new file mode 100644 index 00000000000..bc1aeac671f --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/IdentityTokenType.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "IdentityTokenType.g.generated.h" + +USTRUCT(BlueprintType) +struct SPACETIMEDBSDK_API FIdentityTokenType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBIdentity Identity; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FString Token; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBConnectionId ConnectionId; + + FORCEINLINE bool operator==(const FIdentityTokenType& Other) const + { + return Identity == Other.Identity && Token == Other.Token && ConnectionId == Other.ConnectionId; + } + + FORCEINLINE bool operator!=(const FIdentityTokenType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FIdentityTokenType. + * Combines the hashes of all fields that are compared in operator==. + * @param IdentityTokenType The FIdentityTokenType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FIdentityTokenType& IdentityTokenType) +{ + uint32 Hash = GetTypeHash(IdentityTokenType.Identity); + Hash = HashCombine(Hash, GetTypeHash(IdentityTokenType.Token)); + Hash = HashCombine(Hash, GetTypeHash(IdentityTokenType.ConnectionId)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FIdentityTokenType); + + UE_SPACETIMEDB_STRUCT(FIdentityTokenType, Identity, Token, ConnectionId); +} diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/InitialSubscriptionType.g.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/InitialSubscriptionType.g.h new file mode 100644 index 00000000000..73c4020fe8a --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/InitialSubscriptionType.g.h @@ -0,0 +1,55 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Types/DatabaseUpdateType.g.h" +#include "Types/Builtins.h" +#include "InitialSubscriptionType.g.generated.h" + +USTRUCT(BlueprintType) +struct SPACETIMEDBSDK_API FInitialSubscriptionType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FDatabaseUpdateType DatabaseUpdate; + + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 RequestId; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBTimeDuration TotalHostExecutionDuration; + + FORCEINLINE bool operator==(const FInitialSubscriptionType& Other) const + { + return DatabaseUpdate == Other.DatabaseUpdate && RequestId == Other.RequestId && TotalHostExecutionDuration == Other.TotalHostExecutionDuration; + } + + FORCEINLINE bool operator!=(const FInitialSubscriptionType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FInitialSubscriptionType. + * Combines the hashes of all fields that are compared in operator==. + * @param InitialSubscriptionType The FInitialSubscriptionType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FInitialSubscriptionType& InitialSubscriptionType) +{ + uint32 Hash = GetTypeHash(InitialSubscriptionType.DatabaseUpdate); + Hash = HashCombine(Hash, GetTypeHash(InitialSubscriptionType.RequestId)); + Hash = HashCombine(Hash, GetTypeHash(InitialSubscriptionType.TotalHostExecutionDuration)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FInitialSubscriptionType); + + UE_SPACETIMEDB_STRUCT(FInitialSubscriptionType, DatabaseUpdate, RequestId, TotalHostExecutionDuration); +} diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/OneOffQueryResponseType.g.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/OneOffQueryResponseType.g.h new file mode 100644 index 00000000000..52cf4140c6d --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/OneOffQueryResponseType.g.h @@ -0,0 +1,60 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Optionals/SpacetimeDbSdkOptionalString.g.h" +#include "ModuleBindings/Types/OneOffTableType.g.h" +#include "Types/Builtins.h" +#include "OneOffQueryResponseType.g.generated.h" + +USTRUCT(BlueprintType) +struct SPACETIMEDBSDK_API FOneOffQueryResponseType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + TArray MessageId; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDbSdkOptionalString Error; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + TArray Tables; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBTimeDuration TotalHostExecutionDuration; + + FORCEINLINE bool operator==(const FOneOffQueryResponseType& Other) const + { + return MessageId == Other.MessageId && Error == Other.Error && Tables == Other.Tables && TotalHostExecutionDuration == Other.TotalHostExecutionDuration; + } + + FORCEINLINE bool operator!=(const FOneOffQueryResponseType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FOneOffQueryResponseType. + * Combines the hashes of all fields that are compared in operator==. + * @param OneOffQueryResponseType The FOneOffQueryResponseType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FOneOffQueryResponseType& OneOffQueryResponseType) +{ + uint32 Hash = GetTypeHash(OneOffQueryResponseType.MessageId); + Hash = HashCombine(Hash, GetTypeHash(OneOffQueryResponseType.Error)); + Hash = HashCombine(Hash, GetTypeHash(OneOffQueryResponseType.Tables)); + Hash = HashCombine(Hash, GetTypeHash(OneOffQueryResponseType.TotalHostExecutionDuration)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FOneOffQueryResponseType); + + UE_SPACETIMEDB_STRUCT(FOneOffQueryResponseType, MessageId, Error, Tables, TotalHostExecutionDuration); +} diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/OneOffQueryType.g.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/OneOffQueryType.g.h new file mode 100644 index 00000000000..f32539e1fa0 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/OneOffQueryType.g.h @@ -0,0 +1,49 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "OneOffQueryType.g.generated.h" + +USTRUCT(BlueprintType) +struct SPACETIMEDBSDK_API FOneOffQueryType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + TArray MessageId; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FString QueryString; + + FORCEINLINE bool operator==(const FOneOffQueryType& Other) const + { + return MessageId == Other.MessageId && QueryString == Other.QueryString; + } + + FORCEINLINE bool operator!=(const FOneOffQueryType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FOneOffQueryType. + * Combines the hashes of all fields that are compared in operator==. + * @param OneOffQueryType The FOneOffQueryType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FOneOffQueryType& OneOffQueryType) +{ + uint32 Hash = GetTypeHash(OneOffQueryType.MessageId); + Hash = HashCombine(Hash, GetTypeHash(OneOffQueryType.QueryString)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FOneOffQueryType); + + UE_SPACETIMEDB_STRUCT(FOneOffQueryType, MessageId, QueryString); +} diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/OneOffTableType.g.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/OneOffTableType.g.h new file mode 100644 index 00000000000..5f4f93a2672 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/OneOffTableType.g.h @@ -0,0 +1,50 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Types/BsatnRowListType.g.h" +#include "OneOffTableType.g.generated.h" + +USTRUCT(BlueprintType) +struct SPACETIMEDBSDK_API FOneOffTableType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FString TableName; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FBsatnRowListType Rows; + + FORCEINLINE bool operator==(const FOneOffTableType& Other) const + { + return TableName == Other.TableName && Rows == Other.Rows; + } + + FORCEINLINE bool operator!=(const FOneOffTableType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FOneOffTableType. + * Combines the hashes of all fields that are compared in operator==. + * @param OneOffTableType The FOneOffTableType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FOneOffTableType& OneOffTableType) +{ + uint32 Hash = GetTypeHash(OneOffTableType.TableName); + Hash = HashCombine(Hash, GetTypeHash(OneOffTableType.Rows)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FOneOffTableType); + + UE_SPACETIMEDB_STRUCT(FOneOffTableType, TableName, Rows); +} diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/QueryIdType.g.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/QueryIdType.g.h new file mode 100644 index 00000000000..4b6118fd288 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/QueryIdType.g.h @@ -0,0 +1,45 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "QueryIdType.g.generated.h" + +USTRUCT(BlueprintType) +struct SPACETIMEDBSDK_API FQueryIdType +{ + GENERATED_BODY() + + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 Id; + + FORCEINLINE bool operator==(const FQueryIdType& Other) const + { + return Id == Other.Id; + } + + FORCEINLINE bool operator!=(const FQueryIdType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FQueryIdType. + * Combines the hashes of all fields that are compared in operator==. + * @param QueryIdType The FQueryIdType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FQueryIdType& QueryIdType) +{ + uint32 Hash = GetTypeHash(QueryIdType.Id); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FQueryIdType); + + UE_SPACETIMEDB_STRUCT(FQueryIdType, Id); +} diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/QueryUpdateType.g.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/QueryUpdateType.g.h new file mode 100644 index 00000000000..d710b49a324 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/QueryUpdateType.g.h @@ -0,0 +1,50 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Types/BsatnRowListType.g.h" +#include "QueryUpdateType.g.generated.h" + +USTRUCT(BlueprintType) +struct SPACETIMEDBSDK_API FQueryUpdateType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FBsatnRowListType Deletes; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FBsatnRowListType Inserts; + + FORCEINLINE bool operator==(const FQueryUpdateType& Other) const + { + return Deletes == Other.Deletes && Inserts == Other.Inserts; + } + + FORCEINLINE bool operator!=(const FQueryUpdateType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FQueryUpdateType. + * Combines the hashes of all fields that are compared in operator==. + * @param QueryUpdateType The FQueryUpdateType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FQueryUpdateType& QueryUpdateType) +{ + uint32 Hash = GetTypeHash(QueryUpdateType.Deletes); + Hash = HashCombine(Hash, GetTypeHash(QueryUpdateType.Inserts)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FQueryUpdateType); + + UE_SPACETIMEDB_STRUCT(FQueryUpdateType, Deletes, Inserts); +} diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/ReducerCallInfoType.g.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/ReducerCallInfoType.g.h new file mode 100644 index 00000000000..0ff8aa51174 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/ReducerCallInfoType.g.h @@ -0,0 +1,57 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ReducerCallInfoType.g.generated.h" + +USTRUCT(BlueprintType) +struct SPACETIMEDBSDK_API FReducerCallInfoType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FString ReducerName; + + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 ReducerId; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + TArray Args; + + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 RequestId; + + FORCEINLINE bool operator==(const FReducerCallInfoType& Other) const + { + return ReducerName == Other.ReducerName && ReducerId == Other.ReducerId && Args == Other.Args && RequestId == Other.RequestId; + } + + FORCEINLINE bool operator!=(const FReducerCallInfoType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FReducerCallInfoType. + * Combines the hashes of all fields that are compared in operator==. + * @param ReducerCallInfoType The FReducerCallInfoType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FReducerCallInfoType& ReducerCallInfoType) +{ + uint32 Hash = GetTypeHash(ReducerCallInfoType.ReducerName); + Hash = HashCombine(Hash, GetTypeHash(ReducerCallInfoType.ReducerId)); + Hash = HashCombine(Hash, GetTypeHash(ReducerCallInfoType.Args)); + Hash = HashCombine(Hash, GetTypeHash(ReducerCallInfoType.RequestId)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FReducerCallInfoType); + + UE_SPACETIMEDB_STRUCT(FReducerCallInfoType, ReducerName, ReducerId, Args, RequestId); +} diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/RowSizeHintType.g.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/RowSizeHintType.g.h new file mode 100644 index 00000000000..479ffca818d --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/RowSizeHintType.g.h @@ -0,0 +1,150 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "RowSizeHintType.g.generated.h" + +UENUM(BlueprintType) +enum class ERowSizeHintTag : uint8 +{ + FixedSize, + RowOffsets +}; + +USTRUCT(BlueprintType) +struct SPACETIMEDBSDK_API FRowSizeHintType +{ + GENERATED_BODY() + +public: + FRowSizeHintType() = default; + + TVariant, uint16> MessageData; + + UPROPERTY(BlueprintReadOnly) + ERowSizeHintTag Tag; + + static FRowSizeHintType FixedSize(const uint16& Value) + { + FRowSizeHintType Obj; + Obj.Tag = ERowSizeHintTag::FixedSize; + Obj.MessageData.Set(Value); + return Obj; + } + + static FRowSizeHintType RowOffsets(const TArray& Value) + { + FRowSizeHintType Obj; + Obj.Tag = ERowSizeHintTag::RowOffsets; + Obj.MessageData.Set>(Value); + return Obj; + } + + FORCEINLINE bool IsFixedSize() const { return Tag == ERowSizeHintTag::FixedSize; } + + FORCEINLINE uint16 GetAsFixedSize() const + { + ensureMsgf(IsFixedSize(), TEXT("MessageData does not hold FixedSize!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsRowOffsets() const { return Tag == ERowSizeHintTag::RowOffsets; } + + FORCEINLINE TArray GetAsRowOffsets() const + { + ensureMsgf(IsRowOffsets(), TEXT("MessageData does not hold RowOffsets!")); + return MessageData.Get>(); + } + + // Inline equality operators + FORCEINLINE bool operator==(const FRowSizeHintType& Other) const + { + if (Tag != Other.Tag) return false; + + switch (Tag) + { + case ERowSizeHintTag::FixedSize: + return GetAsFixedSize() == Other.GetAsFixedSize(); + case ERowSizeHintTag::RowOffsets: + return GetAsRowOffsets() == Other.GetAsRowOffsets(); + default: + return false; + } + } + + FORCEINLINE bool operator!=(const FRowSizeHintType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FRowSizeHintType. + * Combines the hashes of all fields that are compared in operator==. + * @param RowSizeHintType The FRowSizeHintType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FRowSizeHintType& RowSizeHint) +{ + const uint32 TagHash = GetTypeHash(static_cast(RowSizeHint.Tag)); + switch (RowSizeHint.Tag) + { + case ERowSizeHintTag::FixedSize: return HashCombine(TagHash, GetTypeHash(RowSizeHint.GetAsFixedSize())); + case ERowSizeHintTag::RowOffsets: return HashCombine(TagHash, ::GetTypeHash(RowSizeHint.GetAsRowOffsets())); + default: return TagHash; + } +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FRowSizeHintType); + + UE_SPACETIMEDB_TAGGED_ENUM( + FRowSizeHintType, + ERowSizeHintTag, + MessageData, + FixedSize, uint16, + RowOffsets, TArray + ); +} + +UCLASS() +class SPACETIMEDBSDK_API URowSizeHintBpLib : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() + +private: + // NOTE: Not exposed to Blueprint because uint16 types are not Blueprint-compatible + static FRowSizeHintType FixedSize(const uint16& InValue) + { + return FRowSizeHintType::FixedSize(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|RowSizeHint") + static bool IsFixedSize(const FRowSizeHintType& InValue) { return InValue.IsFixedSize(); } + + // NOTE: Not exposed to Blueprint because uint16 types are not Blueprint-compatible + static uint16 GetAsFixedSize(const FRowSizeHintType& InValue) + { + return InValue.GetAsFixedSize(); + } + + // NOTE: Not exposed to Blueprint because TArray types are not Blueprint-compatible + static FRowSizeHintType RowOffsets(const TArray& InValue) + { + return FRowSizeHintType::RowOffsets(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|RowSizeHint") + static bool IsRowOffsets(const FRowSizeHintType& InValue) { return InValue.IsRowOffsets(); } + + // NOTE: Not exposed to Blueprint because TArray types are not Blueprint-compatible + static TArray GetAsRowOffsets(const FRowSizeHintType& InValue) + { + return InValue.GetAsRowOffsets(); + } + +}; diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/ServerMessageType.g.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/ServerMessageType.g.h new file mode 100644 index 00000000000..3350fd77479 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/ServerMessageType.g.h @@ -0,0 +1,448 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Types/UnsubscribeMultiAppliedType.g.h" +#include "ModuleBindings/Types/UnsubscribeAppliedType.g.h" +#include "ModuleBindings/Types/SubscriptionErrorType.g.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "ModuleBindings/Types/InitialSubscriptionType.g.h" +#include "ModuleBindings/Types/TransactionUpdateType.g.h" +#include "ModuleBindings/Types/OneOffQueryResponseType.g.h" +#include "ModuleBindings/Types/SubscribeAppliedType.g.h" +#include "ModuleBindings/Types/SubscribeMultiAppliedType.g.h" +#include "ModuleBindings/Types/IdentityTokenType.g.h" +#include "ModuleBindings/Types/TransactionUpdateLightType.g.h" +#include "ServerMessageType.g.generated.h" + +UENUM(BlueprintType) +enum class EServerMessageTag : uint8 +{ + InitialSubscription, + TransactionUpdate, + TransactionUpdateLight, + IdentityToken, + OneOffQueryResponse, + SubscribeApplied, + UnsubscribeApplied, + SubscriptionError, + SubscribeMultiApplied, + UnsubscribeMultiApplied +}; + +USTRUCT(BlueprintType) +struct SPACETIMEDBSDK_API FServerMessageType +{ + GENERATED_BODY() + +public: + FServerMessageType() = default; + + TVariant MessageData; + + UPROPERTY(BlueprintReadOnly) + EServerMessageTag Tag; + + static FServerMessageType InitialSubscription(const FInitialSubscriptionType& Value) + { + FServerMessageType Obj; + Obj.Tag = EServerMessageTag::InitialSubscription; + Obj.MessageData.Set(Value); + return Obj; + } + + static FServerMessageType TransactionUpdate(const FTransactionUpdateType& Value) + { + FServerMessageType Obj; + Obj.Tag = EServerMessageTag::TransactionUpdate; + Obj.MessageData.Set(Value); + return Obj; + } + + static FServerMessageType TransactionUpdateLight(const FTransactionUpdateLightType& Value) + { + FServerMessageType Obj; + Obj.Tag = EServerMessageTag::TransactionUpdateLight; + Obj.MessageData.Set(Value); + return Obj; + } + + static FServerMessageType IdentityToken(const FIdentityTokenType& Value) + { + FServerMessageType Obj; + Obj.Tag = EServerMessageTag::IdentityToken; + Obj.MessageData.Set(Value); + return Obj; + } + + static FServerMessageType OneOffQueryResponse(const FOneOffQueryResponseType& Value) + { + FServerMessageType Obj; + Obj.Tag = EServerMessageTag::OneOffQueryResponse; + Obj.MessageData.Set(Value); + return Obj; + } + + static FServerMessageType SubscribeApplied(const FSubscribeAppliedType& Value) + { + FServerMessageType Obj; + Obj.Tag = EServerMessageTag::SubscribeApplied; + Obj.MessageData.Set(Value); + return Obj; + } + + static FServerMessageType UnsubscribeApplied(const FUnsubscribeAppliedType& Value) + { + FServerMessageType Obj; + Obj.Tag = EServerMessageTag::UnsubscribeApplied; + Obj.MessageData.Set(Value); + return Obj; + } + + static FServerMessageType SubscriptionError(const FSubscriptionErrorType& Value) + { + FServerMessageType Obj; + Obj.Tag = EServerMessageTag::SubscriptionError; + Obj.MessageData.Set(Value); + return Obj; + } + + static FServerMessageType SubscribeMultiApplied(const FSubscribeMultiAppliedType& Value) + { + FServerMessageType Obj; + Obj.Tag = EServerMessageTag::SubscribeMultiApplied; + Obj.MessageData.Set(Value); + return Obj; + } + + static FServerMessageType UnsubscribeMultiApplied(const FUnsubscribeMultiAppliedType& Value) + { + FServerMessageType Obj; + Obj.Tag = EServerMessageTag::UnsubscribeMultiApplied; + Obj.MessageData.Set(Value); + return Obj; + } + + FORCEINLINE bool IsInitialSubscription() const { return Tag == EServerMessageTag::InitialSubscription; } + + FORCEINLINE FInitialSubscriptionType GetAsInitialSubscription() const + { + ensureMsgf(IsInitialSubscription(), TEXT("MessageData does not hold InitialSubscription!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsTransactionUpdate() const { return Tag == EServerMessageTag::TransactionUpdate; } + + FORCEINLINE FTransactionUpdateType GetAsTransactionUpdate() const + { + ensureMsgf(IsTransactionUpdate(), TEXT("MessageData does not hold TransactionUpdate!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsTransactionUpdateLight() const { return Tag == EServerMessageTag::TransactionUpdateLight; } + + FORCEINLINE FTransactionUpdateLightType GetAsTransactionUpdateLight() const + { + ensureMsgf(IsTransactionUpdateLight(), TEXT("MessageData does not hold TransactionUpdateLight!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsIdentityToken() const { return Tag == EServerMessageTag::IdentityToken; } + + FORCEINLINE FIdentityTokenType GetAsIdentityToken() const + { + ensureMsgf(IsIdentityToken(), TEXT("MessageData does not hold IdentityToken!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsOneOffQueryResponse() const { return Tag == EServerMessageTag::OneOffQueryResponse; } + + FORCEINLINE FOneOffQueryResponseType GetAsOneOffQueryResponse() const + { + ensureMsgf(IsOneOffQueryResponse(), TEXT("MessageData does not hold OneOffQueryResponse!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsSubscribeApplied() const { return Tag == EServerMessageTag::SubscribeApplied; } + + FORCEINLINE FSubscribeAppliedType GetAsSubscribeApplied() const + { + ensureMsgf(IsSubscribeApplied(), TEXT("MessageData does not hold SubscribeApplied!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsUnsubscribeApplied() const { return Tag == EServerMessageTag::UnsubscribeApplied; } + + FORCEINLINE FUnsubscribeAppliedType GetAsUnsubscribeApplied() const + { + ensureMsgf(IsUnsubscribeApplied(), TEXT("MessageData does not hold UnsubscribeApplied!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsSubscriptionError() const { return Tag == EServerMessageTag::SubscriptionError; } + + FORCEINLINE FSubscriptionErrorType GetAsSubscriptionError() const + { + ensureMsgf(IsSubscriptionError(), TEXT("MessageData does not hold SubscriptionError!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsSubscribeMultiApplied() const { return Tag == EServerMessageTag::SubscribeMultiApplied; } + + FORCEINLINE FSubscribeMultiAppliedType GetAsSubscribeMultiApplied() const + { + ensureMsgf(IsSubscribeMultiApplied(), TEXT("MessageData does not hold SubscribeMultiApplied!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsUnsubscribeMultiApplied() const { return Tag == EServerMessageTag::UnsubscribeMultiApplied; } + + FORCEINLINE FUnsubscribeMultiAppliedType GetAsUnsubscribeMultiApplied() const + { + ensureMsgf(IsUnsubscribeMultiApplied(), TEXT("MessageData does not hold UnsubscribeMultiApplied!")); + return MessageData.Get(); + } + + // Inline equality operators + FORCEINLINE bool operator==(const FServerMessageType& Other) const + { + if (Tag != Other.Tag) return false; + + switch (Tag) + { + case EServerMessageTag::InitialSubscription: + return GetAsInitialSubscription() == Other.GetAsInitialSubscription(); + case EServerMessageTag::TransactionUpdate: + return GetAsTransactionUpdate() == Other.GetAsTransactionUpdate(); + case EServerMessageTag::TransactionUpdateLight: + return GetAsTransactionUpdateLight() == Other.GetAsTransactionUpdateLight(); + case EServerMessageTag::IdentityToken: + return GetAsIdentityToken() == Other.GetAsIdentityToken(); + case EServerMessageTag::OneOffQueryResponse: + return GetAsOneOffQueryResponse() == Other.GetAsOneOffQueryResponse(); + case EServerMessageTag::SubscribeApplied: + return GetAsSubscribeApplied() == Other.GetAsSubscribeApplied(); + case EServerMessageTag::UnsubscribeApplied: + return GetAsUnsubscribeApplied() == Other.GetAsUnsubscribeApplied(); + case EServerMessageTag::SubscriptionError: + return GetAsSubscriptionError() == Other.GetAsSubscriptionError(); + case EServerMessageTag::SubscribeMultiApplied: + return GetAsSubscribeMultiApplied() == Other.GetAsSubscribeMultiApplied(); + case EServerMessageTag::UnsubscribeMultiApplied: + return GetAsUnsubscribeMultiApplied() == Other.GetAsUnsubscribeMultiApplied(); + default: + return false; + } + } + + FORCEINLINE bool operator!=(const FServerMessageType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FServerMessageType. + * Combines the hashes of all fields that are compared in operator==. + * @param ServerMessageType The FServerMessageType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FServerMessageType& ServerMessage) +{ + const uint32 TagHash = GetTypeHash(static_cast(ServerMessage.Tag)); + switch (ServerMessage.Tag) + { + case EServerMessageTag::InitialSubscription: return HashCombine(TagHash, ::GetTypeHash(ServerMessage.GetAsInitialSubscription())); + case EServerMessageTag::TransactionUpdate: return HashCombine(TagHash, ::GetTypeHash(ServerMessage.GetAsTransactionUpdate())); + case EServerMessageTag::TransactionUpdateLight: return HashCombine(TagHash, ::GetTypeHash(ServerMessage.GetAsTransactionUpdateLight())); + case EServerMessageTag::IdentityToken: return HashCombine(TagHash, ::GetTypeHash(ServerMessage.GetAsIdentityToken())); + case EServerMessageTag::OneOffQueryResponse: return HashCombine(TagHash, ::GetTypeHash(ServerMessage.GetAsOneOffQueryResponse())); + case EServerMessageTag::SubscribeApplied: return HashCombine(TagHash, ::GetTypeHash(ServerMessage.GetAsSubscribeApplied())); + case EServerMessageTag::UnsubscribeApplied: return HashCombine(TagHash, ::GetTypeHash(ServerMessage.GetAsUnsubscribeApplied())); + case EServerMessageTag::SubscriptionError: return HashCombine(TagHash, ::GetTypeHash(ServerMessage.GetAsSubscriptionError())); + case EServerMessageTag::SubscribeMultiApplied: return HashCombine(TagHash, ::GetTypeHash(ServerMessage.GetAsSubscribeMultiApplied())); + case EServerMessageTag::UnsubscribeMultiApplied: return HashCombine(TagHash, ::GetTypeHash(ServerMessage.GetAsUnsubscribeMultiApplied())); + default: return TagHash; + } +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FServerMessageType); + + UE_SPACETIMEDB_TAGGED_ENUM( + FServerMessageType, + EServerMessageTag, + MessageData, + InitialSubscription, FInitialSubscriptionType, + TransactionUpdate, FTransactionUpdateType, + TransactionUpdateLight, FTransactionUpdateLightType, + IdentityToken, FIdentityTokenType, + OneOffQueryResponse, FOneOffQueryResponseType, + SubscribeApplied, FSubscribeAppliedType, + UnsubscribeApplied, FUnsubscribeAppliedType, + SubscriptionError, FSubscriptionErrorType, + SubscribeMultiApplied, FSubscribeMultiAppliedType, + UnsubscribeMultiApplied, FUnsubscribeMultiAppliedType + ); +} + +UCLASS() +class SPACETIMEDBSDK_API UServerMessageBpLib : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() + +private: + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|ServerMessage") + static FServerMessageType InitialSubscription(const FInitialSubscriptionType& InValue) + { + return FServerMessageType::InitialSubscription(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|ServerMessage") + static bool IsInitialSubscription(const FServerMessageType& InValue) { return InValue.IsInitialSubscription(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|ServerMessage") + static FInitialSubscriptionType GetAsInitialSubscription(const FServerMessageType& InValue) + { + return InValue.GetAsInitialSubscription(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|ServerMessage") + static FServerMessageType TransactionUpdate(const FTransactionUpdateType& InValue) + { + return FServerMessageType::TransactionUpdate(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|ServerMessage") + static bool IsTransactionUpdate(const FServerMessageType& InValue) { return InValue.IsTransactionUpdate(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|ServerMessage") + static FTransactionUpdateType GetAsTransactionUpdate(const FServerMessageType& InValue) + { + return InValue.GetAsTransactionUpdate(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|ServerMessage") + static FServerMessageType TransactionUpdateLight(const FTransactionUpdateLightType& InValue) + { + return FServerMessageType::TransactionUpdateLight(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|ServerMessage") + static bool IsTransactionUpdateLight(const FServerMessageType& InValue) { return InValue.IsTransactionUpdateLight(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|ServerMessage") + static FTransactionUpdateLightType GetAsTransactionUpdateLight(const FServerMessageType& InValue) + { + return InValue.GetAsTransactionUpdateLight(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|ServerMessage") + static FServerMessageType IdentityToken(const FIdentityTokenType& InValue) + { + return FServerMessageType::IdentityToken(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|ServerMessage") + static bool IsIdentityToken(const FServerMessageType& InValue) { return InValue.IsIdentityToken(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|ServerMessage") + static FIdentityTokenType GetAsIdentityToken(const FServerMessageType& InValue) + { + return InValue.GetAsIdentityToken(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|ServerMessage") + static FServerMessageType OneOffQueryResponse(const FOneOffQueryResponseType& InValue) + { + return FServerMessageType::OneOffQueryResponse(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|ServerMessage") + static bool IsOneOffQueryResponse(const FServerMessageType& InValue) { return InValue.IsOneOffQueryResponse(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|ServerMessage") + static FOneOffQueryResponseType GetAsOneOffQueryResponse(const FServerMessageType& InValue) + { + return InValue.GetAsOneOffQueryResponse(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|ServerMessage") + static FServerMessageType SubscribeApplied(const FSubscribeAppliedType& InValue) + { + return FServerMessageType::SubscribeApplied(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|ServerMessage") + static bool IsSubscribeApplied(const FServerMessageType& InValue) { return InValue.IsSubscribeApplied(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|ServerMessage") + static FSubscribeAppliedType GetAsSubscribeApplied(const FServerMessageType& InValue) + { + return InValue.GetAsSubscribeApplied(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|ServerMessage") + static FServerMessageType UnsubscribeApplied(const FUnsubscribeAppliedType& InValue) + { + return FServerMessageType::UnsubscribeApplied(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|ServerMessage") + static bool IsUnsubscribeApplied(const FServerMessageType& InValue) { return InValue.IsUnsubscribeApplied(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|ServerMessage") + static FUnsubscribeAppliedType GetAsUnsubscribeApplied(const FServerMessageType& InValue) + { + return InValue.GetAsUnsubscribeApplied(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|ServerMessage") + static FServerMessageType SubscriptionError(const FSubscriptionErrorType& InValue) + { + return FServerMessageType::SubscriptionError(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|ServerMessage") + static bool IsSubscriptionError(const FServerMessageType& InValue) { return InValue.IsSubscriptionError(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|ServerMessage") + static FSubscriptionErrorType GetAsSubscriptionError(const FServerMessageType& InValue) + { + return InValue.GetAsSubscriptionError(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|ServerMessage") + static FServerMessageType SubscribeMultiApplied(const FSubscribeMultiAppliedType& InValue) + { + return FServerMessageType::SubscribeMultiApplied(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|ServerMessage") + static bool IsSubscribeMultiApplied(const FServerMessageType& InValue) { return InValue.IsSubscribeMultiApplied(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|ServerMessage") + static FSubscribeMultiAppliedType GetAsSubscribeMultiApplied(const FServerMessageType& InValue) + { + return InValue.GetAsSubscribeMultiApplied(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|ServerMessage") + static FServerMessageType UnsubscribeMultiApplied(const FUnsubscribeMultiAppliedType& InValue) + { + return FServerMessageType::UnsubscribeMultiApplied(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|ServerMessage") + static bool IsUnsubscribeMultiApplied(const FServerMessageType& InValue) { return InValue.IsUnsubscribeMultiApplied(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|ServerMessage") + static FUnsubscribeMultiAppliedType GetAsUnsubscribeMultiApplied(const FServerMessageType& InValue) + { + return InValue.GetAsUnsubscribeMultiApplied(); + } + +}; diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/SubscribeAppliedType.g.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/SubscribeAppliedType.g.h new file mode 100644 index 00000000000..25609d1bb23 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/SubscribeAppliedType.g.h @@ -0,0 +1,59 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Types/QueryIdType.g.h" +#include "ModuleBindings/Types/SubscribeRowsType.g.h" +#include "SubscribeAppliedType.g.generated.h" + +USTRUCT(BlueprintType) +struct SPACETIMEDBSDK_API FSubscribeAppliedType +{ + GENERATED_BODY() + + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 RequestId; + + // NOTE: uint64 field not exposed to Blueprint due to non-blueprintable elements + uint64 TotalHostExecutionDurationMicros; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FQueryIdType QueryId; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSubscribeRowsType Rows; + + FORCEINLINE bool operator==(const FSubscribeAppliedType& Other) const + { + return RequestId == Other.RequestId && TotalHostExecutionDurationMicros == Other.TotalHostExecutionDurationMicros && QueryId == Other.QueryId && Rows == Other.Rows; + } + + FORCEINLINE bool operator!=(const FSubscribeAppliedType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FSubscribeAppliedType. + * Combines the hashes of all fields that are compared in operator==. + * @param SubscribeAppliedType The FSubscribeAppliedType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FSubscribeAppliedType& SubscribeAppliedType) +{ + uint32 Hash = GetTypeHash(SubscribeAppliedType.RequestId); + Hash = HashCombine(Hash, GetTypeHash(SubscribeAppliedType.TotalHostExecutionDurationMicros)); + Hash = HashCombine(Hash, GetTypeHash(SubscribeAppliedType.QueryId)); + Hash = HashCombine(Hash, GetTypeHash(SubscribeAppliedType.Rows)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FSubscribeAppliedType); + + UE_SPACETIMEDB_STRUCT(FSubscribeAppliedType, RequestId, TotalHostExecutionDurationMicros, QueryId, Rows); +} diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/SubscribeMultiAppliedType.g.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/SubscribeMultiAppliedType.g.h new file mode 100644 index 00000000000..9969a045a9a --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/SubscribeMultiAppliedType.g.h @@ -0,0 +1,59 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Types/DatabaseUpdateType.g.h" +#include "ModuleBindings/Types/QueryIdType.g.h" +#include "SubscribeMultiAppliedType.g.generated.h" + +USTRUCT(BlueprintType) +struct SPACETIMEDBSDK_API FSubscribeMultiAppliedType +{ + GENERATED_BODY() + + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 RequestId; + + // NOTE: uint64 field not exposed to Blueprint due to non-blueprintable elements + uint64 TotalHostExecutionDurationMicros; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FQueryIdType QueryId; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FDatabaseUpdateType Update; + + FORCEINLINE bool operator==(const FSubscribeMultiAppliedType& Other) const + { + return RequestId == Other.RequestId && TotalHostExecutionDurationMicros == Other.TotalHostExecutionDurationMicros && QueryId == Other.QueryId && Update == Other.Update; + } + + FORCEINLINE bool operator!=(const FSubscribeMultiAppliedType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FSubscribeMultiAppliedType. + * Combines the hashes of all fields that are compared in operator==. + * @param SubscribeMultiAppliedType The FSubscribeMultiAppliedType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FSubscribeMultiAppliedType& SubscribeMultiAppliedType) +{ + uint32 Hash = GetTypeHash(SubscribeMultiAppliedType.RequestId); + Hash = HashCombine(Hash, GetTypeHash(SubscribeMultiAppliedType.TotalHostExecutionDurationMicros)); + Hash = HashCombine(Hash, GetTypeHash(SubscribeMultiAppliedType.QueryId)); + Hash = HashCombine(Hash, GetTypeHash(SubscribeMultiAppliedType.Update)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FSubscribeMultiAppliedType); + + UE_SPACETIMEDB_STRUCT(FSubscribeMultiAppliedType, RequestId, TotalHostExecutionDurationMicros, QueryId, Update); +} diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/SubscribeMultiType.g.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/SubscribeMultiType.g.h new file mode 100644 index 00000000000..c078e3ecade --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/SubscribeMultiType.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Types/QueryIdType.g.h" +#include "SubscribeMultiType.g.generated.h" + +USTRUCT(BlueprintType) +struct SPACETIMEDBSDK_API FSubscribeMultiType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + TArray QueryStrings; + + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 RequestId; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FQueryIdType QueryId; + + FORCEINLINE bool operator==(const FSubscribeMultiType& Other) const + { + return QueryStrings == Other.QueryStrings && RequestId == Other.RequestId && QueryId == Other.QueryId; + } + + FORCEINLINE bool operator!=(const FSubscribeMultiType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FSubscribeMultiType. + * Combines the hashes of all fields that are compared in operator==. + * @param SubscribeMultiType The FSubscribeMultiType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FSubscribeMultiType& SubscribeMultiType) +{ + uint32 Hash = GetTypeHash(SubscribeMultiType.QueryStrings); + Hash = HashCombine(Hash, GetTypeHash(SubscribeMultiType.RequestId)); + Hash = HashCombine(Hash, GetTypeHash(SubscribeMultiType.QueryId)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FSubscribeMultiType); + + UE_SPACETIMEDB_STRUCT(FSubscribeMultiType, QueryStrings, RequestId, QueryId); +} diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/SubscribeRowsType.g.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/SubscribeRowsType.g.h new file mode 100644 index 00000000000..6e58b2cfdaa --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/SubscribeRowsType.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Types/TableUpdateType.g.h" +#include "SubscribeRowsType.g.generated.h" + +USTRUCT(BlueprintType) +struct SPACETIMEDBSDK_API FSubscribeRowsType +{ + GENERATED_BODY() + + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 TableId; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FString TableName; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FTableUpdateType TableRows; + + FORCEINLINE bool operator==(const FSubscribeRowsType& Other) const + { + return TableId == Other.TableId && TableName == Other.TableName && TableRows == Other.TableRows; + } + + FORCEINLINE bool operator!=(const FSubscribeRowsType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FSubscribeRowsType. + * Combines the hashes of all fields that are compared in operator==. + * @param SubscribeRowsType The FSubscribeRowsType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FSubscribeRowsType& SubscribeRowsType) +{ + uint32 Hash = GetTypeHash(SubscribeRowsType.TableId); + Hash = HashCombine(Hash, GetTypeHash(SubscribeRowsType.TableName)); + Hash = HashCombine(Hash, GetTypeHash(SubscribeRowsType.TableRows)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FSubscribeRowsType); + + UE_SPACETIMEDB_STRUCT(FSubscribeRowsType, TableId, TableName, TableRows); +} diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/SubscribeSingleType.g.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/SubscribeSingleType.g.h new file mode 100644 index 00000000000..c73cc6a08d7 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/SubscribeSingleType.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Types/QueryIdType.g.h" +#include "SubscribeSingleType.g.generated.h" + +USTRUCT(BlueprintType) +struct SPACETIMEDBSDK_API FSubscribeSingleType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FString Query; + + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 RequestId; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FQueryIdType QueryId; + + FORCEINLINE bool operator==(const FSubscribeSingleType& Other) const + { + return Query == Other.Query && RequestId == Other.RequestId && QueryId == Other.QueryId; + } + + FORCEINLINE bool operator!=(const FSubscribeSingleType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FSubscribeSingleType. + * Combines the hashes of all fields that are compared in operator==. + * @param SubscribeSingleType The FSubscribeSingleType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FSubscribeSingleType& SubscribeSingleType) +{ + uint32 Hash = GetTypeHash(SubscribeSingleType.Query); + Hash = HashCombine(Hash, GetTypeHash(SubscribeSingleType.RequestId)); + Hash = HashCombine(Hash, GetTypeHash(SubscribeSingleType.QueryId)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FSubscribeSingleType); + + UE_SPACETIMEDB_STRUCT(FSubscribeSingleType, Query, RequestId, QueryId); +} diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/SubscribeType.g.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/SubscribeType.g.h new file mode 100644 index 00000000000..c8f6f457065 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/SubscribeType.g.h @@ -0,0 +1,49 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "SubscribeType.g.generated.h" + +USTRUCT(BlueprintType) +struct SPACETIMEDBSDK_API FSubscribeType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + TArray QueryStrings; + + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 RequestId; + + FORCEINLINE bool operator==(const FSubscribeType& Other) const + { + return QueryStrings == Other.QueryStrings && RequestId == Other.RequestId; + } + + FORCEINLINE bool operator!=(const FSubscribeType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FSubscribeType. + * Combines the hashes of all fields that are compared in operator==. + * @param SubscribeType The FSubscribeType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FSubscribeType& SubscribeType) +{ + uint32 Hash = GetTypeHash(SubscribeType.QueryStrings); + Hash = HashCombine(Hash, GetTypeHash(SubscribeType.RequestId)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FSubscribeType); + + UE_SPACETIMEDB_STRUCT(FSubscribeType, QueryStrings, RequestId); +} diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/SubscriptionErrorType.g.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/SubscriptionErrorType.g.h new file mode 100644 index 00000000000..8c0d8796a2b --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/SubscriptionErrorType.g.h @@ -0,0 +1,62 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Optionals/SpacetimeDbSdkOptionalUInt32.g.h" +#include "SubscriptionErrorType.g.generated.h" + +USTRUCT(BlueprintType) +struct SPACETIMEDBSDK_API FSubscriptionErrorType +{ + GENERATED_BODY() + + // NOTE: uint64 field not exposed to Blueprint due to non-blueprintable elements + uint64 TotalHostExecutionDurationMicros; + + // NOTE: FSpacetimeDbSdkOptionalUInt32 field not exposed to Blueprint due to non-blueprintable elements + FSpacetimeDbSdkOptionalUInt32 RequestId; + + // NOTE: FSpacetimeDbSdkOptionalUInt32 field not exposed to Blueprint due to non-blueprintable elements + FSpacetimeDbSdkOptionalUInt32 QueryId; + + // NOTE: FSpacetimeDbSdkOptionalUInt32 field not exposed to Blueprint due to non-blueprintable elements + FSpacetimeDbSdkOptionalUInt32 TableId; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FString Error; + + FORCEINLINE bool operator==(const FSubscriptionErrorType& Other) const + { + return TotalHostExecutionDurationMicros == Other.TotalHostExecutionDurationMicros && RequestId == Other.RequestId && QueryId == Other.QueryId && TableId == Other.TableId && Error == Other.Error; + } + + FORCEINLINE bool operator!=(const FSubscriptionErrorType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FSubscriptionErrorType. + * Combines the hashes of all fields that are compared in operator==. + * @param SubscriptionErrorType The FSubscriptionErrorType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FSubscriptionErrorType& SubscriptionErrorType) +{ + uint32 Hash = GetTypeHash(SubscriptionErrorType.TotalHostExecutionDurationMicros); + Hash = HashCombine(Hash, GetTypeHash(SubscriptionErrorType.RequestId)); + Hash = HashCombine(Hash, GetTypeHash(SubscriptionErrorType.QueryId)); + Hash = HashCombine(Hash, GetTypeHash(SubscriptionErrorType.TableId)); + Hash = HashCombine(Hash, GetTypeHash(SubscriptionErrorType.Error)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FSubscriptionErrorType); + + UE_SPACETIMEDB_STRUCT(FSubscriptionErrorType, TotalHostExecutionDurationMicros, RequestId, QueryId, TableId, Error); +} diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/TableUpdateType.g.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/TableUpdateType.g.h new file mode 100644 index 00000000000..1231d619ca0 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/TableUpdateType.g.h @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Types/CompressableQueryUpdateType.g.h" +#include "TableUpdateType.g.generated.h" + +USTRUCT(BlueprintType) +struct SPACETIMEDBSDK_API FTableUpdateType +{ + GENERATED_BODY() + + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 TableId; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FString TableName; + + // NOTE: uint64 field not exposed to Blueprint due to non-blueprintable elements + uint64 NumRows; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + TArray Updates; + + FORCEINLINE bool operator==(const FTableUpdateType& Other) const + { + return TableId == Other.TableId && TableName == Other.TableName && NumRows == Other.NumRows && Updates == Other.Updates; + } + + FORCEINLINE bool operator!=(const FTableUpdateType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FTableUpdateType. + * Combines the hashes of all fields that are compared in operator==. + * @param TableUpdateType The FTableUpdateType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FTableUpdateType& TableUpdateType) +{ + uint32 Hash = GetTypeHash(TableUpdateType.TableId); + Hash = HashCombine(Hash, GetTypeHash(TableUpdateType.TableName)); + Hash = HashCombine(Hash, GetTypeHash(TableUpdateType.NumRows)); + Hash = HashCombine(Hash, GetTypeHash(TableUpdateType.Updates)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FTableUpdateType); + + UE_SPACETIMEDB_STRUCT(FTableUpdateType, TableId, TableName, NumRows, Updates); +} diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/TransactionUpdateLightType.g.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/TransactionUpdateLightType.g.h new file mode 100644 index 00000000000..70546b3238c --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/TransactionUpdateLightType.g.h @@ -0,0 +1,50 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Types/DatabaseUpdateType.g.h" +#include "TransactionUpdateLightType.g.generated.h" + +USTRUCT(BlueprintType) +struct SPACETIMEDBSDK_API FTransactionUpdateLightType +{ + GENERATED_BODY() + + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 RequestId; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FDatabaseUpdateType Update; + + FORCEINLINE bool operator==(const FTransactionUpdateLightType& Other) const + { + return RequestId == Other.RequestId && Update == Other.Update; + } + + FORCEINLINE bool operator!=(const FTransactionUpdateLightType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FTransactionUpdateLightType. + * Combines the hashes of all fields that are compared in operator==. + * @param TransactionUpdateLightType The FTransactionUpdateLightType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FTransactionUpdateLightType& TransactionUpdateLightType) +{ + uint32 Hash = GetTypeHash(TransactionUpdateLightType.RequestId); + Hash = HashCombine(Hash, GetTypeHash(TransactionUpdateLightType.Update)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FTransactionUpdateLightType); + + UE_SPACETIMEDB_STRUCT(FTransactionUpdateLightType, RequestId, Update); +} diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/TransactionUpdateType.g.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/TransactionUpdateType.g.h new file mode 100644 index 00000000000..18c0d727cd3 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/TransactionUpdateType.g.h @@ -0,0 +1,73 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Types/EnergyQuantaType.g.h" +#include "ModuleBindings/Types/ReducerCallInfoType.g.h" +#include "ModuleBindings/Types/UpdateStatusType.g.h" +#include "Types/Builtins.h" +#include "TransactionUpdateType.g.generated.h" + +USTRUCT(BlueprintType) +struct SPACETIMEDBSDK_API FTransactionUpdateType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FUpdateStatusType Status; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBTimestamp Timestamp; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBIdentity CallerIdentity; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBConnectionId CallerConnectionId; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FReducerCallInfoType ReducerCall; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FEnergyQuantaType EnergyQuantaUsed; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBTimeDuration TotalHostExecutionDuration; + + FORCEINLINE bool operator==(const FTransactionUpdateType& Other) const + { + return Status == Other.Status && Timestamp == Other.Timestamp && CallerIdentity == Other.CallerIdentity && CallerConnectionId == Other.CallerConnectionId && ReducerCall == Other.ReducerCall && EnergyQuantaUsed == Other.EnergyQuantaUsed && TotalHostExecutionDuration == Other.TotalHostExecutionDuration; + } + + FORCEINLINE bool operator!=(const FTransactionUpdateType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FTransactionUpdateType. + * Combines the hashes of all fields that are compared in operator==. + * @param TransactionUpdateType The FTransactionUpdateType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FTransactionUpdateType& TransactionUpdateType) +{ + uint32 Hash = GetTypeHash(TransactionUpdateType.Status); + Hash = HashCombine(Hash, GetTypeHash(TransactionUpdateType.Timestamp)); + Hash = HashCombine(Hash, GetTypeHash(TransactionUpdateType.CallerIdentity)); + Hash = HashCombine(Hash, GetTypeHash(TransactionUpdateType.CallerConnectionId)); + Hash = HashCombine(Hash, GetTypeHash(TransactionUpdateType.ReducerCall)); + Hash = HashCombine(Hash, GetTypeHash(TransactionUpdateType.EnergyQuantaUsed)); + Hash = HashCombine(Hash, GetTypeHash(TransactionUpdateType.TotalHostExecutionDuration)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FTransactionUpdateType); + + UE_SPACETIMEDB_STRUCT(FTransactionUpdateType, Status, Timestamp, CallerIdentity, CallerConnectionId, ReducerCall, EnergyQuantaUsed, TotalHostExecutionDuration); +} diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/UnsubscribeAppliedType.g.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/UnsubscribeAppliedType.g.h new file mode 100644 index 00000000000..b02e5f7068b --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/UnsubscribeAppliedType.g.h @@ -0,0 +1,59 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Types/QueryIdType.g.h" +#include "ModuleBindings/Types/SubscribeRowsType.g.h" +#include "UnsubscribeAppliedType.g.generated.h" + +USTRUCT(BlueprintType) +struct SPACETIMEDBSDK_API FUnsubscribeAppliedType +{ + GENERATED_BODY() + + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 RequestId; + + // NOTE: uint64 field not exposed to Blueprint due to non-blueprintable elements + uint64 TotalHostExecutionDurationMicros; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FQueryIdType QueryId; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSubscribeRowsType Rows; + + FORCEINLINE bool operator==(const FUnsubscribeAppliedType& Other) const + { + return RequestId == Other.RequestId && TotalHostExecutionDurationMicros == Other.TotalHostExecutionDurationMicros && QueryId == Other.QueryId && Rows == Other.Rows; + } + + FORCEINLINE bool operator!=(const FUnsubscribeAppliedType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FUnsubscribeAppliedType. + * Combines the hashes of all fields that are compared in operator==. + * @param UnsubscribeAppliedType The FUnsubscribeAppliedType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FUnsubscribeAppliedType& UnsubscribeAppliedType) +{ + uint32 Hash = GetTypeHash(UnsubscribeAppliedType.RequestId); + Hash = HashCombine(Hash, GetTypeHash(UnsubscribeAppliedType.TotalHostExecutionDurationMicros)); + Hash = HashCombine(Hash, GetTypeHash(UnsubscribeAppliedType.QueryId)); + Hash = HashCombine(Hash, GetTypeHash(UnsubscribeAppliedType.Rows)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FUnsubscribeAppliedType); + + UE_SPACETIMEDB_STRUCT(FUnsubscribeAppliedType, RequestId, TotalHostExecutionDurationMicros, QueryId, Rows); +} diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/UnsubscribeMultiAppliedType.g.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/UnsubscribeMultiAppliedType.g.h new file mode 100644 index 00000000000..b99b479407c --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/UnsubscribeMultiAppliedType.g.h @@ -0,0 +1,59 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Types/DatabaseUpdateType.g.h" +#include "ModuleBindings/Types/QueryIdType.g.h" +#include "UnsubscribeMultiAppliedType.g.generated.h" + +USTRUCT(BlueprintType) +struct SPACETIMEDBSDK_API FUnsubscribeMultiAppliedType +{ + GENERATED_BODY() + + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 RequestId; + + // NOTE: uint64 field not exposed to Blueprint due to non-blueprintable elements + uint64 TotalHostExecutionDurationMicros; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FQueryIdType QueryId; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FDatabaseUpdateType Update; + + FORCEINLINE bool operator==(const FUnsubscribeMultiAppliedType& Other) const + { + return RequestId == Other.RequestId && TotalHostExecutionDurationMicros == Other.TotalHostExecutionDurationMicros && QueryId == Other.QueryId && Update == Other.Update; + } + + FORCEINLINE bool operator!=(const FUnsubscribeMultiAppliedType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FUnsubscribeMultiAppliedType. + * Combines the hashes of all fields that are compared in operator==. + * @param UnsubscribeMultiAppliedType The FUnsubscribeMultiAppliedType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FUnsubscribeMultiAppliedType& UnsubscribeMultiAppliedType) +{ + uint32 Hash = GetTypeHash(UnsubscribeMultiAppliedType.RequestId); + Hash = HashCombine(Hash, GetTypeHash(UnsubscribeMultiAppliedType.TotalHostExecutionDurationMicros)); + Hash = HashCombine(Hash, GetTypeHash(UnsubscribeMultiAppliedType.QueryId)); + Hash = HashCombine(Hash, GetTypeHash(UnsubscribeMultiAppliedType.Update)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FUnsubscribeMultiAppliedType); + + UE_SPACETIMEDB_STRUCT(FUnsubscribeMultiAppliedType, RequestId, TotalHostExecutionDurationMicros, QueryId, Update); +} diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/UnsubscribeMultiType.g.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/UnsubscribeMultiType.g.h new file mode 100644 index 00000000000..ccd9e1eead5 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/UnsubscribeMultiType.g.h @@ -0,0 +1,50 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Types/QueryIdType.g.h" +#include "UnsubscribeMultiType.g.generated.h" + +USTRUCT(BlueprintType) +struct SPACETIMEDBSDK_API FUnsubscribeMultiType +{ + GENERATED_BODY() + + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 RequestId; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FQueryIdType QueryId; + + FORCEINLINE bool operator==(const FUnsubscribeMultiType& Other) const + { + return RequestId == Other.RequestId && QueryId == Other.QueryId; + } + + FORCEINLINE bool operator!=(const FUnsubscribeMultiType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FUnsubscribeMultiType. + * Combines the hashes of all fields that are compared in operator==. + * @param UnsubscribeMultiType The FUnsubscribeMultiType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FUnsubscribeMultiType& UnsubscribeMultiType) +{ + uint32 Hash = GetTypeHash(UnsubscribeMultiType.RequestId); + Hash = HashCombine(Hash, GetTypeHash(UnsubscribeMultiType.QueryId)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FUnsubscribeMultiType); + + UE_SPACETIMEDB_STRUCT(FUnsubscribeMultiType, RequestId, QueryId); +} diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/UnsubscribeType.g.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/UnsubscribeType.g.h new file mode 100644 index 00000000000..1f8b58a7e32 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/UnsubscribeType.g.h @@ -0,0 +1,50 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Types/QueryIdType.g.h" +#include "UnsubscribeType.g.generated.h" + +USTRUCT(BlueprintType) +struct SPACETIMEDBSDK_API FUnsubscribeType +{ + GENERATED_BODY() + + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 RequestId; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FQueryIdType QueryId; + + FORCEINLINE bool operator==(const FUnsubscribeType& Other) const + { + return RequestId == Other.RequestId && QueryId == Other.QueryId; + } + + FORCEINLINE bool operator!=(const FUnsubscribeType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FUnsubscribeType. + * Combines the hashes of all fields that are compared in operator==. + * @param UnsubscribeType The FUnsubscribeType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FUnsubscribeType& UnsubscribeType) +{ + uint32 Hash = GetTypeHash(UnsubscribeType.RequestId); + Hash = HashCombine(Hash, GetTypeHash(UnsubscribeType.QueryId)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FUnsubscribeType); + + UE_SPACETIMEDB_STRUCT(FUnsubscribeType, RequestId, QueryId); +} diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/UpdateStatusType.g.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/UpdateStatusType.g.h new file mode 100644 index 00000000000..1795ff56dcf --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/ModuleBindings/Types/UpdateStatusType.g.h @@ -0,0 +1,188 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "Types/UnitType.h" +#include "ModuleBindings/Types/DatabaseUpdateType.g.h" +#include "UpdateStatusType.g.generated.h" + +UENUM(BlueprintType) +enum class EUpdateStatusTag : uint8 +{ + Committed, + Failed, + OutOfEnergy +}; + +USTRUCT(BlueprintType) +struct SPACETIMEDBSDK_API FUpdateStatusType +{ + GENERATED_BODY() + +public: + FUpdateStatusType() = default; + + TVariant MessageData; + + UPROPERTY(BlueprintReadOnly) + EUpdateStatusTag Tag; + + static FUpdateStatusType Committed(const FDatabaseUpdateType& Value) + { + FUpdateStatusType Obj; + Obj.Tag = EUpdateStatusTag::Committed; + Obj.MessageData.Set(Value); + return Obj; + } + + static FUpdateStatusType Failed(const FString& Value) + { + FUpdateStatusType Obj; + Obj.Tag = EUpdateStatusTag::Failed; + Obj.MessageData.Set(Value); + return Obj; + } + + static FUpdateStatusType OutOfEnergy(const FSpacetimeDBUnit& Value) + { + FUpdateStatusType Obj; + Obj.Tag = EUpdateStatusTag::OutOfEnergy; + Obj.MessageData.Set(Value); + return Obj; + } + + FORCEINLINE bool IsCommitted() const { return Tag == EUpdateStatusTag::Committed; } + + FORCEINLINE FDatabaseUpdateType GetAsCommitted() const + { + ensureMsgf(IsCommitted(), TEXT("MessageData does not hold Committed!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsFailed() const { return Tag == EUpdateStatusTag::Failed; } + + FORCEINLINE FString GetAsFailed() const + { + ensureMsgf(IsFailed(), TEXT("MessageData does not hold Failed!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsOutOfEnergy() const { return Tag == EUpdateStatusTag::OutOfEnergy; } + + FORCEINLINE FSpacetimeDBUnit GetAsOutOfEnergy() const + { + ensureMsgf(IsOutOfEnergy(), TEXT("MessageData does not hold OutOfEnergy!")); + return MessageData.Get(); + } + + // Inline equality operators + FORCEINLINE bool operator==(const FUpdateStatusType& Other) const + { + if (Tag != Other.Tag) return false; + + switch (Tag) + { + case EUpdateStatusTag::Committed: + return GetAsCommitted() == Other.GetAsCommitted(); + case EUpdateStatusTag::Failed: + return GetAsFailed() == Other.GetAsFailed(); + case EUpdateStatusTag::OutOfEnergy: + return GetAsOutOfEnergy() == Other.GetAsOutOfEnergy(); + default: + return false; + } + } + + FORCEINLINE bool operator!=(const FUpdateStatusType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FUpdateStatusType. + * Combines the hashes of all fields that are compared in operator==. + * @param UpdateStatusType The FUpdateStatusType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FUpdateStatusType& UpdateStatus) +{ + const uint32 TagHash = GetTypeHash(static_cast(UpdateStatus.Tag)); + switch (UpdateStatus.Tag) + { + case EUpdateStatusTag::Committed: return HashCombine(TagHash, ::GetTypeHash(UpdateStatus.GetAsCommitted())); + case EUpdateStatusTag::Failed: return HashCombine(TagHash, GetTypeHash(UpdateStatus.GetAsFailed())); + case EUpdateStatusTag::OutOfEnergy: return HashCombine(TagHash, ::GetTypeHash(UpdateStatus.GetAsOutOfEnergy())); + default: return TagHash; + } +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FUpdateStatusType); + + UE_SPACETIMEDB_TAGGED_ENUM( + FUpdateStatusType, + EUpdateStatusTag, + MessageData, + Committed, FDatabaseUpdateType, + Failed, FString, + OutOfEnergy, FSpacetimeDBUnit + ); +} + +UCLASS() +class SPACETIMEDBSDK_API UUpdateStatusBpLib : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() + +private: + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|UpdateStatus") + static FUpdateStatusType Committed(const FDatabaseUpdateType& InValue) + { + return FUpdateStatusType::Committed(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|UpdateStatus") + static bool IsCommitted(const FUpdateStatusType& InValue) { return InValue.IsCommitted(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|UpdateStatus") + static FDatabaseUpdateType GetAsCommitted(const FUpdateStatusType& InValue) + { + return InValue.GetAsCommitted(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|UpdateStatus") + static FUpdateStatusType Failed(const FString& InValue) + { + return FUpdateStatusType::Failed(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|UpdateStatus") + static bool IsFailed(const FUpdateStatusType& InValue) { return InValue.IsFailed(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|UpdateStatus") + static FString GetAsFailed(const FUpdateStatusType& InValue) + { + return InValue.GetAsFailed(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|UpdateStatus") + static FUpdateStatusType OutOfEnergy(const FSpacetimeDBUnit& InValue) + { + return FUpdateStatusType::OutOfEnergy(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|UpdateStatus") + static bool IsOutOfEnergy(const FUpdateStatusType& InValue) { return InValue.IsOutOfEnergy(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|UpdateStatus") + static FSpacetimeDBUnit GetAsOutOfEnergy(const FUpdateStatusType& InValue) + { + return InValue.GetAsOutOfEnergy(); + } + +}; diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/SpacetimeDbSdk.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/SpacetimeDbSdk.h new file mode 100644 index 00000000000..221bea47f33 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/SpacetimeDbSdk.h @@ -0,0 +1,13 @@ + +#pragma once + +#include "Modules/ModuleManager.h" + +class FSpacetimeDbSdkModule : public IModuleInterface +{ +public: + + /** IModuleInterface implementation */ + virtual void StartupModule() override; + virtual void ShutdownModule() override; +}; diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/Tables/README.md b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/Tables/README.md new file mode 100644 index 00000000000..40fe31e1284 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/Tables/README.md @@ -0,0 +1,7 @@ +# Tables + +Base classes for the generated table wrappers used by SpacetimeDB modules. + +## Files + +- `RemoteTable.h` `URemoteTable` defines helpers for applying server diffs to a `UClientCache`. Generated tables derive from this class. \ No newline at end of file diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/Tables/RemoteTable.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/Tables/RemoteTable.h new file mode 100644 index 00000000000..cb331255ec7 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/Tables/RemoteTable.h @@ -0,0 +1,60 @@ +#pragma once + +#include "CoreMinimal.h" +#include "UObject/Object.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableAppliedDiff.h" +#include "DBCache/WithBsatn.h" + +#include "RemoteTable.generated.h" + +/** + * Base type for all generated remote table wrappers. + * Provides helper functionality for applying diffs + * received from the server. + */ +UCLASS() +class SPACETIMEDBSDK_API URemoteTable : public UObject +{ + GENERATED_BODY() + +protected: + + /** + * Apply a diff to the local cache. + * @param InsertsRef Insert operations with BSATN encoded keys + * @param DeletesRef Delete operations with BSATN encoded keys + * @param ClientCache Cache instance for this table + * @param InTableName Name of the table being updated + */ + template + FTableAppliedDiff BaseUpdate( + const TArray>& InsertsRef, + const TArray>& DeletesRef, + const TSharedPtr>& ClientCache, + const FString& InTableName + ) + { + // Validate the client cache before proceeding + if (!ClientCache.IsValid()) + { + UE_LOG(LogTemp, Error, TEXT("RemoteTable::BaseUpdate called with invalid ClientCache for table %s"), *InTableName); + return {}; + } + + TArray, T>> Inserts; + for (const FWithBsatn& Insert : InsertsRef) + { + Inserts.Add({ Insert.Bsatn, Insert.Row }); + } + + TArray> Deletes; + for (const FWithBsatn& Delete : DeletesRef) + { + Deletes.Add(Delete.Bsatn); + } + + // Forward to the shared client cache implementation + return ClientCache->ApplyDiff(InTableName, Inserts, Deletes); + } +}; \ No newline at end of file diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/Tests/README.md b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/Tests/README.md new file mode 100644 index 00000000000..7fc6d18de2e --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/Tests/README.md @@ -0,0 +1,7 @@ +# Tests + +Helper header used by the unit test suite for verifying BSATN serialization. + +## Files + +- `SpacetimeDBBSATNTestOrg.h` – Collection of macros and utilities used by automation tests to round‑trip various UE types through the BSATN serializer. \ No newline at end of file diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/Tests/SpacetimeDBBSATNTestOrg.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/Tests/SpacetimeDBBSATNTestOrg.h new file mode 100644 index 00000000000..7b77c3a7b21 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/Tests/SpacetimeDBBSATNTestOrg.h @@ -0,0 +1,452 @@ +/** + * BSATN round-trip test-suite (Simple Automation Test) + * Put in Source//Private/Tests/BSATNSerialization.test.cpp + */ + +#pragma once + +#include "CoreMinimal.h" +#include "Misc/AutomationTest.h" +#include "BSATN/UESpacetimeDB.h" +#include +#include +#include +#include +#include "Math/Quat.h" +#include "Math/Transform.h" +#include "StructUtils/InstancedStruct.h" + +#include "SpacetimeDBBSATNTestOrg.generated.h" + + + + + // ────────────────────────────────────────────────────────────────────────────── + // Logging helpers + // ────────────────────────────────────────────────────────────────────────────── +#if WITH_DEV_AUTOMATION_TESTS + +/** + * Logs the start of a new category . + * @param CategoryName The name of the test. + */ +#define LOG_Category(CategoryName) \ + do \ + { \ + const FString LogMessage = FString::Printf(TEXT("[CATEGORY] %s"), TEXT(CategoryName)); \ + UE_LOG(LogTemp, Log, TEXT("\n%s"), *LogMessage); \ + if (this) \ + { \ + this->AddInfo(LogMessage); \ + } \ + } while (false) + +#define LOG_TEST(Format, ...) \ + do \ + { \ + const FString UserMessage = FString::Printf(Format, ##__VA_ARGS__); \ + const FString LogMessage = FString::Printf(TEXT("\n[TEST] %s"), *UserMessage); \ + UE_LOG(LogTemp, Log, TEXT("%s"), *LogMessage); \ + if (this) \ + { \ + this->AddInfo(LogMessage); \ + } \ + } while (false) + + /** + * Logs a success message to the output log and the automation test results window. + * @param Format The format string for the message. + * @param ... The arguments for the format string. + */ +#define LOG_SUCCESS(Format, ...) \ + do \ + { \ + const FString UserMessage = FString::Printf(Format, ##__VA_ARGS__); \ + const FString LogMessage = FString::Printf(TEXT(" ✓ %s"), *UserMessage); \ + UE_LOG(LogTemp, Log, TEXT("%s"), *LogMessage); \ + if (this) \ + { \ + this->AddInfo(LogMessage); \ + } \ + } while (false) + + /** + * Logs a failure message to the output log and the automation test results window, and marks the test as failed. + * @param Format The format string for the message. + * @param ... The arguments for the format string. + */ +#define LOG_FAIL(Format, ...) \ + do \ + { \ + const FString UserMessage = FString::Printf(Format, ##__VA_ARGS__); \ + const FString LogMessage = FString::Printf(TEXT(" ✗ %s"), *UserMessage); \ + UE_LOG(LogTemp, Error, TEXT("%s"), *LogMessage); \ + if (this) \ + { \ + this->AddError(LogMessage); \ + } \ + } while (false) + + /** + * Logs an informational message to the output log and the automation test results window. + * @param Format The format string for the message. + * @param ... The arguments for the format string. + */ +#define LOG_INFO(Format, ...) \ + do \ + { \ + const FString UserMessage = FString::Printf(Format, ##__VA_ARGS__); \ + const FString LogMessage = FString::Printf(TEXT(" ℹ %s"), *UserMessage); \ + UE_LOG(LogTemp, Log, TEXT("%s"), *LogMessage); \ + if (this) \ + { \ + this->AddInfo(LogMessage); \ + } \ + } while (false) + + /** + * Performs a round-trip serialization/deserialization test for a given type and value. + * @param Type The data type to test. + * @param ValueLiteral The literal value to use for the test. + * @param TestName A descriptive name for the test case. + */ +#define TEST_ROUNDTRIP(Type, ValueLiteral, TestName) \ + do \ + { \ + const Type Original = ValueLiteral; \ + const TArray Bytes = UE::SpacetimeDB::Serialize(Original); \ + const Type Round = UE::SpacetimeDB::Deserialize(Bytes); \ + if (TestEq::Same(Original, Round)) \ + { \ + LOG_SUCCESS(TEXT("%s: Round-trip ok"), TEXT(TestName)); \ + } \ + else \ + { \ + LOG_FAIL(TEXT("%s: Mismatch after round-trip"), TEXT(TestName)); \ + } \ + } while (false) + +#endif // WITH_DEV_AUTOMATION_TESTS + +// ────────────────────────────────────────────────────────────────────────────── +// Generic tolerant equality helpers +// ────────────────────────────────────────────────────────────────────────────── +namespace TestEq +{ + + inline bool Float(float A, float B, float Epsilon = 1e-4f) + { + return FMath::Abs(A - B) < Epsilon; + } + + template + inline bool Same(const T& A, const T& B) + { + return A == B; + } + + template<> + inline bool Same(const float& A, const float& B) + { + return Float(A, B); + } + + template<> + inline bool Same(const double& A, const double& B) + { + return Float(static_cast(A), static_cast(B)); + } + + template<> + inline bool Same(const FVector& A, const FVector& B) + { + return Float(A.X, B.X) && Float(A.Y, B.Y) && Float(A.Z, B.Z); + } + + template<> + inline bool Same(const FRotator& A, const FRotator& B) + { + return Float(A.Pitch, B.Pitch) && Float(A.Yaw, B.Yaw) && Float(A.Roll, B.Roll); + } + + template<> + inline bool Same(const FTransform& A, const FTransform& B) + { + return Same(A.GetLocation(), B.GetLocation()) && + Same(A.GetRotation().Rotator(), B.GetRotation().Rotator()) && + Same(A.GetScale3D(), B.GetScale3D()); + } + + template + inline bool Same(const TObjectPtr& A, const TObjectPtr& B) + { + const T* PtrA = A.Get(); + const T* PtrB = B.Get(); + + // If both pointers are null, they are considered the same. + if (PtrA == nullptr && PtrB == nullptr) + { + return true; + } + + // If one is null but the other isn't, they are different. + if (PtrA == nullptr || PtrB == nullptr) + { + return false; + } + + // If both are valid, dereference them to call the T::operator== + // This performs the deep, value-based comparison on the UObject itself. + return *PtrA == *PtrB; + } +} + + +// ────────────────────────────────────────────────────────────────────────────── +// Utility: little hex-dump for debugging +// ────────────────────────────────────────────────────────────────────────────── +static void PrintHex(const TArray& Bytes, const FString& Label) +{ + constexpr int32 MaxDisplay = 32; + std::cout << TCHAR_TO_UTF8(*Label) << " (" << Bytes.Num() << " bytes): "; + for (int32 i = 0; i < FMath::Min(Bytes.Num(), MaxDisplay); ++i) + { + std::cout << std::hex << std::setw(2) << std::setfill('0') + << static_cast(Bytes[i]) << " "; + } + if (Bytes.Num() > MaxDisplay) + { + std::cout << "..."; + } + std::cout << std::dec << '\n'; +} + + + +// ────────────────────────────────────────────────────────────────────────────── +// Test Enum +// ────────────────────────────────────────────────────────────────────────────── +UENUM(BlueprintType) +enum class ESpaceTimeDBTestEnum1 : uint8 +{ + First, + Secound, + Third +}; + +UENUM(BlueprintType) +enum class ECharacterTypeTag : uint8 +{ + PlayerData, + Npc, +}; + +// ────────────────────────────────────────────────────────────────────────────── +// Test Struct +// ────────────────────────────────────────────────────────────────────────────── +USTRUCT(BlueprintType) +struct FPlayerData +{ + + GENERATED_BODY() + + /** Player’s display name */ + FString PlayerName; + + /** Current character level */ + int32 Level; + + + /** Simple inventory list */ + TArray Inventory; + + bool operator==(const FPlayerData& Other) const + { + return PlayerName == Other.PlayerName && + Level == Other.Level && + Inventory == Other.Inventory; + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FPlayerData, PlayerName, Level, Inventory); +} + + +USTRUCT(BlueprintType) +struct FNpc +{ + GENERATED_BODY() + + /** Player’s display name */ + FString Type; + + + bool operator==(const FNpc& Other) const + { + return Type == Other.Type; + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT( + FNpc, //1 The USTRUCT + Type //2-a Variable name + ); +} + +// ────────────────────────────────────────────────────────────────────────────── +// Test Variants / Tagged Enum +// ────────────────────────────────────────────────────────────────────────────── + +USTRUCT(BlueprintType) +struct FCharacterType +{ + GENERATED_BODY() + +public: + + FCharacterType() = default; + + // Keep Data before/after Tag however your codegen/macros expect. Here we use 'Data' like your old field name. + TVariant MessageData; + + UPROPERTY(BlueprintReadOnly) + ECharacterTypeTag Tag; + + +public: + // ----- Static builders (mirror old style; no UObject/Blueprint library needed) ----- + + static FCharacterType PlayerData(const FPlayerData& Value) + { + FCharacterType Obj; + Obj.Tag = ECharacterTypeTag::PlayerData; + Obj.MessageData.Set(Value); + return Obj; + } + + static FCharacterType Npc(const FNpc& Value) + { + FCharacterType Obj; + Obj.Tag = ECharacterTypeTag::Npc; + Obj.MessageData.Set(Value); + return Obj; + } + + // ----- Query helpers ----- + + bool IsPlayerData() const { return Tag == ECharacterTypeTag::PlayerData; } + bool IsNpc() const { return Tag == ECharacterTypeTag::Npc; } + + FPlayerData GetAsPlayer() const + { + ensureMsgf(IsPlayerData(), TEXT("MessageData does not hold PlayerData!")); + return MessageData.Get(); + } + + FNpc GetAsNpc() const + { + ensureMsgf(IsNpc(), TEXT("MessageData does not hold Npc!")); + return MessageData.Get(); + } + + // ----- Equality ----- + + bool operator==(const FCharacterType& Other) const + { + if (Tag != Other.Tag) { return false; } + + switch (Tag) + { + case ECharacterTypeTag::PlayerData: + return GetAsPlayer() == Other.GetAsPlayer(); + case ECharacterTypeTag::Npc: + return GetAsNpc() == Other.GetAsNpc(); + default: + return false; + } + } + + bool operator!=(const FCharacterType& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + + UE_SPACETIMEDB_ENABLE_TARRAY(FCharacterType); + + + UE_SPACETIMEDB_TAGGED_ENUM( + FCharacterType, // 1 The USTRUCT type + ECharacterTypeTag, // 2 The UENUM tag type + MessageData, // 3 The TVariant field name in Struct + PlayerData, FPlayerData, // 4-a First (Tag, Type) pair + Npc, FNpc // 4-b Second (Tag, Type) pair + ); +} + +// ────────────────────────────────────────────────────────────────────────────── +// Test Struct with Variant +// ────────────────────────────────────────────────────────────────────────────── + +USTRUCT(BlueprintType) +struct FCharacterThing +{ + GENERATED_BODY() + + /** Player’s display name */ + UPROPERTY() + FCharacterType Type; + + /** Current Activation */ + bool Active; + + bool operator==(const FCharacterThing& Other) const + { + return Type == Other.Type && Active == Other.Active; + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FCharacterThing, Type, Active); +} + + + +// ────────────────────────────────────────────────────────────────────────────── +// Test custom optional type +// ────────────────────────────────────────────────────────────────────────────── + +USTRUCT(BlueprintType) +struct FManaOptional +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + bool bHasMana = false; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB", meta = (EditCondition = "bHasName")) + int Mana; + + FORCEINLINE bool operator==(const FManaOptional& Other) const + { + return Mana == Other.Mana && bHasMana == Other.bHasMana; + } + + FORCEINLINE bool operator!=(const FManaOptional& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_OPTIONAL(FManaOptional, bHasMana, Mana); +} diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/Types/Builtins.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/Types/Builtins.h new file mode 100644 index 00000000000..1d6fa23b264 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/Types/Builtins.h @@ -0,0 +1,861 @@ +#pragma once +#include "CoreMinimal.h" +#include "Misc/DateTime.h" +#include "Misc/Timespan.h" +#include "Misc/Parse.h" +#include "BSATN/UESpacetimeDB.h" +#include "LargeIntegers.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "Builtins.generated.h" + + + +/**Compression algorithms supported by SpacetimeDB for data storage and transmission. */ +UENUM(BlueprintType) +enum class ESpacetimeDBCompression : uint8 +{ + None, + Brotli, + Gzip +}; + +/** + * SpacetimeDB value types. + */ + + + /** + * 128-bit identifier used for active connections. + * Internally uses a FSpacetimeDBUInt128 for the value. + */ +USTRUCT(BlueprintType, Category = "SpacetimeDB") +struct FSpacetimeDBConnectionId +{ + GENERATED_BODY() + + /** The 128-bit value of the identifier. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite) + FSpacetimeDBUInt128 Value; + + /** Default constructor initializes to zero. */ + FSpacetimeDBConnectionId() = default; + + /** + * Construct from a 128-bit unsigned integer. + * @param InValue The value to initialize with. + */ + explicit FSpacetimeDBConnectionId(const FSpacetimeDBUInt128& InValue) + : Value(InValue) + { + } + + /** + * Compare two connection IDs for equality. + * @param Other The other connection ID to compare against. + * @return True if the values are equal. + */ + bool operator==(const FSpacetimeDBConnectionId& Other) const + { + return Value == Other.Value; + } + + /** + * Compare two connection IDs for inequality. + * @param Other The other connection ID to compare against. + * @return True if the values are not equal. + */ + bool operator!=(const FSpacetimeDBConnectionId& Other) const + { + return !(*this == Other); + } + + /** + * Compare two connection IDs for ordering. + */ + bool operator<(const FSpacetimeDBConnectionId& Other) const + { + return Value < Other.Value; + } + + bool operator>(const FSpacetimeDBConnectionId& Other) const + { + return Value > Other.Value; + } + + bool operator<=(const FSpacetimeDBConnectionId& Other) const + { + return !(*this > Other); + } + + bool operator>=(const FSpacetimeDBConnectionId& Other) const + { + return !(*this < Other); + } + + /** + * Construct from a little-endian byte array. + * @param InBytes A 16-element byte array in little-endian order. + * @return A new FSpacetimeDBConnectionId instance. + */ + static FSpacetimeDBConnectionId FromLittleEndian(const TArray& InBytes) + { + if (InBytes.Num() != 16) + { + return FSpacetimeDBConnectionId(); + } + TArray BigEndianBytes; + BigEndianBytes.SetNumUninitialized(16); + for (int32 i = 0; i < 16; ++i) + { + BigEndianBytes[i] = InBytes[15 - i]; + } + return FSpacetimeDBConnectionId(FSpacetimeDBUInt128::FromBytesArray(BigEndianBytes)); + } + + /** + * Construct from a big-endian byte array. + * @param InBytes A 16-element byte array in big-endian order. + * @return A new FSpacetimeDBConnectionId instance. + */ + static FSpacetimeDBConnectionId FromBigEndian(const TArray& InBytes) + { + if (InBytes.Num() != 16) + { + return FSpacetimeDBConnectionId(); + } + return FSpacetimeDBConnectionId(FSpacetimeDBUInt128::FromBytesArray(InBytes)); + } + + /** + * Construct from hex string (assumes big-endian). + * @param Hex The hex string (e.g., "0x..."). + * @return A new FSpacetimeDBConnectionId instance. + */ + static FSpacetimeDBConnectionId FromHex(const FString& Hex) + { + FString Clean = Hex.StartsWith(TEXT("0x")) ? Hex.Mid(2) : Hex; + if (Clean.Len() != 32) + { + return FSpacetimeDBConnectionId(); + } + TArray Bytes; + Bytes.SetNumUninitialized(16); + for (int32 i = 0; i < 16; ++i) + { + TCHAR High = Clean[i * 2]; + TCHAR Low = Clean[i * 2 + 1]; + uint8 ValueHigh = FParse::HexDigit(High); + uint8 ValueLow = FParse::HexDigit(Low); + Bytes[i] = (ValueHigh << 4) | ValueLow; + } + return FromBigEndian(Bytes); + } + + /** + * Convert to hex string. + * @return The hex string representation of the value. + */ + FString ToHex() const + { + return Value.ToHexString(); + } +}; + +/** + * Get the hash of a Connection ID, required for use as a TMap key. + * @param Id The Connection ID to hash. + * @return The hash value. + */ +inline uint32 GetTypeHash(const FSpacetimeDBConnectionId& Id) +{ + return HashCombine(GetTypeHash(Id.Value.GetUpper()), GetTypeHash(Id.Value.GetLower())); +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FSpacetimeDBConnectionId); + UE_SPACETIMEDB_STRUCT(FSpacetimeDBConnectionId, Value); +} + + + +/** + * 256-bit persistent identity for a user. + * Internally uses a FSpacetimeDBUInt256 for the value. + */ +USTRUCT(BlueprintType, Category = "SpacetimeDB") +struct FSpacetimeDBIdentity +{ + GENERATED_BODY() + + /** The 256-bit value of the identity. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite) + FSpacetimeDBUInt256 Value; + + /** Default constructor initializes to zero. */ + FSpacetimeDBIdentity() = default; + + /** + * Construct from a 256-bit unsigned integer. + * @param InValue The value to initialize with. + */ + explicit FSpacetimeDBIdentity(const FSpacetimeDBUInt256& InValue) + : Value(InValue) + { + } + + /** + * Compare two identities for equality. Required for TMap key. + * @param Other The other identity to compare against. + * @return True if the values are equal. + */ + bool operator==(const FSpacetimeDBIdentity& Other) const + { + return Value == Other.Value; + } + + /** + * Compare two identities for inequality. + * @param Other The other identity to compare against. + * @return True if the values are not equal. + */ + bool operator!=(const FSpacetimeDBIdentity& Other) const + { + return !(*this == Other); + } + + /** + * Compare two identities for ordering. Required for certain TMap/TSet internal operations. + * @param Other The other identity to compare against. + * @return True if this identity is less than the other. + */ + bool operator<(const FSpacetimeDBIdentity& Other) const + { + return Value < Other.Value; + } + + /** + * Compare two identities for ordering. Required for certain TMap/TSet internal operations. + * @param Other The other identity to compare against. + * @return True if this identity is less than the other. + */ + bool operator>(const FSpacetimeDBIdentity& Other) const + { + return Value > Other.Value; + } + + bool operator<=(const FSpacetimeDBIdentity& Other) const + { + return !(*this > Other); + } + + bool operator>=(const FSpacetimeDBIdentity& Other) const + { + return !(*this < Other); + } + + + /** + * Construct from a little-endian byte array. + * @param InBytes A 32-element byte array in little-endian order. + * @return A new FSpacetimeDBIdentity instance. + */ + static FSpacetimeDBIdentity FromLittleEndian(const TArray& InBytes) + { + if (InBytes.Num() != 32) + { + return FSpacetimeDBIdentity(); + } + TArray BigEndianBytes; + BigEndianBytes.SetNumUninitialized(32); + for (int32 i = 0; i < 32; ++i) + { + BigEndianBytes[i] = InBytes[31 - i]; + } + return FSpacetimeDBIdentity(FSpacetimeDBUInt256::FromBytesArray(BigEndianBytes)); + } + + /** + * Construct from a big-endian byte array. + * @param InBytes A 32-element byte array in big-endian order. + * @return A new FSpacetimeDBIdentity instance. + */ + static FSpacetimeDBIdentity FromBigEndian(const TArray& InBytes) + { + if (InBytes.Num() != 32) + { + return FSpacetimeDBIdentity(); + } + return FSpacetimeDBIdentity(FSpacetimeDBUInt256::FromBytesArray(InBytes)); + } + + /** + * Construct from hex string (assumes big-endian). + * @param Hex The hex string (e.g., "0x..."). + * @return A new FSpacetimeDBIdentity instance. + */ + static FSpacetimeDBIdentity FromHex(const FString& Hex) + { + FString Clean = Hex.StartsWith(TEXT("0x")) ? Hex.Mid(2) : Hex; + if (Clean.Len() != 64) + { + return FSpacetimeDBIdentity(); + } + TArray Bytes; + Bytes.SetNumUninitialized(32); + for (int32 i = 0; i < 32; ++i) + { + TCHAR High = Clean[i * 2]; + TCHAR Low = Clean[i * 2 + 1]; + uint8 ValueHigh = FParse::HexDigit(High); + uint8 ValueLow = FParse::HexDigit(Low); + Bytes[i] = (ValueHigh << 4) | ValueLow; + } + return FromBigEndian(Bytes); + } + + /** + * Convert to hex string. + * @return The hex string representation of the value. + */ + FString ToHex() const + { + return Value.ToHexString(); + } +}; + +/** + * Get the hash of an Identity, required for use as a TMap key. + * @param Identity The identity to hash. + * @return The hash value. + */ +inline uint32 GetTypeHash(const FSpacetimeDBIdentity& Identity) +{ + // Hash the upper and lower 128-bit parts of the 256-bit integer. + return HashCombine(GetTypeHash(Identity.Value.GetUpper()), GetTypeHash(Identity.Value.GetLower())); +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FSpacetimeDBIdentity) + UE_SPACETIMEDB_ENABLE_TOPTIONAL(FSpacetimeDBIdentity) + + UE_SPACETIMEDB_STRUCT(FSpacetimeDBIdentity, Value); +} + +/** +* Represents a point in time as microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). +* This corresponds to SpacetimeDB's Timestamp type. +*/ +USTRUCT(BlueprintType, Category = "SpacetimeDB") +struct FSpacetimeDBTimestamp +{ + GENERATED_BODY() + +public: + /** Microseconds since the Unix epoch (1970-01-01 00:00:00 UTC). */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + int64 MicrosecondsSinceEpoch = 0; + +public: + /** Default constructor. */ + FSpacetimeDBTimestamp() = default; + + /** + * Constructor from microseconds. + * @param InMicroseconds The number of microseconds since the Unix epoch. + */ + explicit FSpacetimeDBTimestamp(int64 InMicroseconds) + : MicrosecondsSinceEpoch(InMicroseconds) + { + } + + /** + * Creates a timestamp from a native FDateTime. + * @param DateTime The FDateTime to convert. + * @return A new FSpacetimeDBTimestamp instance. + */ + static FSpacetimeDBTimestamp FromFDateTime(const FDateTime& DateTime) + { + constexpr int64 UnixEpochTicks = 621355968000000000LL; + const int64 Ticks = DateTime.GetTicks(); + if (Ticks < UnixEpochTicks) + { + return FSpacetimeDBTimestamp(0); + } + return FSpacetimeDBTimestamp((Ticks - UnixEpochTicks) / ETimespan::TicksPerMicrosecond); + } + + /** + * Converts this timestamp to a native FDateTime. + * @return The FDateTime representation. + */ + FDateTime ToFDateTime() const + { + constexpr int64 UnixEpochTicks = 621355968000000000LL; + int64 Ticks = UnixEpochTicks + MicrosecondsSinceEpoch * ETimespan::TicksPerMicrosecond; + return FDateTime(Ticks); + } + + /** Gets the raw microsecond value. */ + int64 GetMicroseconds() const { return MicrosecondsSinceEpoch; } + + /** + * Converts the timestamp to a string in the ISO 8601 format: YYYY-MM-DDTHH:MM:SS.ffffffZ + */ + FString ToString() const + { + const FDateTime AsDateTime = ToFDateTime(); + const int32 Microseconds = (AsDateTime.GetTicks() % ETimespan::TicksPerSecond) / ETimespan::TicksPerMicrosecond; + return FString::Printf(TEXT("%04d-%02d-%02dT%02d:%02d:%02d.%06dZ"), + AsDateTime.GetYear(), AsDateTime.GetMonth(), AsDateTime.GetDay(), + AsDateTime.GetHour(), AsDateTime.GetMinute(), AsDateTime.GetSecond(), + Microseconds + ); + } + + /** Comparison operators */ + bool operator==(const FSpacetimeDBTimestamp& Other) const { return MicrosecondsSinceEpoch == Other.MicrosecondsSinceEpoch; } + bool operator!=(const FSpacetimeDBTimestamp& Other) const { return MicrosecondsSinceEpoch != Other.MicrosecondsSinceEpoch; } + bool operator<(const FSpacetimeDBTimestamp& Other) const { return MicrosecondsSinceEpoch < Other.MicrosecondsSinceEpoch; } + bool operator<=(const FSpacetimeDBTimestamp& Other) const { return MicrosecondsSinceEpoch <= Other.MicrosecondsSinceEpoch; } + bool operator>(const FSpacetimeDBTimestamp& Other) const { return MicrosecondsSinceEpoch > Other.MicrosecondsSinceEpoch; } + bool operator>=(const FSpacetimeDBTimestamp& Other) const { return MicrosecondsSinceEpoch >= Other.MicrosecondsSinceEpoch; } + + /** Arithmetic operators */ + FSpacetimeDBTimestamp operator+(const FSpacetimeDBTimeDuration& Duration) const; + FSpacetimeDBTimestamp operator-(const FSpacetimeDBTimeDuration& Duration) const; + FSpacetimeDBTimeDuration operator-(const FSpacetimeDBTimestamp& Other) const; +}; + +FORCEINLINE uint32 GetTypeHash(const FSpacetimeDBTimestamp& Timestamp) +{ + // Directly hash the int64 value. Unreal's GetTypeHash for int64 will handle this. + return GetTypeHash(Timestamp.MicrosecondsSinceEpoch); +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FSpacetimeDBTimestamp) + UE_SPACETIMEDB_ENABLE_TOPTIONAL(FSpacetimeDBTimestamp) + + + UE_SPACETIMEDB_STRUCT(FSpacetimeDBTimestamp, MicrosecondsSinceEpoch); +} + +/** +* Represents a duration of time with microsecond precision. +* This corresponds to SpacetimeDB's TimeDuration type. +*/ +USTRUCT(BlueprintType, Category = "SpacetimeDB") +struct FSpacetimeDBTimeDuration +{ + GENERATED_BODY() + +public: + /** Total duration in microseconds. */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + int64 TotalMicroseconds = 0; + +public: + /** Default constructor. */ + FSpacetimeDBTimeDuration() = default; + + /** + * Constructor from microseconds. + * @param InMicroseconds The total number of microseconds for this duration. + */ + explicit FSpacetimeDBTimeDuration(int64 InMicroseconds) + : TotalMicroseconds(InMicroseconds) + { + } + + /** + * Creates a duration from a native FTimespan. + * @param Timespan The FTimespan to convert. + * @return A new FSpacetimeDBTimeDuration instance. + */ + static FSpacetimeDBTimeDuration FromFTimespan(const FTimespan& Timespan) + { + return FSpacetimeDBTimeDuration(Timespan.GetTotalMicroseconds()); + } + + /** + * Converts this duration to a native FTimespan. + * @return The FTimespan representation. + */ + FTimespan ToFTimespan() const + { + return FTimespan::FromMicroseconds(TotalMicroseconds); + } + + /** Gets the raw microsecond value. */ + int64 GetMicroseconds() const { return TotalMicroseconds; } + + /** + * Converts the duration to a string in the format: [-]d.hh:mm:ss.ffffff + */ + FString ToString() const + { + const FTimespan AsTimespan = ToFTimespan(); + const bool bIsNegative = AsTimespan.GetTicks() < 0; + const FTimespan AbsoluteTimespan(FMath::Abs(AsTimespan.GetTicks())); + const FString FormattedString = FString::Printf(TEXT("%d.%02d:%02d:%02d.%06d"), + AbsoluteTimespan.GetDays(), + AbsoluteTimespan.GetHours(), + AbsoluteTimespan.GetMinutes(), + AbsoluteTimespan.GetSeconds(), + AbsoluteTimespan.GetFractionMicro() + ); + return bIsNegative ? TEXT("-") + FormattedString : FormattedString; + } + + /** Comparison operators */ + bool operator==(const FSpacetimeDBTimeDuration& Other) const { return TotalMicroseconds == Other.TotalMicroseconds; } + bool operator!=(const FSpacetimeDBTimeDuration& Other) const { return TotalMicroseconds != Other.TotalMicroseconds; } + bool operator<(const FSpacetimeDBTimeDuration& Other) const { return TotalMicroseconds < Other.TotalMicroseconds; } + bool operator<=(const FSpacetimeDBTimeDuration& Other) const { return TotalMicroseconds <= Other.TotalMicroseconds; } + bool operator>(const FSpacetimeDBTimeDuration& Other) const { return TotalMicroseconds > Other.TotalMicroseconds; } + bool operator>=(const FSpacetimeDBTimeDuration& Other) const { return TotalMicroseconds >= Other.TotalMicroseconds; } + + /** Arithmetic operators */ + FSpacetimeDBTimeDuration operator+(const FSpacetimeDBTimeDuration& Other) const { return FSpacetimeDBTimeDuration(TotalMicroseconds + Other.TotalMicroseconds); } + FSpacetimeDBTimeDuration operator-(const FSpacetimeDBTimeDuration& Other) const { return FSpacetimeDBTimeDuration(TotalMicroseconds - Other.TotalMicroseconds); } +}; + + //--- GetTypeHash for FSpacetimeDBTimeDuration --- + //This should be placed in a .h file where FSpacetimeDBTimeDuration is defined. + //It must be in the global namespace or a namespace where ADL can find it. +inline uint32 GetTypeHash(const FSpacetimeDBTimeDuration& Thing) +{ + // Since FSpacetimeDBTimeDuration is just a wrapper around int64, + // we can simply use the hash of its TotalMicroseconds member. + // GetTypeHash is already defined for int64. + return GetTypeHash(Thing.TotalMicroseconds); +} + + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FSpacetimeDBTimeDuration) + UE_SPACETIMEDB_ENABLE_TOPTIONAL(FSpacetimeDBTimeDuration) + + UE_SPACETIMEDB_STRUCT(FSpacetimeDBTimeDuration, TotalMicroseconds); +} + + +UENUM(BlueprintType, Category = "SpacetimeDB") +enum class EScheduleAtTag : uint8 +{ + Interval, + Time, +}; + +// New: value type with TVariant payload +USTRUCT(BlueprintType) +struct SPACETIMEDBSDK_API FSpacetimeDBScheduleAt +{ + GENERATED_BODY() + +public: + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + EScheduleAtTag Tag = EScheduleAtTag::Interval; + + // Payload + TVariant Data; + + // ---- C++ convenience constructors (mirroring old static makers) ---- + static FSpacetimeDBScheduleAt Interval(const FSpacetimeDBTimeDuration& Value) + { + FSpacetimeDBScheduleAt Out; + Out.Tag = EScheduleAtTag::Interval; + Out.Data.Set(Value); + return Out; + } + static FSpacetimeDBScheduleAt Time(const FSpacetimeDBTimestamp& Value) + { + FSpacetimeDBScheduleAt Out; + Out.Tag = EScheduleAtTag::Time; + Out.Data.Set(Value); + return Out; + } + + // ---- Query helpers (C++) ---- + FORCEINLINE bool IsInterval() const { return Tag == EScheduleAtTag::Interval; } + FORCEINLINE bool IsTime() const { return Tag == EScheduleAtTag::Time; } + + FORCEINLINE FSpacetimeDBTimeDuration GetAsInterval() const + { + ensureMsgf(IsInterval(), TEXT("MessageData does not hold Interval!")); + return Data.Get(); + } + FORCEINLINE FSpacetimeDBTimestamp GetAsTime() const + { + ensureMsgf(IsTime(), TEXT("MessageData does not hold Time!")); + return Data.Get(); + } + + // Equality + FORCEINLINE bool operator==(const FSpacetimeDBScheduleAt& Other) const + { + if (Tag != Other.Tag) return false; + switch (Tag) + { + case EScheduleAtTag::Interval: + return GetAsInterval() == Other.GetAsInterval(); + case EScheduleAtTag::Time: + return GetAsTime() == Other.GetAsTime(); + default: return false; + } + } + FORCEINLINE bool operator!=(const FSpacetimeDBScheduleAt& Other) const { return !(*this == Other); } +}; + +FORCEINLINE uint32 GetTypeHash(const FSpacetimeDBScheduleAt& ScheduleAt) +{ + const uint32 TagHash = ::GetTypeHash(static_cast(ScheduleAt.Tag)); + switch (ScheduleAt.Tag) + { + case EScheduleAtTag::Interval: + return HashCombine(TagHash, ::GetTypeHash(ScheduleAt.GetAsInterval())); + case EScheduleAtTag::Time: + return HashCombine(TagHash, ::GetTypeHash(ScheduleAt.GetAsTime())); + default: return TagHash; + } +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FSpacetimeDBScheduleAt); + + UE_SPACETIMEDB_TAGGED_ENUM( + FSpacetimeDBScheduleAt, + EScheduleAtTag, + Data, + // Tag // TVariant alternative type + Interval, FSpacetimeDBTimeDuration, + Time, FSpacetimeDBTimestamp + ); +} + +// ---- Blueprint Function Library ---- +UCLASS() +class SPACETIMEDBSDK_API USpacetimeDBScheduleAtBpLib : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() + +public: + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|ScheduleAt") + static FSpacetimeDBScheduleAt Interval(const FSpacetimeDBTimeDuration& Interval) + { + return FSpacetimeDBScheduleAt::Interval(Interval); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|ScheduleAt") + static FSpacetimeDBScheduleAt Time(const FSpacetimeDBTimestamp& Timestamp) + { + return FSpacetimeDBScheduleAt::Time(Timestamp); + } + + // Predicates + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|ScheduleAt") + static bool IsInterval(const FSpacetimeDBScheduleAt& InValue) { return InValue.IsInterval(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|ScheduleAt") + static bool IsTime(const FSpacetimeDBScheduleAt& InValue) { return InValue.IsTime(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|ScheduleAt") + static FSpacetimeDBTimeDuration GetAsInterval(const FSpacetimeDBScheduleAt& InValue) + { + return InValue.GetAsInterval(); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|ScheduleAt") + static FSpacetimeDBTimestamp GetTime(const FSpacetimeDBScheduleAt& InValue) + { + return InValue.GetAsTime(); + } +}; + +/** +* Blueprint helpers that turn SpacetimeDB value types into strings +*/ +UCLASS() +class SPACETIMEDBSDK_API USpacetimeDBBuiltinLibrary : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() + +public: + + /* ───────── 128-bit ConnectionId → FString ───────── */ + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Conversion", + meta = (DisplayName = "To String (ConnectionId)", + CompactNodeTitle = ".", + BlueprintAutocast)) + static FString Conv_ConnectionIdToString(const FSpacetimeDBConnectionId& InValue) + { + return InValue.ToHex(); + } + + /* ───────── 256-bit Identity → FString ───────── */ + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Conversion", + meta = (DisplayName = "To String (Identity)", + CompactNodeTitle = ".", + BlueprintAutocast)) + static FString Conv_IdentityToString(const FSpacetimeDBIdentity& InValue) + { + return InValue.ToHex(); + } + + /* ───────── Timestamp → FString ───────── */ + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Conversion", + meta = (DisplayName = "To String (Timestamp)", + CompactNodeTitle = ".", + BlueprintAutocast)) + static FString Conv_TimestampToString(const FSpacetimeDBTimestamp& InValue) + { + return InValue.ToString(); + } + + /* ───────── TimeDuration → FString ───────── */ + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Conversion", + meta = (DisplayName = "To String (TimeDuration)", + CompactNodeTitle = ".", + BlueprintAutocast)) + static FString Conv_TimeDurationToString(const FSpacetimeDBTimeDuration& InValue) + { + return InValue.ToString(); + } + + /* ───────── ScheduleAt (variant UObject) → FString ───────── */ + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Conversion", + meta = (DisplayName = "To String (ScheduleAt)", + CompactNodeTitle = ".", + BlueprintAutocast)) + static FString Conv_ScheduleAtToString(const FSpacetimeDBScheduleAt& InValue) + { + switch (InValue.Tag) + { + case EScheduleAtTag::Interval: + { + const FSpacetimeDBTimeDuration Duration = InValue.GetAsInterval(); + return Duration.ToString(); + } + case EScheduleAtTag::Time: + { + bool bValid = false; + const FSpacetimeDBTimestamp Time = InValue.GetAsTime(); + return Time.ToString(); + } + default: + return TEXT(""); + } + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Comparison", + meta = (DisplayName = "Equal (ConnectionId)", + CompactNodeTitle = "==", + Keywords = "== equals equal")) + static bool Equal_ConnectionId(const FSpacetimeDBConnectionId& A, + const FSpacetimeDBConnectionId& B) + { + return A == B; + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Comparison", + meta = (DisplayName = "Not Equal (ConnectionId)", + CompactNodeTitle = "!=", + Keywords = "!= notequal")) + static bool NotEqual_ConnectionId(const FSpacetimeDBConnectionId& A, + const FSpacetimeDBConnectionId& B) + { + return A != B; + } + + /* ───────── Identity compare ───────── */ + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Comparison", + meta = (DisplayName = "Equal (Identity)", + CompactNodeTitle = "==", + Keywords = "== equals equal")) + static bool Equal_Identity(const FSpacetimeDBIdentity& A, + const FSpacetimeDBIdentity& B) + { + return A == B; + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Comparison", + meta = (DisplayName = "Not Equal (Identity)", + CompactNodeTitle = "!=", + Keywords = "!= notequal")) + static bool NotEqual_Identity(const FSpacetimeDBIdentity& A, + const FSpacetimeDBIdentity& B) + { + return A != B; + } + + /* ───────── Timestamp compare ───────── */ + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Comparison", + meta = (DisplayName = "Equal (Timestamp)", + CompactNodeTitle = "==", + Keywords = "== equals equal")) + static bool Equal_Timestamp(const FSpacetimeDBTimestamp& A, + const FSpacetimeDBTimestamp& B) + { + return A == B; + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Comparison", + meta = (DisplayName = "Not Equal (Timestamp)", + CompactNodeTitle = "!=", + Keywords = "!= notequal")) + static bool NotEqual_Timestamp(const FSpacetimeDBTimestamp& A, + const FSpacetimeDBTimestamp& B) + { + return A != B; + } + + /* ───────── TimeDuration compare ───────── */ + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Comparison", + meta = (DisplayName = "Equal (TimeDuration)", + CompactNodeTitle = "==", + Keywords = "== equals equal")) + static bool Equal_TimeDuration(const FSpacetimeDBTimeDuration& A, + const FSpacetimeDBTimeDuration& B) + { + return A == B; + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Comparison", + meta = (DisplayName = "Not Equal (TimeDuration)", + CompactNodeTitle = "!=", + Keywords = "!= notequal")) + static bool NotEqual_TimeDuration(const FSpacetimeDBTimeDuration& A, + const FSpacetimeDBTimeDuration& B) + { + return A != B; + } + + /* ───────── ScheduleAt compare (UObject ptr) ───────── */ + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Comparison", + meta = (DisplayName = "Equal (ScheduleAt)", + CompactNodeTitle = "==", + Keywords = "== equals equal", + DeterminesOutputType = "A")) + static bool Equal_ScheduleAt(const FSpacetimeDBScheduleAt& A, + const FSpacetimeDBScheduleAt& B) + { + return A == B; // deep compare + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Comparison", + meta = (DisplayName = "Not Equal (ScheduleAt)", + CompactNodeTitle = "!=", + Keywords = "!= notequal", + DeterminesOutputType = "A")) + static bool NotEqual_ScheduleAt(const FSpacetimeDBScheduleAt& A, + const FSpacetimeDBScheduleAt& B) + { + return !Equal_ScheduleAt(A, B); + } +}; \ No newline at end of file diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/Types/LargeIntegers.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/Types/LargeIntegers.h new file mode 100644 index 00000000000..8dcfcbc7fa1 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/Types/LargeIntegers.h @@ -0,0 +1,790 @@ +#pragma once +#include "CoreMinimal.h" +#include "Algo/Reverse.h" +#include "LargeIntegers.generated.h" + + +#define UINT64_HEX TEXT("%016llx") // one 64-bit chunk → 16 hex chars, zero-padded +#define INT64_HEX TEXT("%016llx") + +// Reverse an FString in-place (works with UE 5.x) +static void ReverseStringInline(FString& Str) +{ + const int32 Len = Str.Len(); + if (Len <= 1) + { + return; + } + + for (int32 I = 0, J = Len - 1; I < J; ++I, --J) + { + const TCHAR Tmp = Str[I]; + Str[I] = Str[J]; + Str[J] = Tmp; + } +} + +// Big-endian bytes -> decimal string (base-10) via repeated division by 10. +static FString BigEndianBytesToDecimalString(const TArray& InBigEndian) +{ + // Trim leading zeros + int32 FirstNZ = 0; + while (FirstNZ < InBigEndian.Num() && InBigEndian[FirstNZ] == 0) + { + ++FirstNZ; + } + if (FirstNZ == InBigEndian.Num()) + { + return TEXT("0"); + } + + // Working buffer (big-endian, no leading zeros) + TArray Work; + Work.Append(InBigEndian.GetData() + FirstNZ, InBigEndian.Num() - FirstNZ); + + FString Digits; + Digits.Reserve(Work.Num() * 3); // heuristic + + // Long division in base 256, collecting base-10 remainders + while (Work.Num() > 0) + { + uint32 Remainder = 0; + + TArray Quot; + Quot.SetNumUninitialized(Work.Num()); + + for (int32 i = 0; i < Work.Num(); ++i) + { + const uint32 Acc = (Remainder << 8) | Work[i]; // base-256 step + const uint8 Q = static_cast(Acc / 10); + Remainder = Acc - static_cast(Q) * 10; + Quot[i] = Q; + } + + // Next least-significant decimal digit + Digits.AppendChar(static_cast('0' + static_cast(Remainder))); + + // Trim leading zeros of quotient + int32 QFirst = 0; + while (QFirst < Quot.Num() && Quot[QFirst] == 0) + { + ++QFirst; + } + + if (QFirst == Quot.Num()) + { + Work.Reset(); + } + else + { + TArray Next; + Next.Append(Quot.GetData() + QFirst, Quot.Num() - QFirst); + Work = MoveTemp(Next); + } + } + + // We collected digits least→most significant, so reverse + ReverseStringInline(Digits); + return Digits; +} + +static void TwosComplementNegateBigEndian(TArray& Bytes) +{ + // In-place: value = (~value) + 1 (big-endian) + for (uint8& B : Bytes) { B = ~B; } + // add 1 from the least significant end (last byte) + int32 i = Bytes.Num() - 1; + while (i >= 0) + { + uint16 Sum = static_cast(Bytes[i]) + 1u; + Bytes[i] = static_cast(Sum & 0xFFu); + if ((Sum & 0x100u) == 0) { break; } // no carry -> done + --i; + } +} + + +/** + * Unsigned 128-bit integer (Upper:High 64 bits, Lower:Low 64 bits). + * Designed for fast value-type use in C++ and Blueprint. + */ +USTRUCT(BlueprintType) +struct FSpacetimeDBUInt128 +{ + GENERATED_BODY() + +private: + /** Low 64 bits (little-endian layout) */ + UPROPERTY() + uint64 Lower = 0; + + /** High 64 bits */ + UPROPERTY() + uint64 Upper = 0; + +public: + /** Default-zero constructor (required for Blueprint) */ + FSpacetimeDBUInt128() = default; + + /** Construct from two 64-bit parts */ + FSpacetimeDBUInt128(uint64 InUpper, uint64 InLower) + : Lower(InLower) + , Upper(InUpper) + { + } + + /** High 64 bits */ + FORCEINLINE uint64 GetUpper() const + { + return Upper; + } + + /** Low 64 bits */ + FORCEINLINE uint64 GetLower() const + { + return Lower; + } + + /** Comparison operators */ + FORCEINLINE bool operator<(const FSpacetimeDBUInt128& Other) const + { + return (Upper < Other.Upper) || (Upper == Other.Upper && Lower < Other.Lower); + } + + FORCEINLINE bool operator>(const FSpacetimeDBUInt128& Other) const + { + return (Upper > Other.Upper) || (Upper == Other.Upper && Lower > Other.Lower); + } + + FORCEINLINE bool operator<=(const FSpacetimeDBUInt128& Other) const + { + return !(*this > Other); + } + + FORCEINLINE bool operator>=(const FSpacetimeDBUInt128& Other) const + { + return !(*this < Other); + } + + FORCEINLINE bool operator==(const FSpacetimeDBUInt128& Other) const + { + return Upper == Other.Upper && Lower == Other.Lower; + } + + FORCEINLINE bool operator!=(const FSpacetimeDBUInt128& Other) const + { + return !(*this == Other); + } + + + /** Decimal via simple hex fallback (cheap & predictable). */ + FString ToHexString() const + { + // Concatenate the two halves; Upper first for natural reading. + return FString::Printf(TEXT("0x") UINT64_HEX UINT64_HEX, Upper, Lower); + } + + /** Hex string “0xHHHH…LLLL” (always 32 hex digits) */ + FString ToString() const { return ToHexString(); } + + /** 16-byte BE array: Upper(63‒0) | Lower(63‒0) */ + TArray ToBytesArray() const + { + TArray Bytes; + Bytes.SetNumUninitialized(16); + + for (int32 Index = 0; Index < 8; ++Index) + { + Bytes[Index] = static_cast((Upper >> ((7 - Index) * 8)) & 0xFF); + Bytes[8 + Index] = static_cast((Lower >> ((7 - Index) * 8)) & 0xFF); + } + return Bytes; + } + + static FSpacetimeDBUInt128 FromBytesArray(const TArray& Bytes) + { + check(Bytes.Num() == 16); + + uint64 Upper = 0; + uint64 Lower = 0; + + for (int32 Index = 0; Index < 8; ++Index) + { + Upper = (Upper << 8) | Bytes[Index]; + Lower = (Lower << 8) | Bytes[8 + Index]; + } + + return FSpacetimeDBUInt128(Upper, Lower); + } + + FString ToDecimalString() const + { + const TArray Bytes = ToBytesArray(); + return BigEndianBytesToDecimalString(Bytes); + } +}; + +/** + * Get the hash of a 128-bit unsigned integer. + * @param Val The value to hash. + * @return The hash value. + */ +inline uint32 GetTypeHash(const FSpacetimeDBUInt128& Val) +{ + return HashCombine(GetTypeHash(Val.GetUpper()), GetTypeHash(Val.GetLower())); +} + +/** + * Signed 128-bit integer (two’s-complement). + * Upper = high 64 bits, Lower = low 64 bits. + * Fields are *not* UPROPERTY because Blueprint reflection only supports + * uint8 / int32 / float, not 64-bit ints. :contentReference[oaicite:0]{index=0} + */ +USTRUCT(BlueprintType) +struct FSpacetimeDBInt128 +{ + GENERATED_BODY() + +private: + UPROPERTY() + uint64 Lower = 0; + UPROPERTY() + uint64 Upper = 0; + +public: + FSpacetimeDBInt128() = default; + + /** Build from the two 64-bit halves. */ + FSpacetimeDBInt128(uint64 InUpper, uint64 InLower) + : Lower(InLower), Upper(InUpper) + { + } + + /** Sign test (two’s-complement). */ + FORCEINLINE bool IsNegative() const noexcept + { + // Bit 127 (sign-bit) lives in the high 64-bits -> index 63. + return (Upper >> 63) != 0; + } + + FORCEINLINE uint64 GetUpper() const { return Upper; } + FORCEINLINE uint64 GetLower() const { return Lower; } + + /* ---------- comparison ---------- */ + FORCEINLINE bool operator<(const FSpacetimeDBInt128& Rhs) const + { + const bool bNegA = IsNegative(); + const bool bNegB = Rhs.IsNegative(); + if (bNegA != bNegB) + { + return bNegA; // negative < positive + } + return (Upper < Rhs.Upper) || (Upper == Rhs.Upper && Lower < Rhs.Lower); + } + + FORCEINLINE bool operator>(const FSpacetimeDBInt128& Rhs) const + { + const bool bNegA = IsNegative(); + const bool bNegB = Rhs.IsNegative(); + if (bNegA != bNegB) + { + return bNegB; // positive > negative + } + return (Upper > Rhs.Upper) || (Upper == Rhs.Upper && Lower > Rhs.Lower); + } + + FORCEINLINE bool operator<=(const FSpacetimeDBInt128& Rhs) const + { + return !(*this > Rhs); + } + + FORCEINLINE bool operator>=(const FSpacetimeDBInt128& Rhs) const + { + return !(*this < Rhs); + } + + FORCEINLINE bool operator==(const FSpacetimeDBInt128& Rhs) const + { + return Upper == Rhs.Upper && Lower == Rhs.Lower; + } + FORCEINLINE bool operator!=(const FSpacetimeDBInt128& Rhs) const + { + return !(*this == Rhs); + } + + /** Hex form ― 32 digits, two’s-complement. */ + FString ToHexString() const + { + return FString::Printf(TEXT("0x") INT64_HEX INT64_HEX, Upper, Lower); + } + + /** Decimal via simple hex fallback (cheap & predictable). */ + FString ToString() const { return ToHexString(); } + + TArray ToBytesArray() const + { + TArray Bytes; + Bytes.SetNumUninitialized(16); + + for (int32 Index = 0; Index < 8; ++Index) + { + Bytes[Index] = static_cast((Upper >> ((7 - Index) * 8)) & 0xFF); + Bytes[8 + Index] = static_cast((Lower >> ((7 - Index) * 8)) & 0xFF); + } + return Bytes; + } + + static FSpacetimeDBInt128 FromBytesArray(const TArray& Bytes) + { + check(Bytes.Num() == 16); + + uint64 Upper = 0; + uint64 Lower = 0; + + for (int32 Index = 0; Index < 8; ++Index) + { + Upper = (Upper << 8) | Bytes[Index]; + Lower = (Lower << 8) | Bytes[8 + Index]; + } + + return FSpacetimeDBInt128(Upper, Lower); + } + + FString ToDecimalString() const + { + // Get big-endian bytes: Upper | Lower (already provided by your struct) + TArray Bytes = ToBytesArray(); + const bool bNegative = IsNegative(); + + if (bNegative) + { + // Convert magnitude = two's-complement negate (on a copy) + TArray Mag = Bytes; + TwosComplementNegateBigEndian(Mag); + FString Dec = BigEndianBytesToDecimalString(Mag); + return FString::Printf(TEXT("-%s"), *Dec); + } + else + { + return BigEndianBytesToDecimalString(Bytes); + } + } +}; + +/** + * Get the hash of a 128-bit signed integer. + * @param Val The value to hash. + * @return The hash value. + */ +inline uint32 GetTypeHash(const FSpacetimeDBInt128& Val) +{ + return HashCombine(GetTypeHash(Val.GetUpper()), GetTypeHash(Val.GetLower())); +} + + + +/** + * Unsigned 256-bit integer (Upper = high 128 bits, Lower = low 128 bits). + * Internal data stay private (Blueprint can’t expose uint64 directly) :contentReference[oaicite:0]{index=0} + */ +USTRUCT(BlueprintType) +struct FSpacetimeDBUInt256 +{ + GENERATED_BODY() + +private: + UPROPERTY() FSpacetimeDBUInt128 Lower; // bits 0–127 (least significant) + UPROPERTY() FSpacetimeDBUInt128 Upper; // bits 128–255 (most significant) + +public: + /** Default-zero - required for BP */ + FSpacetimeDBUInt256() = default; + + /** Construct from two 128-bit halves (Upper: high, Lower: low) */ + FSpacetimeDBUInt256(const FSpacetimeDBUInt128& InUpper, const FSpacetimeDBUInt128& InLower) + : Lower(InLower), Upper(InUpper) + { + } + + /* ---------- accessors ---------- */ + FORCEINLINE const FSpacetimeDBUInt128& GetUpper() const { return Upper; } + FORCEINLINE const FSpacetimeDBUInt128& GetLower() const { return Lower; } + + /* ---------- comparisons (unsigned lexicographic Upper→Lower) ---------- */ + FORCEINLINE bool operator<(const FSpacetimeDBUInt256& Rhs) const + { + return (Upper < Rhs.Upper) || (Upper == Rhs.Upper && Lower < Rhs.Lower); + } + + FORCEINLINE bool operator>(const FSpacetimeDBUInt256& Rhs) const + { + return (Upper > Rhs.Upper) || (Upper == Rhs.Upper && Lower > Rhs.Lower); + } + + FORCEINLINE bool operator<=(const FSpacetimeDBUInt256& Rhs) const { return !(*this > Rhs); } + FORCEINLINE bool operator>=(const FSpacetimeDBUInt256& Rhs) const { return !(*this < Rhs); } + + FORCEINLINE bool operator==(const FSpacetimeDBUInt256& Rhs) const + { + return Upper == Rhs.Upper && Lower == Rhs.Lower; + } + + FORCEINLINE bool operator!=(const FSpacetimeDBUInt256& Rhs) const { return !(*this == Rhs); } + + /** Fixed-width hex string “0x[64 hex digits]” */ + FString ToHexString() const + { + return FString::Printf( + TEXT("0x") UINT64_HEX UINT64_HEX UINT64_HEX UINT64_HEX, + Upper.GetUpper(), /* bits 192–255 */ + Upper.GetLower(), /* bits 128–191 */ + Lower.GetUpper(), /* bits 64–127 */ + Lower.GetLower()); /* bits 0–63 */ + } + + FString ToString() const { return ToHexString(); } + + /** 32-byte BE array: Upper(127…0) | Lower(127…0) */ + TArray ToBytesArray() const + { + TArray Bytes; + Bytes.SetNumUninitialized(32); + + const uint64 Parts[4] = + { + Upper.GetUpper(), // 192–255 + Upper.GetLower(), // 128–191 + Lower.GetUpper(), // 64–127 + Lower.GetLower() // 0–63 + }; + + int32 Offset = 0; + for (uint64 Part : Parts) + { + for (int32 ByteIndex = 0; ByteIndex < 8; ++ByteIndex) + { + Bytes[Offset++] = static_cast((Part >> ((7 - ByteIndex) * 8)) & 0xFF); + } + } + return Bytes; + } + + static FSpacetimeDBUInt256 FromBytesArray(const TArray& Bytes) + { + check(Bytes.Num() == 32); + + uint64 Parts[4] = { 0, 0, 0, 0 }; + int32 Offset = 0; + + for (int32 PartIdx = 0; PartIdx < 4; ++PartIdx) + { + for (int32 ByteIdx = 0; ByteIdx < 8; ++ByteIdx) + { + Parts[PartIdx] = (Parts[PartIdx] << 8) | Bytes[Offset++]; + } + } + + const FSpacetimeDBUInt128 NewUpper(Parts[0], Parts[1]); + const FSpacetimeDBUInt128 NewLower(Parts[2], Parts[3]); + return FSpacetimeDBUInt256(NewUpper, NewLower); + } + + /** Decimal (unsigned) via your byte→decimal helper */ + FString ToDecimalString() const + { + const TArray Bytes = ToBytesArray(); // big-endian + return BigEndianBytesToDecimalString(Bytes); + } +}; + +/** + * Get the hash of a 256-bit unsigned integer, required for use as a TMap key. + * @param Val The value to hash. + * @return The hash value. + */ +inline uint32 GetTypeHash(const FSpacetimeDBUInt256& Val) +{ + // Hash the upper and lower 128-bit parts of the 256-bit integer. + // Assuming FSpacetimeDBUInt128 has its own GetTypeHash defined, + // which you provided in the initial prompt. + return HashCombine(GetTypeHash(Val.GetUpper()), GetTypeHash(Val.GetLower())); +} + +/** + * Signed 256-bit integer (two’s-complement). + * Upper = high 128 bits, Lower = low 128 bits. + */ +USTRUCT(BlueprintType) +struct FSpacetimeDBInt256 +{ + GENERATED_BODY() + +private: + UPROPERTY() + FSpacetimeDBUInt128 Lower; /** Bits 0-127 (least-significant) */ + UPROPERTY() + FSpacetimeDBUInt128 Upper; /** Bits 128-255 (most-significant) */ + +public: + /** Zero constructor (needed for BP) */ + FSpacetimeDBInt256() = default; + + /** Construct from two halves */ + FSpacetimeDBInt256(const FSpacetimeDBUInt128& InUpper, const FSpacetimeDBUInt128& InLower) + : Lower(InLower) + , Upper(InUpper) + { + } + + /** + * @return true when the 256-bit value is negative (MS-bit set). + */ + FORCEINLINE bool IsNegative() const noexcept + { + // Bit 255 lives in the upper-halfs top 64 bits -> index 63. + return (Upper.GetUpper() >> 63) != 0; + } + + FORCEINLINE const FSpacetimeDBUInt128& GetUpper() const { return Upper; } + FORCEINLINE const FSpacetimeDBUInt128& GetLower() const { return Lower; } + + /* ---------- comparisons ---------- */ + FORCEINLINE bool operator<(const FSpacetimeDBInt256& Rhs) const + { + const bool bNegA = IsNegative(); + const bool bNegB = Rhs.IsNegative(); + if (bNegA != bNegB) + { + return bNegA; // negative < positive + } + return (Upper < Rhs.Upper) || (Upper == Rhs.Upper && Lower < Rhs.Lower); + } + + FORCEINLINE bool operator>(const FSpacetimeDBInt256& Rhs) const + { + const bool bNegA = IsNegative(); + const bool bNegB = Rhs.IsNegative(); + if (bNegA != bNegB) + { + return bNegB; // positive > negative + } + return (Upper > Rhs.Upper) || (Upper == Rhs.Upper && Lower > Rhs.Lower); + } + + FORCEINLINE bool operator<=(const FSpacetimeDBInt256& Rhs) const + { + return !(*this > Rhs); + } + + FORCEINLINE bool operator>=(const FSpacetimeDBInt256& Rhs) const + { + return !(*this < Rhs); + } + + FORCEINLINE bool operator==(const FSpacetimeDBInt256& Rhs) const + { + return Upper == Rhs.Upper && Lower == Rhs.Lower; + } + + FORCEINLINE bool operator!=(const FSpacetimeDBInt256& Rhs) const + { + return !(*this == Rhs); + } + + + /** Hex string “0x[64 hex digits]”. */ + FString ToHexString() const + { + return FString::Printf( + TEXT("0x") UINT64_HEX UINT64_HEX UINT64_HEX UINT64_HEX, + Upper.GetUpper(), // bits 192-255 + Upper.GetLower(), // bits 128-191 + Lower.GetUpper(), // bits 64-127 + Lower.GetLower()); // bits 0-63 + } + + FString ToString() const { return ToHexString(); } + + /* ---------- helpers ---------- */ + /** Cast from int64 for convenience (matches C# implicit). */ + static FSpacetimeDBInt256 FromInt64(int64 Src) + { + const uint64 Low = static_cast(Src); + const uint64 High = static_cast(Src >> 63); // 0 or 0xFFFF… for sign-extension + return FSpacetimeDBInt256(FSpacetimeDBUInt128(High, 0), FSpacetimeDBUInt128(0, Low)); + } + + TArray ToBytesArray() const + { + TArray Bytes; + Bytes.SetNumUninitialized(32); + + const uint64 Parts[4] = + { + Upper.GetUpper(), Upper.GetLower(), + Lower.GetUpper(), Lower.GetLower() + }; + + int32 Offset = 0; + for (uint64 Part : Parts) + { + for (int32 ByteIndex = 0; ByteIndex < 8; ++ByteIndex) + { + Bytes[Offset++] = static_cast((Part >> ((7 - ByteIndex) * 8)) & 0xFF); + } + } + return Bytes; + } + + static FSpacetimeDBInt256 FromBytesArray(const TArray& Bytes) + { + check(Bytes.Num() == 32); + + uint64 Parts[4] = {0, 0, 0, 0}; + int32 Offset = 0; + + for (int32 PartIdx = 0; PartIdx < 4; ++PartIdx) + { + for (int32 ByteIdx = 0; ByteIdx < 8; ++ByteIdx) + { + Parts[PartIdx] = (Parts[PartIdx] << 8) | Bytes[Offset++]; + } + } + + const FSpacetimeDBUInt128 Upper(Parts[0], Parts[1]); + const FSpacetimeDBUInt128 Lower(Parts[2], Parts[3]); + return FSpacetimeDBInt256(Upper, Lower); + } + + FString ToDecimalString() const + { + TArray bytes = ToBytesArray(); // big-endian Upper|Lower (two’s-complement) + if (IsNegative()) + { + TArray mag = bytes; // copy + TwosComplementNegateBigEndian(mag); // magnitude = (~x)+1 + const FString dec = BigEndianBytesToDecimalString(mag); + return FString::Printf(TEXT("-%s"), *dec); + } + return BigEndianBytesToDecimalString(bytes); + } +}; + + +UCLASS() +class USpacetimeDBLargeIntegerLibrary : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() + +public: + + /** FString ← FSpacetimeDBUInt128 */ + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|LargeInteger", + meta = (DisplayName = "To String (UInt128)", CompactNodeTitle = ".", + BlueprintAutocast)) + static FString Conv_UInt128ToString(const FSpacetimeDBUInt128& InValue) { return InValue.ToString(); }; + + /** FString ← FSpacetimeDBInt128 */ + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|LargeInteger", + meta = (DisplayName = "To String (Int128)", CompactNodeTitle = ".", + BlueprintAutocast)) + static FString Conv_Int128ToString(const FSpacetimeDBInt128& InValue) { return InValue.ToString(); }; + + /** FString ← FSpacetimeDBUInt256 */ + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|LargeInteger", + meta = (DisplayName = "To String (UInt256)", CompactNodeTitle = ".", + BlueprintAutocast)) + static FString Conv_UInt256ToString(const FSpacetimeDBUInt256& InValue) { return InValue.ToString(); }; + + /** FString ← FSpacetimeDBInt256 */ + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|LargeInteger", + meta = (DisplayName = "To String (Int256)", CompactNodeTitle = ".", + BlueprintAutocast)) + static FString Conv_Int256ToString(const FSpacetimeDBInt256& InValue) { return InValue.ToString(); }; + + /* ───────── UInt128 compare ───────── */ + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Comparison", + meta = (DisplayName = "Equal (UInt128)", + CompactNodeTitle = "==")) + static bool Equal_UInt128(const FSpacetimeDBUInt128& A, + const FSpacetimeDBUInt128& B) + { + return A == B; + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Comparison", + meta = (DisplayName = "Not Equal (UInt128)", + CompactNodeTitle = "!=")) + static bool NotEqual_UInt128(const FSpacetimeDBUInt128& A, + const FSpacetimeDBUInt128& B) + { + return A != B; + } + + /* ───────── Int128 compare ───────── */ + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Comparison", + meta = (DisplayName = "Equal (Int128)", + CompactNodeTitle = "==")) + static bool Equal_Int128(const FSpacetimeDBInt128& A, + const FSpacetimeDBInt128& B) + { + return A == B; + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Comparison", + meta = (DisplayName = "Not Equal (Int128)", + CompactNodeTitle = "!=")) + static bool NotEqual_Int128(const FSpacetimeDBInt128& A, + const FSpacetimeDBInt128& B) + { + return A != B; + } + + /* ───────── UInt256 compare ───────── */ + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Comparison", + meta = (DisplayName = "Equal (UInt256)", + CompactNodeTitle = "==")) + static bool Equal_UInt256(const FSpacetimeDBUInt256& A, + const FSpacetimeDBUInt256& B) + { + return A == B; + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Comparison", + meta = (DisplayName = "Not Equal (UInt256)", + CompactNodeTitle = "!=")) + static bool NotEqual_UInt256(const FSpacetimeDBUInt256& A, + const FSpacetimeDBUInt256& B) + { + return A != B; + } + + /* ───────── Int256 compare ───────── */ + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Comparison", + meta = (DisplayName = "Equal (Int256)", + CompactNodeTitle = "==")) + static bool Equal_Int256(const FSpacetimeDBInt256& A, + const FSpacetimeDBInt256& B) + { + return A == B; + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Comparison", + meta = (DisplayName = "Not Equal (Int256)", + CompactNodeTitle = "!=")) + static bool NotEqual_Int256(const FSpacetimeDBInt256& A, + const FSpacetimeDBInt256& B) + { + return A != B; + } +}; + +/** + * Get the hash of a 256-bit signed integer. + * @param Val The value to hash. + * @return The hash value. + */ +inline uint32 GetTypeHash(const FSpacetimeDBInt256& Val) +{ + return HashCombine(GetTypeHash(Val.GetUpper()), GetTypeHash(Val.GetLower())); +} \ No newline at end of file diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/Types/README.md b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/Types/README.md new file mode 100644 index 00000000000..0de58f9a915 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/Types/README.md @@ -0,0 +1,42 @@ +# Types + +This directory contains C++ structures that mirror the SpacetimeDB wire protocol, ClientAPI. Headers with the `.g.h` suffix are auto‑generated by the SpacetimeDB CLI and provide accessible representations of server and client messages. + + +## Files + +- `BsatnRowListType.g.h` – (Generated) Describes a list of BSATN encoded rows with a size hint. +- `Builtins.h` – Helper types used to expose SpacetimeDB Special Types to Unreal. +- `CallReducerType.g.h` – (Generated) Message sent to invoke a reducer on the server. +- `ClientMessageType.g.h` – (Generated) Union of all messages the client can send. +- `CompressableQueryUpdateType.g.h` – (Generated) Wrapper for updates that may be compressed. +- `DatabaseUpdateType.g.h` – (Generated) Represents a collection of table updates in a transaction. +- `EnergyQuantaType.g.h` – (Generated) Simple numeric wrapper used for Maincloud energy. +- `IdentityTokenType.g.h` – (Generated) Token used when authenticating a connection. +- `InitialSubscriptionType.g.h` – (Generated) Payload describing the initial state of a subscription. +- `LargeIntegers.h` – Definitions for large integer structures. +- `OneOffQueryResponseType.g.h` – (Generated) Result of a one‑off SQL query. +- `OneOffQueryType.g.h` – (Generated) Request type for a one‑off SQL query. +- `OneOffTableType.g.h` – (Generated) Table information returned from one‑off queries. +- `PrimaryTypeWrappers.h` – (Generated) BSATN wrappers for primitive types such as strings and arrays. +- `QueryIdType.g.h` – (Generated) Integer identifier for subscriptions and queries. +- `QueryUpdateType.g.h` – (Generated) Update message for an ongoing query. +- `ReducerCallInfoType.g.h` – (Generated) Details about a reducer invocation. +- `RowSizeHintType.g.h` – (Generated) Indicates how many rows to expect in a payload. +- `ServerMessageType.g.h` – (Generated) Union of all messages the server can send. +- `SubscribeAppliedType.g.h` – (Generated) Notification when a subscription has been applied. +- `SubscribeMultiAppliedType.g.h` – (Generated) Result of subscribing to multiple queries. +- `SubscribeMultiType.g.h` – (Generated) Request to subscribe to multiple queries. +- `SubscribeRowsType.g.h` – (Generated) Payload carrying row data during a subscription. +- `SubscribeSingleType.g.h` – (Generated) Request for a single subscription query. +- `SubscribeType.g.h` – (Generated) Generic subscribe request wrapper. +- `SubscriptionErrorType.g.h` – (Generated) Describes an error that occurred during subscription. +- `TableUpdateType.g.h` – (Generated) Set of row inserts and deletes for one table. +- `TransactionUpdateLightType.g.h` – (Generated) Lightweight transaction update containing only diffs. +- `TransactionUpdateType.g.h` – (Generated) Full transaction update including table contents. +- `UnitType.h` – Empty struct used where a non data type is required. +- `UnsubscribeAppliedType.g.h` – (Generated) Confirmation that an unsubscribe succeeded. +- `UnsubscribeMultiAppliedType.g.h` – (Generated) Result of unsubscribing from multiple queries. +- `UnsubscribeMultiType.g.h` – (Generated) Request to unsubscribe from multiple queries. +- `UnsubscribeType.g.h` – (Generated) Generic unsubscribe request. +- `UpdateStatusType.g.h` – (Generated) Indicates whether a reducer succeeded, failed or ran out of energy. \ No newline at end of file diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/Types/UnitType.h b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/Types/UnitType.h new file mode 100644 index 00000000000..8a1aaddde6d --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/Public/Types/UnitType.h @@ -0,0 +1,47 @@ +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "UnitType.generated.h" + +/** + * Represents a Unit type, which holds no data. + * It is used as a placeholder in data structures (like tagged unions) for variants + * that have no associated value. + */ +USTRUCT(BlueprintType, Category = "SpacetimeDB") +struct FSpacetimeDBUnit +{ + GENERATED_BODY() + + /** + * Compare two Unit types for equality. Always returns true. + * @param Other The other Unit to compare against. + * @return True, as all instances of Unit are identical. + */ + bool operator==(const FSpacetimeDBUnit& Other) const + { + return true; + } + + /** + * Compare two Unit types for inequality. Always returns false. + * @param Other The other Unit to compare against. + * @return False, as all instances of Unit are identical. + */ + bool operator!=(const FSpacetimeDBUnit& Other) const + { + return false; + } + +}; + +FORCEINLINE uint32 GetTypeHash(const FSpacetimeDBUnit& /*Value*/) +{ + return 0u; +} + + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT_EMPTY(FSpacetimeDBUnit); +} \ No newline at end of file diff --git a/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/SpacetimeDbSdk.Build.cs b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/SpacetimeDbSdk.Build.cs new file mode 100644 index 00000000000..edeac5fc940 --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/Source/SpacetimeDbSdk/SpacetimeDbSdk.Build.cs @@ -0,0 +1,44 @@ +using UnrealBuildTool; +using System.IO; + +public class SpacetimeDbSdk : ModuleRules +{ + public SpacetimeDbSdk(ReadOnlyTargetRules Target) : base(Target) + { + // Set the module type to be a standard module + PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; + + // Set the module to use C++20 standard + CppStandard = CppStandardVersion.Cpp20; + + + // Enable exceptions for this module + bEnableExceptions = true; + + PublicDependencyModuleNames.AddRange( + new string[] + { + "Core", + "WebSockets" // Required for WebSocket functionality + } + ); + + + PrivateDependencyModuleNames.AddRange( + new string[] + { + "CoreUObject", + "Engine", + "JsonUtilities", // Required for JSON serialization/deserialization + "Json" // Required for JSON handling + } + ); + + + DynamicallyLoadedModuleNames.AddRange( + new string[] + { + } + ); + } +} diff --git a/sdks/unreal/src/SpacetimeDbSdk/SpacetimeDbSdk.uplugin b/sdks/unreal/src/SpacetimeDbSdk/SpacetimeDbSdk.uplugin new file mode 100644 index 00000000000..11b7a29c56c --- /dev/null +++ b/sdks/unreal/src/SpacetimeDbSdk/SpacetimeDbSdk.uplugin @@ -0,0 +1,24 @@ +{ + "FileVersion": 3, + "Version": 1, + "VersionName": "1.0", + "FriendlyName": "SpacetimeDbSdk", + "Description": "", + "Category": "Other", + "CreatedBy": "Clockwork Labs", + "CreatedByURL": "", + "DocsURL": "", + "MarketplaceURL": "", + "SupportURL": "", + "CanContainContent": false, + "IsBetaVersion": false, + "IsExperimentalVersion": false, + "Installed": false, + "Modules": [ + { + "Name": "SpacetimeDbSdk", + "Type": "Runtime", + "LoadingPhase": "Default" + } + ] +} \ No newline at end of file diff --git a/sdks/unreal/tests/README.md b/sdks/unreal/tests/README.md new file mode 100644 index 00000000000..1aa5d875a14 --- /dev/null +++ b/sdks/unreal/tests/README.md @@ -0,0 +1,66 @@ +# Unreal Headless Test Harness for SpacetimeDB + +This directory contains the Unreal Engine headless test harness for the **SpacetimeDB Unreal SDK**. + +--- + +## Overview +The tests here validate the Unreal SDK integration against a running SpacetimeDB instance. +They use the Rust-based test harness in [`sdk.rs`](../../testing/src/sdk.rs) and execute an Unreal test project headlessly. + +- **Test Harness**: + `crates\testing\src\sdk.rs` + +- **Unreal Test Entry Point**: + `crates\sdk-unreal\tests\test.rs` + +- **Unreal Test Project**: + `crates\sdk-unreal\tests\TestClient` + +## Prerequisites + +The tests require an environment variable pointing to your Unreal Engine installation: +Example for Unreal Engine 5.6: +```sh +set UE_ROOT_PATH="C:/Program Files/Epic Games/UE_5.6" +``` + +## Running the Test + +From inside the Unreal SDK crate: + +```sh +cd \sdk-unreal +cargo test -p sdk-unreal-test-harness --test test -- --nocapture +``` + +## Using a Custom SpacetimeDB Build + +To run tests against a custom CLI build of SpacetimeDB, set the following environment variables: +```sh +set CUSTOM_SPACETIMEDB_ROOT=true +set CUSTOM_SPACETIMEDB_PATH= +``` + + + +## Unreal Engine Command Line Flags + +When running Unreal headlessly in CI, the following flags are commonly used: + +| Flag | Purpose | +| --- | --- | +| `-ExecCmds="..."` | Executes in-editor console commands in sequence (e.g., `Automation RunTests ...; Automation ExportReport; Quit`). | +| `-Unattended` | Disables all interactive dialogs; required for fully automated/headless runs. | +| `-NoPause` | Prevents Press any key to continue prompts on exit. | +| `-NullRHI` | Disables rendering entirely; speeds up headless runs and avoids GPU usage. | +| `-NoSplash` | Skips the Unreal splash screen for faster startup. | +| `-NoSound` | Disables audio systems; can improve performance in automation. | +| `-nop4` | Disables Perforce integration; avoids P4 login prompts in CI. | +| `-log` | Prints log output to the console window (instead of only writing to file). | +| `-Log="Path\To\File.log"` | Writes engine log output to a specific file. | +| `-ReportOutputPath="..."` | Directory where HTML reports (and related assets) will be saved when running `Automation ExportReport`. | +| `-ReportExportPath="..."` | File path for exporting the raw test results as JSON, which the HTML report uses. | +| `-LogCmds="automation veryverbose"` | Increases log verbosity for the automation system; useful for debugging test discovery and execution. | +| `-test="Filter"` | (When using `-run=Automation`) Runs only tests that match the given filter. | +| `-run=Automation` | Runs the Automation commandlet (source builds or certain editor configs only). Not always available in installed builds. | \ No newline at end of file diff --git a/sdks/unreal/tests/TestClient/.vsconfig b/sdks/unreal/tests/TestClient/.vsconfig new file mode 100644 index 00000000000..3b919ea7b8f --- /dev/null +++ b/sdks/unreal/tests/TestClient/.vsconfig @@ -0,0 +1,17 @@ +{ + "version": "1.0", + "components": [ + "Component.Unreal.Debugger", + "Component.Unreal.Ide", + "Microsoft.Net.Component.4.6.2.TargetingPack", + "Microsoft.VisualStudio.Component.VC.14.38.17.8.ATL", + "Microsoft.VisualStudio.Component.VC.14.38.17.8.x86.x64", + "Microsoft.VisualStudio.Component.VC.Llvm.Clang", + "Microsoft.VisualStudio.Component.VC.Tools.x86.x64", + "Microsoft.VisualStudio.Component.Windows11SDK.22621", + "Microsoft.VisualStudio.Workload.CoreEditor", + "Microsoft.VisualStudio.Workload.ManagedDesktop", + "Microsoft.VisualStudio.Workload.NativeDesktop", + "Microsoft.VisualStudio.Workload.NativeGame" + ] +} diff --git a/sdks/unreal/tests/TestClient/Config/DefaultEditor.ini b/sdks/unreal/tests/TestClient/Config/DefaultEditor.ini new file mode 100644 index 00000000000..e69de29bb2d diff --git a/sdks/unreal/tests/TestClient/Config/DefaultEditorPerProjectUserSettings.ini b/sdks/unreal/tests/TestClient/Config/DefaultEditorPerProjectUserSettings.ini new file mode 100644 index 00000000000..f66b9696a3d --- /dev/null +++ b/sdks/unreal/tests/TestClient/Config/DefaultEditorPerProjectUserSettings.ini @@ -0,0 +1,5 @@ + + +[/Script/TestClient.SpacetimeDBSettings] +SpacetimeDbTestName=sdk-test + diff --git a/sdks/unreal/tests/TestClient/Config/DefaultEngine.ini b/sdks/unreal/tests/TestClient/Config/DefaultEngine.ini new file mode 100644 index 00000000000..9c45040c09f --- /dev/null +++ b/sdks/unreal/tests/TestClient/Config/DefaultEngine.ini @@ -0,0 +1,51 @@ + + +[Audio] +UseAudioMixer=True + +[/Script/HardwareTargeting.HardwareTargetingSettings] +TargetedHardwareClass=Desktop +AppliedTargetedHardwareClass=Desktop +DefaultGraphicsPerformance=Maximum +AppliedDefaultGraphicsPerformance=Maximum + +[/Script/WindowsTargetPlatform.WindowsTargetSettings] +DefaultGraphicsRHI=DefaultGraphicsRHI_DX12 +DefaultGraphicsRHI=DefaultGraphicsRHI_DX12 +!D3D12TargetedShaderFormats=ClearArray ++D3D12TargetedShaderFormats=PCD3D_SM6 + +[/Script/Engine.RendererSettings] +r.AllowStaticLighting=0 +r.GenerateMeshDistanceFields=True +r.DynamicGlobalIlluminationMethod=1 +r.ReflectionMethod=1 +r.Shadow.Virtual.Enable=1 +r.DefaultFeature.AutoExposure.ExtendDefaultLuminanceRange=True +r.DefaultFeature.LocalExposure.HighlightContrastScale=0.8 +r.DefaultFeature.LocalExposure.ShadowContrastScale=0.8 +r.SkinCache.CompileShaders=True +r.RayTracing.RayTracingProxies.ProjectEnabled=True + +[/Script/WorldPartitionEditor.WorldPartitionEditorSettings] +CommandletClass=Class'/Script/UnrealEd.WorldPartitionConvertCommandlet' + +[/Script/Engine.UserInterfaceSettings] +bAuthorizeAutomaticWidgetVariableCreation=False +FontDPIPreset=Standard +FontDPI=72 + +[/Script/AndroidFileServerEditor.AndroidFileServerRuntimeSettings] +bEnablePlugin=True +bAllowNetworkConnection=True +SecurityToken=FC2469BA449F3D6AFB81E9A6E6FCBE4B +bIncludeInShipping=False +bAllowExternalStartInShipping=False +bCompileAFSProject=False +bUseCompression=False +bLogFiles=False +bReportStats=False +ConnectionType=USBOnly +bUseManualIPAddress=False +ManualIPAddress= + diff --git a/sdks/unreal/tests/TestClient/Config/DefaultGame.ini b/sdks/unreal/tests/TestClient/Config/DefaultGame.ini new file mode 100644 index 00000000000..4754b466b8d --- /dev/null +++ b/sdks/unreal/tests/TestClient/Config/DefaultGame.ini @@ -0,0 +1,5 @@ +[/Script/EngineSettings.GeneralProjectSettings] +ProjectID=9B36AE4A4DF62F180A496F93BE6813D9 + +[/Script/CommonUI.CommonUISettings] +CommonButtonAcceptKeyHandling=TriggerClick diff --git a/sdks/unreal/tests/TestClient/Config/DefaultInput.ini b/sdks/unreal/tests/TestClient/Config/DefaultInput.ini new file mode 100644 index 00000000000..a72fda22b24 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Config/DefaultInput.ini @@ -0,0 +1,85 @@ +[/Script/Engine.InputSettings] +-AxisConfig=(AxisKeyName="Gamepad_LeftX",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f)) +-AxisConfig=(AxisKeyName="Gamepad_LeftY",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f)) +-AxisConfig=(AxisKeyName="Gamepad_RightX",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f)) +-AxisConfig=(AxisKeyName="Gamepad_RightY",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f)) +-AxisConfig=(AxisKeyName="MouseX",AxisProperties=(DeadZone=0.f,Exponent=1.f,Sensitivity=0.07f)) +-AxisConfig=(AxisKeyName="MouseY",AxisProperties=(DeadZone=0.f,Exponent=1.f,Sensitivity=0.07f)) +-AxisConfig=(AxisKeyName="Mouse2D",AxisProperties=(DeadZone=0.f,Exponent=1.f,Sensitivity=0.07f)) ++AxisConfig=(AxisKeyName="Gamepad_LeftX",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Gamepad_LeftY",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Gamepad_RightX",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Gamepad_RightY",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MouseX",AxisProperties=(DeadZone=0.000000,Sensitivity=0.070000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MouseY",AxisProperties=(DeadZone=0.000000,Sensitivity=0.070000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Mouse2D",AxisProperties=(DeadZone=0.000000,Sensitivity=0.070000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MouseWheelAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Gamepad_LeftTriggerAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Gamepad_RightTriggerAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Gamepad_Special_Left_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Gamepad_Special_Left_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Vive_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Vive_Left_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Vive_Left_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Vive_Right_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Vive_Right_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="Vive_Right_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MixedReality_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MixedReality_Left_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MixedReality_Left_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MixedReality_Left_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MixedReality_Left_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MixedReality_Right_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MixedReality_Right_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MixedReality_Right_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MixedReality_Right_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="MixedReality_Right_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="OculusTouch_Left_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="OculusTouch_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="OculusTouch_Left_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="OculusTouch_Left_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="OculusTouch_Right_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="OculusTouch_Right_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="OculusTouch_Right_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="OculusTouch_Right_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Left_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Left_Grip_Force",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Left_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Left_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Left_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Left_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Left_Trackpad_Force",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Right_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Right_Grip_Force",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Right_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Right_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Right_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Right_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Right_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) ++AxisConfig=(AxisKeyName="ValveIndex_Right_Trackpad_Force",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) +bAltEnterTogglesFullscreen=True +bF11TogglesFullscreen=True +bUseMouseForTouch=False +bEnableMouseSmoothing=True +bEnableFOVScaling=True +bCaptureMouseOnLaunch=True +bEnableLegacyInputScales=True +bEnableMotionControls=True +bFilterInputByPlatformUser=False +bShouldFlushPressedKeysOnViewportFocusLost=True +bEnableDynamicComponentInputBinding=True +bAlwaysShowTouchInterface=False +bShowConsoleOnFourFingerTap=True +bEnableGestureRecognizer=False +bUseAutocorrect=False +DefaultViewportMouseCaptureMode=CapturePermanently_IncludingInitialMouseDown +DefaultViewportMouseLockMode=LockOnCapture +FOVScale=0.011110 +DoubleClickTime=0.200000 +DefaultPlayerInputClass=/Script/EnhancedInput.EnhancedPlayerInput +DefaultInputComponentClass=/Script/EnhancedInput.EnhancedInputComponent +DefaultTouchInterface=/Engine/MobileResources/HUD/DefaultVirtualJoysticks.DefaultVirtualJoysticks +-ConsoleKeys=Tilde ++ConsoleKeys=Tilde + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient.Target.cs b/sdks/unreal/tests/TestClient/Source/TestClient.Target.cs new file mode 100644 index 00000000000..f608c98c22b --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient.Target.cs @@ -0,0 +1,15 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +using UnrealBuildTool; +using System.Collections.Generic; + +public class TestClientTarget : TargetRules +{ + public TestClientTarget(TargetInfo Target) : base(Target) + { + Type = TargetType.Game; + DefaultBuildSettings = BuildSettingsVersion.V5; + + ExtraModuleNames.AddRange( new string[] { "TestClient" } ); + } +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/SpacetimeDBClient.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/SpacetimeDBClient.g.cpp new file mode 100644 index 00000000000..6ca589212ac --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/SpacetimeDBClient.g.cpp @@ -0,0 +1,9325 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/SpacetimeDBClient.g.h" +#include "DBCache/WithBsatn.h" +#include "BSATN/UEBSATNHelpers.h" +#include "ModuleBindings/Tables/OneF64Table.g.h" +#include "ModuleBindings/Tables/VecU256Table.g.h" +#include "ModuleBindings/Tables/OneU32Table.g.h" +#include "ModuleBindings/Tables/VecI16Table.g.h" +#include "ModuleBindings/Tables/OptionVecOptionI32Table.g.h" +#include "ModuleBindings/Tables/VecEnumWithPayloadTable.g.h" +#include "ModuleBindings/Tables/VecI128Table.g.h" +#include "ModuleBindings/Tables/OneI256Table.g.h" +#include "ModuleBindings/Tables/VecF64Table.g.h" +#include "ModuleBindings/Tables/OneConnectionIdTable.g.h" +#include "ModuleBindings/Tables/UniqueU16Table.g.h" +#include "ModuleBindings/Tables/LargeTableTable.g.h" +#include "ModuleBindings/Tables/VecEveryPrimitiveStructTable.g.h" +#include "ModuleBindings/Tables/VecI8Table.g.h" +#include "ModuleBindings/Tables/VecI64Table.g.h" +#include "ModuleBindings/Tables/VecTimestampTable.g.h" +#include "ModuleBindings/Tables/UniqueU64Table.g.h" +#include "ModuleBindings/Tables/VecU32Table.g.h" +#include "ModuleBindings/Tables/VecUnitStructTable.g.h" +#include "ModuleBindings/Tables/OneU64Table.g.h" +#include "ModuleBindings/Tables/OneEveryPrimitiveStructTable.g.h" +#include "ModuleBindings/Tables/IndexedTableTable.g.h" +#include "ModuleBindings/Tables/OptionSimpleEnumTable.g.h" +#include "ModuleBindings/Tables/PkU16Table.g.h" +#include "ModuleBindings/Tables/OneSimpleEnumTable.g.h" +#include "ModuleBindings/Tables/UniqueU32Table.g.h" +#include "ModuleBindings/Tables/UniqueI64Table.g.h" +#include "ModuleBindings/Tables/VecByteStructTable.g.h" +#include "ModuleBindings/Tables/VecU128Table.g.h" +#include "ModuleBindings/Tables/VecI32Table.g.h" +#include "ModuleBindings/Tables/OneBoolTable.g.h" +#include "ModuleBindings/Tables/VecIdentityTable.g.h" +#include "ModuleBindings/Tables/TableHoldsTableTable.g.h" +#include "ModuleBindings/Tables/UniqueIdentityTable.g.h" +#include "ModuleBindings/Tables/UniqueConnectionIdTable.g.h" +#include "ModuleBindings/Tables/IndexedSimpleEnumTable.g.h" +#include "ModuleBindings/Tables/OneU8Table.g.h" +#include "ModuleBindings/Tables/PkU8Table.g.h" +#include "ModuleBindings/Tables/PkI256Table.g.h" +#include "ModuleBindings/Tables/PkI16Table.g.h" +#include "ModuleBindings/Tables/PkStringTable.g.h" +#include "ModuleBindings/Tables/OneIdentityTable.g.h" +#include "ModuleBindings/Tables/OneI64Table.g.h" +#include "ModuleBindings/Tables/OptionEveryPrimitiveStructTable.g.h" +#include "ModuleBindings/Tables/VecBoolTable.g.h" +#include "ModuleBindings/Tables/UniqueI16Table.g.h" +#include "ModuleBindings/Tables/PkSimpleEnumTable.g.h" +#include "ModuleBindings/Tables/UniqueI32Table.g.h" +#include "ModuleBindings/Tables/PkI32Table.g.h" +#include "ModuleBindings/Tables/UniqueI256Table.g.h" +#include "ModuleBindings/Tables/UniqueI8Table.g.h" +#include "ModuleBindings/Tables/OneI16Table.g.h" +#include "ModuleBindings/Tables/PkU128Table.g.h" +#include "ModuleBindings/Tables/VecU8Table.g.h" +#include "ModuleBindings/Tables/OneEnumWithPayloadTable.g.h" +#include "ModuleBindings/Tables/PkU64Table.g.h" +#include "ModuleBindings/Tables/UniqueU128Table.g.h" +#include "ModuleBindings/Tables/OneStringTable.g.h" +#include "ModuleBindings/Tables/OneTimestampTable.g.h" +#include "ModuleBindings/Tables/PkBoolTable.g.h" +#include "ModuleBindings/Tables/VecSimpleEnumTable.g.h" +#include "ModuleBindings/Tables/OneU256Table.g.h" +#include "ModuleBindings/Tables/OneF32Table.g.h" +#include "ModuleBindings/Tables/OneI128Table.g.h" +#include "ModuleBindings/Tables/OneU128Table.g.h" +#include "ModuleBindings/Tables/OneUnitStructTable.g.h" +#include "ModuleBindings/Tables/VecU16Table.g.h" +#include "ModuleBindings/Tables/OneByteStructTable.g.h" +#include "ModuleBindings/Tables/ScheduledTableTable.g.h" +#include "ModuleBindings/Tables/PkConnectionIdTable.g.h" +#include "ModuleBindings/Tables/OneI32Table.g.h" +#include "ModuleBindings/Tables/PkI128Table.g.h" +#include "ModuleBindings/Tables/PkU32Table.g.h" +#include "ModuleBindings/Tables/UniqueStringTable.g.h" +#include "ModuleBindings/Tables/PkIdentityTable.g.h" +#include "ModuleBindings/Tables/UniqueI128Table.g.h" +#include "ModuleBindings/Tables/OptionI32Table.g.h" +#include "ModuleBindings/Tables/PkI64Table.g.h" +#include "ModuleBindings/Tables/PkU32TwoTable.g.h" +#include "ModuleBindings/Tables/VecU64Table.g.h" +#include "ModuleBindings/Tables/VecF32Table.g.h" +#include "ModuleBindings/Tables/OneU16Table.g.h" +#include "ModuleBindings/Tables/BTreeU32Table.g.h" +#include "ModuleBindings/Tables/PkI8Table.g.h" +#include "ModuleBindings/Tables/PkU256Table.g.h" +#include "ModuleBindings/Tables/IndexedTable2Table.g.h" +#include "ModuleBindings/Tables/OneEveryVecStructTable.g.h" +#include "ModuleBindings/Tables/OptionIdentityTable.g.h" +#include "ModuleBindings/Tables/OptionStringTable.g.h" +#include "ModuleBindings/Tables/UniqueU256Table.g.h" +#include "ModuleBindings/Tables/VecConnectionIdTable.g.h" +#include "ModuleBindings/Tables/VecEveryVecStructTable.g.h" +#include "ModuleBindings/Tables/VecI256Table.g.h" +#include "ModuleBindings/Tables/UsersTable.g.h" +#include "ModuleBindings/Tables/VecStringTable.g.h" +#include "ModuleBindings/Tables/OneI8Table.g.h" +#include "ModuleBindings/Tables/UniqueBoolTable.g.h" +#include "ModuleBindings/Tables/UniqueU8Table.g.h" + +static FReducer DecodeReducer(const FReducerEvent& Event) +{ + const FString& ReducerName = Event.ReducerCall.ReducerName; + + if (ReducerName == TEXT("delete_from_btree_u32")) + { + FDeleteFromBtreeU32Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::DeleteFromBtreeU32(Args); + } + + if (ReducerName == TEXT("delete_large_table")) + { + FDeleteLargeTableArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::DeleteLargeTable(Args); + } + + if (ReducerName == TEXT("delete_pk_bool")) + { + FDeletePkBoolArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::DeletePkBool(Args); + } + + if (ReducerName == TEXT("delete_pk_connection_id")) + { + FDeletePkConnectionIdArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::DeletePkConnectionId(Args); + } + + if (ReducerName == TEXT("delete_pk_i128")) + { + FDeletePkI128Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::DeletePkI128(Args); + } + + if (ReducerName == TEXT("delete_pk_i16")) + { + FDeletePkI16Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::DeletePkI16(Args); + } + + if (ReducerName == TEXT("delete_pk_i256")) + { + FDeletePkI256Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::DeletePkI256(Args); + } + + if (ReducerName == TEXT("delete_pk_i32")) + { + FDeletePkI32Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::DeletePkI32(Args); + } + + if (ReducerName == TEXT("delete_pk_i64")) + { + FDeletePkI64Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::DeletePkI64(Args); + } + + if (ReducerName == TEXT("delete_pk_i8")) + { + FDeletePkI8Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::DeletePkI8(Args); + } + + if (ReducerName == TEXT("delete_pk_identity")) + { + FDeletePkIdentityArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::DeletePkIdentity(Args); + } + + if (ReducerName == TEXT("delete_pk_string")) + { + FDeletePkStringArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::DeletePkString(Args); + } + + if (ReducerName == TEXT("delete_pk_u128")) + { + FDeletePkU128Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::DeletePkU128(Args); + } + + if (ReducerName == TEXT("delete_pk_u16")) + { + FDeletePkU16Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::DeletePkU16(Args); + } + + if (ReducerName == TEXT("delete_pk_u256")) + { + FDeletePkU256Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::DeletePkU256(Args); + } + + if (ReducerName == TEXT("delete_pk_u32")) + { + FDeletePkU32Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::DeletePkU32(Args); + } + + if (ReducerName == TEXT("delete_pk_u32_insert_pk_u32_two")) + { + FDeletePkU32InsertPkU32TwoArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::DeletePkU32InsertPkU32Two(Args); + } + + if (ReducerName == TEXT("delete_pk_u32_two")) + { + FDeletePkU32TwoArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::DeletePkU32Two(Args); + } + + if (ReducerName == TEXT("delete_pk_u64")) + { + FDeletePkU64Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::DeletePkU64(Args); + } + + if (ReducerName == TEXT("delete_pk_u8")) + { + FDeletePkU8Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::DeletePkU8(Args); + } + + if (ReducerName == TEXT("delete_unique_bool")) + { + FDeleteUniqueBoolArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::DeleteUniqueBool(Args); + } + + if (ReducerName == TEXT("delete_unique_connection_id")) + { + FDeleteUniqueConnectionIdArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::DeleteUniqueConnectionId(Args); + } + + if (ReducerName == TEXT("delete_unique_i128")) + { + FDeleteUniqueI128Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::DeleteUniqueI128(Args); + } + + if (ReducerName == TEXT("delete_unique_i16")) + { + FDeleteUniqueI16Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::DeleteUniqueI16(Args); + } + + if (ReducerName == TEXT("delete_unique_i256")) + { + FDeleteUniqueI256Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::DeleteUniqueI256(Args); + } + + if (ReducerName == TEXT("delete_unique_i32")) + { + FDeleteUniqueI32Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::DeleteUniqueI32(Args); + } + + if (ReducerName == TEXT("delete_unique_i64")) + { + FDeleteUniqueI64Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::DeleteUniqueI64(Args); + } + + if (ReducerName == TEXT("delete_unique_i8")) + { + FDeleteUniqueI8Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::DeleteUniqueI8(Args); + } + + if (ReducerName == TEXT("delete_unique_identity")) + { + FDeleteUniqueIdentityArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::DeleteUniqueIdentity(Args); + } + + if (ReducerName == TEXT("delete_unique_string")) + { + FDeleteUniqueStringArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::DeleteUniqueString(Args); + } + + if (ReducerName == TEXT("delete_unique_u128")) + { + FDeleteUniqueU128Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::DeleteUniqueU128(Args); + } + + if (ReducerName == TEXT("delete_unique_u16")) + { + FDeleteUniqueU16Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::DeleteUniqueU16(Args); + } + + if (ReducerName == TEXT("delete_unique_u256")) + { + FDeleteUniqueU256Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::DeleteUniqueU256(Args); + } + + if (ReducerName == TEXT("delete_unique_u32")) + { + FDeleteUniqueU32Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::DeleteUniqueU32(Args); + } + + if (ReducerName == TEXT("delete_unique_u64")) + { + FDeleteUniqueU64Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::DeleteUniqueU64(Args); + } + + if (ReducerName == TEXT("delete_unique_u8")) + { + FDeleteUniqueU8Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::DeleteUniqueU8(Args); + } + + if (ReducerName == TEXT("insert_call_timestamp")) + { + FInsertCallTimestampArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertCallTimestamp(Args); + } + + if (ReducerName == TEXT("insert_caller_one_connection_id")) + { + FInsertCallerOneConnectionIdArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertCallerOneConnectionId(Args); + } + + if (ReducerName == TEXT("insert_caller_one_identity")) + { + FInsertCallerOneIdentityArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertCallerOneIdentity(Args); + } + + if (ReducerName == TEXT("insert_caller_pk_connection_id")) + { + FInsertCallerPkConnectionIdArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertCallerPkConnectionId(Args); + } + + if (ReducerName == TEXT("insert_caller_pk_identity")) + { + FInsertCallerPkIdentityArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertCallerPkIdentity(Args); + } + + if (ReducerName == TEXT("insert_caller_unique_connection_id")) + { + FInsertCallerUniqueConnectionIdArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertCallerUniqueConnectionId(Args); + } + + if (ReducerName == TEXT("insert_caller_unique_identity")) + { + FInsertCallerUniqueIdentityArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertCallerUniqueIdentity(Args); + } + + if (ReducerName == TEXT("insert_caller_vec_connection_id")) + { + FInsertCallerVecConnectionIdArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertCallerVecConnectionId(Args); + } + + if (ReducerName == TEXT("insert_caller_vec_identity")) + { + FInsertCallerVecIdentityArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertCallerVecIdentity(Args); + } + + if (ReducerName == TEXT("insert_into_btree_u32")) + { + FInsertIntoBtreeU32Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertIntoBtreeU32(Args); + } + + if (ReducerName == TEXT("insert_into_indexed_simple_enum")) + { + FInsertIntoIndexedSimpleEnumArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertIntoIndexedSimpleEnum(Args); + } + + if (ReducerName == TEXT("insert_into_pk_btree_u32")) + { + FInsertIntoPkBtreeU32Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertIntoPkBtreeU32(Args); + } + + if (ReducerName == TEXT("insert_large_table")) + { + FInsertLargeTableArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertLargeTable(Args); + } + + if (ReducerName == TEXT("insert_one_bool")) + { + FInsertOneBoolArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertOneBool(Args); + } + + if (ReducerName == TEXT("insert_one_byte_struct")) + { + FInsertOneByteStructArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertOneByteStruct(Args); + } + + if (ReducerName == TEXT("insert_one_connection_id")) + { + FInsertOneConnectionIdArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertOneConnectionId(Args); + } + + if (ReducerName == TEXT("insert_one_enum_with_payload")) + { + FInsertOneEnumWithPayloadArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertOneEnumWithPayload(Args); + } + + if (ReducerName == TEXT("insert_one_every_primitive_struct")) + { + FInsertOneEveryPrimitiveStructArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertOneEveryPrimitiveStruct(Args); + } + + if (ReducerName == TEXT("insert_one_every_vec_struct")) + { + FInsertOneEveryVecStructArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertOneEveryVecStruct(Args); + } + + if (ReducerName == TEXT("insert_one_f32")) + { + FInsertOneF32Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertOneF32(Args); + } + + if (ReducerName == TEXT("insert_one_f64")) + { + FInsertOneF64Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertOneF64(Args); + } + + if (ReducerName == TEXT("insert_one_i128")) + { + FInsertOneI128Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertOneI128(Args); + } + + if (ReducerName == TEXT("insert_one_i16")) + { + FInsertOneI16Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertOneI16(Args); + } + + if (ReducerName == TEXT("insert_one_i256")) + { + FInsertOneI256Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertOneI256(Args); + } + + if (ReducerName == TEXT("insert_one_i32")) + { + FInsertOneI32Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertOneI32(Args); + } + + if (ReducerName == TEXT("insert_one_i64")) + { + FInsertOneI64Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertOneI64(Args); + } + + if (ReducerName == TEXT("insert_one_i8")) + { + FInsertOneI8Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertOneI8(Args); + } + + if (ReducerName == TEXT("insert_one_identity")) + { + FInsertOneIdentityArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertOneIdentity(Args); + } + + if (ReducerName == TEXT("insert_one_simple_enum")) + { + FInsertOneSimpleEnumArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertOneSimpleEnum(Args); + } + + if (ReducerName == TEXT("insert_one_string")) + { + FInsertOneStringArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertOneString(Args); + } + + if (ReducerName == TEXT("insert_one_timestamp")) + { + FInsertOneTimestampArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertOneTimestamp(Args); + } + + if (ReducerName == TEXT("insert_one_u128")) + { + FInsertOneU128Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertOneU128(Args); + } + + if (ReducerName == TEXT("insert_one_u16")) + { + FInsertOneU16Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertOneU16(Args); + } + + if (ReducerName == TEXT("insert_one_u256")) + { + FInsertOneU256Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertOneU256(Args); + } + + if (ReducerName == TEXT("insert_one_u32")) + { + FInsertOneU32Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertOneU32(Args); + } + + if (ReducerName == TEXT("insert_one_u64")) + { + FInsertOneU64Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertOneU64(Args); + } + + if (ReducerName == TEXT("insert_one_u8")) + { + FInsertOneU8Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertOneU8(Args); + } + + if (ReducerName == TEXT("insert_one_unit_struct")) + { + FInsertOneUnitStructArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertOneUnitStruct(Args); + } + + if (ReducerName == TEXT("insert_option_every_primitive_struct")) + { + FInsertOptionEveryPrimitiveStructArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertOptionEveryPrimitiveStruct(Args); + } + + if (ReducerName == TEXT("insert_option_i32")) + { + FInsertOptionI32Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertOptionI32(Args); + } + + if (ReducerName == TEXT("insert_option_identity")) + { + FInsertOptionIdentityArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertOptionIdentity(Args); + } + + if (ReducerName == TEXT("insert_option_simple_enum")) + { + FInsertOptionSimpleEnumArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertOptionSimpleEnum(Args); + } + + if (ReducerName == TEXT("insert_option_string")) + { + FInsertOptionStringArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertOptionString(Args); + } + + if (ReducerName == TEXT("insert_option_vec_option_i32")) + { + FInsertOptionVecOptionI32Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertOptionVecOptionI32(Args); + } + + if (ReducerName == TEXT("insert_pk_bool")) + { + FInsertPkBoolArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertPkBool(Args); + } + + if (ReducerName == TEXT("insert_pk_connection_id")) + { + FInsertPkConnectionIdArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertPkConnectionId(Args); + } + + if (ReducerName == TEXT("insert_pk_i128")) + { + FInsertPkI128Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertPkI128(Args); + } + + if (ReducerName == TEXT("insert_pk_i16")) + { + FInsertPkI16Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertPkI16(Args); + } + + if (ReducerName == TEXT("insert_pk_i256")) + { + FInsertPkI256Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertPkI256(Args); + } + + if (ReducerName == TEXT("insert_pk_i32")) + { + FInsertPkI32Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertPkI32(Args); + } + + if (ReducerName == TEXT("insert_pk_i64")) + { + FInsertPkI64Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertPkI64(Args); + } + + if (ReducerName == TEXT("insert_pk_i8")) + { + FInsertPkI8Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertPkI8(Args); + } + + if (ReducerName == TEXT("insert_pk_identity")) + { + FInsertPkIdentityArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertPkIdentity(Args); + } + + if (ReducerName == TEXT("insert_pk_simple_enum")) + { + FInsertPkSimpleEnumArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertPkSimpleEnum(Args); + } + + if (ReducerName == TEXT("insert_pk_string")) + { + FInsertPkStringArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertPkString(Args); + } + + if (ReducerName == TEXT("insert_pk_u128")) + { + FInsertPkU128Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertPkU128(Args); + } + + if (ReducerName == TEXT("insert_pk_u16")) + { + FInsertPkU16Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertPkU16(Args); + } + + if (ReducerName == TEXT("insert_pk_u256")) + { + FInsertPkU256Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertPkU256(Args); + } + + if (ReducerName == TEXT("insert_pk_u32")) + { + FInsertPkU32Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertPkU32(Args); + } + + if (ReducerName == TEXT("insert_pk_u32_two")) + { + FInsertPkU32TwoArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertPkU32Two(Args); + } + + if (ReducerName == TEXT("insert_pk_u64")) + { + FInsertPkU64Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertPkU64(Args); + } + + if (ReducerName == TEXT("insert_pk_u8")) + { + FInsertPkU8Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertPkU8(Args); + } + + if (ReducerName == TEXT("insert_primitives_as_strings")) + { + FInsertPrimitivesAsStringsArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertPrimitivesAsStrings(Args); + } + + if (ReducerName == TEXT("insert_table_holds_table")) + { + FInsertTableHoldsTableArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertTableHoldsTable(Args); + } + + if (ReducerName == TEXT("insert_unique_bool")) + { + FInsertUniqueBoolArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertUniqueBool(Args); + } + + if (ReducerName == TEXT("insert_unique_connection_id")) + { + FInsertUniqueConnectionIdArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertUniqueConnectionId(Args); + } + + if (ReducerName == TEXT("insert_unique_i128")) + { + FInsertUniqueI128Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertUniqueI128(Args); + } + + if (ReducerName == TEXT("insert_unique_i16")) + { + FInsertUniqueI16Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertUniqueI16(Args); + } + + if (ReducerName == TEXT("insert_unique_i256")) + { + FInsertUniqueI256Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertUniqueI256(Args); + } + + if (ReducerName == TEXT("insert_unique_i32")) + { + FInsertUniqueI32Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertUniqueI32(Args); + } + + if (ReducerName == TEXT("insert_unique_i64")) + { + FInsertUniqueI64Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertUniqueI64(Args); + } + + if (ReducerName == TEXT("insert_unique_i8")) + { + FInsertUniqueI8Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertUniqueI8(Args); + } + + if (ReducerName == TEXT("insert_unique_identity")) + { + FInsertUniqueIdentityArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertUniqueIdentity(Args); + } + + if (ReducerName == TEXT("insert_unique_string")) + { + FInsertUniqueStringArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertUniqueString(Args); + } + + if (ReducerName == TEXT("insert_unique_u128")) + { + FInsertUniqueU128Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertUniqueU128(Args); + } + + if (ReducerName == TEXT("insert_unique_u16")) + { + FInsertUniqueU16Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertUniqueU16(Args); + } + + if (ReducerName == TEXT("insert_unique_u256")) + { + FInsertUniqueU256Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertUniqueU256(Args); + } + + if (ReducerName == TEXT("insert_unique_u32")) + { + FInsertUniqueU32Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertUniqueU32(Args); + } + + if (ReducerName == TEXT("insert_unique_u32_update_pk_u32")) + { + FInsertUniqueU32UpdatePkU32Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertUniqueU32UpdatePkU32(Args); + } + + if (ReducerName == TEXT("insert_unique_u64")) + { + FInsertUniqueU64Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertUniqueU64(Args); + } + + if (ReducerName == TEXT("insert_unique_u8")) + { + FInsertUniqueU8Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertUniqueU8(Args); + } + + if (ReducerName == TEXT("insert_user")) + { + FInsertUserArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertUser(Args); + } + + if (ReducerName == TEXT("insert_vec_bool")) + { + FInsertVecBoolArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertVecBool(Args); + } + + if (ReducerName == TEXT("insert_vec_byte_struct")) + { + FInsertVecByteStructArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertVecByteStruct(Args); + } + + if (ReducerName == TEXT("insert_vec_connection_id")) + { + FInsertVecConnectionIdArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertVecConnectionId(Args); + } + + if (ReducerName == TEXT("insert_vec_enum_with_payload")) + { + FInsertVecEnumWithPayloadArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertVecEnumWithPayload(Args); + } + + if (ReducerName == TEXT("insert_vec_every_primitive_struct")) + { + FInsertVecEveryPrimitiveStructArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertVecEveryPrimitiveStruct(Args); + } + + if (ReducerName == TEXT("insert_vec_every_vec_struct")) + { + FInsertVecEveryVecStructArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertVecEveryVecStruct(Args); + } + + if (ReducerName == TEXT("insert_vec_f32")) + { + FInsertVecF32Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertVecF32(Args); + } + + if (ReducerName == TEXT("insert_vec_f64")) + { + FInsertVecF64Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertVecF64(Args); + } + + if (ReducerName == TEXT("insert_vec_i128")) + { + FInsertVecI128Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertVecI128(Args); + } + + if (ReducerName == TEXT("insert_vec_i16")) + { + FInsertVecI16Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertVecI16(Args); + } + + if (ReducerName == TEXT("insert_vec_i256")) + { + FInsertVecI256Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertVecI256(Args); + } + + if (ReducerName == TEXT("insert_vec_i32")) + { + FInsertVecI32Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertVecI32(Args); + } + + if (ReducerName == TEXT("insert_vec_i64")) + { + FInsertVecI64Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertVecI64(Args); + } + + if (ReducerName == TEXT("insert_vec_i8")) + { + FInsertVecI8Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertVecI8(Args); + } + + if (ReducerName == TEXT("insert_vec_identity")) + { + FInsertVecIdentityArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertVecIdentity(Args); + } + + if (ReducerName == TEXT("insert_vec_simple_enum")) + { + FInsertVecSimpleEnumArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertVecSimpleEnum(Args); + } + + if (ReducerName == TEXT("insert_vec_string")) + { + FInsertVecStringArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertVecString(Args); + } + + if (ReducerName == TEXT("insert_vec_timestamp")) + { + FInsertVecTimestampArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertVecTimestamp(Args); + } + + if (ReducerName == TEXT("insert_vec_u128")) + { + FInsertVecU128Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertVecU128(Args); + } + + if (ReducerName == TEXT("insert_vec_u16")) + { + FInsertVecU16Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertVecU16(Args); + } + + if (ReducerName == TEXT("insert_vec_u256")) + { + FInsertVecU256Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertVecU256(Args); + } + + if (ReducerName == TEXT("insert_vec_u32")) + { + FInsertVecU32Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertVecU32(Args); + } + + if (ReducerName == TEXT("insert_vec_u64")) + { + FInsertVecU64Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertVecU64(Args); + } + + if (ReducerName == TEXT("insert_vec_u8")) + { + FInsertVecU8Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertVecU8(Args); + } + + if (ReducerName == TEXT("insert_vec_unit_struct")) + { + FInsertVecUnitStructArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::InsertVecUnitStruct(Args); + } + + if (ReducerName == TEXT("no_op_succeeds")) + { + FNoOpSucceedsArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::NoOpSucceeds(Args); + } + + if (ReducerName == TEXT("send_scheduled_message")) + { + FSendScheduledMessageArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::SendScheduledMessage(Args); + } + + if (ReducerName == TEXT("update_indexed_simple_enum")) + { + FUpdateIndexedSimpleEnumArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::UpdateIndexedSimpleEnum(Args); + } + + if (ReducerName == TEXT("update_pk_bool")) + { + FUpdatePkBoolArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::UpdatePkBool(Args); + } + + if (ReducerName == TEXT("update_pk_connection_id")) + { + FUpdatePkConnectionIdArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::UpdatePkConnectionId(Args); + } + + if (ReducerName == TEXT("update_pk_i128")) + { + FUpdatePkI128Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::UpdatePkI128(Args); + } + + if (ReducerName == TEXT("update_pk_i16")) + { + FUpdatePkI16Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::UpdatePkI16(Args); + } + + if (ReducerName == TEXT("update_pk_i256")) + { + FUpdatePkI256Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::UpdatePkI256(Args); + } + + if (ReducerName == TEXT("update_pk_i32")) + { + FUpdatePkI32Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::UpdatePkI32(Args); + } + + if (ReducerName == TEXT("update_pk_i64")) + { + FUpdatePkI64Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::UpdatePkI64(Args); + } + + if (ReducerName == TEXT("update_pk_i8")) + { + FUpdatePkI8Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::UpdatePkI8(Args); + } + + if (ReducerName == TEXT("update_pk_identity")) + { + FUpdatePkIdentityArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::UpdatePkIdentity(Args); + } + + if (ReducerName == TEXT("update_pk_simple_enum")) + { + FUpdatePkSimpleEnumArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::UpdatePkSimpleEnum(Args); + } + + if (ReducerName == TEXT("update_pk_string")) + { + FUpdatePkStringArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::UpdatePkString(Args); + } + + if (ReducerName == TEXT("update_pk_u128")) + { + FUpdatePkU128Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::UpdatePkU128(Args); + } + + if (ReducerName == TEXT("update_pk_u16")) + { + FUpdatePkU16Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::UpdatePkU16(Args); + } + + if (ReducerName == TEXT("update_pk_u256")) + { + FUpdatePkU256Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::UpdatePkU256(Args); + } + + if (ReducerName == TEXT("update_pk_u32")) + { + FUpdatePkU32Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::UpdatePkU32(Args); + } + + if (ReducerName == TEXT("update_pk_u32_two")) + { + FUpdatePkU32TwoArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::UpdatePkU32Two(Args); + } + + if (ReducerName == TEXT("update_pk_u64")) + { + FUpdatePkU64Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::UpdatePkU64(Args); + } + + if (ReducerName == TEXT("update_pk_u8")) + { + FUpdatePkU8Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::UpdatePkU8(Args); + } + + if (ReducerName == TEXT("update_unique_bool")) + { + FUpdateUniqueBoolArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::UpdateUniqueBool(Args); + } + + if (ReducerName == TEXT("update_unique_connection_id")) + { + FUpdateUniqueConnectionIdArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::UpdateUniqueConnectionId(Args); + } + + if (ReducerName == TEXT("update_unique_i128")) + { + FUpdateUniqueI128Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::UpdateUniqueI128(Args); + } + + if (ReducerName == TEXT("update_unique_i16")) + { + FUpdateUniqueI16Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::UpdateUniqueI16(Args); + } + + if (ReducerName == TEXT("update_unique_i256")) + { + FUpdateUniqueI256Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::UpdateUniqueI256(Args); + } + + if (ReducerName == TEXT("update_unique_i32")) + { + FUpdateUniqueI32Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::UpdateUniqueI32(Args); + } + + if (ReducerName == TEXT("update_unique_i64")) + { + FUpdateUniqueI64Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::UpdateUniqueI64(Args); + } + + if (ReducerName == TEXT("update_unique_i8")) + { + FUpdateUniqueI8Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::UpdateUniqueI8(Args); + } + + if (ReducerName == TEXT("update_unique_identity")) + { + FUpdateUniqueIdentityArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::UpdateUniqueIdentity(Args); + } + + if (ReducerName == TEXT("update_unique_string")) + { + FUpdateUniqueStringArgs Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::UpdateUniqueString(Args); + } + + if (ReducerName == TEXT("update_unique_u128")) + { + FUpdateUniqueU128Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::UpdateUniqueU128(Args); + } + + if (ReducerName == TEXT("update_unique_u16")) + { + FUpdateUniqueU16Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::UpdateUniqueU16(Args); + } + + if (ReducerName == TEXT("update_unique_u256")) + { + FUpdateUniqueU256Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::UpdateUniqueU256(Args); + } + + if (ReducerName == TEXT("update_unique_u32")) + { + FUpdateUniqueU32Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::UpdateUniqueU32(Args); + } + + if (ReducerName == TEXT("update_unique_u64")) + { + FUpdateUniqueU64Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::UpdateUniqueU64(Args); + } + + if (ReducerName == TEXT("update_unique_u8")) + { + FUpdateUniqueU8Args Args = UE::SpacetimeDB::Deserialize(Event.ReducerCall.Args); + return FReducer::UpdateUniqueU8(Args); + } + + return FReducer(); +} + +UDbConnection::UDbConnection(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer) +{ + SetReducerFlags = ObjectInitializer.CreateDefaultSubobject(this, TEXT("SetReducerFlags")); + + Db = ObjectInitializer.CreateDefaultSubobject(this, TEXT("RemoteTables")); + Db->Initialize(); + + Reducers = ObjectInitializer.CreateDefaultSubobject(this, TEXT("RemoteReducers")); + Reducers->SetCallReducerFlags = SetReducerFlags; + Reducers->Conn = this; + + RegisterTable(TEXT("one_f64"), Db->OneF64); + RegisterTable(TEXT("vec_u256"), Db->VecU256); + RegisterTable(TEXT("one_u32"), Db->OneU32); + RegisterTable(TEXT("vec_i16"), Db->VecI16); + RegisterTable(TEXT("option_vec_option_i32"), Db->OptionVecOptionI32); + RegisterTable(TEXT("vec_enum_with_payload"), Db->VecEnumWithPayload); + RegisterTable(TEXT("vec_i128"), Db->VecI128); + RegisterTable(TEXT("one_i256"), Db->OneI256); + RegisterTable(TEXT("vec_f64"), Db->VecF64); + RegisterTable(TEXT("one_connection_id"), Db->OneConnectionId); + RegisterTable(TEXT("unique_u16"), Db->UniqueU16); + RegisterTable(TEXT("large_table"), Db->LargeTable); + RegisterTable(TEXT("vec_every_primitive_struct"), Db->VecEveryPrimitiveStruct); + RegisterTable(TEXT("vec_i8"), Db->VecI8); + RegisterTable(TEXT("vec_i64"), Db->VecI64); + RegisterTable(TEXT("vec_timestamp"), Db->VecTimestamp); + RegisterTable(TEXT("unique_u64"), Db->UniqueU64); + RegisterTable(TEXT("vec_u32"), Db->VecU32); + RegisterTable(TEXT("vec_unit_struct"), Db->VecUnitStruct); + RegisterTable(TEXT("one_u64"), Db->OneU64); + RegisterTable(TEXT("one_every_primitive_struct"), Db->OneEveryPrimitiveStruct); + RegisterTable(TEXT("indexed_table"), Db->IndexedTable); + RegisterTable(TEXT("option_simple_enum"), Db->OptionSimpleEnum); + RegisterTable(TEXT("pk_u16"), Db->PkU16); + RegisterTable(TEXT("one_simple_enum"), Db->OneSimpleEnum); + RegisterTable(TEXT("unique_u32"), Db->UniqueU32); + RegisterTable(TEXT("unique_i64"), Db->UniqueI64); + RegisterTable(TEXT("vec_byte_struct"), Db->VecByteStruct); + RegisterTable(TEXT("vec_u128"), Db->VecU128); + RegisterTable(TEXT("vec_i32"), Db->VecI32); + RegisterTable(TEXT("one_bool"), Db->OneBool); + RegisterTable(TEXT("vec_identity"), Db->VecIdentity); + RegisterTable(TEXT("table_holds_table"), Db->TableHoldsTable); + RegisterTable(TEXT("unique_identity"), Db->UniqueIdentity); + RegisterTable(TEXT("unique_connection_id"), Db->UniqueConnectionId); + RegisterTable(TEXT("indexed_simple_enum"), Db->IndexedSimpleEnum); + RegisterTable(TEXT("one_u8"), Db->OneU8); + RegisterTable(TEXT("pk_u8"), Db->PkU8); + RegisterTable(TEXT("pk_i256"), Db->PkI256); + RegisterTable(TEXT("pk_i16"), Db->PkI16); + RegisterTable(TEXT("pk_string"), Db->PkString); + RegisterTable(TEXT("one_identity"), Db->OneIdentity); + RegisterTable(TEXT("one_i64"), Db->OneI64); + RegisterTable(TEXT("option_every_primitive_struct"), Db->OptionEveryPrimitiveStruct); + RegisterTable(TEXT("vec_bool"), Db->VecBool); + RegisterTable(TEXT("unique_i16"), Db->UniqueI16); + RegisterTable(TEXT("pk_simple_enum"), Db->PkSimpleEnum); + RegisterTable(TEXT("unique_i32"), Db->UniqueI32); + RegisterTable(TEXT("pk_i32"), Db->PkI32); + RegisterTable(TEXT("unique_i256"), Db->UniqueI256); + RegisterTable(TEXT("unique_i8"), Db->UniqueI8); + RegisterTable(TEXT("one_i16"), Db->OneI16); + RegisterTable(TEXT("pk_u128"), Db->PkU128); + RegisterTable(TEXT("vec_u8"), Db->VecU8); + RegisterTable(TEXT("one_enum_with_payload"), Db->OneEnumWithPayload); + RegisterTable(TEXT("pk_u64"), Db->PkU64); + RegisterTable(TEXT("unique_u128"), Db->UniqueU128); + RegisterTable(TEXT("one_string"), Db->OneString); + RegisterTable(TEXT("one_timestamp"), Db->OneTimestamp); + RegisterTable(TEXT("pk_bool"), Db->PkBool); + RegisterTable(TEXT("vec_simple_enum"), Db->VecSimpleEnum); + RegisterTable(TEXT("one_u256"), Db->OneU256); + RegisterTable(TEXT("one_f32"), Db->OneF32); + RegisterTable(TEXT("one_i128"), Db->OneI128); + RegisterTable(TEXT("one_u128"), Db->OneU128); + RegisterTable(TEXT("one_unit_struct"), Db->OneUnitStruct); + RegisterTable(TEXT("vec_u16"), Db->VecU16); + RegisterTable(TEXT("one_byte_struct"), Db->OneByteStruct); + RegisterTable(TEXT("scheduled_table"), Db->ScheduledTable); + RegisterTable(TEXT("pk_connection_id"), Db->PkConnectionId); + RegisterTable(TEXT("one_i32"), Db->OneI32); + RegisterTable(TEXT("pk_i128"), Db->PkI128); + RegisterTable(TEXT("pk_u32"), Db->PkU32); + RegisterTable(TEXT("unique_string"), Db->UniqueString); + RegisterTable(TEXT("pk_identity"), Db->PkIdentity); + RegisterTable(TEXT("unique_i128"), Db->UniqueI128); + RegisterTable(TEXT("option_i32"), Db->OptionI32); + RegisterTable(TEXT("pk_i64"), Db->PkI64); + RegisterTable(TEXT("pk_u32_two"), Db->PkU32Two); + RegisterTable(TEXT("vec_u64"), Db->VecU64); + RegisterTable(TEXT("vec_f32"), Db->VecF32); + RegisterTable(TEXT("one_u16"), Db->OneU16); + RegisterTable(TEXT("btree_u32"), Db->BtreeU32); + RegisterTable(TEXT("pk_i8"), Db->PkI8); + RegisterTable(TEXT("pk_u256"), Db->PkU256); + RegisterTable(TEXT("indexed_table_2"), Db->IndexedTable2); + RegisterTable(TEXT("one_every_vec_struct"), Db->OneEveryVecStruct); + RegisterTable(TEXT("option_identity"), Db->OptionIdentity); + RegisterTable(TEXT("option_string"), Db->OptionString); + RegisterTable(TEXT("unique_u256"), Db->UniqueU256); + RegisterTable(TEXT("vec_connection_id"), Db->VecConnectionId); + RegisterTable(TEXT("vec_every_vec_struct"), Db->VecEveryVecStruct); + RegisterTable(TEXT("vec_i256"), Db->VecI256); + RegisterTable(TEXT("users"), Db->Users); + RegisterTable(TEXT("vec_string"), Db->VecString); + RegisterTable(TEXT("one_i8"), Db->OneI8); + RegisterTable(TEXT("unique_bool"), Db->UniqueBool); + RegisterTable(TEXT("unique_u8"), Db->UniqueU8); +} + +FContextBase::FContextBase(UDbConnection* InConn) +{ + Db = InConn->Db; + Reducers = InConn->Reducers; + SetReducerFlags = InConn->SetReducerFlags; + Conn = InConn; +} +bool FContextBase::IsActive() const +{ + return Conn->IsActive(); +} +void FContextBase::Disconnect() +{ + Conn->Disconnect(); +} +USubscriptionBuilder* FContextBase::SubscriptionBuilder() +{ + return Conn->SubscriptionBuilder(); +} +bool FContextBase::TryGetIdentity(FSpacetimeDBIdentity& OutIdentity) const +{ + return Conn->TryGetIdentity(OutIdentity); +} +FSpacetimeDBConnectionId FContextBase::GetConnectionId() const +{ + return Conn->GetConnectionId(); +} + +void URemoteTables::Initialize() +{ + + /** Creating tables */ + OneF64 = NewObject(this); + VecU256 = NewObject(this); + OneU32 = NewObject(this); + VecI16 = NewObject(this); + OptionVecOptionI32 = NewObject(this); + VecEnumWithPayload = NewObject(this); + VecI128 = NewObject(this); + OneI256 = NewObject(this); + VecF64 = NewObject(this); + OneConnectionId = NewObject(this); + UniqueU16 = NewObject(this); + LargeTable = NewObject(this); + VecEveryPrimitiveStruct = NewObject(this); + VecI8 = NewObject(this); + VecI64 = NewObject(this); + VecTimestamp = NewObject(this); + UniqueU64 = NewObject(this); + VecU32 = NewObject(this); + VecUnitStruct = NewObject(this); + OneU64 = NewObject(this); + OneEveryPrimitiveStruct = NewObject(this); + IndexedTable = NewObject(this); + OptionSimpleEnum = NewObject(this); + PkU16 = NewObject(this); + OneSimpleEnum = NewObject(this); + UniqueU32 = NewObject(this); + UniqueI64 = NewObject(this); + VecByteStruct = NewObject(this); + VecU128 = NewObject(this); + VecI32 = NewObject(this); + OneBool = NewObject(this); + VecIdentity = NewObject(this); + TableHoldsTable = NewObject(this); + UniqueIdentity = NewObject(this); + UniqueConnectionId = NewObject(this); + IndexedSimpleEnum = NewObject(this); + OneU8 = NewObject(this); + PkU8 = NewObject(this); + PkI256 = NewObject(this); + PkI16 = NewObject(this); + PkString = NewObject(this); + OneIdentity = NewObject(this); + OneI64 = NewObject(this); + OptionEveryPrimitiveStruct = NewObject(this); + VecBool = NewObject(this); + UniqueI16 = NewObject(this); + PkSimpleEnum = NewObject(this); + UniqueI32 = NewObject(this); + PkI32 = NewObject(this); + UniqueI256 = NewObject(this); + UniqueI8 = NewObject(this); + OneI16 = NewObject(this); + PkU128 = NewObject(this); + VecU8 = NewObject(this); + OneEnumWithPayload = NewObject(this); + PkU64 = NewObject(this); + UniqueU128 = NewObject(this); + OneString = NewObject(this); + OneTimestamp = NewObject(this); + PkBool = NewObject(this); + VecSimpleEnum = NewObject(this); + OneU256 = NewObject(this); + OneF32 = NewObject(this); + OneI128 = NewObject(this); + OneU128 = NewObject(this); + OneUnitStruct = NewObject(this); + VecU16 = NewObject(this); + OneByteStruct = NewObject(this); + ScheduledTable = NewObject(this); + PkConnectionId = NewObject(this); + OneI32 = NewObject(this); + PkI128 = NewObject(this); + PkU32 = NewObject(this); + UniqueString = NewObject(this); + PkIdentity = NewObject(this); + UniqueI128 = NewObject(this); + OptionI32 = NewObject(this); + PkI64 = NewObject(this); + PkU32Two = NewObject(this); + VecU64 = NewObject(this); + VecF32 = NewObject(this); + OneU16 = NewObject(this); + BtreeU32 = NewObject(this); + PkI8 = NewObject(this); + PkU256 = NewObject(this); + IndexedTable2 = NewObject(this); + OneEveryVecStruct = NewObject(this); + OptionIdentity = NewObject(this); + OptionString = NewObject(this); + UniqueU256 = NewObject(this); + VecConnectionId = NewObject(this); + VecEveryVecStruct = NewObject(this); + VecI256 = NewObject(this); + Users = NewObject(this); + VecString = NewObject(this); + OneI8 = NewObject(this); + UniqueBool = NewObject(this); + UniqueU8 = NewObject(this); + /**/ + + /** Initialization */ + OneF64->PostInitialize(); + VecU256->PostInitialize(); + OneU32->PostInitialize(); + VecI16->PostInitialize(); + OptionVecOptionI32->PostInitialize(); + VecEnumWithPayload->PostInitialize(); + VecI128->PostInitialize(); + OneI256->PostInitialize(); + VecF64->PostInitialize(); + OneConnectionId->PostInitialize(); + UniqueU16->PostInitialize(); + LargeTable->PostInitialize(); + VecEveryPrimitiveStruct->PostInitialize(); + VecI8->PostInitialize(); + VecI64->PostInitialize(); + VecTimestamp->PostInitialize(); + UniqueU64->PostInitialize(); + VecU32->PostInitialize(); + VecUnitStruct->PostInitialize(); + OneU64->PostInitialize(); + OneEveryPrimitiveStruct->PostInitialize(); + IndexedTable->PostInitialize(); + OptionSimpleEnum->PostInitialize(); + PkU16->PostInitialize(); + OneSimpleEnum->PostInitialize(); + UniqueU32->PostInitialize(); + UniqueI64->PostInitialize(); + VecByteStruct->PostInitialize(); + VecU128->PostInitialize(); + VecI32->PostInitialize(); + OneBool->PostInitialize(); + VecIdentity->PostInitialize(); + TableHoldsTable->PostInitialize(); + UniqueIdentity->PostInitialize(); + UniqueConnectionId->PostInitialize(); + IndexedSimpleEnum->PostInitialize(); + OneU8->PostInitialize(); + PkU8->PostInitialize(); + PkI256->PostInitialize(); + PkI16->PostInitialize(); + PkString->PostInitialize(); + OneIdentity->PostInitialize(); + OneI64->PostInitialize(); + OptionEveryPrimitiveStruct->PostInitialize(); + VecBool->PostInitialize(); + UniqueI16->PostInitialize(); + PkSimpleEnum->PostInitialize(); + UniqueI32->PostInitialize(); + PkI32->PostInitialize(); + UniqueI256->PostInitialize(); + UniqueI8->PostInitialize(); + OneI16->PostInitialize(); + PkU128->PostInitialize(); + VecU8->PostInitialize(); + OneEnumWithPayload->PostInitialize(); + PkU64->PostInitialize(); + UniqueU128->PostInitialize(); + OneString->PostInitialize(); + OneTimestamp->PostInitialize(); + PkBool->PostInitialize(); + VecSimpleEnum->PostInitialize(); + OneU256->PostInitialize(); + OneF32->PostInitialize(); + OneI128->PostInitialize(); + OneU128->PostInitialize(); + OneUnitStruct->PostInitialize(); + VecU16->PostInitialize(); + OneByteStruct->PostInitialize(); + ScheduledTable->PostInitialize(); + PkConnectionId->PostInitialize(); + OneI32->PostInitialize(); + PkI128->PostInitialize(); + PkU32->PostInitialize(); + UniqueString->PostInitialize(); + PkIdentity->PostInitialize(); + UniqueI128->PostInitialize(); + OptionI32->PostInitialize(); + PkI64->PostInitialize(); + PkU32Two->PostInitialize(); + VecU64->PostInitialize(); + VecF32->PostInitialize(); + OneU16->PostInitialize(); + BtreeU32->PostInitialize(); + PkI8->PostInitialize(); + PkU256->PostInitialize(); + IndexedTable2->PostInitialize(); + OneEveryVecStruct->PostInitialize(); + OptionIdentity->PostInitialize(); + OptionString->PostInitialize(); + UniqueU256->PostInitialize(); + VecConnectionId->PostInitialize(); + VecEveryVecStruct->PostInitialize(); + VecI256->PostInitialize(); + Users->PostInitialize(); + VecString->PostInitialize(); + OneI8->PostInitialize(); + UniqueBool->PostInitialize(); + UniqueU8->PostInitialize(); + /**/ +} + +void USetReducerFlags::DeleteFromBtreeU32(ECallReducerFlags Flag) +{ + FlagMap.Add("DeleteFromBtreeU32", Flag); +} +void USetReducerFlags::DeleteLargeTable(ECallReducerFlags Flag) +{ + FlagMap.Add("DeleteLargeTable", Flag); +} +void USetReducerFlags::DeletePkBool(ECallReducerFlags Flag) +{ + FlagMap.Add("DeletePkBool", Flag); +} +void USetReducerFlags::DeletePkConnectionId(ECallReducerFlags Flag) +{ + FlagMap.Add("DeletePkConnectionId", Flag); +} +void USetReducerFlags::DeletePkI128(ECallReducerFlags Flag) +{ + FlagMap.Add("DeletePkI128", Flag); +} +void USetReducerFlags::DeletePkI16(ECallReducerFlags Flag) +{ + FlagMap.Add("DeletePkI16", Flag); +} +void USetReducerFlags::DeletePkI256(ECallReducerFlags Flag) +{ + FlagMap.Add("DeletePkI256", Flag); +} +void USetReducerFlags::DeletePkI32(ECallReducerFlags Flag) +{ + FlagMap.Add("DeletePkI32", Flag); +} +void USetReducerFlags::DeletePkI64(ECallReducerFlags Flag) +{ + FlagMap.Add("DeletePkI64", Flag); +} +void USetReducerFlags::DeletePkI8(ECallReducerFlags Flag) +{ + FlagMap.Add("DeletePkI8", Flag); +} +void USetReducerFlags::DeletePkIdentity(ECallReducerFlags Flag) +{ + FlagMap.Add("DeletePkIdentity", Flag); +} +void USetReducerFlags::DeletePkString(ECallReducerFlags Flag) +{ + FlagMap.Add("DeletePkString", Flag); +} +void USetReducerFlags::DeletePkU128(ECallReducerFlags Flag) +{ + FlagMap.Add("DeletePkU128", Flag); +} +void USetReducerFlags::DeletePkU16(ECallReducerFlags Flag) +{ + FlagMap.Add("DeletePkU16", Flag); +} +void USetReducerFlags::DeletePkU256(ECallReducerFlags Flag) +{ + FlagMap.Add("DeletePkU256", Flag); +} +void USetReducerFlags::DeletePkU32(ECallReducerFlags Flag) +{ + FlagMap.Add("DeletePkU32", Flag); +} +void USetReducerFlags::DeletePkU32InsertPkU32Two(ECallReducerFlags Flag) +{ + FlagMap.Add("DeletePkU32InsertPkU32Two", Flag); +} +void USetReducerFlags::DeletePkU32Two(ECallReducerFlags Flag) +{ + FlagMap.Add("DeletePkU32Two", Flag); +} +void USetReducerFlags::DeletePkU64(ECallReducerFlags Flag) +{ + FlagMap.Add("DeletePkU64", Flag); +} +void USetReducerFlags::DeletePkU8(ECallReducerFlags Flag) +{ + FlagMap.Add("DeletePkU8", Flag); +} +void USetReducerFlags::DeleteUniqueBool(ECallReducerFlags Flag) +{ + FlagMap.Add("DeleteUniqueBool", Flag); +} +void USetReducerFlags::DeleteUniqueConnectionId(ECallReducerFlags Flag) +{ + FlagMap.Add("DeleteUniqueConnectionId", Flag); +} +void USetReducerFlags::DeleteUniqueI128(ECallReducerFlags Flag) +{ + FlagMap.Add("DeleteUniqueI128", Flag); +} +void USetReducerFlags::DeleteUniqueI16(ECallReducerFlags Flag) +{ + FlagMap.Add("DeleteUniqueI16", Flag); +} +void USetReducerFlags::DeleteUniqueI256(ECallReducerFlags Flag) +{ + FlagMap.Add("DeleteUniqueI256", Flag); +} +void USetReducerFlags::DeleteUniqueI32(ECallReducerFlags Flag) +{ + FlagMap.Add("DeleteUniqueI32", Flag); +} +void USetReducerFlags::DeleteUniqueI64(ECallReducerFlags Flag) +{ + FlagMap.Add("DeleteUniqueI64", Flag); +} +void USetReducerFlags::DeleteUniqueI8(ECallReducerFlags Flag) +{ + FlagMap.Add("DeleteUniqueI8", Flag); +} +void USetReducerFlags::DeleteUniqueIdentity(ECallReducerFlags Flag) +{ + FlagMap.Add("DeleteUniqueIdentity", Flag); +} +void USetReducerFlags::DeleteUniqueString(ECallReducerFlags Flag) +{ + FlagMap.Add("DeleteUniqueString", Flag); +} +void USetReducerFlags::DeleteUniqueU128(ECallReducerFlags Flag) +{ + FlagMap.Add("DeleteUniqueU128", Flag); +} +void USetReducerFlags::DeleteUniqueU16(ECallReducerFlags Flag) +{ + FlagMap.Add("DeleteUniqueU16", Flag); +} +void USetReducerFlags::DeleteUniqueU256(ECallReducerFlags Flag) +{ + FlagMap.Add("DeleteUniqueU256", Flag); +} +void USetReducerFlags::DeleteUniqueU32(ECallReducerFlags Flag) +{ + FlagMap.Add("DeleteUniqueU32", Flag); +} +void USetReducerFlags::DeleteUniqueU64(ECallReducerFlags Flag) +{ + FlagMap.Add("DeleteUniqueU64", Flag); +} +void USetReducerFlags::DeleteUniqueU8(ECallReducerFlags Flag) +{ + FlagMap.Add("DeleteUniqueU8", Flag); +} +void USetReducerFlags::InsertCallTimestamp(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertCallTimestamp", Flag); +} +void USetReducerFlags::InsertCallerOneConnectionId(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertCallerOneConnectionId", Flag); +} +void USetReducerFlags::InsertCallerOneIdentity(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertCallerOneIdentity", Flag); +} +void USetReducerFlags::InsertCallerPkConnectionId(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertCallerPkConnectionId", Flag); +} +void USetReducerFlags::InsertCallerPkIdentity(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertCallerPkIdentity", Flag); +} +void USetReducerFlags::InsertCallerUniqueConnectionId(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertCallerUniqueConnectionId", Flag); +} +void USetReducerFlags::InsertCallerUniqueIdentity(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertCallerUniqueIdentity", Flag); +} +void USetReducerFlags::InsertCallerVecConnectionId(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertCallerVecConnectionId", Flag); +} +void USetReducerFlags::InsertCallerVecIdentity(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertCallerVecIdentity", Flag); +} +void USetReducerFlags::InsertIntoBtreeU32(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertIntoBtreeU32", Flag); +} +void USetReducerFlags::InsertIntoIndexedSimpleEnum(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertIntoIndexedSimpleEnum", Flag); +} +void USetReducerFlags::InsertIntoPkBtreeU32(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertIntoPkBtreeU32", Flag); +} +void USetReducerFlags::InsertLargeTable(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertLargeTable", Flag); +} +void USetReducerFlags::InsertOneBool(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertOneBool", Flag); +} +void USetReducerFlags::InsertOneByteStruct(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertOneByteStruct", Flag); +} +void USetReducerFlags::InsertOneConnectionId(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertOneConnectionId", Flag); +} +void USetReducerFlags::InsertOneEnumWithPayload(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertOneEnumWithPayload", Flag); +} +void USetReducerFlags::InsertOneEveryPrimitiveStruct(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertOneEveryPrimitiveStruct", Flag); +} +void USetReducerFlags::InsertOneEveryVecStruct(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertOneEveryVecStruct", Flag); +} +void USetReducerFlags::InsertOneF32(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertOneF32", Flag); +} +void USetReducerFlags::InsertOneF64(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertOneF64", Flag); +} +void USetReducerFlags::InsertOneI128(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertOneI128", Flag); +} +void USetReducerFlags::InsertOneI16(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertOneI16", Flag); +} +void USetReducerFlags::InsertOneI256(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertOneI256", Flag); +} +void USetReducerFlags::InsertOneI32(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertOneI32", Flag); +} +void USetReducerFlags::InsertOneI64(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertOneI64", Flag); +} +void USetReducerFlags::InsertOneI8(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertOneI8", Flag); +} +void USetReducerFlags::InsertOneIdentity(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertOneIdentity", Flag); +} +void USetReducerFlags::InsertOneSimpleEnum(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertOneSimpleEnum", Flag); +} +void USetReducerFlags::InsertOneString(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertOneString", Flag); +} +void USetReducerFlags::InsertOneTimestamp(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertOneTimestamp", Flag); +} +void USetReducerFlags::InsertOneU128(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertOneU128", Flag); +} +void USetReducerFlags::InsertOneU16(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertOneU16", Flag); +} +void USetReducerFlags::InsertOneU256(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertOneU256", Flag); +} +void USetReducerFlags::InsertOneU32(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertOneU32", Flag); +} +void USetReducerFlags::InsertOneU64(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertOneU64", Flag); +} +void USetReducerFlags::InsertOneU8(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertOneU8", Flag); +} +void USetReducerFlags::InsertOneUnitStruct(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertOneUnitStruct", Flag); +} +void USetReducerFlags::InsertOptionEveryPrimitiveStruct(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertOptionEveryPrimitiveStruct", Flag); +} +void USetReducerFlags::InsertOptionI32(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertOptionI32", Flag); +} +void USetReducerFlags::InsertOptionIdentity(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertOptionIdentity", Flag); +} +void USetReducerFlags::InsertOptionSimpleEnum(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertOptionSimpleEnum", Flag); +} +void USetReducerFlags::InsertOptionString(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertOptionString", Flag); +} +void USetReducerFlags::InsertOptionVecOptionI32(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertOptionVecOptionI32", Flag); +} +void USetReducerFlags::InsertPkBool(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertPkBool", Flag); +} +void USetReducerFlags::InsertPkConnectionId(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertPkConnectionId", Flag); +} +void USetReducerFlags::InsertPkI128(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertPkI128", Flag); +} +void USetReducerFlags::InsertPkI16(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertPkI16", Flag); +} +void USetReducerFlags::InsertPkI256(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertPkI256", Flag); +} +void USetReducerFlags::InsertPkI32(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertPkI32", Flag); +} +void USetReducerFlags::InsertPkI64(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertPkI64", Flag); +} +void USetReducerFlags::InsertPkI8(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertPkI8", Flag); +} +void USetReducerFlags::InsertPkIdentity(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertPkIdentity", Flag); +} +void USetReducerFlags::InsertPkSimpleEnum(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertPkSimpleEnum", Flag); +} +void USetReducerFlags::InsertPkString(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertPkString", Flag); +} +void USetReducerFlags::InsertPkU128(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertPkU128", Flag); +} +void USetReducerFlags::InsertPkU16(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertPkU16", Flag); +} +void USetReducerFlags::InsertPkU256(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertPkU256", Flag); +} +void USetReducerFlags::InsertPkU32(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertPkU32", Flag); +} +void USetReducerFlags::InsertPkU32Two(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertPkU32Two", Flag); +} +void USetReducerFlags::InsertPkU64(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertPkU64", Flag); +} +void USetReducerFlags::InsertPkU8(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertPkU8", Flag); +} +void USetReducerFlags::InsertPrimitivesAsStrings(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertPrimitivesAsStrings", Flag); +} +void USetReducerFlags::InsertTableHoldsTable(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertTableHoldsTable", Flag); +} +void USetReducerFlags::InsertUniqueBool(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertUniqueBool", Flag); +} +void USetReducerFlags::InsertUniqueConnectionId(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertUniqueConnectionId", Flag); +} +void USetReducerFlags::InsertUniqueI128(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertUniqueI128", Flag); +} +void USetReducerFlags::InsertUniqueI16(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertUniqueI16", Flag); +} +void USetReducerFlags::InsertUniqueI256(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertUniqueI256", Flag); +} +void USetReducerFlags::InsertUniqueI32(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertUniqueI32", Flag); +} +void USetReducerFlags::InsertUniqueI64(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertUniqueI64", Flag); +} +void USetReducerFlags::InsertUniqueI8(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertUniqueI8", Flag); +} +void USetReducerFlags::InsertUniqueIdentity(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertUniqueIdentity", Flag); +} +void USetReducerFlags::InsertUniqueString(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertUniqueString", Flag); +} +void USetReducerFlags::InsertUniqueU128(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertUniqueU128", Flag); +} +void USetReducerFlags::InsertUniqueU16(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertUniqueU16", Flag); +} +void USetReducerFlags::InsertUniqueU256(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertUniqueU256", Flag); +} +void USetReducerFlags::InsertUniqueU32(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertUniqueU32", Flag); +} +void USetReducerFlags::InsertUniqueU32UpdatePkU32(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertUniqueU32UpdatePkU32", Flag); +} +void USetReducerFlags::InsertUniqueU64(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertUniqueU64", Flag); +} +void USetReducerFlags::InsertUniqueU8(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertUniqueU8", Flag); +} +void USetReducerFlags::InsertUser(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertUser", Flag); +} +void USetReducerFlags::InsertVecBool(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertVecBool", Flag); +} +void USetReducerFlags::InsertVecByteStruct(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertVecByteStruct", Flag); +} +void USetReducerFlags::InsertVecConnectionId(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertVecConnectionId", Flag); +} +void USetReducerFlags::InsertVecEnumWithPayload(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertVecEnumWithPayload", Flag); +} +void USetReducerFlags::InsertVecEveryPrimitiveStruct(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertVecEveryPrimitiveStruct", Flag); +} +void USetReducerFlags::InsertVecEveryVecStruct(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertVecEveryVecStruct", Flag); +} +void USetReducerFlags::InsertVecF32(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertVecF32", Flag); +} +void USetReducerFlags::InsertVecF64(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertVecF64", Flag); +} +void USetReducerFlags::InsertVecI128(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertVecI128", Flag); +} +void USetReducerFlags::InsertVecI16(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertVecI16", Flag); +} +void USetReducerFlags::InsertVecI256(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertVecI256", Flag); +} +void USetReducerFlags::InsertVecI32(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertVecI32", Flag); +} +void USetReducerFlags::InsertVecI64(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertVecI64", Flag); +} +void USetReducerFlags::InsertVecI8(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertVecI8", Flag); +} +void USetReducerFlags::InsertVecIdentity(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertVecIdentity", Flag); +} +void USetReducerFlags::InsertVecSimpleEnum(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertVecSimpleEnum", Flag); +} +void USetReducerFlags::InsertVecString(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertVecString", Flag); +} +void USetReducerFlags::InsertVecTimestamp(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertVecTimestamp", Flag); +} +void USetReducerFlags::InsertVecU128(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertVecU128", Flag); +} +void USetReducerFlags::InsertVecU16(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertVecU16", Flag); +} +void USetReducerFlags::InsertVecU256(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertVecU256", Flag); +} +void USetReducerFlags::InsertVecU32(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertVecU32", Flag); +} +void USetReducerFlags::InsertVecU64(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertVecU64", Flag); +} +void USetReducerFlags::InsertVecU8(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertVecU8", Flag); +} +void USetReducerFlags::InsertVecUnitStruct(ECallReducerFlags Flag) +{ + FlagMap.Add("InsertVecUnitStruct", Flag); +} +void USetReducerFlags::NoOpSucceeds(ECallReducerFlags Flag) +{ + FlagMap.Add("NoOpSucceeds", Flag); +} +void USetReducerFlags::SendScheduledMessage(ECallReducerFlags Flag) +{ + FlagMap.Add("SendScheduledMessage", Flag); +} +void USetReducerFlags::UpdateIndexedSimpleEnum(ECallReducerFlags Flag) +{ + FlagMap.Add("UpdateIndexedSimpleEnum", Flag); +} +void USetReducerFlags::UpdatePkBool(ECallReducerFlags Flag) +{ + FlagMap.Add("UpdatePkBool", Flag); +} +void USetReducerFlags::UpdatePkConnectionId(ECallReducerFlags Flag) +{ + FlagMap.Add("UpdatePkConnectionId", Flag); +} +void USetReducerFlags::UpdatePkI128(ECallReducerFlags Flag) +{ + FlagMap.Add("UpdatePkI128", Flag); +} +void USetReducerFlags::UpdatePkI16(ECallReducerFlags Flag) +{ + FlagMap.Add("UpdatePkI16", Flag); +} +void USetReducerFlags::UpdatePkI256(ECallReducerFlags Flag) +{ + FlagMap.Add("UpdatePkI256", Flag); +} +void USetReducerFlags::UpdatePkI32(ECallReducerFlags Flag) +{ + FlagMap.Add("UpdatePkI32", Flag); +} +void USetReducerFlags::UpdatePkI64(ECallReducerFlags Flag) +{ + FlagMap.Add("UpdatePkI64", Flag); +} +void USetReducerFlags::UpdatePkI8(ECallReducerFlags Flag) +{ + FlagMap.Add("UpdatePkI8", Flag); +} +void USetReducerFlags::UpdatePkIdentity(ECallReducerFlags Flag) +{ + FlagMap.Add("UpdatePkIdentity", Flag); +} +void USetReducerFlags::UpdatePkSimpleEnum(ECallReducerFlags Flag) +{ + FlagMap.Add("UpdatePkSimpleEnum", Flag); +} +void USetReducerFlags::UpdatePkString(ECallReducerFlags Flag) +{ + FlagMap.Add("UpdatePkString", Flag); +} +void USetReducerFlags::UpdatePkU128(ECallReducerFlags Flag) +{ + FlagMap.Add("UpdatePkU128", Flag); +} +void USetReducerFlags::UpdatePkU16(ECallReducerFlags Flag) +{ + FlagMap.Add("UpdatePkU16", Flag); +} +void USetReducerFlags::UpdatePkU256(ECallReducerFlags Flag) +{ + FlagMap.Add("UpdatePkU256", Flag); +} +void USetReducerFlags::UpdatePkU32(ECallReducerFlags Flag) +{ + FlagMap.Add("UpdatePkU32", Flag); +} +void USetReducerFlags::UpdatePkU32Two(ECallReducerFlags Flag) +{ + FlagMap.Add("UpdatePkU32Two", Flag); +} +void USetReducerFlags::UpdatePkU64(ECallReducerFlags Flag) +{ + FlagMap.Add("UpdatePkU64", Flag); +} +void USetReducerFlags::UpdatePkU8(ECallReducerFlags Flag) +{ + FlagMap.Add("UpdatePkU8", Flag); +} +void USetReducerFlags::UpdateUniqueBool(ECallReducerFlags Flag) +{ + FlagMap.Add("UpdateUniqueBool", Flag); +} +void USetReducerFlags::UpdateUniqueConnectionId(ECallReducerFlags Flag) +{ + FlagMap.Add("UpdateUniqueConnectionId", Flag); +} +void USetReducerFlags::UpdateUniqueI128(ECallReducerFlags Flag) +{ + FlagMap.Add("UpdateUniqueI128", Flag); +} +void USetReducerFlags::UpdateUniqueI16(ECallReducerFlags Flag) +{ + FlagMap.Add("UpdateUniqueI16", Flag); +} +void USetReducerFlags::UpdateUniqueI256(ECallReducerFlags Flag) +{ + FlagMap.Add("UpdateUniqueI256", Flag); +} +void USetReducerFlags::UpdateUniqueI32(ECallReducerFlags Flag) +{ + FlagMap.Add("UpdateUniqueI32", Flag); +} +void USetReducerFlags::UpdateUniqueI64(ECallReducerFlags Flag) +{ + FlagMap.Add("UpdateUniqueI64", Flag); +} +void USetReducerFlags::UpdateUniqueI8(ECallReducerFlags Flag) +{ + FlagMap.Add("UpdateUniqueI8", Flag); +} +void USetReducerFlags::UpdateUniqueIdentity(ECallReducerFlags Flag) +{ + FlagMap.Add("UpdateUniqueIdentity", Flag); +} +void USetReducerFlags::UpdateUniqueString(ECallReducerFlags Flag) +{ + FlagMap.Add("UpdateUniqueString", Flag); +} +void USetReducerFlags::UpdateUniqueU128(ECallReducerFlags Flag) +{ + FlagMap.Add("UpdateUniqueU128", Flag); +} +void USetReducerFlags::UpdateUniqueU16(ECallReducerFlags Flag) +{ + FlagMap.Add("UpdateUniqueU16", Flag); +} +void USetReducerFlags::UpdateUniqueU256(ECallReducerFlags Flag) +{ + FlagMap.Add("UpdateUniqueU256", Flag); +} +void USetReducerFlags::UpdateUniqueU32(ECallReducerFlags Flag) +{ + FlagMap.Add("UpdateUniqueU32", Flag); +} +void USetReducerFlags::UpdateUniqueU64(ECallReducerFlags Flag) +{ + FlagMap.Add("UpdateUniqueU64", Flag); +} +void USetReducerFlags::UpdateUniqueU8(ECallReducerFlags Flag) +{ + FlagMap.Add("UpdateUniqueU8", Flag); +} + +void URemoteReducers::DeleteFromBtreeU32(const TArray& Rows) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("delete_from_btree_u32"), FDeleteFromBtreeU32Args(Rows), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeDeleteFromBtreeU32(const FReducerEventContext& Context, const UDeleteFromBtreeU32Reducer* Args) +{ + if (!OnDeleteFromBtreeU32.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for DeleteFromBtreeU32")); + } + return false; + } + + OnDeleteFromBtreeU32.Broadcast(Context, Args->Rows); + return true; +} + +void URemoteReducers::DeleteLargeTable(const uint8 A, const uint16 B, const uint32 C, const uint64 D, const FSpacetimeDBUInt128& E, const FSpacetimeDBUInt256& F, const int8 G, const int16 H, const int32 I, const int64 J, const FSpacetimeDBInt128& K, const FSpacetimeDBInt256& L, const bool M, const float N, const double O, const FString& P, const ESimpleEnumType& Q, const FEnumWithPayloadType& R, const FUnitStructType& S, const FByteStructType& T, const FEveryPrimitiveStructType& U, const FEveryVecStructType& V) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("delete_large_table"), FDeleteLargeTableArgs(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeDeleteLargeTable(const FReducerEventContext& Context, const UDeleteLargeTableReducer* Args) +{ + if (!OnDeleteLargeTable.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for DeleteLargeTable")); + } + return false; + } + + FDeleteLargeTableArgs ArgsStruct; + ArgsStruct.A = Args->A; + ArgsStruct.B = Args->B; + ArgsStruct.C = Args->C; + ArgsStruct.D = Args->D; + ArgsStruct.E = Args->E; + ArgsStruct.F = Args->F; + ArgsStruct.G = Args->G; + ArgsStruct.H = Args->H; + ArgsStruct.I = Args->I; + ArgsStruct.J = Args->J; + ArgsStruct.K = Args->K; + ArgsStruct.L = Args->L; + ArgsStruct.M = Args->M; + ArgsStruct.N = Args->N; + ArgsStruct.O = Args->O; + ArgsStruct.P = Args->P; + ArgsStruct.Q = Args->Q; + ArgsStruct.R = Args->R; + ArgsStruct.S = Args->S; + ArgsStruct.T = Args->T; + ArgsStruct.U = Args->U; + ArgsStruct.V = Args->V; + OnDeleteLargeTable.Broadcast(Context, ArgsStruct); + return true; +} + +void URemoteReducers::DeletePkBool(const bool B) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("delete_pk_bool"), FDeletePkBoolArgs(B), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeDeletePkBool(const FReducerEventContext& Context, const UDeletePkBoolReducer* Args) +{ + if (!OnDeletePkBool.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for DeletePkBool")); + } + return false; + } + + OnDeletePkBool.Broadcast(Context, Args->B); + return true; +} + +void URemoteReducers::DeletePkConnectionId(const FSpacetimeDBConnectionId& A) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("delete_pk_connection_id"), FDeletePkConnectionIdArgs(A), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeDeletePkConnectionId(const FReducerEventContext& Context, const UDeletePkConnectionIdReducer* Args) +{ + if (!OnDeletePkConnectionId.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for DeletePkConnectionId")); + } + return false; + } + + OnDeletePkConnectionId.Broadcast(Context, Args->A); + return true; +} + +void URemoteReducers::DeletePkI128(const FSpacetimeDBInt128& N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("delete_pk_i128"), FDeletePkI128Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeDeletePkI128(const FReducerEventContext& Context, const UDeletePkI128Reducer* Args) +{ + if (!OnDeletePkI128.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for DeletePkI128")); + } + return false; + } + + OnDeletePkI128.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::DeletePkI16(const int16 N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("delete_pk_i16"), FDeletePkI16Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeDeletePkI16(const FReducerEventContext& Context, const UDeletePkI16Reducer* Args) +{ + if (!OnDeletePkI16.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for DeletePkI16")); + } + return false; + } + + OnDeletePkI16.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::DeletePkI256(const FSpacetimeDBInt256& N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("delete_pk_i256"), FDeletePkI256Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeDeletePkI256(const FReducerEventContext& Context, const UDeletePkI256Reducer* Args) +{ + if (!OnDeletePkI256.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for DeletePkI256")); + } + return false; + } + + OnDeletePkI256.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::DeletePkI32(const int32 N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("delete_pk_i32"), FDeletePkI32Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeDeletePkI32(const FReducerEventContext& Context, const UDeletePkI32Reducer* Args) +{ + if (!OnDeletePkI32.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for DeletePkI32")); + } + return false; + } + + OnDeletePkI32.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::DeletePkI64(const int64 N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("delete_pk_i64"), FDeletePkI64Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeDeletePkI64(const FReducerEventContext& Context, const UDeletePkI64Reducer* Args) +{ + if (!OnDeletePkI64.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for DeletePkI64")); + } + return false; + } + + OnDeletePkI64.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::DeletePkI8(const int8 N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("delete_pk_i8"), FDeletePkI8Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeDeletePkI8(const FReducerEventContext& Context, const UDeletePkI8Reducer* Args) +{ + if (!OnDeletePkI8.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for DeletePkI8")); + } + return false; + } + + OnDeletePkI8.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::DeletePkIdentity(const FSpacetimeDBIdentity& I) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("delete_pk_identity"), FDeletePkIdentityArgs(I), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeDeletePkIdentity(const FReducerEventContext& Context, const UDeletePkIdentityReducer* Args) +{ + if (!OnDeletePkIdentity.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for DeletePkIdentity")); + } + return false; + } + + OnDeletePkIdentity.Broadcast(Context, Args->I); + return true; +} + +void URemoteReducers::DeletePkString(const FString& S) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("delete_pk_string"), FDeletePkStringArgs(S), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeDeletePkString(const FReducerEventContext& Context, const UDeletePkStringReducer* Args) +{ + if (!OnDeletePkString.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for DeletePkString")); + } + return false; + } + + OnDeletePkString.Broadcast(Context, Args->S); + return true; +} + +void URemoteReducers::DeletePkU128(const FSpacetimeDBUInt128& N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("delete_pk_u128"), FDeletePkU128Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeDeletePkU128(const FReducerEventContext& Context, const UDeletePkU128Reducer* Args) +{ + if (!OnDeletePkU128.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for DeletePkU128")); + } + return false; + } + + OnDeletePkU128.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::DeletePkU16(const uint16 N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("delete_pk_u16"), FDeletePkU16Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeDeletePkU16(const FReducerEventContext& Context, const UDeletePkU16Reducer* Args) +{ + if (!OnDeletePkU16.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for DeletePkU16")); + } + return false; + } + + OnDeletePkU16.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::DeletePkU256(const FSpacetimeDBUInt256& N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("delete_pk_u256"), FDeletePkU256Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeDeletePkU256(const FReducerEventContext& Context, const UDeletePkU256Reducer* Args) +{ + if (!OnDeletePkU256.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for DeletePkU256")); + } + return false; + } + + OnDeletePkU256.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::DeletePkU32(const uint32 N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("delete_pk_u32"), FDeletePkU32Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeDeletePkU32(const FReducerEventContext& Context, const UDeletePkU32Reducer* Args) +{ + if (!OnDeletePkU32.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for DeletePkU32")); + } + return false; + } + + OnDeletePkU32.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::DeletePkU32InsertPkU32Two(const uint32 N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("delete_pk_u32_insert_pk_u32_two"), FDeletePkU32InsertPkU32TwoArgs(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeDeletePkU32InsertPkU32Two(const FReducerEventContext& Context, const UDeletePkU32InsertPkU32TwoReducer* Args) +{ + if (!OnDeletePkU32InsertPkU32Two.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for DeletePkU32InsertPkU32Two")); + } + return false; + } + + OnDeletePkU32InsertPkU32Two.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::DeletePkU32Two(const uint32 N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("delete_pk_u32_two"), FDeletePkU32TwoArgs(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeDeletePkU32Two(const FReducerEventContext& Context, const UDeletePkU32TwoReducer* Args) +{ + if (!OnDeletePkU32Two.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for DeletePkU32Two")); + } + return false; + } + + OnDeletePkU32Two.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::DeletePkU64(const uint64 N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("delete_pk_u64"), FDeletePkU64Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeDeletePkU64(const FReducerEventContext& Context, const UDeletePkU64Reducer* Args) +{ + if (!OnDeletePkU64.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for DeletePkU64")); + } + return false; + } + + OnDeletePkU64.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::DeletePkU8(const uint8 N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("delete_pk_u8"), FDeletePkU8Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeDeletePkU8(const FReducerEventContext& Context, const UDeletePkU8Reducer* Args) +{ + if (!OnDeletePkU8.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for DeletePkU8")); + } + return false; + } + + OnDeletePkU8.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::DeleteUniqueBool(const bool B) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("delete_unique_bool"), FDeleteUniqueBoolArgs(B), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeDeleteUniqueBool(const FReducerEventContext& Context, const UDeleteUniqueBoolReducer* Args) +{ + if (!OnDeleteUniqueBool.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for DeleteUniqueBool")); + } + return false; + } + + OnDeleteUniqueBool.Broadcast(Context, Args->B); + return true; +} + +void URemoteReducers::DeleteUniqueConnectionId(const FSpacetimeDBConnectionId& A) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("delete_unique_connection_id"), FDeleteUniqueConnectionIdArgs(A), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeDeleteUniqueConnectionId(const FReducerEventContext& Context, const UDeleteUniqueConnectionIdReducer* Args) +{ + if (!OnDeleteUniqueConnectionId.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for DeleteUniqueConnectionId")); + } + return false; + } + + OnDeleteUniqueConnectionId.Broadcast(Context, Args->A); + return true; +} + +void URemoteReducers::DeleteUniqueI128(const FSpacetimeDBInt128& N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("delete_unique_i128"), FDeleteUniqueI128Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeDeleteUniqueI128(const FReducerEventContext& Context, const UDeleteUniqueI128Reducer* Args) +{ + if (!OnDeleteUniqueI128.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for DeleteUniqueI128")); + } + return false; + } + + OnDeleteUniqueI128.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::DeleteUniqueI16(const int16 N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("delete_unique_i16"), FDeleteUniqueI16Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeDeleteUniqueI16(const FReducerEventContext& Context, const UDeleteUniqueI16Reducer* Args) +{ + if (!OnDeleteUniqueI16.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for DeleteUniqueI16")); + } + return false; + } + + OnDeleteUniqueI16.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::DeleteUniqueI256(const FSpacetimeDBInt256& N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("delete_unique_i256"), FDeleteUniqueI256Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeDeleteUniqueI256(const FReducerEventContext& Context, const UDeleteUniqueI256Reducer* Args) +{ + if (!OnDeleteUniqueI256.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for DeleteUniqueI256")); + } + return false; + } + + OnDeleteUniqueI256.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::DeleteUniqueI32(const int32 N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("delete_unique_i32"), FDeleteUniqueI32Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeDeleteUniqueI32(const FReducerEventContext& Context, const UDeleteUniqueI32Reducer* Args) +{ + if (!OnDeleteUniqueI32.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for DeleteUniqueI32")); + } + return false; + } + + OnDeleteUniqueI32.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::DeleteUniqueI64(const int64 N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("delete_unique_i64"), FDeleteUniqueI64Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeDeleteUniqueI64(const FReducerEventContext& Context, const UDeleteUniqueI64Reducer* Args) +{ + if (!OnDeleteUniqueI64.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for DeleteUniqueI64")); + } + return false; + } + + OnDeleteUniqueI64.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::DeleteUniqueI8(const int8 N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("delete_unique_i8"), FDeleteUniqueI8Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeDeleteUniqueI8(const FReducerEventContext& Context, const UDeleteUniqueI8Reducer* Args) +{ + if (!OnDeleteUniqueI8.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for DeleteUniqueI8")); + } + return false; + } + + OnDeleteUniqueI8.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::DeleteUniqueIdentity(const FSpacetimeDBIdentity& I) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("delete_unique_identity"), FDeleteUniqueIdentityArgs(I), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeDeleteUniqueIdentity(const FReducerEventContext& Context, const UDeleteUniqueIdentityReducer* Args) +{ + if (!OnDeleteUniqueIdentity.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for DeleteUniqueIdentity")); + } + return false; + } + + OnDeleteUniqueIdentity.Broadcast(Context, Args->I); + return true; +} + +void URemoteReducers::DeleteUniqueString(const FString& S) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("delete_unique_string"), FDeleteUniqueStringArgs(S), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeDeleteUniqueString(const FReducerEventContext& Context, const UDeleteUniqueStringReducer* Args) +{ + if (!OnDeleteUniqueString.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for DeleteUniqueString")); + } + return false; + } + + OnDeleteUniqueString.Broadcast(Context, Args->S); + return true; +} + +void URemoteReducers::DeleteUniqueU128(const FSpacetimeDBUInt128& N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("delete_unique_u128"), FDeleteUniqueU128Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeDeleteUniqueU128(const FReducerEventContext& Context, const UDeleteUniqueU128Reducer* Args) +{ + if (!OnDeleteUniqueU128.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for DeleteUniqueU128")); + } + return false; + } + + OnDeleteUniqueU128.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::DeleteUniqueU16(const uint16 N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("delete_unique_u16"), FDeleteUniqueU16Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeDeleteUniqueU16(const FReducerEventContext& Context, const UDeleteUniqueU16Reducer* Args) +{ + if (!OnDeleteUniqueU16.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for DeleteUniqueU16")); + } + return false; + } + + OnDeleteUniqueU16.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::DeleteUniqueU256(const FSpacetimeDBUInt256& N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("delete_unique_u256"), FDeleteUniqueU256Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeDeleteUniqueU256(const FReducerEventContext& Context, const UDeleteUniqueU256Reducer* Args) +{ + if (!OnDeleteUniqueU256.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for DeleteUniqueU256")); + } + return false; + } + + OnDeleteUniqueU256.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::DeleteUniqueU32(const uint32 N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("delete_unique_u32"), FDeleteUniqueU32Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeDeleteUniqueU32(const FReducerEventContext& Context, const UDeleteUniqueU32Reducer* Args) +{ + if (!OnDeleteUniqueU32.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for DeleteUniqueU32")); + } + return false; + } + + OnDeleteUniqueU32.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::DeleteUniqueU64(const uint64 N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("delete_unique_u64"), FDeleteUniqueU64Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeDeleteUniqueU64(const FReducerEventContext& Context, const UDeleteUniqueU64Reducer* Args) +{ + if (!OnDeleteUniqueU64.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for DeleteUniqueU64")); + } + return false; + } + + OnDeleteUniqueU64.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::DeleteUniqueU8(const uint8 N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("delete_unique_u8"), FDeleteUniqueU8Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeDeleteUniqueU8(const FReducerEventContext& Context, const UDeleteUniqueU8Reducer* Args) +{ + if (!OnDeleteUniqueU8.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for DeleteUniqueU8")); + } + return false; + } + + OnDeleteUniqueU8.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::InsertCallTimestamp() +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_call_timestamp"), FInsertCallTimestampArgs(), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertCallTimestamp(const FReducerEventContext& Context, const UInsertCallTimestampReducer* Args) +{ + if (!OnInsertCallTimestamp.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertCallTimestamp")); + } + return false; + } + + OnInsertCallTimestamp.Broadcast(Context); + return true; +} + +void URemoteReducers::InsertCallerOneConnectionId() +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_caller_one_connection_id"), FInsertCallerOneConnectionIdArgs(), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertCallerOneConnectionId(const FReducerEventContext& Context, const UInsertCallerOneConnectionIdReducer* Args) +{ + if (!OnInsertCallerOneConnectionId.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertCallerOneConnectionId")); + } + return false; + } + + OnInsertCallerOneConnectionId.Broadcast(Context); + return true; +} + +void URemoteReducers::InsertCallerOneIdentity() +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_caller_one_identity"), FInsertCallerOneIdentityArgs(), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertCallerOneIdentity(const FReducerEventContext& Context, const UInsertCallerOneIdentityReducer* Args) +{ + if (!OnInsertCallerOneIdentity.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertCallerOneIdentity")); + } + return false; + } + + OnInsertCallerOneIdentity.Broadcast(Context); + return true; +} + +void URemoteReducers::InsertCallerPkConnectionId(const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_caller_pk_connection_id"), FInsertCallerPkConnectionIdArgs(Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertCallerPkConnectionId(const FReducerEventContext& Context, const UInsertCallerPkConnectionIdReducer* Args) +{ + if (!OnInsertCallerPkConnectionId.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertCallerPkConnectionId")); + } + return false; + } + + OnInsertCallerPkConnectionId.Broadcast(Context, Args->Data); + return true; +} + +void URemoteReducers::InsertCallerPkIdentity(const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_caller_pk_identity"), FInsertCallerPkIdentityArgs(Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertCallerPkIdentity(const FReducerEventContext& Context, const UInsertCallerPkIdentityReducer* Args) +{ + if (!OnInsertCallerPkIdentity.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertCallerPkIdentity")); + } + return false; + } + + OnInsertCallerPkIdentity.Broadcast(Context, Args->Data); + return true; +} + +void URemoteReducers::InsertCallerUniqueConnectionId(const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_caller_unique_connection_id"), FInsertCallerUniqueConnectionIdArgs(Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertCallerUniqueConnectionId(const FReducerEventContext& Context, const UInsertCallerUniqueConnectionIdReducer* Args) +{ + if (!OnInsertCallerUniqueConnectionId.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertCallerUniqueConnectionId")); + } + return false; + } + + OnInsertCallerUniqueConnectionId.Broadcast(Context, Args->Data); + return true; +} + +void URemoteReducers::InsertCallerUniqueIdentity(const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_caller_unique_identity"), FInsertCallerUniqueIdentityArgs(Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertCallerUniqueIdentity(const FReducerEventContext& Context, const UInsertCallerUniqueIdentityReducer* Args) +{ + if (!OnInsertCallerUniqueIdentity.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertCallerUniqueIdentity")); + } + return false; + } + + OnInsertCallerUniqueIdentity.Broadcast(Context, Args->Data); + return true; +} + +void URemoteReducers::InsertCallerVecConnectionId() +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_caller_vec_connection_id"), FInsertCallerVecConnectionIdArgs(), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertCallerVecConnectionId(const FReducerEventContext& Context, const UInsertCallerVecConnectionIdReducer* Args) +{ + if (!OnInsertCallerVecConnectionId.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertCallerVecConnectionId")); + } + return false; + } + + OnInsertCallerVecConnectionId.Broadcast(Context); + return true; +} + +void URemoteReducers::InsertCallerVecIdentity() +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_caller_vec_identity"), FInsertCallerVecIdentityArgs(), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertCallerVecIdentity(const FReducerEventContext& Context, const UInsertCallerVecIdentityReducer* Args) +{ + if (!OnInsertCallerVecIdentity.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertCallerVecIdentity")); + } + return false; + } + + OnInsertCallerVecIdentity.Broadcast(Context); + return true; +} + +void URemoteReducers::InsertIntoBtreeU32(const TArray& Rows) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_into_btree_u32"), FInsertIntoBtreeU32Args(Rows), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertIntoBtreeU32(const FReducerEventContext& Context, const UInsertIntoBtreeU32Reducer* Args) +{ + if (!OnInsertIntoBtreeU32.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertIntoBtreeU32")); + } + return false; + } + + OnInsertIntoBtreeU32.Broadcast(Context, Args->Rows); + return true; +} + +void URemoteReducers::InsertIntoIndexedSimpleEnum(const ESimpleEnumType& N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_into_indexed_simple_enum"), FInsertIntoIndexedSimpleEnumArgs(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertIntoIndexedSimpleEnum(const FReducerEventContext& Context, const UInsertIntoIndexedSimpleEnumReducer* Args) +{ + if (!OnInsertIntoIndexedSimpleEnum.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertIntoIndexedSimpleEnum")); + } + return false; + } + + OnInsertIntoIndexedSimpleEnum.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::InsertIntoPkBtreeU32(const TArray& PkU32, const TArray& BtU32) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_into_pk_btree_u32"), FInsertIntoPkBtreeU32Args(PkU32, BtU32), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertIntoPkBtreeU32(const FReducerEventContext& Context, const UInsertIntoPkBtreeU32Reducer* Args) +{ + if (!OnInsertIntoPkBtreeU32.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertIntoPkBtreeU32")); + } + return false; + } + + OnInsertIntoPkBtreeU32.Broadcast(Context, Args->PkU32, Args->BtU32); + return true; +} + +void URemoteReducers::InsertLargeTable(const uint8 A, const uint16 B, const uint32 C, const uint64 D, const FSpacetimeDBUInt128& E, const FSpacetimeDBUInt256& F, const int8 G, const int16 H, const int32 I, const int64 J, const FSpacetimeDBInt128& K, const FSpacetimeDBInt256& L, const bool M, const float N, const double O, const FString& P, const ESimpleEnumType& Q, const FEnumWithPayloadType& R, const FUnitStructType& S, const FByteStructType& T, const FEveryPrimitiveStructType& U, const FEveryVecStructType& V) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_large_table"), FInsertLargeTableArgs(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertLargeTable(const FReducerEventContext& Context, const UInsertLargeTableReducer* Args) +{ + if (!OnInsertLargeTable.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertLargeTable")); + } + return false; + } + + FInsertLargeTableArgs ArgsStruct; + ArgsStruct.A = Args->A; + ArgsStruct.B = Args->B; + ArgsStruct.C = Args->C; + ArgsStruct.D = Args->D; + ArgsStruct.E = Args->E; + ArgsStruct.F = Args->F; + ArgsStruct.G = Args->G; + ArgsStruct.H = Args->H; + ArgsStruct.I = Args->I; + ArgsStruct.J = Args->J; + ArgsStruct.K = Args->K; + ArgsStruct.L = Args->L; + ArgsStruct.M = Args->M; + ArgsStruct.N = Args->N; + ArgsStruct.O = Args->O; + ArgsStruct.P = Args->P; + ArgsStruct.Q = Args->Q; + ArgsStruct.R = Args->R; + ArgsStruct.S = Args->S; + ArgsStruct.T = Args->T; + ArgsStruct.U = Args->U; + ArgsStruct.V = Args->V; + OnInsertLargeTable.Broadcast(Context, ArgsStruct); + return true; +} + +void URemoteReducers::InsertOneBool(const bool B) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_one_bool"), FInsertOneBoolArgs(B), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertOneBool(const FReducerEventContext& Context, const UInsertOneBoolReducer* Args) +{ + if (!OnInsertOneBool.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertOneBool")); + } + return false; + } + + OnInsertOneBool.Broadcast(Context, Args->B); + return true; +} + +void URemoteReducers::InsertOneByteStruct(const FByteStructType& S) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_one_byte_struct"), FInsertOneByteStructArgs(S), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertOneByteStruct(const FReducerEventContext& Context, const UInsertOneByteStructReducer* Args) +{ + if (!OnInsertOneByteStruct.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertOneByteStruct")); + } + return false; + } + + OnInsertOneByteStruct.Broadcast(Context, Args->S); + return true; +} + +void URemoteReducers::InsertOneConnectionId(const FSpacetimeDBConnectionId& A) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_one_connection_id"), FInsertOneConnectionIdArgs(A), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertOneConnectionId(const FReducerEventContext& Context, const UInsertOneConnectionIdReducer* Args) +{ + if (!OnInsertOneConnectionId.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertOneConnectionId")); + } + return false; + } + + OnInsertOneConnectionId.Broadcast(Context, Args->A); + return true; +} + +void URemoteReducers::InsertOneEnumWithPayload(const FEnumWithPayloadType& E) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_one_enum_with_payload"), FInsertOneEnumWithPayloadArgs(E), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertOneEnumWithPayload(const FReducerEventContext& Context, const UInsertOneEnumWithPayloadReducer* Args) +{ + if (!OnInsertOneEnumWithPayload.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertOneEnumWithPayload")); + } + return false; + } + + OnInsertOneEnumWithPayload.Broadcast(Context, Args->E); + return true; +} + +void URemoteReducers::InsertOneEveryPrimitiveStruct(const FEveryPrimitiveStructType& S) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_one_every_primitive_struct"), FInsertOneEveryPrimitiveStructArgs(S), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertOneEveryPrimitiveStruct(const FReducerEventContext& Context, const UInsertOneEveryPrimitiveStructReducer* Args) +{ + if (!OnInsertOneEveryPrimitiveStruct.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertOneEveryPrimitiveStruct")); + } + return false; + } + + OnInsertOneEveryPrimitiveStruct.Broadcast(Context, Args->S); + return true; +} + +void URemoteReducers::InsertOneEveryVecStruct(const FEveryVecStructType& S) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_one_every_vec_struct"), FInsertOneEveryVecStructArgs(S), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertOneEveryVecStruct(const FReducerEventContext& Context, const UInsertOneEveryVecStructReducer* Args) +{ + if (!OnInsertOneEveryVecStruct.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertOneEveryVecStruct")); + } + return false; + } + + OnInsertOneEveryVecStruct.Broadcast(Context, Args->S); + return true; +} + +void URemoteReducers::InsertOneF32(const float F) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_one_f32"), FInsertOneF32Args(F), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertOneF32(const FReducerEventContext& Context, const UInsertOneF32Reducer* Args) +{ + if (!OnInsertOneF32.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertOneF32")); + } + return false; + } + + OnInsertOneF32.Broadcast(Context, Args->F); + return true; +} + +void URemoteReducers::InsertOneF64(const double F) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_one_f64"), FInsertOneF64Args(F), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertOneF64(const FReducerEventContext& Context, const UInsertOneF64Reducer* Args) +{ + if (!OnInsertOneF64.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertOneF64")); + } + return false; + } + + OnInsertOneF64.Broadcast(Context, Args->F); + return true; +} + +void URemoteReducers::InsertOneI128(const FSpacetimeDBInt128& N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_one_i128"), FInsertOneI128Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertOneI128(const FReducerEventContext& Context, const UInsertOneI128Reducer* Args) +{ + if (!OnInsertOneI128.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertOneI128")); + } + return false; + } + + OnInsertOneI128.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::InsertOneI16(const int16 N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_one_i16"), FInsertOneI16Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertOneI16(const FReducerEventContext& Context, const UInsertOneI16Reducer* Args) +{ + if (!OnInsertOneI16.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertOneI16")); + } + return false; + } + + OnInsertOneI16.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::InsertOneI256(const FSpacetimeDBInt256& N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_one_i256"), FInsertOneI256Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertOneI256(const FReducerEventContext& Context, const UInsertOneI256Reducer* Args) +{ + if (!OnInsertOneI256.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertOneI256")); + } + return false; + } + + OnInsertOneI256.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::InsertOneI32(const int32 N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_one_i32"), FInsertOneI32Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertOneI32(const FReducerEventContext& Context, const UInsertOneI32Reducer* Args) +{ + if (!OnInsertOneI32.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertOneI32")); + } + return false; + } + + OnInsertOneI32.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::InsertOneI64(const int64 N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_one_i64"), FInsertOneI64Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertOneI64(const FReducerEventContext& Context, const UInsertOneI64Reducer* Args) +{ + if (!OnInsertOneI64.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertOneI64")); + } + return false; + } + + OnInsertOneI64.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::InsertOneI8(const int8 N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_one_i8"), FInsertOneI8Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertOneI8(const FReducerEventContext& Context, const UInsertOneI8Reducer* Args) +{ + if (!OnInsertOneI8.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertOneI8")); + } + return false; + } + + OnInsertOneI8.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::InsertOneIdentity(const FSpacetimeDBIdentity& I) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_one_identity"), FInsertOneIdentityArgs(I), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertOneIdentity(const FReducerEventContext& Context, const UInsertOneIdentityReducer* Args) +{ + if (!OnInsertOneIdentity.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertOneIdentity")); + } + return false; + } + + OnInsertOneIdentity.Broadcast(Context, Args->I); + return true; +} + +void URemoteReducers::InsertOneSimpleEnum(const ESimpleEnumType& E) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_one_simple_enum"), FInsertOneSimpleEnumArgs(E), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertOneSimpleEnum(const FReducerEventContext& Context, const UInsertOneSimpleEnumReducer* Args) +{ + if (!OnInsertOneSimpleEnum.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertOneSimpleEnum")); + } + return false; + } + + OnInsertOneSimpleEnum.Broadcast(Context, Args->E); + return true; +} + +void URemoteReducers::InsertOneString(const FString& S) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_one_string"), FInsertOneStringArgs(S), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertOneString(const FReducerEventContext& Context, const UInsertOneStringReducer* Args) +{ + if (!OnInsertOneString.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertOneString")); + } + return false; + } + + OnInsertOneString.Broadcast(Context, Args->S); + return true; +} + +void URemoteReducers::InsertOneTimestamp(const FSpacetimeDBTimestamp& T) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_one_timestamp"), FInsertOneTimestampArgs(T), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertOneTimestamp(const FReducerEventContext& Context, const UInsertOneTimestampReducer* Args) +{ + if (!OnInsertOneTimestamp.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertOneTimestamp")); + } + return false; + } + + OnInsertOneTimestamp.Broadcast(Context, Args->T); + return true; +} + +void URemoteReducers::InsertOneU128(const FSpacetimeDBUInt128& N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_one_u128"), FInsertOneU128Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertOneU128(const FReducerEventContext& Context, const UInsertOneU128Reducer* Args) +{ + if (!OnInsertOneU128.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertOneU128")); + } + return false; + } + + OnInsertOneU128.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::InsertOneU16(const uint16 N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_one_u16"), FInsertOneU16Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertOneU16(const FReducerEventContext& Context, const UInsertOneU16Reducer* Args) +{ + if (!OnInsertOneU16.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertOneU16")); + } + return false; + } + + OnInsertOneU16.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::InsertOneU256(const FSpacetimeDBUInt256& N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_one_u256"), FInsertOneU256Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertOneU256(const FReducerEventContext& Context, const UInsertOneU256Reducer* Args) +{ + if (!OnInsertOneU256.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertOneU256")); + } + return false; + } + + OnInsertOneU256.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::InsertOneU32(const uint32 N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_one_u32"), FInsertOneU32Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertOneU32(const FReducerEventContext& Context, const UInsertOneU32Reducer* Args) +{ + if (!OnInsertOneU32.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertOneU32")); + } + return false; + } + + OnInsertOneU32.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::InsertOneU64(const uint64 N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_one_u64"), FInsertOneU64Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertOneU64(const FReducerEventContext& Context, const UInsertOneU64Reducer* Args) +{ + if (!OnInsertOneU64.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertOneU64")); + } + return false; + } + + OnInsertOneU64.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::InsertOneU8(const uint8 N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_one_u8"), FInsertOneU8Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertOneU8(const FReducerEventContext& Context, const UInsertOneU8Reducer* Args) +{ + if (!OnInsertOneU8.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertOneU8")); + } + return false; + } + + OnInsertOneU8.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::InsertOneUnitStruct(const FUnitStructType& S) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_one_unit_struct"), FInsertOneUnitStructArgs(S), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertOneUnitStruct(const FReducerEventContext& Context, const UInsertOneUnitStructReducer* Args) +{ + if (!OnInsertOneUnitStruct.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertOneUnitStruct")); + } + return false; + } + + OnInsertOneUnitStruct.Broadcast(Context, Args->S); + return true; +} + +void URemoteReducers::InsertOptionEveryPrimitiveStruct(const FTestClientOptionalEveryPrimitiveStruct& S) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_option_every_primitive_struct"), FInsertOptionEveryPrimitiveStructArgs(S), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertOptionEveryPrimitiveStruct(const FReducerEventContext& Context, const UInsertOptionEveryPrimitiveStructReducer* Args) +{ + if (!OnInsertOptionEveryPrimitiveStruct.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertOptionEveryPrimitiveStruct")); + } + return false; + } + + OnInsertOptionEveryPrimitiveStruct.Broadcast(Context, Args->S); + return true; +} + +void URemoteReducers::InsertOptionI32(const FTestClientOptionalInt32 N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_option_i32"), FInsertOptionI32Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertOptionI32(const FReducerEventContext& Context, const UInsertOptionI32Reducer* Args) +{ + if (!OnInsertOptionI32.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertOptionI32")); + } + return false; + } + + OnInsertOptionI32.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::InsertOptionIdentity(const FTestClientOptionalIdentity& I) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_option_identity"), FInsertOptionIdentityArgs(I), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertOptionIdentity(const FReducerEventContext& Context, const UInsertOptionIdentityReducer* Args) +{ + if (!OnInsertOptionIdentity.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertOptionIdentity")); + } + return false; + } + + OnInsertOptionIdentity.Broadcast(Context, Args->I); + return true; +} + +void URemoteReducers::InsertOptionSimpleEnum(const FTestClientOptionalSimpleEnum& E) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_option_simple_enum"), FInsertOptionSimpleEnumArgs(E), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertOptionSimpleEnum(const FReducerEventContext& Context, const UInsertOptionSimpleEnumReducer* Args) +{ + if (!OnInsertOptionSimpleEnum.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertOptionSimpleEnum")); + } + return false; + } + + OnInsertOptionSimpleEnum.Broadcast(Context, Args->E); + return true; +} + +void URemoteReducers::InsertOptionString(const FTestClientOptionalString& S) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_option_string"), FInsertOptionStringArgs(S), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertOptionString(const FReducerEventContext& Context, const UInsertOptionStringReducer* Args) +{ + if (!OnInsertOptionString.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertOptionString")); + } + return false; + } + + OnInsertOptionString.Broadcast(Context, Args->S); + return true; +} + +void URemoteReducers::InsertOptionVecOptionI32(const FTestClientOptionalVecInt32& V) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_option_vec_option_i32"), FInsertOptionVecOptionI32Args(V), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertOptionVecOptionI32(const FReducerEventContext& Context, const UInsertOptionVecOptionI32Reducer* Args) +{ + if (!OnInsertOptionVecOptionI32.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertOptionVecOptionI32")); + } + return false; + } + + OnInsertOptionVecOptionI32.Broadcast(Context, Args->V); + return true; +} + +void URemoteReducers::InsertPkBool(const bool B, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_pk_bool"), FInsertPkBoolArgs(B, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertPkBool(const FReducerEventContext& Context, const UInsertPkBoolReducer* Args) +{ + if (!OnInsertPkBool.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertPkBool")); + } + return false; + } + + OnInsertPkBool.Broadcast(Context, Args->B, Args->Data); + return true; +} + +void URemoteReducers::InsertPkConnectionId(const FSpacetimeDBConnectionId& A, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_pk_connection_id"), FInsertPkConnectionIdArgs(A, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertPkConnectionId(const FReducerEventContext& Context, const UInsertPkConnectionIdReducer* Args) +{ + if (!OnInsertPkConnectionId.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertPkConnectionId")); + } + return false; + } + + OnInsertPkConnectionId.Broadcast(Context, Args->A, Args->Data); + return true; +} + +void URemoteReducers::InsertPkI128(const FSpacetimeDBInt128& N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_pk_i128"), FInsertPkI128Args(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertPkI128(const FReducerEventContext& Context, const UInsertPkI128Reducer* Args) +{ + if (!OnInsertPkI128.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertPkI128")); + } + return false; + } + + OnInsertPkI128.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::InsertPkI16(const int16 N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_pk_i16"), FInsertPkI16Args(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertPkI16(const FReducerEventContext& Context, const UInsertPkI16Reducer* Args) +{ + if (!OnInsertPkI16.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertPkI16")); + } + return false; + } + + OnInsertPkI16.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::InsertPkI256(const FSpacetimeDBInt256& N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_pk_i256"), FInsertPkI256Args(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertPkI256(const FReducerEventContext& Context, const UInsertPkI256Reducer* Args) +{ + if (!OnInsertPkI256.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertPkI256")); + } + return false; + } + + OnInsertPkI256.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::InsertPkI32(const int32 N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_pk_i32"), FInsertPkI32Args(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertPkI32(const FReducerEventContext& Context, const UInsertPkI32Reducer* Args) +{ + if (!OnInsertPkI32.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertPkI32")); + } + return false; + } + + OnInsertPkI32.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::InsertPkI64(const int64 N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_pk_i64"), FInsertPkI64Args(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertPkI64(const FReducerEventContext& Context, const UInsertPkI64Reducer* Args) +{ + if (!OnInsertPkI64.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertPkI64")); + } + return false; + } + + OnInsertPkI64.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::InsertPkI8(const int8 N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_pk_i8"), FInsertPkI8Args(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertPkI8(const FReducerEventContext& Context, const UInsertPkI8Reducer* Args) +{ + if (!OnInsertPkI8.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertPkI8")); + } + return false; + } + + OnInsertPkI8.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::InsertPkIdentity(const FSpacetimeDBIdentity& I, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_pk_identity"), FInsertPkIdentityArgs(I, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertPkIdentity(const FReducerEventContext& Context, const UInsertPkIdentityReducer* Args) +{ + if (!OnInsertPkIdentity.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertPkIdentity")); + } + return false; + } + + OnInsertPkIdentity.Broadcast(Context, Args->I, Args->Data); + return true; +} + +void URemoteReducers::InsertPkSimpleEnum(const ESimpleEnumType& A, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_pk_simple_enum"), FInsertPkSimpleEnumArgs(A, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertPkSimpleEnum(const FReducerEventContext& Context, const UInsertPkSimpleEnumReducer* Args) +{ + if (!OnInsertPkSimpleEnum.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertPkSimpleEnum")); + } + return false; + } + + OnInsertPkSimpleEnum.Broadcast(Context, Args->A, Args->Data); + return true; +} + +void URemoteReducers::InsertPkString(const FString& S, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_pk_string"), FInsertPkStringArgs(S, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertPkString(const FReducerEventContext& Context, const UInsertPkStringReducer* Args) +{ + if (!OnInsertPkString.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertPkString")); + } + return false; + } + + OnInsertPkString.Broadcast(Context, Args->S, Args->Data); + return true; +} + +void URemoteReducers::InsertPkU128(const FSpacetimeDBUInt128& N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_pk_u128"), FInsertPkU128Args(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertPkU128(const FReducerEventContext& Context, const UInsertPkU128Reducer* Args) +{ + if (!OnInsertPkU128.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertPkU128")); + } + return false; + } + + OnInsertPkU128.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::InsertPkU16(const uint16 N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_pk_u16"), FInsertPkU16Args(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertPkU16(const FReducerEventContext& Context, const UInsertPkU16Reducer* Args) +{ + if (!OnInsertPkU16.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertPkU16")); + } + return false; + } + + OnInsertPkU16.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::InsertPkU256(const FSpacetimeDBUInt256& N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_pk_u256"), FInsertPkU256Args(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertPkU256(const FReducerEventContext& Context, const UInsertPkU256Reducer* Args) +{ + if (!OnInsertPkU256.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertPkU256")); + } + return false; + } + + OnInsertPkU256.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::InsertPkU32(const uint32 N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_pk_u32"), FInsertPkU32Args(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertPkU32(const FReducerEventContext& Context, const UInsertPkU32Reducer* Args) +{ + if (!OnInsertPkU32.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertPkU32")); + } + return false; + } + + OnInsertPkU32.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::InsertPkU32Two(const uint32 N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_pk_u32_two"), FInsertPkU32TwoArgs(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertPkU32Two(const FReducerEventContext& Context, const UInsertPkU32TwoReducer* Args) +{ + if (!OnInsertPkU32Two.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertPkU32Two")); + } + return false; + } + + OnInsertPkU32Two.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::InsertPkU64(const uint64 N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_pk_u64"), FInsertPkU64Args(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertPkU64(const FReducerEventContext& Context, const UInsertPkU64Reducer* Args) +{ + if (!OnInsertPkU64.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertPkU64")); + } + return false; + } + + OnInsertPkU64.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::InsertPkU8(const uint8 N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_pk_u8"), FInsertPkU8Args(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertPkU8(const FReducerEventContext& Context, const UInsertPkU8Reducer* Args) +{ + if (!OnInsertPkU8.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertPkU8")); + } + return false; + } + + OnInsertPkU8.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::InsertPrimitivesAsStrings(const FEveryPrimitiveStructType& S) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_primitives_as_strings"), FInsertPrimitivesAsStringsArgs(S), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertPrimitivesAsStrings(const FReducerEventContext& Context, const UInsertPrimitivesAsStringsReducer* Args) +{ + if (!OnInsertPrimitivesAsStrings.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertPrimitivesAsStrings")); + } + return false; + } + + OnInsertPrimitivesAsStrings.Broadcast(Context, Args->S); + return true; +} + +void URemoteReducers::InsertTableHoldsTable(const FOneU8Type& A, const FVecU8Type& B) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_table_holds_table"), FInsertTableHoldsTableArgs(A, B), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertTableHoldsTable(const FReducerEventContext& Context, const UInsertTableHoldsTableReducer* Args) +{ + if (!OnInsertTableHoldsTable.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertTableHoldsTable")); + } + return false; + } + + OnInsertTableHoldsTable.Broadcast(Context, Args->A, Args->B); + return true; +} + +void URemoteReducers::InsertUniqueBool(const bool B, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_unique_bool"), FInsertUniqueBoolArgs(B, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertUniqueBool(const FReducerEventContext& Context, const UInsertUniqueBoolReducer* Args) +{ + if (!OnInsertUniqueBool.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertUniqueBool")); + } + return false; + } + + OnInsertUniqueBool.Broadcast(Context, Args->B, Args->Data); + return true; +} + +void URemoteReducers::InsertUniqueConnectionId(const FSpacetimeDBConnectionId& A, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_unique_connection_id"), FInsertUniqueConnectionIdArgs(A, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertUniqueConnectionId(const FReducerEventContext& Context, const UInsertUniqueConnectionIdReducer* Args) +{ + if (!OnInsertUniqueConnectionId.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertUniqueConnectionId")); + } + return false; + } + + OnInsertUniqueConnectionId.Broadcast(Context, Args->A, Args->Data); + return true; +} + +void URemoteReducers::InsertUniqueI128(const FSpacetimeDBInt128& N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_unique_i128"), FInsertUniqueI128Args(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertUniqueI128(const FReducerEventContext& Context, const UInsertUniqueI128Reducer* Args) +{ + if (!OnInsertUniqueI128.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertUniqueI128")); + } + return false; + } + + OnInsertUniqueI128.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::InsertUniqueI16(const int16 N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_unique_i16"), FInsertUniqueI16Args(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertUniqueI16(const FReducerEventContext& Context, const UInsertUniqueI16Reducer* Args) +{ + if (!OnInsertUniqueI16.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertUniqueI16")); + } + return false; + } + + OnInsertUniqueI16.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::InsertUniqueI256(const FSpacetimeDBInt256& N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_unique_i256"), FInsertUniqueI256Args(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertUniqueI256(const FReducerEventContext& Context, const UInsertUniqueI256Reducer* Args) +{ + if (!OnInsertUniqueI256.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertUniqueI256")); + } + return false; + } + + OnInsertUniqueI256.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::InsertUniqueI32(const int32 N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_unique_i32"), FInsertUniqueI32Args(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertUniqueI32(const FReducerEventContext& Context, const UInsertUniqueI32Reducer* Args) +{ + if (!OnInsertUniqueI32.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertUniqueI32")); + } + return false; + } + + OnInsertUniqueI32.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::InsertUniqueI64(const int64 N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_unique_i64"), FInsertUniqueI64Args(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertUniqueI64(const FReducerEventContext& Context, const UInsertUniqueI64Reducer* Args) +{ + if (!OnInsertUniqueI64.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertUniqueI64")); + } + return false; + } + + OnInsertUniqueI64.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::InsertUniqueI8(const int8 N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_unique_i8"), FInsertUniqueI8Args(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertUniqueI8(const FReducerEventContext& Context, const UInsertUniqueI8Reducer* Args) +{ + if (!OnInsertUniqueI8.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertUniqueI8")); + } + return false; + } + + OnInsertUniqueI8.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::InsertUniqueIdentity(const FSpacetimeDBIdentity& I, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_unique_identity"), FInsertUniqueIdentityArgs(I, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertUniqueIdentity(const FReducerEventContext& Context, const UInsertUniqueIdentityReducer* Args) +{ + if (!OnInsertUniqueIdentity.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertUniqueIdentity")); + } + return false; + } + + OnInsertUniqueIdentity.Broadcast(Context, Args->I, Args->Data); + return true; +} + +void URemoteReducers::InsertUniqueString(const FString& S, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_unique_string"), FInsertUniqueStringArgs(S, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertUniqueString(const FReducerEventContext& Context, const UInsertUniqueStringReducer* Args) +{ + if (!OnInsertUniqueString.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertUniqueString")); + } + return false; + } + + OnInsertUniqueString.Broadcast(Context, Args->S, Args->Data); + return true; +} + +void URemoteReducers::InsertUniqueU128(const FSpacetimeDBUInt128& N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_unique_u128"), FInsertUniqueU128Args(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertUniqueU128(const FReducerEventContext& Context, const UInsertUniqueU128Reducer* Args) +{ + if (!OnInsertUniqueU128.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertUniqueU128")); + } + return false; + } + + OnInsertUniqueU128.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::InsertUniqueU16(const uint16 N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_unique_u16"), FInsertUniqueU16Args(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertUniqueU16(const FReducerEventContext& Context, const UInsertUniqueU16Reducer* Args) +{ + if (!OnInsertUniqueU16.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertUniqueU16")); + } + return false; + } + + OnInsertUniqueU16.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::InsertUniqueU256(const FSpacetimeDBUInt256& N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_unique_u256"), FInsertUniqueU256Args(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertUniqueU256(const FReducerEventContext& Context, const UInsertUniqueU256Reducer* Args) +{ + if (!OnInsertUniqueU256.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertUniqueU256")); + } + return false; + } + + OnInsertUniqueU256.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::InsertUniqueU32(const uint32 N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_unique_u32"), FInsertUniqueU32Args(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertUniqueU32(const FReducerEventContext& Context, const UInsertUniqueU32Reducer* Args) +{ + if (!OnInsertUniqueU32.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertUniqueU32")); + } + return false; + } + + OnInsertUniqueU32.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::InsertUniqueU32UpdatePkU32(const uint32 N, const int32 DUnique, const int32 DPk) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_unique_u32_update_pk_u32"), FInsertUniqueU32UpdatePkU32Args(N, DUnique, DPk), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertUniqueU32UpdatePkU32(const FReducerEventContext& Context, const UInsertUniqueU32UpdatePkU32Reducer* Args) +{ + if (!OnInsertUniqueU32UpdatePkU32.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertUniqueU32UpdatePkU32")); + } + return false; + } + + OnInsertUniqueU32UpdatePkU32.Broadcast(Context, Args->N, Args->DUnique, Args->DPk); + return true; +} + +void URemoteReducers::InsertUniqueU64(const uint64 N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_unique_u64"), FInsertUniqueU64Args(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertUniqueU64(const FReducerEventContext& Context, const UInsertUniqueU64Reducer* Args) +{ + if (!OnInsertUniqueU64.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertUniqueU64")); + } + return false; + } + + OnInsertUniqueU64.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::InsertUniqueU8(const uint8 N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_unique_u8"), FInsertUniqueU8Args(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertUniqueU8(const FReducerEventContext& Context, const UInsertUniqueU8Reducer* Args) +{ + if (!OnInsertUniqueU8.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertUniqueU8")); + } + return false; + } + + OnInsertUniqueU8.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::InsertUser(const FString& Name, const FSpacetimeDBIdentity& Identity) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_user"), FInsertUserArgs(Name, Identity), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertUser(const FReducerEventContext& Context, const UInsertUserReducer* Args) +{ + if (!OnInsertUser.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertUser")); + } + return false; + } + + OnInsertUser.Broadcast(Context, Args->Name, Args->Identity); + return true; +} + +void URemoteReducers::InsertVecBool(const TArray& B) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_vec_bool"), FInsertVecBoolArgs(B), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertVecBool(const FReducerEventContext& Context, const UInsertVecBoolReducer* Args) +{ + if (!OnInsertVecBool.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertVecBool")); + } + return false; + } + + OnInsertVecBool.Broadcast(Context, Args->B); + return true; +} + +void URemoteReducers::InsertVecByteStruct(const TArray& S) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_vec_byte_struct"), FInsertVecByteStructArgs(S), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertVecByteStruct(const FReducerEventContext& Context, const UInsertVecByteStructReducer* Args) +{ + if (!OnInsertVecByteStruct.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertVecByteStruct")); + } + return false; + } + + OnInsertVecByteStruct.Broadcast(Context, Args->S); + return true; +} + +void URemoteReducers::InsertVecConnectionId(const TArray& A) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_vec_connection_id"), FInsertVecConnectionIdArgs(A), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertVecConnectionId(const FReducerEventContext& Context, const UInsertVecConnectionIdReducer* Args) +{ + if (!OnInsertVecConnectionId.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertVecConnectionId")); + } + return false; + } + + OnInsertVecConnectionId.Broadcast(Context, Args->A); + return true; +} + +void URemoteReducers::InsertVecEnumWithPayload(const TArray& E) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_vec_enum_with_payload"), FInsertVecEnumWithPayloadArgs(E), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertVecEnumWithPayload(const FReducerEventContext& Context, const UInsertVecEnumWithPayloadReducer* Args) +{ + if (!OnInsertVecEnumWithPayload.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertVecEnumWithPayload")); + } + return false; + } + + OnInsertVecEnumWithPayload.Broadcast(Context, Args->E); + return true; +} + +void URemoteReducers::InsertVecEveryPrimitiveStruct(const TArray& S) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_vec_every_primitive_struct"), FInsertVecEveryPrimitiveStructArgs(S), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertVecEveryPrimitiveStruct(const FReducerEventContext& Context, const UInsertVecEveryPrimitiveStructReducer* Args) +{ + if (!OnInsertVecEveryPrimitiveStruct.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertVecEveryPrimitiveStruct")); + } + return false; + } + + OnInsertVecEveryPrimitiveStruct.Broadcast(Context, Args->S); + return true; +} + +void URemoteReducers::InsertVecEveryVecStruct(const TArray& S) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_vec_every_vec_struct"), FInsertVecEveryVecStructArgs(S), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertVecEveryVecStruct(const FReducerEventContext& Context, const UInsertVecEveryVecStructReducer* Args) +{ + if (!OnInsertVecEveryVecStruct.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertVecEveryVecStruct")); + } + return false; + } + + OnInsertVecEveryVecStruct.Broadcast(Context, Args->S); + return true; +} + +void URemoteReducers::InsertVecF32(const TArray& F) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_vec_f32"), FInsertVecF32Args(F), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertVecF32(const FReducerEventContext& Context, const UInsertVecF32Reducer* Args) +{ + if (!OnInsertVecF32.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertVecF32")); + } + return false; + } + + OnInsertVecF32.Broadcast(Context, Args->F); + return true; +} + +void URemoteReducers::InsertVecF64(const TArray& F) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_vec_f64"), FInsertVecF64Args(F), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertVecF64(const FReducerEventContext& Context, const UInsertVecF64Reducer* Args) +{ + if (!OnInsertVecF64.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertVecF64")); + } + return false; + } + + OnInsertVecF64.Broadcast(Context, Args->F); + return true; +} + +void URemoteReducers::InsertVecI128(const TArray& N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_vec_i128"), FInsertVecI128Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertVecI128(const FReducerEventContext& Context, const UInsertVecI128Reducer* Args) +{ + if (!OnInsertVecI128.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertVecI128")); + } + return false; + } + + OnInsertVecI128.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::InsertVecI16(const TArray& N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_vec_i16"), FInsertVecI16Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertVecI16(const FReducerEventContext& Context, const UInsertVecI16Reducer* Args) +{ + if (!OnInsertVecI16.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertVecI16")); + } + return false; + } + + OnInsertVecI16.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::InsertVecI256(const TArray& N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_vec_i256"), FInsertVecI256Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertVecI256(const FReducerEventContext& Context, const UInsertVecI256Reducer* Args) +{ + if (!OnInsertVecI256.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertVecI256")); + } + return false; + } + + OnInsertVecI256.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::InsertVecI32(const TArray& N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_vec_i32"), FInsertVecI32Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertVecI32(const FReducerEventContext& Context, const UInsertVecI32Reducer* Args) +{ + if (!OnInsertVecI32.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertVecI32")); + } + return false; + } + + OnInsertVecI32.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::InsertVecI64(const TArray& N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_vec_i64"), FInsertVecI64Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertVecI64(const FReducerEventContext& Context, const UInsertVecI64Reducer* Args) +{ + if (!OnInsertVecI64.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertVecI64")); + } + return false; + } + + OnInsertVecI64.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::InsertVecI8(const TArray& N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_vec_i8"), FInsertVecI8Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertVecI8(const FReducerEventContext& Context, const UInsertVecI8Reducer* Args) +{ + if (!OnInsertVecI8.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertVecI8")); + } + return false; + } + + OnInsertVecI8.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::InsertVecIdentity(const TArray& I) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_vec_identity"), FInsertVecIdentityArgs(I), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertVecIdentity(const FReducerEventContext& Context, const UInsertVecIdentityReducer* Args) +{ + if (!OnInsertVecIdentity.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertVecIdentity")); + } + return false; + } + + OnInsertVecIdentity.Broadcast(Context, Args->I); + return true; +} + +void URemoteReducers::InsertVecSimpleEnum(const TArray& E) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_vec_simple_enum"), FInsertVecSimpleEnumArgs(E), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertVecSimpleEnum(const FReducerEventContext& Context, const UInsertVecSimpleEnumReducer* Args) +{ + if (!OnInsertVecSimpleEnum.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertVecSimpleEnum")); + } + return false; + } + + OnInsertVecSimpleEnum.Broadcast(Context, Args->E); + return true; +} + +void URemoteReducers::InsertVecString(const TArray& S) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_vec_string"), FInsertVecStringArgs(S), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertVecString(const FReducerEventContext& Context, const UInsertVecStringReducer* Args) +{ + if (!OnInsertVecString.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertVecString")); + } + return false; + } + + OnInsertVecString.Broadcast(Context, Args->S); + return true; +} + +void URemoteReducers::InsertVecTimestamp(const TArray& T) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_vec_timestamp"), FInsertVecTimestampArgs(T), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertVecTimestamp(const FReducerEventContext& Context, const UInsertVecTimestampReducer* Args) +{ + if (!OnInsertVecTimestamp.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertVecTimestamp")); + } + return false; + } + + OnInsertVecTimestamp.Broadcast(Context, Args->T); + return true; +} + +void URemoteReducers::InsertVecU128(const TArray& N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_vec_u128"), FInsertVecU128Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertVecU128(const FReducerEventContext& Context, const UInsertVecU128Reducer* Args) +{ + if (!OnInsertVecU128.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertVecU128")); + } + return false; + } + + OnInsertVecU128.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::InsertVecU16(const TArray& N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_vec_u16"), FInsertVecU16Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertVecU16(const FReducerEventContext& Context, const UInsertVecU16Reducer* Args) +{ + if (!OnInsertVecU16.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertVecU16")); + } + return false; + } + + OnInsertVecU16.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::InsertVecU256(const TArray& N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_vec_u256"), FInsertVecU256Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertVecU256(const FReducerEventContext& Context, const UInsertVecU256Reducer* Args) +{ + if (!OnInsertVecU256.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertVecU256")); + } + return false; + } + + OnInsertVecU256.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::InsertVecU32(const TArray& N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_vec_u32"), FInsertVecU32Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertVecU32(const FReducerEventContext& Context, const UInsertVecU32Reducer* Args) +{ + if (!OnInsertVecU32.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertVecU32")); + } + return false; + } + + OnInsertVecU32.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::InsertVecU64(const TArray& N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_vec_u64"), FInsertVecU64Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertVecU64(const FReducerEventContext& Context, const UInsertVecU64Reducer* Args) +{ + if (!OnInsertVecU64.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertVecU64")); + } + return false; + } + + OnInsertVecU64.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::InsertVecU8(const TArray& N) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_vec_u8"), FInsertVecU8Args(N), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertVecU8(const FReducerEventContext& Context, const UInsertVecU8Reducer* Args) +{ + if (!OnInsertVecU8.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertVecU8")); + } + return false; + } + + OnInsertVecU8.Broadcast(Context, Args->N); + return true; +} + +void URemoteReducers::InsertVecUnitStruct(const TArray& S) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("insert_vec_unit_struct"), FInsertVecUnitStructArgs(S), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeInsertVecUnitStruct(const FReducerEventContext& Context, const UInsertVecUnitStructReducer* Args) +{ + if (!OnInsertVecUnitStruct.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for InsertVecUnitStruct")); + } + return false; + } + + OnInsertVecUnitStruct.Broadcast(Context, Args->S); + return true; +} + +void URemoteReducers::NoOpSucceeds() +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("no_op_succeeds"), FNoOpSucceedsArgs(), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeNoOpSucceeds(const FReducerEventContext& Context, const UNoOpSucceedsReducer* Args) +{ + if (!OnNoOpSucceeds.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for NoOpSucceeds")); + } + return false; + } + + OnNoOpSucceeds.Broadcast(Context); + return true; +} + +void URemoteReducers::SendScheduledMessage(const FScheduledTableType& Arg) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("send_scheduled_message"), FSendScheduledMessageArgs(Arg), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeSendScheduledMessage(const FReducerEventContext& Context, const USendScheduledMessageReducer* Args) +{ + if (!OnSendScheduledMessage.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for SendScheduledMessage")); + } + return false; + } + + OnSendScheduledMessage.Broadcast(Context, Args->Arg); + return true; +} + +void URemoteReducers::UpdateIndexedSimpleEnum(const ESimpleEnumType& A, const ESimpleEnumType& B) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("update_indexed_simple_enum"), FUpdateIndexedSimpleEnumArgs(A, B), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeUpdateIndexedSimpleEnum(const FReducerEventContext& Context, const UUpdateIndexedSimpleEnumReducer* Args) +{ + if (!OnUpdateIndexedSimpleEnum.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for UpdateIndexedSimpleEnum")); + } + return false; + } + + OnUpdateIndexedSimpleEnum.Broadcast(Context, Args->A, Args->B); + return true; +} + +void URemoteReducers::UpdatePkBool(const bool B, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("update_pk_bool"), FUpdatePkBoolArgs(B, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeUpdatePkBool(const FReducerEventContext& Context, const UUpdatePkBoolReducer* Args) +{ + if (!OnUpdatePkBool.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for UpdatePkBool")); + } + return false; + } + + OnUpdatePkBool.Broadcast(Context, Args->B, Args->Data); + return true; +} + +void URemoteReducers::UpdatePkConnectionId(const FSpacetimeDBConnectionId& A, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("update_pk_connection_id"), FUpdatePkConnectionIdArgs(A, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeUpdatePkConnectionId(const FReducerEventContext& Context, const UUpdatePkConnectionIdReducer* Args) +{ + if (!OnUpdatePkConnectionId.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for UpdatePkConnectionId")); + } + return false; + } + + OnUpdatePkConnectionId.Broadcast(Context, Args->A, Args->Data); + return true; +} + +void URemoteReducers::UpdatePkI128(const FSpacetimeDBInt128& N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("update_pk_i128"), FUpdatePkI128Args(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeUpdatePkI128(const FReducerEventContext& Context, const UUpdatePkI128Reducer* Args) +{ + if (!OnUpdatePkI128.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for UpdatePkI128")); + } + return false; + } + + OnUpdatePkI128.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::UpdatePkI16(const int16 N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("update_pk_i16"), FUpdatePkI16Args(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeUpdatePkI16(const FReducerEventContext& Context, const UUpdatePkI16Reducer* Args) +{ + if (!OnUpdatePkI16.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for UpdatePkI16")); + } + return false; + } + + OnUpdatePkI16.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::UpdatePkI256(const FSpacetimeDBInt256& N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("update_pk_i256"), FUpdatePkI256Args(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeUpdatePkI256(const FReducerEventContext& Context, const UUpdatePkI256Reducer* Args) +{ + if (!OnUpdatePkI256.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for UpdatePkI256")); + } + return false; + } + + OnUpdatePkI256.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::UpdatePkI32(const int32 N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("update_pk_i32"), FUpdatePkI32Args(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeUpdatePkI32(const FReducerEventContext& Context, const UUpdatePkI32Reducer* Args) +{ + if (!OnUpdatePkI32.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for UpdatePkI32")); + } + return false; + } + + OnUpdatePkI32.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::UpdatePkI64(const int64 N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("update_pk_i64"), FUpdatePkI64Args(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeUpdatePkI64(const FReducerEventContext& Context, const UUpdatePkI64Reducer* Args) +{ + if (!OnUpdatePkI64.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for UpdatePkI64")); + } + return false; + } + + OnUpdatePkI64.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::UpdatePkI8(const int8 N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("update_pk_i8"), FUpdatePkI8Args(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeUpdatePkI8(const FReducerEventContext& Context, const UUpdatePkI8Reducer* Args) +{ + if (!OnUpdatePkI8.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for UpdatePkI8")); + } + return false; + } + + OnUpdatePkI8.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::UpdatePkIdentity(const FSpacetimeDBIdentity& I, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("update_pk_identity"), FUpdatePkIdentityArgs(I, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeUpdatePkIdentity(const FReducerEventContext& Context, const UUpdatePkIdentityReducer* Args) +{ + if (!OnUpdatePkIdentity.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for UpdatePkIdentity")); + } + return false; + } + + OnUpdatePkIdentity.Broadcast(Context, Args->I, Args->Data); + return true; +} + +void URemoteReducers::UpdatePkSimpleEnum(const ESimpleEnumType& A, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("update_pk_simple_enum"), FUpdatePkSimpleEnumArgs(A, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeUpdatePkSimpleEnum(const FReducerEventContext& Context, const UUpdatePkSimpleEnumReducer* Args) +{ + if (!OnUpdatePkSimpleEnum.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for UpdatePkSimpleEnum")); + } + return false; + } + + OnUpdatePkSimpleEnum.Broadcast(Context, Args->A, Args->Data); + return true; +} + +void URemoteReducers::UpdatePkString(const FString& S, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("update_pk_string"), FUpdatePkStringArgs(S, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeUpdatePkString(const FReducerEventContext& Context, const UUpdatePkStringReducer* Args) +{ + if (!OnUpdatePkString.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for UpdatePkString")); + } + return false; + } + + OnUpdatePkString.Broadcast(Context, Args->S, Args->Data); + return true; +} + +void URemoteReducers::UpdatePkU128(const FSpacetimeDBUInt128& N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("update_pk_u128"), FUpdatePkU128Args(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeUpdatePkU128(const FReducerEventContext& Context, const UUpdatePkU128Reducer* Args) +{ + if (!OnUpdatePkU128.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for UpdatePkU128")); + } + return false; + } + + OnUpdatePkU128.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::UpdatePkU16(const uint16 N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("update_pk_u16"), FUpdatePkU16Args(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeUpdatePkU16(const FReducerEventContext& Context, const UUpdatePkU16Reducer* Args) +{ + if (!OnUpdatePkU16.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for UpdatePkU16")); + } + return false; + } + + OnUpdatePkU16.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::UpdatePkU256(const FSpacetimeDBUInt256& N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("update_pk_u256"), FUpdatePkU256Args(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeUpdatePkU256(const FReducerEventContext& Context, const UUpdatePkU256Reducer* Args) +{ + if (!OnUpdatePkU256.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for UpdatePkU256")); + } + return false; + } + + OnUpdatePkU256.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::UpdatePkU32(const uint32 N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("update_pk_u32"), FUpdatePkU32Args(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeUpdatePkU32(const FReducerEventContext& Context, const UUpdatePkU32Reducer* Args) +{ + if (!OnUpdatePkU32.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for UpdatePkU32")); + } + return false; + } + + OnUpdatePkU32.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::UpdatePkU32Two(const uint32 N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("update_pk_u32_two"), FUpdatePkU32TwoArgs(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeUpdatePkU32Two(const FReducerEventContext& Context, const UUpdatePkU32TwoReducer* Args) +{ + if (!OnUpdatePkU32Two.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for UpdatePkU32Two")); + } + return false; + } + + OnUpdatePkU32Two.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::UpdatePkU64(const uint64 N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("update_pk_u64"), FUpdatePkU64Args(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeUpdatePkU64(const FReducerEventContext& Context, const UUpdatePkU64Reducer* Args) +{ + if (!OnUpdatePkU64.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for UpdatePkU64")); + } + return false; + } + + OnUpdatePkU64.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::UpdatePkU8(const uint8 N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("update_pk_u8"), FUpdatePkU8Args(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeUpdatePkU8(const FReducerEventContext& Context, const UUpdatePkU8Reducer* Args) +{ + if (!OnUpdatePkU8.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for UpdatePkU8")); + } + return false; + } + + OnUpdatePkU8.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::UpdateUniqueBool(const bool B, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("update_unique_bool"), FUpdateUniqueBoolArgs(B, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeUpdateUniqueBool(const FReducerEventContext& Context, const UUpdateUniqueBoolReducer* Args) +{ + if (!OnUpdateUniqueBool.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for UpdateUniqueBool")); + } + return false; + } + + OnUpdateUniqueBool.Broadcast(Context, Args->B, Args->Data); + return true; +} + +void URemoteReducers::UpdateUniqueConnectionId(const FSpacetimeDBConnectionId& A, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("update_unique_connection_id"), FUpdateUniqueConnectionIdArgs(A, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeUpdateUniqueConnectionId(const FReducerEventContext& Context, const UUpdateUniqueConnectionIdReducer* Args) +{ + if (!OnUpdateUniqueConnectionId.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for UpdateUniqueConnectionId")); + } + return false; + } + + OnUpdateUniqueConnectionId.Broadcast(Context, Args->A, Args->Data); + return true; +} + +void URemoteReducers::UpdateUniqueI128(const FSpacetimeDBInt128& N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("update_unique_i128"), FUpdateUniqueI128Args(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeUpdateUniqueI128(const FReducerEventContext& Context, const UUpdateUniqueI128Reducer* Args) +{ + if (!OnUpdateUniqueI128.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for UpdateUniqueI128")); + } + return false; + } + + OnUpdateUniqueI128.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::UpdateUniqueI16(const int16 N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("update_unique_i16"), FUpdateUniqueI16Args(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeUpdateUniqueI16(const FReducerEventContext& Context, const UUpdateUniqueI16Reducer* Args) +{ + if (!OnUpdateUniqueI16.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for UpdateUniqueI16")); + } + return false; + } + + OnUpdateUniqueI16.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::UpdateUniqueI256(const FSpacetimeDBInt256& N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("update_unique_i256"), FUpdateUniqueI256Args(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeUpdateUniqueI256(const FReducerEventContext& Context, const UUpdateUniqueI256Reducer* Args) +{ + if (!OnUpdateUniqueI256.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for UpdateUniqueI256")); + } + return false; + } + + OnUpdateUniqueI256.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::UpdateUniqueI32(const int32 N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("update_unique_i32"), FUpdateUniqueI32Args(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeUpdateUniqueI32(const FReducerEventContext& Context, const UUpdateUniqueI32Reducer* Args) +{ + if (!OnUpdateUniqueI32.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for UpdateUniqueI32")); + } + return false; + } + + OnUpdateUniqueI32.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::UpdateUniqueI64(const int64 N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("update_unique_i64"), FUpdateUniqueI64Args(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeUpdateUniqueI64(const FReducerEventContext& Context, const UUpdateUniqueI64Reducer* Args) +{ + if (!OnUpdateUniqueI64.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for UpdateUniqueI64")); + } + return false; + } + + OnUpdateUniqueI64.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::UpdateUniqueI8(const int8 N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("update_unique_i8"), FUpdateUniqueI8Args(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeUpdateUniqueI8(const FReducerEventContext& Context, const UUpdateUniqueI8Reducer* Args) +{ + if (!OnUpdateUniqueI8.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for UpdateUniqueI8")); + } + return false; + } + + OnUpdateUniqueI8.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::UpdateUniqueIdentity(const FSpacetimeDBIdentity& I, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("update_unique_identity"), FUpdateUniqueIdentityArgs(I, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeUpdateUniqueIdentity(const FReducerEventContext& Context, const UUpdateUniqueIdentityReducer* Args) +{ + if (!OnUpdateUniqueIdentity.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for UpdateUniqueIdentity")); + } + return false; + } + + OnUpdateUniqueIdentity.Broadcast(Context, Args->I, Args->Data); + return true; +} + +void URemoteReducers::UpdateUniqueString(const FString& S, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("update_unique_string"), FUpdateUniqueStringArgs(S, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeUpdateUniqueString(const FReducerEventContext& Context, const UUpdateUniqueStringReducer* Args) +{ + if (!OnUpdateUniqueString.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for UpdateUniqueString")); + } + return false; + } + + OnUpdateUniqueString.Broadcast(Context, Args->S, Args->Data); + return true; +} + +void URemoteReducers::UpdateUniqueU128(const FSpacetimeDBUInt128& N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("update_unique_u128"), FUpdateUniqueU128Args(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeUpdateUniqueU128(const FReducerEventContext& Context, const UUpdateUniqueU128Reducer* Args) +{ + if (!OnUpdateUniqueU128.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for UpdateUniqueU128")); + } + return false; + } + + OnUpdateUniqueU128.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::UpdateUniqueU16(const uint16 N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("update_unique_u16"), FUpdateUniqueU16Args(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeUpdateUniqueU16(const FReducerEventContext& Context, const UUpdateUniqueU16Reducer* Args) +{ + if (!OnUpdateUniqueU16.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for UpdateUniqueU16")); + } + return false; + } + + OnUpdateUniqueU16.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::UpdateUniqueU256(const FSpacetimeDBUInt256& N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("update_unique_u256"), FUpdateUniqueU256Args(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeUpdateUniqueU256(const FReducerEventContext& Context, const UUpdateUniqueU256Reducer* Args) +{ + if (!OnUpdateUniqueU256.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for UpdateUniqueU256")); + } + return false; + } + + OnUpdateUniqueU256.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::UpdateUniqueU32(const uint32 N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("update_unique_u32"), FUpdateUniqueU32Args(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeUpdateUniqueU32(const FReducerEventContext& Context, const UUpdateUniqueU32Reducer* Args) +{ + if (!OnUpdateUniqueU32.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for UpdateUniqueU32")); + } + return false; + } + + OnUpdateUniqueU32.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::UpdateUniqueU64(const uint64 N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("update_unique_u64"), FUpdateUniqueU64Args(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeUpdateUniqueU64(const FReducerEventContext& Context, const UUpdateUniqueU64Reducer* Args) +{ + if (!OnUpdateUniqueU64.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for UpdateUniqueU64")); + } + return false; + } + + OnUpdateUniqueU64.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void URemoteReducers::UpdateUniqueU8(const uint8 N, const int32 Data) +{ + if (!Conn) + { + UE_LOG(LogTemp, Error, TEXT("SpacetimeDB connection is null")); + return; + } + + Conn->CallReducerTyped(TEXT("update_unique_u8"), FUpdateUniqueU8Args(N, Data), SetCallReducerFlags); +} + +bool URemoteReducers::InvokeUpdateUniqueU8(const FReducerEventContext& Context, const UUpdateUniqueU8Reducer* Args) +{ + if (!OnUpdateUniqueU8.IsBound()) + { + // Handle unhandled reducer error + if (InternalOnUnhandledReducerError.IsBound()) + { + // TODO: Check Context.Event.Status for Failed/OutOfEnergy cases + // For now, just broadcast any error + InternalOnUnhandledReducerError.Broadcast(Context, TEXT("No handler registered for UpdateUniqueU8")); + } + return false; + } + + OnUpdateUniqueU8.Broadcast(Context, Args->N, Args->Data); + return true; +} + +void UDbConnection::PostInitProperties() +{ + Super::PostInitProperties(); + + // Connect OnUnhandledReducerError to Reducers.InternalOnUnhandledReducerError + if (Reducers) + { + Reducers->InternalOnUnhandledReducerError.AddDynamic(this, &UDbConnection::OnUnhandledReducerErrorHandler); + } +} + +UFUNCTION() +void UDbConnection::OnUnhandledReducerErrorHandler(const FReducerEventContext& Context, const FString& Error) +{ + if (OnUnhandledReducerError.IsBound()) + { + OnUnhandledReducerError.Broadcast(Context, Error); + } +} + +void UDbConnection::ReducerEvent(const FReducerEvent& Event) +{ + if (!Reducers) { return; } + + FReducer DecodedReducer = DecodeReducer(Event); + + FTestClientReducerEvent ReducerEvent; + ReducerEvent.CallerConnectionId = Event.CallerConnectionId; + ReducerEvent.CallerIdentity = Event.CallerIdentity; + ReducerEvent.EnergyConsumed = Event.EnergyConsumed; + ReducerEvent.Status = Event.Status; + ReducerEvent.Timestamp = Event.Timestamp; + ReducerEvent.Reducer = DecodedReducer; + + FReducerEventContext Context(this, ReducerEvent); + + // Use hardcoded string matching for reducer dispatching + const FString& ReducerName = Event.ReducerCall.ReducerName; + + if (ReducerName == TEXT("delete_from_btree_u32")) + { + FDeleteFromBtreeU32Args Args = ReducerEvent.Reducer.GetAsDeleteFromBtreeU32(); + UDeleteFromBtreeU32Reducer* Reducer = NewObject(); + Reducer->Rows = Args.Rows; + Reducers->InvokeDeleteFromBtreeU32(Context, Reducer); + return; + } + if (ReducerName == TEXT("delete_large_table")) + { + FDeleteLargeTableArgs Args = ReducerEvent.Reducer.GetAsDeleteLargeTable(); + UDeleteLargeTableReducer* Reducer = NewObject(); + Reducer->A = Args.A; + Reducer->B = Args.B; + Reducer->C = Args.C; + Reducer->D = Args.D; + Reducer->E = Args.E; + Reducer->F = Args.F; + Reducer->G = Args.G; + Reducer->H = Args.H; + Reducer->I = Args.I; + Reducer->J = Args.J; + Reducer->K = Args.K; + Reducer->L = Args.L; + Reducer->M = Args.M; + Reducer->N = Args.N; + Reducer->O = Args.O; + Reducer->P = Args.P; + Reducer->Q = Args.Q; + Reducer->R = Args.R; + Reducer->S = Args.S; + Reducer->T = Args.T; + Reducer->U = Args.U; + Reducer->V = Args.V; + Reducers->InvokeDeleteLargeTable(Context, Reducer); + return; + } + if (ReducerName == TEXT("delete_pk_bool")) + { + FDeletePkBoolArgs Args = ReducerEvent.Reducer.GetAsDeletePkBool(); + UDeletePkBoolReducer* Reducer = NewObject(); + Reducer->B = Args.B; + Reducers->InvokeDeletePkBool(Context, Reducer); + return; + } + if (ReducerName == TEXT("delete_pk_connection_id")) + { + FDeletePkConnectionIdArgs Args = ReducerEvent.Reducer.GetAsDeletePkConnectionId(); + UDeletePkConnectionIdReducer* Reducer = NewObject(); + Reducer->A = Args.A; + Reducers->InvokeDeletePkConnectionId(Context, Reducer); + return; + } + if (ReducerName == TEXT("delete_pk_i128")) + { + FDeletePkI128Args Args = ReducerEvent.Reducer.GetAsDeletePkI128(); + UDeletePkI128Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeDeletePkI128(Context, Reducer); + return; + } + if (ReducerName == TEXT("delete_pk_i16")) + { + FDeletePkI16Args Args = ReducerEvent.Reducer.GetAsDeletePkI16(); + UDeletePkI16Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeDeletePkI16(Context, Reducer); + return; + } + if (ReducerName == TEXT("delete_pk_i256")) + { + FDeletePkI256Args Args = ReducerEvent.Reducer.GetAsDeletePkI256(); + UDeletePkI256Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeDeletePkI256(Context, Reducer); + return; + } + if (ReducerName == TEXT("delete_pk_i32")) + { + FDeletePkI32Args Args = ReducerEvent.Reducer.GetAsDeletePkI32(); + UDeletePkI32Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeDeletePkI32(Context, Reducer); + return; + } + if (ReducerName == TEXT("delete_pk_i64")) + { + FDeletePkI64Args Args = ReducerEvent.Reducer.GetAsDeletePkI64(); + UDeletePkI64Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeDeletePkI64(Context, Reducer); + return; + } + if (ReducerName == TEXT("delete_pk_i8")) + { + FDeletePkI8Args Args = ReducerEvent.Reducer.GetAsDeletePkI8(); + UDeletePkI8Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeDeletePkI8(Context, Reducer); + return; + } + if (ReducerName == TEXT("delete_pk_identity")) + { + FDeletePkIdentityArgs Args = ReducerEvent.Reducer.GetAsDeletePkIdentity(); + UDeletePkIdentityReducer* Reducer = NewObject(); + Reducer->I = Args.I; + Reducers->InvokeDeletePkIdentity(Context, Reducer); + return; + } + if (ReducerName == TEXT("delete_pk_string")) + { + FDeletePkStringArgs Args = ReducerEvent.Reducer.GetAsDeletePkString(); + UDeletePkStringReducer* Reducer = NewObject(); + Reducer->S = Args.S; + Reducers->InvokeDeletePkString(Context, Reducer); + return; + } + if (ReducerName == TEXT("delete_pk_u128")) + { + FDeletePkU128Args Args = ReducerEvent.Reducer.GetAsDeletePkU128(); + UDeletePkU128Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeDeletePkU128(Context, Reducer); + return; + } + if (ReducerName == TEXT("delete_pk_u16")) + { + FDeletePkU16Args Args = ReducerEvent.Reducer.GetAsDeletePkU16(); + UDeletePkU16Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeDeletePkU16(Context, Reducer); + return; + } + if (ReducerName == TEXT("delete_pk_u256")) + { + FDeletePkU256Args Args = ReducerEvent.Reducer.GetAsDeletePkU256(); + UDeletePkU256Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeDeletePkU256(Context, Reducer); + return; + } + if (ReducerName == TEXT("delete_pk_u32")) + { + FDeletePkU32Args Args = ReducerEvent.Reducer.GetAsDeletePkU32(); + UDeletePkU32Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeDeletePkU32(Context, Reducer); + return; + } + if (ReducerName == TEXT("delete_pk_u32_insert_pk_u32_two")) + { + FDeletePkU32InsertPkU32TwoArgs Args = ReducerEvent.Reducer.GetAsDeletePkU32InsertPkU32Two(); + UDeletePkU32InsertPkU32TwoReducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeDeletePkU32InsertPkU32Two(Context, Reducer); + return; + } + if (ReducerName == TEXT("delete_pk_u32_two")) + { + FDeletePkU32TwoArgs Args = ReducerEvent.Reducer.GetAsDeletePkU32Two(); + UDeletePkU32TwoReducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeDeletePkU32Two(Context, Reducer); + return; + } + if (ReducerName == TEXT("delete_pk_u64")) + { + FDeletePkU64Args Args = ReducerEvent.Reducer.GetAsDeletePkU64(); + UDeletePkU64Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeDeletePkU64(Context, Reducer); + return; + } + if (ReducerName == TEXT("delete_pk_u8")) + { + FDeletePkU8Args Args = ReducerEvent.Reducer.GetAsDeletePkU8(); + UDeletePkU8Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeDeletePkU8(Context, Reducer); + return; + } + if (ReducerName == TEXT("delete_unique_bool")) + { + FDeleteUniqueBoolArgs Args = ReducerEvent.Reducer.GetAsDeleteUniqueBool(); + UDeleteUniqueBoolReducer* Reducer = NewObject(); + Reducer->B = Args.B; + Reducers->InvokeDeleteUniqueBool(Context, Reducer); + return; + } + if (ReducerName == TEXT("delete_unique_connection_id")) + { + FDeleteUniqueConnectionIdArgs Args = ReducerEvent.Reducer.GetAsDeleteUniqueConnectionId(); + UDeleteUniqueConnectionIdReducer* Reducer = NewObject(); + Reducer->A = Args.A; + Reducers->InvokeDeleteUniqueConnectionId(Context, Reducer); + return; + } + if (ReducerName == TEXT("delete_unique_i128")) + { + FDeleteUniqueI128Args Args = ReducerEvent.Reducer.GetAsDeleteUniqueI128(); + UDeleteUniqueI128Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeDeleteUniqueI128(Context, Reducer); + return; + } + if (ReducerName == TEXT("delete_unique_i16")) + { + FDeleteUniqueI16Args Args = ReducerEvent.Reducer.GetAsDeleteUniqueI16(); + UDeleteUniqueI16Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeDeleteUniqueI16(Context, Reducer); + return; + } + if (ReducerName == TEXT("delete_unique_i256")) + { + FDeleteUniqueI256Args Args = ReducerEvent.Reducer.GetAsDeleteUniqueI256(); + UDeleteUniqueI256Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeDeleteUniqueI256(Context, Reducer); + return; + } + if (ReducerName == TEXT("delete_unique_i32")) + { + FDeleteUniqueI32Args Args = ReducerEvent.Reducer.GetAsDeleteUniqueI32(); + UDeleteUniqueI32Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeDeleteUniqueI32(Context, Reducer); + return; + } + if (ReducerName == TEXT("delete_unique_i64")) + { + FDeleteUniqueI64Args Args = ReducerEvent.Reducer.GetAsDeleteUniqueI64(); + UDeleteUniqueI64Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeDeleteUniqueI64(Context, Reducer); + return; + } + if (ReducerName == TEXT("delete_unique_i8")) + { + FDeleteUniqueI8Args Args = ReducerEvent.Reducer.GetAsDeleteUniqueI8(); + UDeleteUniqueI8Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeDeleteUniqueI8(Context, Reducer); + return; + } + if (ReducerName == TEXT("delete_unique_identity")) + { + FDeleteUniqueIdentityArgs Args = ReducerEvent.Reducer.GetAsDeleteUniqueIdentity(); + UDeleteUniqueIdentityReducer* Reducer = NewObject(); + Reducer->I = Args.I; + Reducers->InvokeDeleteUniqueIdentity(Context, Reducer); + return; + } + if (ReducerName == TEXT("delete_unique_string")) + { + FDeleteUniqueStringArgs Args = ReducerEvent.Reducer.GetAsDeleteUniqueString(); + UDeleteUniqueStringReducer* Reducer = NewObject(); + Reducer->S = Args.S; + Reducers->InvokeDeleteUniqueString(Context, Reducer); + return; + } + if (ReducerName == TEXT("delete_unique_u128")) + { + FDeleteUniqueU128Args Args = ReducerEvent.Reducer.GetAsDeleteUniqueU128(); + UDeleteUniqueU128Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeDeleteUniqueU128(Context, Reducer); + return; + } + if (ReducerName == TEXT("delete_unique_u16")) + { + FDeleteUniqueU16Args Args = ReducerEvent.Reducer.GetAsDeleteUniqueU16(); + UDeleteUniqueU16Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeDeleteUniqueU16(Context, Reducer); + return; + } + if (ReducerName == TEXT("delete_unique_u256")) + { + FDeleteUniqueU256Args Args = ReducerEvent.Reducer.GetAsDeleteUniqueU256(); + UDeleteUniqueU256Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeDeleteUniqueU256(Context, Reducer); + return; + } + if (ReducerName == TEXT("delete_unique_u32")) + { + FDeleteUniqueU32Args Args = ReducerEvent.Reducer.GetAsDeleteUniqueU32(); + UDeleteUniqueU32Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeDeleteUniqueU32(Context, Reducer); + return; + } + if (ReducerName == TEXT("delete_unique_u64")) + { + FDeleteUniqueU64Args Args = ReducerEvent.Reducer.GetAsDeleteUniqueU64(); + UDeleteUniqueU64Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeDeleteUniqueU64(Context, Reducer); + return; + } + if (ReducerName == TEXT("delete_unique_u8")) + { + FDeleteUniqueU8Args Args = ReducerEvent.Reducer.GetAsDeleteUniqueU8(); + UDeleteUniqueU8Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeDeleteUniqueU8(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_call_timestamp")) + { + FInsertCallTimestampArgs Args = ReducerEvent.Reducer.GetAsInsertCallTimestamp(); + UInsertCallTimestampReducer* Reducer = NewObject(); + Reducers->InvokeInsertCallTimestamp(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_caller_one_connection_id")) + { + FInsertCallerOneConnectionIdArgs Args = ReducerEvent.Reducer.GetAsInsertCallerOneConnectionId(); + UInsertCallerOneConnectionIdReducer* Reducer = NewObject(); + Reducers->InvokeInsertCallerOneConnectionId(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_caller_one_identity")) + { + FInsertCallerOneIdentityArgs Args = ReducerEvent.Reducer.GetAsInsertCallerOneIdentity(); + UInsertCallerOneIdentityReducer* Reducer = NewObject(); + Reducers->InvokeInsertCallerOneIdentity(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_caller_pk_connection_id")) + { + FInsertCallerPkConnectionIdArgs Args = ReducerEvent.Reducer.GetAsInsertCallerPkConnectionId(); + UInsertCallerPkConnectionIdReducer* Reducer = NewObject(); + Reducer->Data = Args.Data; + Reducers->InvokeInsertCallerPkConnectionId(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_caller_pk_identity")) + { + FInsertCallerPkIdentityArgs Args = ReducerEvent.Reducer.GetAsInsertCallerPkIdentity(); + UInsertCallerPkIdentityReducer* Reducer = NewObject(); + Reducer->Data = Args.Data; + Reducers->InvokeInsertCallerPkIdentity(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_caller_unique_connection_id")) + { + FInsertCallerUniqueConnectionIdArgs Args = ReducerEvent.Reducer.GetAsInsertCallerUniqueConnectionId(); + UInsertCallerUniqueConnectionIdReducer* Reducer = NewObject(); + Reducer->Data = Args.Data; + Reducers->InvokeInsertCallerUniqueConnectionId(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_caller_unique_identity")) + { + FInsertCallerUniqueIdentityArgs Args = ReducerEvent.Reducer.GetAsInsertCallerUniqueIdentity(); + UInsertCallerUniqueIdentityReducer* Reducer = NewObject(); + Reducer->Data = Args.Data; + Reducers->InvokeInsertCallerUniqueIdentity(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_caller_vec_connection_id")) + { + FInsertCallerVecConnectionIdArgs Args = ReducerEvent.Reducer.GetAsInsertCallerVecConnectionId(); + UInsertCallerVecConnectionIdReducer* Reducer = NewObject(); + Reducers->InvokeInsertCallerVecConnectionId(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_caller_vec_identity")) + { + FInsertCallerVecIdentityArgs Args = ReducerEvent.Reducer.GetAsInsertCallerVecIdentity(); + UInsertCallerVecIdentityReducer* Reducer = NewObject(); + Reducers->InvokeInsertCallerVecIdentity(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_into_btree_u32")) + { + FInsertIntoBtreeU32Args Args = ReducerEvent.Reducer.GetAsInsertIntoBtreeU32(); + UInsertIntoBtreeU32Reducer* Reducer = NewObject(); + Reducer->Rows = Args.Rows; + Reducers->InvokeInsertIntoBtreeU32(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_into_indexed_simple_enum")) + { + FInsertIntoIndexedSimpleEnumArgs Args = ReducerEvent.Reducer.GetAsInsertIntoIndexedSimpleEnum(); + UInsertIntoIndexedSimpleEnumReducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeInsertIntoIndexedSimpleEnum(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_into_pk_btree_u32")) + { + FInsertIntoPkBtreeU32Args Args = ReducerEvent.Reducer.GetAsInsertIntoPkBtreeU32(); + UInsertIntoPkBtreeU32Reducer* Reducer = NewObject(); + Reducer->PkU32 = Args.PkU32; + Reducer->BtU32 = Args.BtU32; + Reducers->InvokeInsertIntoPkBtreeU32(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_large_table")) + { + FInsertLargeTableArgs Args = ReducerEvent.Reducer.GetAsInsertLargeTable(); + UInsertLargeTableReducer* Reducer = NewObject(); + Reducer->A = Args.A; + Reducer->B = Args.B; + Reducer->C = Args.C; + Reducer->D = Args.D; + Reducer->E = Args.E; + Reducer->F = Args.F; + Reducer->G = Args.G; + Reducer->H = Args.H; + Reducer->I = Args.I; + Reducer->J = Args.J; + Reducer->K = Args.K; + Reducer->L = Args.L; + Reducer->M = Args.M; + Reducer->N = Args.N; + Reducer->O = Args.O; + Reducer->P = Args.P; + Reducer->Q = Args.Q; + Reducer->R = Args.R; + Reducer->S = Args.S; + Reducer->T = Args.T; + Reducer->U = Args.U; + Reducer->V = Args.V; + Reducers->InvokeInsertLargeTable(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_one_bool")) + { + FInsertOneBoolArgs Args = ReducerEvent.Reducer.GetAsInsertOneBool(); + UInsertOneBoolReducer* Reducer = NewObject(); + Reducer->B = Args.B; + Reducers->InvokeInsertOneBool(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_one_byte_struct")) + { + FInsertOneByteStructArgs Args = ReducerEvent.Reducer.GetAsInsertOneByteStruct(); + UInsertOneByteStructReducer* Reducer = NewObject(); + Reducer->S = Args.S; + Reducers->InvokeInsertOneByteStruct(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_one_connection_id")) + { + FInsertOneConnectionIdArgs Args = ReducerEvent.Reducer.GetAsInsertOneConnectionId(); + UInsertOneConnectionIdReducer* Reducer = NewObject(); + Reducer->A = Args.A; + Reducers->InvokeInsertOneConnectionId(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_one_enum_with_payload")) + { + FInsertOneEnumWithPayloadArgs Args = ReducerEvent.Reducer.GetAsInsertOneEnumWithPayload(); + UInsertOneEnumWithPayloadReducer* Reducer = NewObject(); + Reducer->E = Args.E; + Reducers->InvokeInsertOneEnumWithPayload(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_one_every_primitive_struct")) + { + FInsertOneEveryPrimitiveStructArgs Args = ReducerEvent.Reducer.GetAsInsertOneEveryPrimitiveStruct(); + UInsertOneEveryPrimitiveStructReducer* Reducer = NewObject(); + Reducer->S = Args.S; + Reducers->InvokeInsertOneEveryPrimitiveStruct(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_one_every_vec_struct")) + { + FInsertOneEveryVecStructArgs Args = ReducerEvent.Reducer.GetAsInsertOneEveryVecStruct(); + UInsertOneEveryVecStructReducer* Reducer = NewObject(); + Reducer->S = Args.S; + Reducers->InvokeInsertOneEveryVecStruct(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_one_f32")) + { + FInsertOneF32Args Args = ReducerEvent.Reducer.GetAsInsertOneF32(); + UInsertOneF32Reducer* Reducer = NewObject(); + Reducer->F = Args.F; + Reducers->InvokeInsertOneF32(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_one_f64")) + { + FInsertOneF64Args Args = ReducerEvent.Reducer.GetAsInsertOneF64(); + UInsertOneF64Reducer* Reducer = NewObject(); + Reducer->F = Args.F; + Reducers->InvokeInsertOneF64(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_one_i128")) + { + FInsertOneI128Args Args = ReducerEvent.Reducer.GetAsInsertOneI128(); + UInsertOneI128Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeInsertOneI128(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_one_i16")) + { + FInsertOneI16Args Args = ReducerEvent.Reducer.GetAsInsertOneI16(); + UInsertOneI16Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeInsertOneI16(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_one_i256")) + { + FInsertOneI256Args Args = ReducerEvent.Reducer.GetAsInsertOneI256(); + UInsertOneI256Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeInsertOneI256(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_one_i32")) + { + FInsertOneI32Args Args = ReducerEvent.Reducer.GetAsInsertOneI32(); + UInsertOneI32Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeInsertOneI32(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_one_i64")) + { + FInsertOneI64Args Args = ReducerEvent.Reducer.GetAsInsertOneI64(); + UInsertOneI64Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeInsertOneI64(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_one_i8")) + { + FInsertOneI8Args Args = ReducerEvent.Reducer.GetAsInsertOneI8(); + UInsertOneI8Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeInsertOneI8(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_one_identity")) + { + FInsertOneIdentityArgs Args = ReducerEvent.Reducer.GetAsInsertOneIdentity(); + UInsertOneIdentityReducer* Reducer = NewObject(); + Reducer->I = Args.I; + Reducers->InvokeInsertOneIdentity(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_one_simple_enum")) + { + FInsertOneSimpleEnumArgs Args = ReducerEvent.Reducer.GetAsInsertOneSimpleEnum(); + UInsertOneSimpleEnumReducer* Reducer = NewObject(); + Reducer->E = Args.E; + Reducers->InvokeInsertOneSimpleEnum(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_one_string")) + { + FInsertOneStringArgs Args = ReducerEvent.Reducer.GetAsInsertOneString(); + UInsertOneStringReducer* Reducer = NewObject(); + Reducer->S = Args.S; + Reducers->InvokeInsertOneString(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_one_timestamp")) + { + FInsertOneTimestampArgs Args = ReducerEvent.Reducer.GetAsInsertOneTimestamp(); + UInsertOneTimestampReducer* Reducer = NewObject(); + Reducer->T = Args.T; + Reducers->InvokeInsertOneTimestamp(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_one_u128")) + { + FInsertOneU128Args Args = ReducerEvent.Reducer.GetAsInsertOneU128(); + UInsertOneU128Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeInsertOneU128(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_one_u16")) + { + FInsertOneU16Args Args = ReducerEvent.Reducer.GetAsInsertOneU16(); + UInsertOneU16Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeInsertOneU16(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_one_u256")) + { + FInsertOneU256Args Args = ReducerEvent.Reducer.GetAsInsertOneU256(); + UInsertOneU256Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeInsertOneU256(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_one_u32")) + { + FInsertOneU32Args Args = ReducerEvent.Reducer.GetAsInsertOneU32(); + UInsertOneU32Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeInsertOneU32(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_one_u64")) + { + FInsertOneU64Args Args = ReducerEvent.Reducer.GetAsInsertOneU64(); + UInsertOneU64Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeInsertOneU64(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_one_u8")) + { + FInsertOneU8Args Args = ReducerEvent.Reducer.GetAsInsertOneU8(); + UInsertOneU8Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeInsertOneU8(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_one_unit_struct")) + { + FInsertOneUnitStructArgs Args = ReducerEvent.Reducer.GetAsInsertOneUnitStruct(); + UInsertOneUnitStructReducer* Reducer = NewObject(); + Reducer->S = Args.S; + Reducers->InvokeInsertOneUnitStruct(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_option_every_primitive_struct")) + { + FInsertOptionEveryPrimitiveStructArgs Args = ReducerEvent.Reducer.GetAsInsertOptionEveryPrimitiveStruct(); + UInsertOptionEveryPrimitiveStructReducer* Reducer = NewObject(); + Reducer->S = Args.S; + Reducers->InvokeInsertOptionEveryPrimitiveStruct(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_option_i32")) + { + FInsertOptionI32Args Args = ReducerEvent.Reducer.GetAsInsertOptionI32(); + UInsertOptionI32Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeInsertOptionI32(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_option_identity")) + { + FInsertOptionIdentityArgs Args = ReducerEvent.Reducer.GetAsInsertOptionIdentity(); + UInsertOptionIdentityReducer* Reducer = NewObject(); + Reducer->I = Args.I; + Reducers->InvokeInsertOptionIdentity(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_option_simple_enum")) + { + FInsertOptionSimpleEnumArgs Args = ReducerEvent.Reducer.GetAsInsertOptionSimpleEnum(); + UInsertOptionSimpleEnumReducer* Reducer = NewObject(); + Reducer->E = Args.E; + Reducers->InvokeInsertOptionSimpleEnum(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_option_string")) + { + FInsertOptionStringArgs Args = ReducerEvent.Reducer.GetAsInsertOptionString(); + UInsertOptionStringReducer* Reducer = NewObject(); + Reducer->S = Args.S; + Reducers->InvokeInsertOptionString(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_option_vec_option_i32")) + { + FInsertOptionVecOptionI32Args Args = ReducerEvent.Reducer.GetAsInsertOptionVecOptionI32(); + UInsertOptionVecOptionI32Reducer* Reducer = NewObject(); + Reducer->V = Args.V; + Reducers->InvokeInsertOptionVecOptionI32(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_pk_bool")) + { + FInsertPkBoolArgs Args = ReducerEvent.Reducer.GetAsInsertPkBool(); + UInsertPkBoolReducer* Reducer = NewObject(); + Reducer->B = Args.B; + Reducer->Data = Args.Data; + Reducers->InvokeInsertPkBool(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_pk_connection_id")) + { + FInsertPkConnectionIdArgs Args = ReducerEvent.Reducer.GetAsInsertPkConnectionId(); + UInsertPkConnectionIdReducer* Reducer = NewObject(); + Reducer->A = Args.A; + Reducer->Data = Args.Data; + Reducers->InvokeInsertPkConnectionId(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_pk_i128")) + { + FInsertPkI128Args Args = ReducerEvent.Reducer.GetAsInsertPkI128(); + UInsertPkI128Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeInsertPkI128(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_pk_i16")) + { + FInsertPkI16Args Args = ReducerEvent.Reducer.GetAsInsertPkI16(); + UInsertPkI16Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeInsertPkI16(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_pk_i256")) + { + FInsertPkI256Args Args = ReducerEvent.Reducer.GetAsInsertPkI256(); + UInsertPkI256Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeInsertPkI256(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_pk_i32")) + { + FInsertPkI32Args Args = ReducerEvent.Reducer.GetAsInsertPkI32(); + UInsertPkI32Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeInsertPkI32(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_pk_i64")) + { + FInsertPkI64Args Args = ReducerEvent.Reducer.GetAsInsertPkI64(); + UInsertPkI64Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeInsertPkI64(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_pk_i8")) + { + FInsertPkI8Args Args = ReducerEvent.Reducer.GetAsInsertPkI8(); + UInsertPkI8Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeInsertPkI8(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_pk_identity")) + { + FInsertPkIdentityArgs Args = ReducerEvent.Reducer.GetAsInsertPkIdentity(); + UInsertPkIdentityReducer* Reducer = NewObject(); + Reducer->I = Args.I; + Reducer->Data = Args.Data; + Reducers->InvokeInsertPkIdentity(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_pk_simple_enum")) + { + FInsertPkSimpleEnumArgs Args = ReducerEvent.Reducer.GetAsInsertPkSimpleEnum(); + UInsertPkSimpleEnumReducer* Reducer = NewObject(); + Reducer->A = Args.A; + Reducer->Data = Args.Data; + Reducers->InvokeInsertPkSimpleEnum(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_pk_string")) + { + FInsertPkStringArgs Args = ReducerEvent.Reducer.GetAsInsertPkString(); + UInsertPkStringReducer* Reducer = NewObject(); + Reducer->S = Args.S; + Reducer->Data = Args.Data; + Reducers->InvokeInsertPkString(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_pk_u128")) + { + FInsertPkU128Args Args = ReducerEvent.Reducer.GetAsInsertPkU128(); + UInsertPkU128Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeInsertPkU128(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_pk_u16")) + { + FInsertPkU16Args Args = ReducerEvent.Reducer.GetAsInsertPkU16(); + UInsertPkU16Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeInsertPkU16(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_pk_u256")) + { + FInsertPkU256Args Args = ReducerEvent.Reducer.GetAsInsertPkU256(); + UInsertPkU256Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeInsertPkU256(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_pk_u32")) + { + FInsertPkU32Args Args = ReducerEvent.Reducer.GetAsInsertPkU32(); + UInsertPkU32Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeInsertPkU32(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_pk_u32_two")) + { + FInsertPkU32TwoArgs Args = ReducerEvent.Reducer.GetAsInsertPkU32Two(); + UInsertPkU32TwoReducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeInsertPkU32Two(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_pk_u64")) + { + FInsertPkU64Args Args = ReducerEvent.Reducer.GetAsInsertPkU64(); + UInsertPkU64Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeInsertPkU64(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_pk_u8")) + { + FInsertPkU8Args Args = ReducerEvent.Reducer.GetAsInsertPkU8(); + UInsertPkU8Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeInsertPkU8(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_primitives_as_strings")) + { + FInsertPrimitivesAsStringsArgs Args = ReducerEvent.Reducer.GetAsInsertPrimitivesAsStrings(); + UInsertPrimitivesAsStringsReducer* Reducer = NewObject(); + Reducer->S = Args.S; + Reducers->InvokeInsertPrimitivesAsStrings(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_table_holds_table")) + { + FInsertTableHoldsTableArgs Args = ReducerEvent.Reducer.GetAsInsertTableHoldsTable(); + UInsertTableHoldsTableReducer* Reducer = NewObject(); + Reducer->A = Args.A; + Reducer->B = Args.B; + Reducers->InvokeInsertTableHoldsTable(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_unique_bool")) + { + FInsertUniqueBoolArgs Args = ReducerEvent.Reducer.GetAsInsertUniqueBool(); + UInsertUniqueBoolReducer* Reducer = NewObject(); + Reducer->B = Args.B; + Reducer->Data = Args.Data; + Reducers->InvokeInsertUniqueBool(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_unique_connection_id")) + { + FInsertUniqueConnectionIdArgs Args = ReducerEvent.Reducer.GetAsInsertUniqueConnectionId(); + UInsertUniqueConnectionIdReducer* Reducer = NewObject(); + Reducer->A = Args.A; + Reducer->Data = Args.Data; + Reducers->InvokeInsertUniqueConnectionId(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_unique_i128")) + { + FInsertUniqueI128Args Args = ReducerEvent.Reducer.GetAsInsertUniqueI128(); + UInsertUniqueI128Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeInsertUniqueI128(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_unique_i16")) + { + FInsertUniqueI16Args Args = ReducerEvent.Reducer.GetAsInsertUniqueI16(); + UInsertUniqueI16Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeInsertUniqueI16(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_unique_i256")) + { + FInsertUniqueI256Args Args = ReducerEvent.Reducer.GetAsInsertUniqueI256(); + UInsertUniqueI256Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeInsertUniqueI256(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_unique_i32")) + { + FInsertUniqueI32Args Args = ReducerEvent.Reducer.GetAsInsertUniqueI32(); + UInsertUniqueI32Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeInsertUniqueI32(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_unique_i64")) + { + FInsertUniqueI64Args Args = ReducerEvent.Reducer.GetAsInsertUniqueI64(); + UInsertUniqueI64Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeInsertUniqueI64(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_unique_i8")) + { + FInsertUniqueI8Args Args = ReducerEvent.Reducer.GetAsInsertUniqueI8(); + UInsertUniqueI8Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeInsertUniqueI8(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_unique_identity")) + { + FInsertUniqueIdentityArgs Args = ReducerEvent.Reducer.GetAsInsertUniqueIdentity(); + UInsertUniqueIdentityReducer* Reducer = NewObject(); + Reducer->I = Args.I; + Reducer->Data = Args.Data; + Reducers->InvokeInsertUniqueIdentity(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_unique_string")) + { + FInsertUniqueStringArgs Args = ReducerEvent.Reducer.GetAsInsertUniqueString(); + UInsertUniqueStringReducer* Reducer = NewObject(); + Reducer->S = Args.S; + Reducer->Data = Args.Data; + Reducers->InvokeInsertUniqueString(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_unique_u128")) + { + FInsertUniqueU128Args Args = ReducerEvent.Reducer.GetAsInsertUniqueU128(); + UInsertUniqueU128Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeInsertUniqueU128(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_unique_u16")) + { + FInsertUniqueU16Args Args = ReducerEvent.Reducer.GetAsInsertUniqueU16(); + UInsertUniqueU16Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeInsertUniqueU16(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_unique_u256")) + { + FInsertUniqueU256Args Args = ReducerEvent.Reducer.GetAsInsertUniqueU256(); + UInsertUniqueU256Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeInsertUniqueU256(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_unique_u32")) + { + FInsertUniqueU32Args Args = ReducerEvent.Reducer.GetAsInsertUniqueU32(); + UInsertUniqueU32Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeInsertUniqueU32(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_unique_u32_update_pk_u32")) + { + FInsertUniqueU32UpdatePkU32Args Args = ReducerEvent.Reducer.GetAsInsertUniqueU32UpdatePkU32(); + UInsertUniqueU32UpdatePkU32Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->DUnique = Args.DUnique; + Reducer->DPk = Args.DPk; + Reducers->InvokeInsertUniqueU32UpdatePkU32(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_unique_u64")) + { + FInsertUniqueU64Args Args = ReducerEvent.Reducer.GetAsInsertUniqueU64(); + UInsertUniqueU64Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeInsertUniqueU64(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_unique_u8")) + { + FInsertUniqueU8Args Args = ReducerEvent.Reducer.GetAsInsertUniqueU8(); + UInsertUniqueU8Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeInsertUniqueU8(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_user")) + { + FInsertUserArgs Args = ReducerEvent.Reducer.GetAsInsertUser(); + UInsertUserReducer* Reducer = NewObject(); + Reducer->Name = Args.Name; + Reducer->Identity = Args.Identity; + Reducers->InvokeInsertUser(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_vec_bool")) + { + FInsertVecBoolArgs Args = ReducerEvent.Reducer.GetAsInsertVecBool(); + UInsertVecBoolReducer* Reducer = NewObject(); + Reducer->B = Args.B; + Reducers->InvokeInsertVecBool(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_vec_byte_struct")) + { + FInsertVecByteStructArgs Args = ReducerEvent.Reducer.GetAsInsertVecByteStruct(); + UInsertVecByteStructReducer* Reducer = NewObject(); + Reducer->S = Args.S; + Reducers->InvokeInsertVecByteStruct(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_vec_connection_id")) + { + FInsertVecConnectionIdArgs Args = ReducerEvent.Reducer.GetAsInsertVecConnectionId(); + UInsertVecConnectionIdReducer* Reducer = NewObject(); + Reducer->A = Args.A; + Reducers->InvokeInsertVecConnectionId(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_vec_enum_with_payload")) + { + FInsertVecEnumWithPayloadArgs Args = ReducerEvent.Reducer.GetAsInsertVecEnumWithPayload(); + UInsertVecEnumWithPayloadReducer* Reducer = NewObject(); + Reducer->E = Args.E; + Reducers->InvokeInsertVecEnumWithPayload(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_vec_every_primitive_struct")) + { + FInsertVecEveryPrimitiveStructArgs Args = ReducerEvent.Reducer.GetAsInsertVecEveryPrimitiveStruct(); + UInsertVecEveryPrimitiveStructReducer* Reducer = NewObject(); + Reducer->S = Args.S; + Reducers->InvokeInsertVecEveryPrimitiveStruct(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_vec_every_vec_struct")) + { + FInsertVecEveryVecStructArgs Args = ReducerEvent.Reducer.GetAsInsertVecEveryVecStruct(); + UInsertVecEveryVecStructReducer* Reducer = NewObject(); + Reducer->S = Args.S; + Reducers->InvokeInsertVecEveryVecStruct(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_vec_f32")) + { + FInsertVecF32Args Args = ReducerEvent.Reducer.GetAsInsertVecF32(); + UInsertVecF32Reducer* Reducer = NewObject(); + Reducer->F = Args.F; + Reducers->InvokeInsertVecF32(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_vec_f64")) + { + FInsertVecF64Args Args = ReducerEvent.Reducer.GetAsInsertVecF64(); + UInsertVecF64Reducer* Reducer = NewObject(); + Reducer->F = Args.F; + Reducers->InvokeInsertVecF64(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_vec_i128")) + { + FInsertVecI128Args Args = ReducerEvent.Reducer.GetAsInsertVecI128(); + UInsertVecI128Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeInsertVecI128(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_vec_i16")) + { + FInsertVecI16Args Args = ReducerEvent.Reducer.GetAsInsertVecI16(); + UInsertVecI16Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeInsertVecI16(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_vec_i256")) + { + FInsertVecI256Args Args = ReducerEvent.Reducer.GetAsInsertVecI256(); + UInsertVecI256Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeInsertVecI256(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_vec_i32")) + { + FInsertVecI32Args Args = ReducerEvent.Reducer.GetAsInsertVecI32(); + UInsertVecI32Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeInsertVecI32(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_vec_i64")) + { + FInsertVecI64Args Args = ReducerEvent.Reducer.GetAsInsertVecI64(); + UInsertVecI64Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeInsertVecI64(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_vec_i8")) + { + FInsertVecI8Args Args = ReducerEvent.Reducer.GetAsInsertVecI8(); + UInsertVecI8Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeInsertVecI8(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_vec_identity")) + { + FInsertVecIdentityArgs Args = ReducerEvent.Reducer.GetAsInsertVecIdentity(); + UInsertVecIdentityReducer* Reducer = NewObject(); + Reducer->I = Args.I; + Reducers->InvokeInsertVecIdentity(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_vec_simple_enum")) + { + FInsertVecSimpleEnumArgs Args = ReducerEvent.Reducer.GetAsInsertVecSimpleEnum(); + UInsertVecSimpleEnumReducer* Reducer = NewObject(); + Reducer->E = Args.E; + Reducers->InvokeInsertVecSimpleEnum(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_vec_string")) + { + FInsertVecStringArgs Args = ReducerEvent.Reducer.GetAsInsertVecString(); + UInsertVecStringReducer* Reducer = NewObject(); + Reducer->S = Args.S; + Reducers->InvokeInsertVecString(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_vec_timestamp")) + { + FInsertVecTimestampArgs Args = ReducerEvent.Reducer.GetAsInsertVecTimestamp(); + UInsertVecTimestampReducer* Reducer = NewObject(); + Reducer->T = Args.T; + Reducers->InvokeInsertVecTimestamp(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_vec_u128")) + { + FInsertVecU128Args Args = ReducerEvent.Reducer.GetAsInsertVecU128(); + UInsertVecU128Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeInsertVecU128(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_vec_u16")) + { + FInsertVecU16Args Args = ReducerEvent.Reducer.GetAsInsertVecU16(); + UInsertVecU16Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeInsertVecU16(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_vec_u256")) + { + FInsertVecU256Args Args = ReducerEvent.Reducer.GetAsInsertVecU256(); + UInsertVecU256Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeInsertVecU256(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_vec_u32")) + { + FInsertVecU32Args Args = ReducerEvent.Reducer.GetAsInsertVecU32(); + UInsertVecU32Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeInsertVecU32(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_vec_u64")) + { + FInsertVecU64Args Args = ReducerEvent.Reducer.GetAsInsertVecU64(); + UInsertVecU64Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeInsertVecU64(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_vec_u8")) + { + FInsertVecU8Args Args = ReducerEvent.Reducer.GetAsInsertVecU8(); + UInsertVecU8Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducers->InvokeInsertVecU8(Context, Reducer); + return; + } + if (ReducerName == TEXT("insert_vec_unit_struct")) + { + FInsertVecUnitStructArgs Args = ReducerEvent.Reducer.GetAsInsertVecUnitStruct(); + UInsertVecUnitStructReducer* Reducer = NewObject(); + Reducer->S = Args.S; + Reducers->InvokeInsertVecUnitStruct(Context, Reducer); + return; + } + if (ReducerName == TEXT("no_op_succeeds")) + { + FNoOpSucceedsArgs Args = ReducerEvent.Reducer.GetAsNoOpSucceeds(); + UNoOpSucceedsReducer* Reducer = NewObject(); + Reducers->InvokeNoOpSucceeds(Context, Reducer); + return; + } + if (ReducerName == TEXT("send_scheduled_message")) + { + FSendScheduledMessageArgs Args = ReducerEvent.Reducer.GetAsSendScheduledMessage(); + USendScheduledMessageReducer* Reducer = NewObject(); + Reducer->Arg = Args.Arg; + Reducers->InvokeSendScheduledMessage(Context, Reducer); + return; + } + if (ReducerName == TEXT("update_indexed_simple_enum")) + { + FUpdateIndexedSimpleEnumArgs Args = ReducerEvent.Reducer.GetAsUpdateIndexedSimpleEnum(); + UUpdateIndexedSimpleEnumReducer* Reducer = NewObject(); + Reducer->A = Args.A; + Reducer->B = Args.B; + Reducers->InvokeUpdateIndexedSimpleEnum(Context, Reducer); + return; + } + if (ReducerName == TEXT("update_pk_bool")) + { + FUpdatePkBoolArgs Args = ReducerEvent.Reducer.GetAsUpdatePkBool(); + UUpdatePkBoolReducer* Reducer = NewObject(); + Reducer->B = Args.B; + Reducer->Data = Args.Data; + Reducers->InvokeUpdatePkBool(Context, Reducer); + return; + } + if (ReducerName == TEXT("update_pk_connection_id")) + { + FUpdatePkConnectionIdArgs Args = ReducerEvent.Reducer.GetAsUpdatePkConnectionId(); + UUpdatePkConnectionIdReducer* Reducer = NewObject(); + Reducer->A = Args.A; + Reducer->Data = Args.Data; + Reducers->InvokeUpdatePkConnectionId(Context, Reducer); + return; + } + if (ReducerName == TEXT("update_pk_i128")) + { + FUpdatePkI128Args Args = ReducerEvent.Reducer.GetAsUpdatePkI128(); + UUpdatePkI128Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeUpdatePkI128(Context, Reducer); + return; + } + if (ReducerName == TEXT("update_pk_i16")) + { + FUpdatePkI16Args Args = ReducerEvent.Reducer.GetAsUpdatePkI16(); + UUpdatePkI16Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeUpdatePkI16(Context, Reducer); + return; + } + if (ReducerName == TEXT("update_pk_i256")) + { + FUpdatePkI256Args Args = ReducerEvent.Reducer.GetAsUpdatePkI256(); + UUpdatePkI256Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeUpdatePkI256(Context, Reducer); + return; + } + if (ReducerName == TEXT("update_pk_i32")) + { + FUpdatePkI32Args Args = ReducerEvent.Reducer.GetAsUpdatePkI32(); + UUpdatePkI32Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeUpdatePkI32(Context, Reducer); + return; + } + if (ReducerName == TEXT("update_pk_i64")) + { + FUpdatePkI64Args Args = ReducerEvent.Reducer.GetAsUpdatePkI64(); + UUpdatePkI64Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeUpdatePkI64(Context, Reducer); + return; + } + if (ReducerName == TEXT("update_pk_i8")) + { + FUpdatePkI8Args Args = ReducerEvent.Reducer.GetAsUpdatePkI8(); + UUpdatePkI8Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeUpdatePkI8(Context, Reducer); + return; + } + if (ReducerName == TEXT("update_pk_identity")) + { + FUpdatePkIdentityArgs Args = ReducerEvent.Reducer.GetAsUpdatePkIdentity(); + UUpdatePkIdentityReducer* Reducer = NewObject(); + Reducer->I = Args.I; + Reducer->Data = Args.Data; + Reducers->InvokeUpdatePkIdentity(Context, Reducer); + return; + } + if (ReducerName == TEXT("update_pk_simple_enum")) + { + FUpdatePkSimpleEnumArgs Args = ReducerEvent.Reducer.GetAsUpdatePkSimpleEnum(); + UUpdatePkSimpleEnumReducer* Reducer = NewObject(); + Reducer->A = Args.A; + Reducer->Data = Args.Data; + Reducers->InvokeUpdatePkSimpleEnum(Context, Reducer); + return; + } + if (ReducerName == TEXT("update_pk_string")) + { + FUpdatePkStringArgs Args = ReducerEvent.Reducer.GetAsUpdatePkString(); + UUpdatePkStringReducer* Reducer = NewObject(); + Reducer->S = Args.S; + Reducer->Data = Args.Data; + Reducers->InvokeUpdatePkString(Context, Reducer); + return; + } + if (ReducerName == TEXT("update_pk_u128")) + { + FUpdatePkU128Args Args = ReducerEvent.Reducer.GetAsUpdatePkU128(); + UUpdatePkU128Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeUpdatePkU128(Context, Reducer); + return; + } + if (ReducerName == TEXT("update_pk_u16")) + { + FUpdatePkU16Args Args = ReducerEvent.Reducer.GetAsUpdatePkU16(); + UUpdatePkU16Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeUpdatePkU16(Context, Reducer); + return; + } + if (ReducerName == TEXT("update_pk_u256")) + { + FUpdatePkU256Args Args = ReducerEvent.Reducer.GetAsUpdatePkU256(); + UUpdatePkU256Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeUpdatePkU256(Context, Reducer); + return; + } + if (ReducerName == TEXT("update_pk_u32")) + { + FUpdatePkU32Args Args = ReducerEvent.Reducer.GetAsUpdatePkU32(); + UUpdatePkU32Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeUpdatePkU32(Context, Reducer); + return; + } + if (ReducerName == TEXT("update_pk_u32_two")) + { + FUpdatePkU32TwoArgs Args = ReducerEvent.Reducer.GetAsUpdatePkU32Two(); + UUpdatePkU32TwoReducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeUpdatePkU32Two(Context, Reducer); + return; + } + if (ReducerName == TEXT("update_pk_u64")) + { + FUpdatePkU64Args Args = ReducerEvent.Reducer.GetAsUpdatePkU64(); + UUpdatePkU64Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeUpdatePkU64(Context, Reducer); + return; + } + if (ReducerName == TEXT("update_pk_u8")) + { + FUpdatePkU8Args Args = ReducerEvent.Reducer.GetAsUpdatePkU8(); + UUpdatePkU8Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeUpdatePkU8(Context, Reducer); + return; + } + if (ReducerName == TEXT("update_unique_bool")) + { + FUpdateUniqueBoolArgs Args = ReducerEvent.Reducer.GetAsUpdateUniqueBool(); + UUpdateUniqueBoolReducer* Reducer = NewObject(); + Reducer->B = Args.B; + Reducer->Data = Args.Data; + Reducers->InvokeUpdateUniqueBool(Context, Reducer); + return; + } + if (ReducerName == TEXT("update_unique_connection_id")) + { + FUpdateUniqueConnectionIdArgs Args = ReducerEvent.Reducer.GetAsUpdateUniqueConnectionId(); + UUpdateUniqueConnectionIdReducer* Reducer = NewObject(); + Reducer->A = Args.A; + Reducer->Data = Args.Data; + Reducers->InvokeUpdateUniqueConnectionId(Context, Reducer); + return; + } + if (ReducerName == TEXT("update_unique_i128")) + { + FUpdateUniqueI128Args Args = ReducerEvent.Reducer.GetAsUpdateUniqueI128(); + UUpdateUniqueI128Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeUpdateUniqueI128(Context, Reducer); + return; + } + if (ReducerName == TEXT("update_unique_i16")) + { + FUpdateUniqueI16Args Args = ReducerEvent.Reducer.GetAsUpdateUniqueI16(); + UUpdateUniqueI16Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeUpdateUniqueI16(Context, Reducer); + return; + } + if (ReducerName == TEXT("update_unique_i256")) + { + FUpdateUniqueI256Args Args = ReducerEvent.Reducer.GetAsUpdateUniqueI256(); + UUpdateUniqueI256Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeUpdateUniqueI256(Context, Reducer); + return; + } + if (ReducerName == TEXT("update_unique_i32")) + { + FUpdateUniqueI32Args Args = ReducerEvent.Reducer.GetAsUpdateUniqueI32(); + UUpdateUniqueI32Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeUpdateUniqueI32(Context, Reducer); + return; + } + if (ReducerName == TEXT("update_unique_i64")) + { + FUpdateUniqueI64Args Args = ReducerEvent.Reducer.GetAsUpdateUniqueI64(); + UUpdateUniqueI64Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeUpdateUniqueI64(Context, Reducer); + return; + } + if (ReducerName == TEXT("update_unique_i8")) + { + FUpdateUniqueI8Args Args = ReducerEvent.Reducer.GetAsUpdateUniqueI8(); + UUpdateUniqueI8Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeUpdateUniqueI8(Context, Reducer); + return; + } + if (ReducerName == TEXT("update_unique_identity")) + { + FUpdateUniqueIdentityArgs Args = ReducerEvent.Reducer.GetAsUpdateUniqueIdentity(); + UUpdateUniqueIdentityReducer* Reducer = NewObject(); + Reducer->I = Args.I; + Reducer->Data = Args.Data; + Reducers->InvokeUpdateUniqueIdentity(Context, Reducer); + return; + } + if (ReducerName == TEXT("update_unique_string")) + { + FUpdateUniqueStringArgs Args = ReducerEvent.Reducer.GetAsUpdateUniqueString(); + UUpdateUniqueStringReducer* Reducer = NewObject(); + Reducer->S = Args.S; + Reducer->Data = Args.Data; + Reducers->InvokeUpdateUniqueString(Context, Reducer); + return; + } + if (ReducerName == TEXT("update_unique_u128")) + { + FUpdateUniqueU128Args Args = ReducerEvent.Reducer.GetAsUpdateUniqueU128(); + UUpdateUniqueU128Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeUpdateUniqueU128(Context, Reducer); + return; + } + if (ReducerName == TEXT("update_unique_u16")) + { + FUpdateUniqueU16Args Args = ReducerEvent.Reducer.GetAsUpdateUniqueU16(); + UUpdateUniqueU16Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeUpdateUniqueU16(Context, Reducer); + return; + } + if (ReducerName == TEXT("update_unique_u256")) + { + FUpdateUniqueU256Args Args = ReducerEvent.Reducer.GetAsUpdateUniqueU256(); + UUpdateUniqueU256Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeUpdateUniqueU256(Context, Reducer); + return; + } + if (ReducerName == TEXT("update_unique_u32")) + { + FUpdateUniqueU32Args Args = ReducerEvent.Reducer.GetAsUpdateUniqueU32(); + UUpdateUniqueU32Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeUpdateUniqueU32(Context, Reducer); + return; + } + if (ReducerName == TEXT("update_unique_u64")) + { + FUpdateUniqueU64Args Args = ReducerEvent.Reducer.GetAsUpdateUniqueU64(); + UUpdateUniqueU64Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeUpdateUniqueU64(Context, Reducer); + return; + } + if (ReducerName == TEXT("update_unique_u8")) + { + FUpdateUniqueU8Args Args = ReducerEvent.Reducer.GetAsUpdateUniqueU8(); + UUpdateUniqueU8Reducer* Reducer = NewObject(); + Reducer->N = Args.N; + Reducer->Data = Args.Data; + Reducers->InvokeUpdateUniqueU8(Context, Reducer); + return; + } + + UE_LOG(LogTemp, Warning, TEXT("Unknown reducer: %s"), *ReducerName); +} + +void UDbConnection::ReducerEventFailed(const FReducerEvent& Event, const FString ErrorMessage) +{ + if (!Reducers) { return; } + + FTestClientReducerEvent ReducerEvent; + ReducerEvent.CallerConnectionId = Event.CallerConnectionId; + ReducerEvent.CallerIdentity = Event.CallerIdentity; + ReducerEvent.EnergyConsumed = Event.EnergyConsumed; + ReducerEvent.Status = Event.Status; + ReducerEvent.Timestamp = Event.Timestamp; + + FReducerEventContext Context(this, ReducerEvent); + + if (Reducers->InternalOnUnhandledReducerError.IsBound()) + { + Reducers->InternalOnUnhandledReducerError.Broadcast(Context, ErrorMessage); + } +} + +UDbConnectionBuilder* UDbConnection::Builder() +{ + return NewObject(); +} +// Added for creating subscriptions +USubscriptionBuilder* UDbConnection::SubscriptionBuilder() +{ + USubscriptionBuilder* Builder = NewObject(this); + Builder->Conn = this; + return Builder; +} +USubscriptionBuilder* USubscriptionBuilder::OnApplied(FOnSubscriptionApplied Callback) +{ + OnAppliedDelegateInternal = Callback; + return this; +} +USubscriptionBuilder* USubscriptionBuilder::OnError(FOnSubscriptionError Callback) +{ + OnErrorDelegateInternal = Callback; + return this; +} +USubscriptionHandle* USubscriptionBuilder::Subscribe(const TArray& SQL) +{ + USubscriptionHandle* Handle = NewObject(); + + // Store user callbacks on the handle + Handle->Conn = Conn; + Handle->OnAppliedDelegate = OnAppliedDelegateInternal; + Handle->OnErrorDelegate = OnErrorDelegateInternal; + + // Bind forwarding functions that will convert base contexts + FSubscriptionEventDelegate BaseApplied; + BaseApplied.BindUFunction(Handle, TEXT("ForwardOnApplied")); + OnAppliedBase(BaseApplied); + + FSubscriptionErrorDelegate BaseError; + BaseError.BindUFunction(Handle, TEXT("ForwardOnError")); + OnErrorBase(BaseError); + + SubscribeBase(SQL, Handle); + if (Conn) + { + Conn->StartSubscription(Handle); + } + return Handle; +} +USubscriptionHandle* USubscriptionBuilder::SubscribeToAllTables() +{ + return Subscribe({ "SELECT * FROM * " }); +} + +USubscriptionHandle::USubscriptionHandle(UDbConnection* InConn) +{ + Conn = InConn; +} + +void USubscriptionHandle::ForwardOnApplied(const FSubscriptionEventContextBase& BaseCtx) +{ + if (OnAppliedDelegate.IsBound()) + { + FSubscriptionEventContext Ctx(Conn); + OnAppliedDelegate.Execute(Ctx); + } +} + +void USubscriptionHandle::ForwardOnError(const FErrorContextBase& BaseCtx) +{ + if (OnErrorDelegate.IsBound()) + { + FErrorContext Ctx(Conn, BaseCtx.Error); + OnErrorDelegate.Execute(Ctx); + } +} + + +// Cast from parent to child class +UDbConnectionBuilder* UDbConnectionBuilder::WithUri(const FString& InUri) +{ + return Cast(WithUriBase(InUri)); +} +UDbConnectionBuilder* UDbConnectionBuilder::WithModuleName(const FString& InName) +{ + return Cast(WithModuleNameBase(InName)); +} +UDbConnectionBuilder* UDbConnectionBuilder::WithToken(const FString& InToken) +{ + return Cast(WithTokenBase(InToken)); +} +UDbConnectionBuilder* UDbConnectionBuilder::WithCompression(const ESpacetimeDBCompression& InCompression) +{ + return Cast(WithCompressionBase(InCompression)); +} +UDbConnectionBuilder* UDbConnectionBuilder::OnConnect(FOnConnectDelegate Callback) +{ + OnConnectDelegateInternal = Callback; + return this; +} +UDbConnectionBuilder* UDbConnectionBuilder::OnConnectError(FOnConnectErrorDelegate Callback) +{ + return Cast(OnConnectErrorBase(Callback)); +} +UDbConnectionBuilder* UDbConnectionBuilder::OnDisconnect(FOnDisconnectDelegate Callback) +{ + OnDisconnectDelegateInternal = Callback; + return this; +} +UDbConnection* UDbConnectionBuilder::Build() +{ + UDbConnection* Connection = NewObject(); + + // Store delegates on the connection for later use + Connection->OnConnectDelegate = OnConnectDelegateInternal; + Connection->OnDisconnectDelegate = OnDisconnectDelegateInternal; + + // Wrap delegates so the base builder can bind them + FOnConnectBaseDelegate BaseConnect; + BaseConnect.BindUFunction(Connection, TEXT("ForwardOnConnect")); + Connection->SetOnConnectDelegate(BaseConnect); + OnConnectBase(BaseConnect); + + FOnDisconnectBaseDelegate BaseDisconnect; + BaseDisconnect.BindUFunction(Connection, TEXT("ForwardOnDisconnect")); + Connection->SetOnDisconnectDelegate(BaseDisconnect); + OnDisconnectBase(BaseDisconnect); + + return Cast(BuildConnection(Connection)); +} +void UDbConnection::ForwardOnConnect(UDbConnectionBase* BaseConnection, FSpacetimeDBIdentity InIdentity, const FString& InToken) +{ + if (OnConnectDelegate.IsBound()) + { + OnConnectDelegate.Execute(this, Identity, Token); + } +} +void UDbConnection::ForwardOnDisconnect(UDbConnectionBase* BaseConnection, const FString& Error) +{ + if (OnDisconnectDelegate.IsBound()) + { + OnDisconnectDelegate.Execute(this, Error); + } +} + + +void UDbConnection::DbUpdate(const FDatabaseUpdateType& Update, const FSpacetimeDBEvent& Event) +{ + FTestClientEvent BaseEvent; + BaseEvent.Tag = Event.Tag; + + switch (Event.Tag) + { + case ESpacetimeDBEventTag::Reducer: + { + FReducerEvent ReducerEvent = Event.GetAsReducer(); + FReducer Reducer = DecodeReducer(ReducerEvent); + BaseEvent = FTestClientEvent::Reducer(Reducer); + break; + } + + case ESpacetimeDBEventTag::SubscribeApplied: + BaseEvent = FTestClientEvent::SubscribeApplied(Event.GetAsSubscribeApplied()); + break; + + case ESpacetimeDBEventTag::UnsubscribeApplied: + BaseEvent = FTestClientEvent::UnsubscribeApplied(Event.GetAsUnsubscribeApplied()); + break; + + case ESpacetimeDBEventTag::Disconnected: + BaseEvent = FTestClientEvent::Disconnected(Event.GetAsDisconnected()); + break; + + case ESpacetimeDBEventTag::SubscribeError: + BaseEvent = FTestClientEvent::SubscribeError(Event.GetAsSubscribeError()); + break; + + case ESpacetimeDBEventTag::UnknownTransaction: + BaseEvent = FTestClientEvent::UnknownTransaction(Event.GetAsUnknownTransaction()); + break; + + default: + break; + } + + FEventContext Context(this, BaseEvent); + // Populate typed reducer args for convenience in table handlers + + ApplyRegisteredTableUpdates(Update, &Context); +} + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/BTreeU32Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/BTreeU32Table.g.cpp new file mode 100644 index 00000000000..fe165e85c76 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/BTreeU32Table.g.cpp @@ -0,0 +1,48 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/BTreeU32Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UBTreeU32Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> BTreeU32Table = Data->GetOrAdd(TableName); + + // Register a new multi-key B-Tree index named "n" on the BTreeU32Table. + BTreeU32Table->AddMultiKeyBTreeIndex>( + TEXT("n"), + [](const FBTreeU32Type& Row) + { + // This tuple is stored in the B-Tree index for fast composite key lookups. + return MakeTuple(Row.N); + } + ); + + N = NewObject(this); + N->SetCache(BTreeU32Table); + + /***/ +} + +FTableAppliedDiff UBTreeU32Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UBTreeU32Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UBTreeU32Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/IndexedSimpleEnumTable.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/IndexedSimpleEnumTable.g.cpp new file mode 100644 index 00000000000..ec143d07cce --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/IndexedSimpleEnumTable.g.cpp @@ -0,0 +1,48 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/IndexedSimpleEnumTable.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UIndexedSimpleEnumTable::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> IndexedSimpleEnumTable = Data->GetOrAdd(TableName); + + // Register a new multi-key B-Tree index named "n" on the IndexedSimpleEnumTable. + IndexedSimpleEnumTable->AddMultiKeyBTreeIndex>( + TEXT("n"), + [](const FIndexedSimpleEnumType& Row) + { + // This tuple is stored in the B-Tree index for fast composite key lookups. + return MakeTuple(Row.N); + } + ); + + N = NewObject(this); + N->SetCache(IndexedSimpleEnumTable); + + /***/ +} + +FTableAppliedDiff UIndexedSimpleEnumTable::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UIndexedSimpleEnumTable::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UIndexedSimpleEnumTable::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/IndexedTable2Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/IndexedTable2Table.g.cpp new file mode 100644 index 00000000000..2f850e9a500 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/IndexedTable2Table.g.cpp @@ -0,0 +1,48 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/IndexedTable2Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UIndexedTable2Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> IndexedTable2Table = Data->GetOrAdd(TableName); + + // Register a new multi-key B-Tree index named "player_id_snazz_index" on the IndexedTable2Table. + IndexedTable2Table->AddMultiKeyBTreeIndex>( + TEXT("player_id_snazz_index"), + [](const FIndexedTable2Type& Row) + { + // This tuple is stored in the B-Tree index for fast composite key lookups. + return MakeTuple(Row.PlayerId, Row.PlayerSnazz); + } + ); + + PlayerIdSnazzIndex = NewObject(this); + PlayerIdSnazzIndex->SetCache(IndexedTable2Table); + + /***/ +} + +FTableAppliedDiff UIndexedTable2Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UIndexedTable2Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UIndexedTable2Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/IndexedTableTable.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/IndexedTableTable.g.cpp new file mode 100644 index 00000000000..5f4755f7b1b --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/IndexedTableTable.g.cpp @@ -0,0 +1,48 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/IndexedTableTable.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UIndexedTableTable::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> IndexedTableTable = Data->GetOrAdd(TableName); + + // Register a new multi-key B-Tree index named "player_id" on the IndexedTableTable. + IndexedTableTable->AddMultiKeyBTreeIndex>( + TEXT("player_id"), + [](const FIndexedTableType& Row) + { + // This tuple is stored in the B-Tree index for fast composite key lookups. + return MakeTuple(Row.PlayerId); + } + ); + + PlayerId = NewObject(this); + PlayerId->SetCache(IndexedTableTable); + + /***/ +} + +FTableAppliedDiff UIndexedTableTable::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UIndexedTableTable::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UIndexedTableTable::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/LargeTableTable.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/LargeTableTable.g.cpp new file mode 100644 index 00000000000..5479b74f9c3 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/LargeTableTable.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/LargeTableTable.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void ULargeTableTable::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> LargeTableTable = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff ULargeTableTable::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 ULargeTableTable::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray ULargeTableTable::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneBoolTable.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneBoolTable.g.cpp new file mode 100644 index 00000000000..6c576fbffdd --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneBoolTable.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/OneBoolTable.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UOneBoolTable::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> OneBoolTable = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UOneBoolTable::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UOneBoolTable::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UOneBoolTable::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneByteStructTable.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneByteStructTable.g.cpp new file mode 100644 index 00000000000..a4c91797374 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneByteStructTable.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/OneByteStructTable.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UOneByteStructTable::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> OneByteStructTable = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UOneByteStructTable::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UOneByteStructTable::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UOneByteStructTable::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneConnectionIdTable.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneConnectionIdTable.g.cpp new file mode 100644 index 00000000000..72fe25b9ddc --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneConnectionIdTable.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/OneConnectionIdTable.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UOneConnectionIdTable::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> OneConnectionIdTable = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UOneConnectionIdTable::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UOneConnectionIdTable::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UOneConnectionIdTable::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneEnumWithPayloadTable.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneEnumWithPayloadTable.g.cpp new file mode 100644 index 00000000000..634cccb0524 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneEnumWithPayloadTable.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/OneEnumWithPayloadTable.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UOneEnumWithPayloadTable::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> OneEnumWithPayloadTable = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UOneEnumWithPayloadTable::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UOneEnumWithPayloadTable::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UOneEnumWithPayloadTable::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneEveryPrimitiveStructTable.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneEveryPrimitiveStructTable.g.cpp new file mode 100644 index 00000000000..0cf659af4fd --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneEveryPrimitiveStructTable.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/OneEveryPrimitiveStructTable.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UOneEveryPrimitiveStructTable::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> OneEveryPrimitiveStructTable = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UOneEveryPrimitiveStructTable::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UOneEveryPrimitiveStructTable::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UOneEveryPrimitiveStructTable::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneEveryVecStructTable.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneEveryVecStructTable.g.cpp new file mode 100644 index 00000000000..7c27523e51b --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneEveryVecStructTable.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/OneEveryVecStructTable.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UOneEveryVecStructTable::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> OneEveryVecStructTable = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UOneEveryVecStructTable::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UOneEveryVecStructTable::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UOneEveryVecStructTable::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneF32Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneF32Table.g.cpp new file mode 100644 index 00000000000..3f3b5666603 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneF32Table.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/OneF32Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UOneF32Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> OneF32Table = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UOneF32Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UOneF32Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UOneF32Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneF64Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneF64Table.g.cpp new file mode 100644 index 00000000000..f5e29b04e5f --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneF64Table.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/OneF64Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UOneF64Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> OneF64Table = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UOneF64Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UOneF64Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UOneF64Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneI128Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneI128Table.g.cpp new file mode 100644 index 00000000000..8b1214d2da8 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneI128Table.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/OneI128Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UOneI128Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> OneI128Table = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UOneI128Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UOneI128Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UOneI128Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneI16Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneI16Table.g.cpp new file mode 100644 index 00000000000..dbf5661464c --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneI16Table.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/OneI16Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UOneI16Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> OneI16Table = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UOneI16Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UOneI16Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UOneI16Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneI256Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneI256Table.g.cpp new file mode 100644 index 00000000000..3a6ab5077e4 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneI256Table.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/OneI256Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UOneI256Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> OneI256Table = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UOneI256Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UOneI256Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UOneI256Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneI32Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneI32Table.g.cpp new file mode 100644 index 00000000000..18d180bea39 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneI32Table.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/OneI32Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UOneI32Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> OneI32Table = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UOneI32Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UOneI32Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UOneI32Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneI64Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneI64Table.g.cpp new file mode 100644 index 00000000000..e032608d648 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneI64Table.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/OneI64Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UOneI64Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> OneI64Table = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UOneI64Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UOneI64Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UOneI64Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneI8Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneI8Table.g.cpp new file mode 100644 index 00000000000..269d13b07d2 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneI8Table.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/OneI8Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UOneI8Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> OneI8Table = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UOneI8Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UOneI8Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UOneI8Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneIdentityTable.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneIdentityTable.g.cpp new file mode 100644 index 00000000000..7c3b0b4931c --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneIdentityTable.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/OneIdentityTable.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UOneIdentityTable::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> OneIdentityTable = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UOneIdentityTable::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UOneIdentityTable::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UOneIdentityTable::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneSimpleEnumTable.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneSimpleEnumTable.g.cpp new file mode 100644 index 00000000000..513a2c56320 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneSimpleEnumTable.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/OneSimpleEnumTable.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UOneSimpleEnumTable::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> OneSimpleEnumTable = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UOneSimpleEnumTable::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UOneSimpleEnumTable::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UOneSimpleEnumTable::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneStringTable.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneStringTable.g.cpp new file mode 100644 index 00000000000..55726a4239d --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneStringTable.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/OneStringTable.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UOneStringTable::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> OneStringTable = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UOneStringTable::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UOneStringTable::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UOneStringTable::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneTimestampTable.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneTimestampTable.g.cpp new file mode 100644 index 00000000000..ae82d0a3f6f --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneTimestampTable.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/OneTimestampTable.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UOneTimestampTable::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> OneTimestampTable = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UOneTimestampTable::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UOneTimestampTable::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UOneTimestampTable::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneU128Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneU128Table.g.cpp new file mode 100644 index 00000000000..c4ee3be9403 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneU128Table.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/OneU128Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UOneU128Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> OneU128Table = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UOneU128Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UOneU128Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UOneU128Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneU16Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneU16Table.g.cpp new file mode 100644 index 00000000000..8457ee37bae --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneU16Table.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/OneU16Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UOneU16Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> OneU16Table = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UOneU16Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UOneU16Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UOneU16Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneU256Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneU256Table.g.cpp new file mode 100644 index 00000000000..d1c5313da5b --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneU256Table.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/OneU256Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UOneU256Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> OneU256Table = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UOneU256Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UOneU256Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UOneU256Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneU32Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneU32Table.g.cpp new file mode 100644 index 00000000000..14582bd27df --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneU32Table.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/OneU32Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UOneU32Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> OneU32Table = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UOneU32Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UOneU32Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UOneU32Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneU64Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneU64Table.g.cpp new file mode 100644 index 00000000000..1689993cee9 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneU64Table.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/OneU64Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UOneU64Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> OneU64Table = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UOneU64Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UOneU64Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UOneU64Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneU8Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneU8Table.g.cpp new file mode 100644 index 00000000000..acf3f2c351e --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneU8Table.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/OneU8Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UOneU8Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> OneU8Table = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UOneU8Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UOneU8Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UOneU8Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneUnitStructTable.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneUnitStructTable.g.cpp new file mode 100644 index 00000000000..82f2a986335 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OneUnitStructTable.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/OneUnitStructTable.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UOneUnitStructTable::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> OneUnitStructTable = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UOneUnitStructTable::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UOneUnitStructTable::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UOneUnitStructTable::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OptionEveryPrimitiveStructTable.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OptionEveryPrimitiveStructTable.g.cpp new file mode 100644 index 00000000000..63d96f36f76 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OptionEveryPrimitiveStructTable.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/OptionEveryPrimitiveStructTable.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UOptionEveryPrimitiveStructTable::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> OptionEveryPrimitiveStructTable = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UOptionEveryPrimitiveStructTable::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UOptionEveryPrimitiveStructTable::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UOptionEveryPrimitiveStructTable::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OptionI32Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OptionI32Table.g.cpp new file mode 100644 index 00000000000..d705338463d --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OptionI32Table.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/OptionI32Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UOptionI32Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> OptionI32Table = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UOptionI32Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UOptionI32Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UOptionI32Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OptionIdentityTable.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OptionIdentityTable.g.cpp new file mode 100644 index 00000000000..9096ac1a259 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OptionIdentityTable.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/OptionIdentityTable.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UOptionIdentityTable::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> OptionIdentityTable = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UOptionIdentityTable::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UOptionIdentityTable::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UOptionIdentityTable::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OptionSimpleEnumTable.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OptionSimpleEnumTable.g.cpp new file mode 100644 index 00000000000..71fd1c0c88a --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OptionSimpleEnumTable.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/OptionSimpleEnumTable.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UOptionSimpleEnumTable::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> OptionSimpleEnumTable = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UOptionSimpleEnumTable::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UOptionSimpleEnumTable::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UOptionSimpleEnumTable::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OptionStringTable.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OptionStringTable.g.cpp new file mode 100644 index 00000000000..b11672d17ae --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OptionStringTable.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/OptionStringTable.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UOptionStringTable::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> OptionStringTable = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UOptionStringTable::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UOptionStringTable::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UOptionStringTable::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OptionVecOptionI32Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OptionVecOptionI32Table.g.cpp new file mode 100644 index 00000000000..d9b55c4b80b --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/OptionVecOptionI32Table.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/OptionVecOptionI32Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UOptionVecOptionI32Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> OptionVecOptionI32Table = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UOptionVecOptionI32Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UOptionVecOptionI32Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UOptionVecOptionI32Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkBoolTable.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkBoolTable.g.cpp new file mode 100644 index 00000000000..7950538cc32 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkBoolTable.g.cpp @@ -0,0 +1,47 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/PkBoolTable.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UPkBoolTable::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> PkBoolTable = Data->GetOrAdd(TableName); + PkBoolTable->AddUniqueConstraint("b", [](const FPkBoolType& Row) -> const bool& { + return Row.B; }); + + B = NewObject(this); + B->SetCache(PkBoolTable); + + /***/ +} + +FTableAppliedDiff UPkBoolTable::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + Diff.DeriveUpdatesByPrimaryKey( + [](const FPkBoolType& Row) + { + return Row.B; + } + ); + + return Diff; +} + +int32 UPkBoolTable::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UPkBoolTable::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkConnectionIdTable.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkConnectionIdTable.g.cpp new file mode 100644 index 00000000000..d0732cfb1a6 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkConnectionIdTable.g.cpp @@ -0,0 +1,47 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/PkConnectionIdTable.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UPkConnectionIdTable::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> PkConnectionIdTable = Data->GetOrAdd(TableName); + PkConnectionIdTable->AddUniqueConstraint("a", [](const FPkConnectionIdType& Row) -> const FSpacetimeDBConnectionId& { + return Row.A; }); + + A = NewObject(this); + A->SetCache(PkConnectionIdTable); + + /***/ +} + +FTableAppliedDiff UPkConnectionIdTable::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + Diff.DeriveUpdatesByPrimaryKey( + [](const FPkConnectionIdType& Row) + { + return Row.A; + } + ); + + return Diff; +} + +int32 UPkConnectionIdTable::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UPkConnectionIdTable::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkI128Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkI128Table.g.cpp new file mode 100644 index 00000000000..d6d13175c9f --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkI128Table.g.cpp @@ -0,0 +1,47 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/PkI128Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UPkI128Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> PkI128Table = Data->GetOrAdd(TableName); + PkI128Table->AddUniqueConstraint("n", [](const FPkI128Type& Row) -> const FSpacetimeDBInt128& { + return Row.N; }); + + N = NewObject(this); + N->SetCache(PkI128Table); + + /***/ +} + +FTableAppliedDiff UPkI128Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + Diff.DeriveUpdatesByPrimaryKey( + [](const FPkI128Type& Row) + { + return Row.N; + } + ); + + return Diff; +} + +int32 UPkI128Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UPkI128Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkI16Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkI16Table.g.cpp new file mode 100644 index 00000000000..57dccc9c103 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkI16Table.g.cpp @@ -0,0 +1,47 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/PkI16Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UPkI16Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> PkI16Table = Data->GetOrAdd(TableName); + PkI16Table->AddUniqueConstraint("n", [](const FPkI16Type& Row) -> const int16& { + return Row.N; }); + + N = NewObject(this); + N->SetCache(PkI16Table); + + /***/ +} + +FTableAppliedDiff UPkI16Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + Diff.DeriveUpdatesByPrimaryKey( + [](const FPkI16Type& Row) + { + return Row.N; + } + ); + + return Diff; +} + +int32 UPkI16Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UPkI16Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkI256Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkI256Table.g.cpp new file mode 100644 index 00000000000..6c5732dc982 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkI256Table.g.cpp @@ -0,0 +1,47 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/PkI256Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UPkI256Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> PkI256Table = Data->GetOrAdd(TableName); + PkI256Table->AddUniqueConstraint("n", [](const FPkI256Type& Row) -> const FSpacetimeDBInt256& { + return Row.N; }); + + N = NewObject(this); + N->SetCache(PkI256Table); + + /***/ +} + +FTableAppliedDiff UPkI256Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + Diff.DeriveUpdatesByPrimaryKey( + [](const FPkI256Type& Row) + { + return Row.N; + } + ); + + return Diff; +} + +int32 UPkI256Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UPkI256Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkI32Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkI32Table.g.cpp new file mode 100644 index 00000000000..fd548540bbc --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkI32Table.g.cpp @@ -0,0 +1,47 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/PkI32Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UPkI32Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> PkI32Table = Data->GetOrAdd(TableName); + PkI32Table->AddUniqueConstraint("n", [](const FPkI32Type& Row) -> const int32& { + return Row.N; }); + + N = NewObject(this); + N->SetCache(PkI32Table); + + /***/ +} + +FTableAppliedDiff UPkI32Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + Diff.DeriveUpdatesByPrimaryKey( + [](const FPkI32Type& Row) + { + return Row.N; + } + ); + + return Diff; +} + +int32 UPkI32Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UPkI32Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkI64Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkI64Table.g.cpp new file mode 100644 index 00000000000..5692c47de8c --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkI64Table.g.cpp @@ -0,0 +1,47 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/PkI64Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UPkI64Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> PkI64Table = Data->GetOrAdd(TableName); + PkI64Table->AddUniqueConstraint("n", [](const FPkI64Type& Row) -> const int64& { + return Row.N; }); + + N = NewObject(this); + N->SetCache(PkI64Table); + + /***/ +} + +FTableAppliedDiff UPkI64Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + Diff.DeriveUpdatesByPrimaryKey( + [](const FPkI64Type& Row) + { + return Row.N; + } + ); + + return Diff; +} + +int32 UPkI64Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UPkI64Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkI8Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkI8Table.g.cpp new file mode 100644 index 00000000000..7e04ae45e09 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkI8Table.g.cpp @@ -0,0 +1,47 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/PkI8Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UPkI8Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> PkI8Table = Data->GetOrAdd(TableName); + PkI8Table->AddUniqueConstraint("n", [](const FPkI8Type& Row) -> const int8& { + return Row.N; }); + + N = NewObject(this); + N->SetCache(PkI8Table); + + /***/ +} + +FTableAppliedDiff UPkI8Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + Diff.DeriveUpdatesByPrimaryKey( + [](const FPkI8Type& Row) + { + return Row.N; + } + ); + + return Diff; +} + +int32 UPkI8Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UPkI8Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkIdentityTable.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkIdentityTable.g.cpp new file mode 100644 index 00000000000..0330a508125 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkIdentityTable.g.cpp @@ -0,0 +1,47 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/PkIdentityTable.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UPkIdentityTable::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> PkIdentityTable = Data->GetOrAdd(TableName); + PkIdentityTable->AddUniqueConstraint("i", [](const FPkIdentityType& Row) -> const FSpacetimeDBIdentity& { + return Row.I; }); + + I = NewObject(this); + I->SetCache(PkIdentityTable); + + /***/ +} + +FTableAppliedDiff UPkIdentityTable::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + Diff.DeriveUpdatesByPrimaryKey( + [](const FPkIdentityType& Row) + { + return Row.I; + } + ); + + return Diff; +} + +int32 UPkIdentityTable::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UPkIdentityTable::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkSimpleEnumTable.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkSimpleEnumTable.g.cpp new file mode 100644 index 00000000000..c1500effca2 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkSimpleEnumTable.g.cpp @@ -0,0 +1,47 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/PkSimpleEnumTable.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UPkSimpleEnumTable::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> PkSimpleEnumTable = Data->GetOrAdd(TableName); + PkSimpleEnumTable->AddUniqueConstraint("a", [](const FPkSimpleEnumType& Row) -> const ESimpleEnumType& { + return Row.A; }); + + A = NewObject(this); + A->SetCache(PkSimpleEnumTable); + + /***/ +} + +FTableAppliedDiff UPkSimpleEnumTable::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + Diff.DeriveUpdatesByPrimaryKey( + [](const FPkSimpleEnumType& Row) + { + return Row.A; + } + ); + + return Diff; +} + +int32 UPkSimpleEnumTable::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UPkSimpleEnumTable::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkStringTable.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkStringTable.g.cpp new file mode 100644 index 00000000000..7fc5bf7766c --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkStringTable.g.cpp @@ -0,0 +1,47 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/PkStringTable.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UPkStringTable::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> PkStringTable = Data->GetOrAdd(TableName); + PkStringTable->AddUniqueConstraint("s", [](const FPkStringType& Row) -> const FString& { + return Row.S; }); + + S = NewObject(this); + S->SetCache(PkStringTable); + + /***/ +} + +FTableAppliedDiff UPkStringTable::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + Diff.DeriveUpdatesByPrimaryKey( + [](const FPkStringType& Row) + { + return Row.S; + } + ); + + return Diff; +} + +int32 UPkStringTable::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UPkStringTable::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkU128Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkU128Table.g.cpp new file mode 100644 index 00000000000..07044f9c3ad --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkU128Table.g.cpp @@ -0,0 +1,47 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/PkU128Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UPkU128Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> PkU128Table = Data->GetOrAdd(TableName); + PkU128Table->AddUniqueConstraint("n", [](const FPkU128Type& Row) -> const FSpacetimeDBUInt128& { + return Row.N; }); + + N = NewObject(this); + N->SetCache(PkU128Table); + + /***/ +} + +FTableAppliedDiff UPkU128Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + Diff.DeriveUpdatesByPrimaryKey( + [](const FPkU128Type& Row) + { + return Row.N; + } + ); + + return Diff; +} + +int32 UPkU128Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UPkU128Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkU16Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkU16Table.g.cpp new file mode 100644 index 00000000000..e2d9f41d015 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkU16Table.g.cpp @@ -0,0 +1,47 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/PkU16Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UPkU16Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> PkU16Table = Data->GetOrAdd(TableName); + PkU16Table->AddUniqueConstraint("n", [](const FPkU16Type& Row) -> const uint16& { + return Row.N; }); + + N = NewObject(this); + N->SetCache(PkU16Table); + + /***/ +} + +FTableAppliedDiff UPkU16Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + Diff.DeriveUpdatesByPrimaryKey( + [](const FPkU16Type& Row) + { + return Row.N; + } + ); + + return Diff; +} + +int32 UPkU16Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UPkU16Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkU256Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkU256Table.g.cpp new file mode 100644 index 00000000000..759ecb90301 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkU256Table.g.cpp @@ -0,0 +1,47 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/PkU256Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UPkU256Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> PkU256Table = Data->GetOrAdd(TableName); + PkU256Table->AddUniqueConstraint("n", [](const FPkU256Type& Row) -> const FSpacetimeDBUInt256& { + return Row.N; }); + + N = NewObject(this); + N->SetCache(PkU256Table); + + /***/ +} + +FTableAppliedDiff UPkU256Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + Diff.DeriveUpdatesByPrimaryKey( + [](const FPkU256Type& Row) + { + return Row.N; + } + ); + + return Diff; +} + +int32 UPkU256Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UPkU256Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkU32Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkU32Table.g.cpp new file mode 100644 index 00000000000..aa7531ba932 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkU32Table.g.cpp @@ -0,0 +1,47 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/PkU32Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UPkU32Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> PkU32Table = Data->GetOrAdd(TableName); + PkU32Table->AddUniqueConstraint("n", [](const FPkU32Type& Row) -> const uint32& { + return Row.N; }); + + N = NewObject(this); + N->SetCache(PkU32Table); + + /***/ +} + +FTableAppliedDiff UPkU32Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + Diff.DeriveUpdatesByPrimaryKey( + [](const FPkU32Type& Row) + { + return Row.N; + } + ); + + return Diff; +} + +int32 UPkU32Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UPkU32Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkU32TwoTable.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkU32TwoTable.g.cpp new file mode 100644 index 00000000000..61c4a3dc83e --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkU32TwoTable.g.cpp @@ -0,0 +1,47 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/PkU32TwoTable.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UPkU32TwoTable::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> PkU32TwoTable = Data->GetOrAdd(TableName); + PkU32TwoTable->AddUniqueConstraint("n", [](const FPkU32TwoType& Row) -> const uint32& { + return Row.N; }); + + N = NewObject(this); + N->SetCache(PkU32TwoTable); + + /***/ +} + +FTableAppliedDiff UPkU32TwoTable::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + Diff.DeriveUpdatesByPrimaryKey( + [](const FPkU32TwoType& Row) + { + return Row.N; + } + ); + + return Diff; +} + +int32 UPkU32TwoTable::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UPkU32TwoTable::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkU64Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkU64Table.g.cpp new file mode 100644 index 00000000000..3620ecca8b1 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkU64Table.g.cpp @@ -0,0 +1,47 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/PkU64Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UPkU64Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> PkU64Table = Data->GetOrAdd(TableName); + PkU64Table->AddUniqueConstraint("n", [](const FPkU64Type& Row) -> const uint64& { + return Row.N; }); + + N = NewObject(this); + N->SetCache(PkU64Table); + + /***/ +} + +FTableAppliedDiff UPkU64Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + Diff.DeriveUpdatesByPrimaryKey( + [](const FPkU64Type& Row) + { + return Row.N; + } + ); + + return Diff; +} + +int32 UPkU64Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UPkU64Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkU8Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkU8Table.g.cpp new file mode 100644 index 00000000000..eff15db94ec --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/PkU8Table.g.cpp @@ -0,0 +1,47 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/PkU8Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UPkU8Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> PkU8Table = Data->GetOrAdd(TableName); + PkU8Table->AddUniqueConstraint("n", [](const FPkU8Type& Row) -> const uint8& { + return Row.N; }); + + N = NewObject(this); + N->SetCache(PkU8Table); + + /***/ +} + +FTableAppliedDiff UPkU8Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + Diff.DeriveUpdatesByPrimaryKey( + [](const FPkU8Type& Row) + { + return Row.N; + } + ); + + return Diff; +} + +int32 UPkU8Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UPkU8Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/ScheduledTableTable.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/ScheduledTableTable.g.cpp new file mode 100644 index 00000000000..0d5e86dbf78 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/ScheduledTableTable.g.cpp @@ -0,0 +1,47 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/ScheduledTableTable.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UScheduledTableTable::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> ScheduledTableTable = Data->GetOrAdd(TableName); + ScheduledTableTable->AddUniqueConstraint("scheduled_id", [](const FScheduledTableType& Row) -> const uint64& { + return Row.ScheduledId; }); + + ScheduledId = NewObject(this); + ScheduledId->SetCache(ScheduledTableTable); + + /***/ +} + +FTableAppliedDiff UScheduledTableTable::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + Diff.DeriveUpdatesByPrimaryKey( + [](const FScheduledTableType& Row) + { + return Row.ScheduledId; + } + ); + + return Diff; +} + +int32 UScheduledTableTable::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UScheduledTableTable::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/TableHoldsTableTable.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/TableHoldsTableTable.g.cpp new file mode 100644 index 00000000000..5d2cd45adc1 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/TableHoldsTableTable.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/TableHoldsTableTable.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UTableHoldsTableTable::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> TableHoldsTableTable = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UTableHoldsTableTable::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UTableHoldsTableTable::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UTableHoldsTableTable::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UniqueBoolTable.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UniqueBoolTable.g.cpp new file mode 100644 index 00000000000..1cc212da76d --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UniqueBoolTable.g.cpp @@ -0,0 +1,40 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/UniqueBoolTable.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UUniqueBoolTable::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> UniqueBoolTable = Data->GetOrAdd(TableName); + UniqueBoolTable->AddUniqueConstraint("b", [](const FUniqueBoolType& Row) -> const bool& { + return Row.B; }); + + B = NewObject(this); + B->SetCache(UniqueBoolTable); + + /***/ +} + +FTableAppliedDiff UUniqueBoolTable::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UUniqueBoolTable::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UUniqueBoolTable::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UniqueConnectionIdTable.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UniqueConnectionIdTable.g.cpp new file mode 100644 index 00000000000..a474dcfaa78 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UniqueConnectionIdTable.g.cpp @@ -0,0 +1,40 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/UniqueConnectionIdTable.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UUniqueConnectionIdTable::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> UniqueConnectionIdTable = Data->GetOrAdd(TableName); + UniqueConnectionIdTable->AddUniqueConstraint("a", [](const FUniqueConnectionIdType& Row) -> const FSpacetimeDBConnectionId& { + return Row.A; }); + + A = NewObject(this); + A->SetCache(UniqueConnectionIdTable); + + /***/ +} + +FTableAppliedDiff UUniqueConnectionIdTable::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UUniqueConnectionIdTable::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UUniqueConnectionIdTable::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UniqueI128Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UniqueI128Table.g.cpp new file mode 100644 index 00000000000..f5f4029db7e --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UniqueI128Table.g.cpp @@ -0,0 +1,40 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/UniqueI128Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UUniqueI128Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> UniqueI128Table = Data->GetOrAdd(TableName); + UniqueI128Table->AddUniqueConstraint("n", [](const FUniqueI128Type& Row) -> const FSpacetimeDBInt128& { + return Row.N; }); + + N = NewObject(this); + N->SetCache(UniqueI128Table); + + /***/ +} + +FTableAppliedDiff UUniqueI128Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UUniqueI128Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UUniqueI128Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UniqueI16Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UniqueI16Table.g.cpp new file mode 100644 index 00000000000..dbbca259599 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UniqueI16Table.g.cpp @@ -0,0 +1,40 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/UniqueI16Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UUniqueI16Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> UniqueI16Table = Data->GetOrAdd(TableName); + UniqueI16Table->AddUniqueConstraint("n", [](const FUniqueI16Type& Row) -> const int16& { + return Row.N; }); + + N = NewObject(this); + N->SetCache(UniqueI16Table); + + /***/ +} + +FTableAppliedDiff UUniqueI16Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UUniqueI16Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UUniqueI16Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UniqueI256Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UniqueI256Table.g.cpp new file mode 100644 index 00000000000..7a8de48399c --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UniqueI256Table.g.cpp @@ -0,0 +1,40 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/UniqueI256Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UUniqueI256Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> UniqueI256Table = Data->GetOrAdd(TableName); + UniqueI256Table->AddUniqueConstraint("n", [](const FUniqueI256Type& Row) -> const FSpacetimeDBInt256& { + return Row.N; }); + + N = NewObject(this); + N->SetCache(UniqueI256Table); + + /***/ +} + +FTableAppliedDiff UUniqueI256Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UUniqueI256Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UUniqueI256Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UniqueI32Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UniqueI32Table.g.cpp new file mode 100644 index 00000000000..3c479bba3ec --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UniqueI32Table.g.cpp @@ -0,0 +1,40 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/UniqueI32Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UUniqueI32Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> UniqueI32Table = Data->GetOrAdd(TableName); + UniqueI32Table->AddUniqueConstraint("n", [](const FUniqueI32Type& Row) -> const int32& { + return Row.N; }); + + N = NewObject(this); + N->SetCache(UniqueI32Table); + + /***/ +} + +FTableAppliedDiff UUniqueI32Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UUniqueI32Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UUniqueI32Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UniqueI64Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UniqueI64Table.g.cpp new file mode 100644 index 00000000000..d477da72592 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UniqueI64Table.g.cpp @@ -0,0 +1,40 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/UniqueI64Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UUniqueI64Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> UniqueI64Table = Data->GetOrAdd(TableName); + UniqueI64Table->AddUniqueConstraint("n", [](const FUniqueI64Type& Row) -> const int64& { + return Row.N; }); + + N = NewObject(this); + N->SetCache(UniqueI64Table); + + /***/ +} + +FTableAppliedDiff UUniqueI64Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UUniqueI64Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UUniqueI64Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UniqueI8Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UniqueI8Table.g.cpp new file mode 100644 index 00000000000..676a0b9b960 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UniqueI8Table.g.cpp @@ -0,0 +1,40 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/UniqueI8Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UUniqueI8Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> UniqueI8Table = Data->GetOrAdd(TableName); + UniqueI8Table->AddUniqueConstraint("n", [](const FUniqueI8Type& Row) -> const int8& { + return Row.N; }); + + N = NewObject(this); + N->SetCache(UniqueI8Table); + + /***/ +} + +FTableAppliedDiff UUniqueI8Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UUniqueI8Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UUniqueI8Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UniqueIdentityTable.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UniqueIdentityTable.g.cpp new file mode 100644 index 00000000000..5cf77e2816c --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UniqueIdentityTable.g.cpp @@ -0,0 +1,40 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/UniqueIdentityTable.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UUniqueIdentityTable::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> UniqueIdentityTable = Data->GetOrAdd(TableName); + UniqueIdentityTable->AddUniqueConstraint("i", [](const FUniqueIdentityType& Row) -> const FSpacetimeDBIdentity& { + return Row.I; }); + + I = NewObject(this); + I->SetCache(UniqueIdentityTable); + + /***/ +} + +FTableAppliedDiff UUniqueIdentityTable::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UUniqueIdentityTable::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UUniqueIdentityTable::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UniqueStringTable.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UniqueStringTable.g.cpp new file mode 100644 index 00000000000..8c63e759a52 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UniqueStringTable.g.cpp @@ -0,0 +1,40 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/UniqueStringTable.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UUniqueStringTable::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> UniqueStringTable = Data->GetOrAdd(TableName); + UniqueStringTable->AddUniqueConstraint("s", [](const FUniqueStringType& Row) -> const FString& { + return Row.S; }); + + S = NewObject(this); + S->SetCache(UniqueStringTable); + + /***/ +} + +FTableAppliedDiff UUniqueStringTable::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UUniqueStringTable::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UUniqueStringTable::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UniqueU128Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UniqueU128Table.g.cpp new file mode 100644 index 00000000000..6f0f0731098 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UniqueU128Table.g.cpp @@ -0,0 +1,40 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/UniqueU128Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UUniqueU128Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> UniqueU128Table = Data->GetOrAdd(TableName); + UniqueU128Table->AddUniqueConstraint("n", [](const FUniqueU128Type& Row) -> const FSpacetimeDBUInt128& { + return Row.N; }); + + N = NewObject(this); + N->SetCache(UniqueU128Table); + + /***/ +} + +FTableAppliedDiff UUniqueU128Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UUniqueU128Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UUniqueU128Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UniqueU16Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UniqueU16Table.g.cpp new file mode 100644 index 00000000000..ccb749ffe1e --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UniqueU16Table.g.cpp @@ -0,0 +1,40 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/UniqueU16Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UUniqueU16Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> UniqueU16Table = Data->GetOrAdd(TableName); + UniqueU16Table->AddUniqueConstraint("n", [](const FUniqueU16Type& Row) -> const uint16& { + return Row.N; }); + + N = NewObject(this); + N->SetCache(UniqueU16Table); + + /***/ +} + +FTableAppliedDiff UUniqueU16Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UUniqueU16Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UUniqueU16Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UniqueU256Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UniqueU256Table.g.cpp new file mode 100644 index 00000000000..55048c47479 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UniqueU256Table.g.cpp @@ -0,0 +1,40 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/UniqueU256Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UUniqueU256Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> UniqueU256Table = Data->GetOrAdd(TableName); + UniqueU256Table->AddUniqueConstraint("n", [](const FUniqueU256Type& Row) -> const FSpacetimeDBUInt256& { + return Row.N; }); + + N = NewObject(this); + N->SetCache(UniqueU256Table); + + /***/ +} + +FTableAppliedDiff UUniqueU256Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UUniqueU256Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UUniqueU256Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UniqueU32Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UniqueU32Table.g.cpp new file mode 100644 index 00000000000..055467806ce --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UniqueU32Table.g.cpp @@ -0,0 +1,40 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/UniqueU32Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UUniqueU32Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> UniqueU32Table = Data->GetOrAdd(TableName); + UniqueU32Table->AddUniqueConstraint("n", [](const FUniqueU32Type& Row) -> const uint32& { + return Row.N; }); + + N = NewObject(this); + N->SetCache(UniqueU32Table); + + /***/ +} + +FTableAppliedDiff UUniqueU32Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UUniqueU32Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UUniqueU32Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UniqueU64Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UniqueU64Table.g.cpp new file mode 100644 index 00000000000..edc7c05fd03 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UniqueU64Table.g.cpp @@ -0,0 +1,40 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/UniqueU64Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UUniqueU64Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> UniqueU64Table = Data->GetOrAdd(TableName); + UniqueU64Table->AddUniqueConstraint("n", [](const FUniqueU64Type& Row) -> const uint64& { + return Row.N; }); + + N = NewObject(this); + N->SetCache(UniqueU64Table); + + /***/ +} + +FTableAppliedDiff UUniqueU64Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UUniqueU64Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UUniqueU64Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UniqueU8Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UniqueU8Table.g.cpp new file mode 100644 index 00000000000..9aef7aa312e --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UniqueU8Table.g.cpp @@ -0,0 +1,40 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/UniqueU8Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UUniqueU8Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> UniqueU8Table = Data->GetOrAdd(TableName); + UniqueU8Table->AddUniqueConstraint("n", [](const FUniqueU8Type& Row) -> const uint8& { + return Row.N; }); + + N = NewObject(this); + N->SetCache(UniqueU8Table); + + /***/ +} + +FTableAppliedDiff UUniqueU8Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UUniqueU8Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UUniqueU8Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UsersTable.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UsersTable.g.cpp new file mode 100644 index 00000000000..41f17430f6e --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/UsersTable.g.cpp @@ -0,0 +1,47 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/UsersTable.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UUsersTable::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> UsersTable = Data->GetOrAdd(TableName); + UsersTable->AddUniqueConstraint("identity", [](const FUsersType& Row) -> const FSpacetimeDBIdentity& { + return Row.Identity; }); + + Identity = NewObject(this); + Identity->SetCache(UsersTable); + + /***/ +} + +FTableAppliedDiff UUsersTable::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + Diff.DeriveUpdatesByPrimaryKey( + [](const FUsersType& Row) + { + return Row.Identity; + } + ); + + return Diff; +} + +int32 UUsersTable::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UUsersTable::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecBoolTable.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecBoolTable.g.cpp new file mode 100644 index 00000000000..e33a76ef2e2 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecBoolTable.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/VecBoolTable.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UVecBoolTable::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> VecBoolTable = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UVecBoolTable::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UVecBoolTable::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UVecBoolTable::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecByteStructTable.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecByteStructTable.g.cpp new file mode 100644 index 00000000000..52b5187f4dd --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecByteStructTable.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/VecByteStructTable.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UVecByteStructTable::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> VecByteStructTable = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UVecByteStructTable::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UVecByteStructTable::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UVecByteStructTable::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecConnectionIdTable.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecConnectionIdTable.g.cpp new file mode 100644 index 00000000000..ae3e7ee6837 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecConnectionIdTable.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/VecConnectionIdTable.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UVecConnectionIdTable::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> VecConnectionIdTable = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UVecConnectionIdTable::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UVecConnectionIdTable::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UVecConnectionIdTable::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecEnumWithPayloadTable.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecEnumWithPayloadTable.g.cpp new file mode 100644 index 00000000000..46319459924 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecEnumWithPayloadTable.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/VecEnumWithPayloadTable.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UVecEnumWithPayloadTable::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> VecEnumWithPayloadTable = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UVecEnumWithPayloadTable::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UVecEnumWithPayloadTable::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UVecEnumWithPayloadTable::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecEveryPrimitiveStructTable.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecEveryPrimitiveStructTable.g.cpp new file mode 100644 index 00000000000..ebdb4e59fc7 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecEveryPrimitiveStructTable.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/VecEveryPrimitiveStructTable.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UVecEveryPrimitiveStructTable::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> VecEveryPrimitiveStructTable = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UVecEveryPrimitiveStructTable::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UVecEveryPrimitiveStructTable::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UVecEveryPrimitiveStructTable::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecEveryVecStructTable.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecEveryVecStructTable.g.cpp new file mode 100644 index 00000000000..14b20b284b1 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecEveryVecStructTable.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/VecEveryVecStructTable.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UVecEveryVecStructTable::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> VecEveryVecStructTable = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UVecEveryVecStructTable::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UVecEveryVecStructTable::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UVecEveryVecStructTable::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecF32Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecF32Table.g.cpp new file mode 100644 index 00000000000..fb05ea90800 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecF32Table.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/VecF32Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UVecF32Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> VecF32Table = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UVecF32Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UVecF32Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UVecF32Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecF64Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecF64Table.g.cpp new file mode 100644 index 00000000000..ca2a3f34fa3 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecF64Table.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/VecF64Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UVecF64Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> VecF64Table = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UVecF64Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UVecF64Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UVecF64Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecI128Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecI128Table.g.cpp new file mode 100644 index 00000000000..6f3f813849d --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecI128Table.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/VecI128Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UVecI128Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> VecI128Table = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UVecI128Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UVecI128Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UVecI128Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecI16Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecI16Table.g.cpp new file mode 100644 index 00000000000..682d6f7dea2 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecI16Table.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/VecI16Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UVecI16Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> VecI16Table = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UVecI16Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UVecI16Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UVecI16Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecI256Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecI256Table.g.cpp new file mode 100644 index 00000000000..807fb53a4f4 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecI256Table.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/VecI256Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UVecI256Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> VecI256Table = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UVecI256Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UVecI256Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UVecI256Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecI32Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecI32Table.g.cpp new file mode 100644 index 00000000000..2d02e43e7e0 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecI32Table.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/VecI32Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UVecI32Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> VecI32Table = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UVecI32Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UVecI32Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UVecI32Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecI64Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecI64Table.g.cpp new file mode 100644 index 00000000000..4d683960aef --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecI64Table.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/VecI64Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UVecI64Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> VecI64Table = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UVecI64Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UVecI64Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UVecI64Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecI8Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecI8Table.g.cpp new file mode 100644 index 00000000000..1d8afa0ef17 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecI8Table.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/VecI8Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UVecI8Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> VecI8Table = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UVecI8Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UVecI8Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UVecI8Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecIdentityTable.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecIdentityTable.g.cpp new file mode 100644 index 00000000000..627cd49210e --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecIdentityTable.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/VecIdentityTable.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UVecIdentityTable::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> VecIdentityTable = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UVecIdentityTable::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UVecIdentityTable::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UVecIdentityTable::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecSimpleEnumTable.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecSimpleEnumTable.g.cpp new file mode 100644 index 00000000000..3d026536e99 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecSimpleEnumTable.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/VecSimpleEnumTable.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UVecSimpleEnumTable::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> VecSimpleEnumTable = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UVecSimpleEnumTable::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UVecSimpleEnumTable::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UVecSimpleEnumTable::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecStringTable.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecStringTable.g.cpp new file mode 100644 index 00000000000..dafee2e97d8 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecStringTable.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/VecStringTable.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UVecStringTable::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> VecStringTable = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UVecStringTable::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UVecStringTable::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UVecStringTable::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecTimestampTable.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecTimestampTable.g.cpp new file mode 100644 index 00000000000..522245ebb79 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecTimestampTable.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/VecTimestampTable.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UVecTimestampTable::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> VecTimestampTable = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UVecTimestampTable::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UVecTimestampTable::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UVecTimestampTable::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecU128Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecU128Table.g.cpp new file mode 100644 index 00000000000..8fd47b11e56 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecU128Table.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/VecU128Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UVecU128Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> VecU128Table = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UVecU128Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UVecU128Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UVecU128Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecU16Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecU16Table.g.cpp new file mode 100644 index 00000000000..9caa1f138c1 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecU16Table.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/VecU16Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UVecU16Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> VecU16Table = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UVecU16Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UVecU16Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UVecU16Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecU256Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecU256Table.g.cpp new file mode 100644 index 00000000000..7f0f085a15e --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecU256Table.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/VecU256Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UVecU256Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> VecU256Table = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UVecU256Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UVecU256Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UVecU256Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecU32Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecU32Table.g.cpp new file mode 100644 index 00000000000..ecf69e94ef7 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecU32Table.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/VecU32Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UVecU32Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> VecU32Table = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UVecU32Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UVecU32Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UVecU32Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecU64Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecU64Table.g.cpp new file mode 100644 index 00000000000..cbe962285a6 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecU64Table.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/VecU64Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UVecU64Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> VecU64Table = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UVecU64Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UVecU64Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UVecU64Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecU8Table.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecU8Table.g.cpp new file mode 100644 index 00000000000..856f139fdfd --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecU8Table.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/VecU8Table.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UVecU8Table::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> VecU8Table = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UVecU8Table::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UVecU8Table::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UVecU8Table::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecUnitStructTable.g.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecUnitStructTable.g.cpp new file mode 100644 index 00000000000..f7688bda6c6 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/ModuleBindings/Tables/VecUnitStructTable.g.cpp @@ -0,0 +1,35 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#include "ModuleBindings/Tables/VecUnitStructTable.g.h" +#include "DBCache/UniqueIndex.h" +#include "DBCache/BTreeUniqueIndex.h" +#include "DBCache/ClientCache.h" +#include "DBCache/TableCache.h" + +void UVecUnitStructTable::PostInitialize() +{ + /** Client cache init and setting up indexes*/ + Data = MakeShared>(); + + TSharedPtr> VecUnitStructTable = Data->GetOrAdd(TableName); + + /***/ +} + +FTableAppliedDiff UVecUnitStructTable::Update(TArray> InsertsRef, TArray> DeletesRef) +{ + FTableAppliedDiff Diff = BaseUpdate(InsertsRef, DeletesRef, Data, TableName); + + return Diff; +} + +int32 UVecUnitStructTable::Count() const +{ + return GetRowCountFromTable(Data, TableName); +} + +TArray UVecUnitStructTable::Iter() const +{ + return GetAllRowsFromTable(Data, TableName); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/Tests/CommonTestFunctions.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/Tests/CommonTestFunctions.cpp new file mode 100644 index 00000000000..f440f37a790 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/Tests/CommonTestFunctions.cpp @@ -0,0 +1,383 @@ +#include "Tests/CommonTestFunctions.h" +#include "UObject/UnrealType.h" +#include "Connection/Credentials.h" + +void UTestHelperDelegates::HandleConnect(UDbConnection* Conn, FSpacetimeDBIdentity Identity, const FString& Token) +{ + if (OnConnect) + { + OnConnect(Conn, Identity, Token); + } +} + +void UTestHelperDelegates::HandleConnectError(UDbConnection* Conn, const FString& Error) +{ + if (OnConnectError) + { + OnConnectError(Conn, Error); + } +} + +void UTestHelperDelegates::HandleDisconnect(UDbConnection* Conn, const FString& Error) +{ + if (OnDisconnect) + { + OnDisconnect(Conn, Error); + } +} + +void UTestHelperDelegates::HandleSubscriptionApplied(FSubscriptionEventContext Ctx) +{ + if (OnSubscriptionApplied) + { + OnSubscriptionApplied(Ctx); + } +} + +void UTestHelperDelegates::HandleSubscriptionEnd(FSubscriptionEventContextBase Ctx) +{ + if (OnSubscriptionEnd) + { + OnSubscriptionEnd(Ctx); + } +} + +void UTestHelperDelegates::HandleSubscriptionError(FErrorContext Ctx) +{ + if (OnSubscriptionError) + { + OnSubscriptionError(Ctx); + } +} + +static int32 GetTableCount(URemoteTable* Table) +{ + if (!Table) + { + return 0; + } + UFunction* CountFunc = Table->FindFunction(TEXT("Count")); + if (!CountFunc) + { + return 0; + } + struct + { + int32 ReturnValue; + } Params; + Table->ProcessEvent(CountFunc, &Params); + return Params.ReturnValue; +} + +UDbConnection* ConnectWithThen(TSharedPtr Counter, + const FString& TestName, + TFunction WithBuilder, + TFunction Callback) +{ + + FString DbName, DbNameError; + if (!GetDbName(DbName, DbNameError)) + { + return nullptr; + } + + UCredentials::Init(TestName); + + const FString ConnectTestName = FString::Printf(TEXT("on_connect_%s"), *TestName); + Counter->Register(ConnectTestName); + + UTestHelperDelegates* TestHelper = NewObject(); + TestHelper->AddToRoot(); + + + TestHelper->OnConnect = [Counter, Callback, ConnectTestName](UDbConnection* Conn, FSpacetimeDBIdentity, const FString&) + { + Callback(Conn); + Counter->MarkSuccess(ConnectTestName); + }; + TestHelper->OnConnectError = [Counter, ConnectTestName](UDbConnection*, const FString& Error) + { + Counter->MarkFailure(ConnectTestName, FString::Printf(TEXT("Connect error: %s"), *Error)); + }; + TestHelper->OnDisconnect = [Counter, ConnectTestName](UDbConnection*, const FString& Error) + { + Counter->MarkFailure(ConnectTestName, FString::Printf(TEXT("Disconnected: %s"), *Error)); + }; + + + FOnConnectDelegate ConnectDelegate; + BIND_DELEGATE_SAFE(ConnectDelegate, TestHelper, UTestHelperDelegates, HandleConnect); + + FOnDisconnectDelegate DisconnectDelegate; + BIND_DELEGATE_SAFE(DisconnectDelegate, TestHelper, UTestHelperDelegates, HandleDisconnect); + + FOnConnectErrorDelegate ErrorDelegate; + BIND_DELEGATE_SAFE(ErrorDelegate, TestHelper, UTestHelperDelegates, HandleConnectError); + + + UDbConnectionBuilder* Builder = UDbConnection::Builder() + ->WithUri(TEXT("localhost:3000")) + ->WithModuleName(DbName) + ->OnConnect(ConnectDelegate) + ->OnDisconnect(DisconnectDelegate) + ->OnConnectError(ErrorDelegate); + + if (WithBuilder) + { + Builder = WithBuilder(Builder); + } + + UDbConnection* Conn = Builder->Build(); + + if (Conn) + { + Conn->SetAutoTicking(true); // Enable automatic ticking of the connection each frame + Conn->AddToRoot(); + } + return Conn; +} + +UDbConnection* ConnectThen(TSharedPtr Counter, + const FString& TestName, + TFunction Callback) +{ + return ConnectWithThen(Counter, TestName, nullptr, Callback); +} + +UDbConnection* Connect(TSharedPtr Counter) +{ + return ConnectThen(Counter, "", [](UDbConnection*) {}); +} + +void SubscribeAllThen(UDbConnection* Conn, + TFunction Callback) +{ + UTestHelperDelegates* TestHelper = NewObject(); + TestHelper->AddToRoot(); + + TestHelper->OnSubscriptionApplied = [Callback](FSubscriptionEventContext Ctx) + { + Callback(Ctx); + }; + TestHelper->OnSubscriptionError = [](FErrorContext Ctx) + { + checkf(false, TEXT("Subscription errored: %s"), *Ctx.Error); + }; + + FOnSubscriptionApplied SubscriptionApplyDelegate; + BIND_DELEGATE_SAFE(SubscriptionApplyDelegate, TestHelper, UTestHelperDelegates, HandleSubscriptionApplied); + + FOnSubscriptionError SubscriptionErrorDelegate; + BIND_DELEGATE_SAFE(SubscriptionErrorDelegate, TestHelper, UTestHelperDelegates, HandleSubscriptionError); + + + Conn->SubscriptionBuilder() + ->OnApplied(SubscriptionApplyDelegate) + ->OnError(SubscriptionErrorDelegate) + ->SubscribeToAllTables(); +} + +void SubscribeTheseThen(UDbConnection* Conn, + const TArray& Queries, + TFunction Callback) +{ + UTestHelperDelegates* TestHelper = NewObject(); + TestHelper->AddToRoot(); + + TestHelper->OnSubscriptionApplied = [Callback](FSubscriptionEventContext Ctx) + { + Callback(Ctx); + }; + TestHelper->OnSubscriptionError = [](FErrorContext Ctx) + { + checkf(false, TEXT("Subscription errored: %s"), *Ctx.Error); + }; + + FOnSubscriptionApplied SubscriptionApplyDelegate; + BIND_DELEGATE_SAFE(SubscriptionApplyDelegate, TestHelper, UTestHelperDelegates, HandleSubscriptionApplied); + + FOnSubscriptionError SubscriptionErrorDelegate; + BIND_DELEGATE_SAFE(SubscriptionErrorDelegate, TestHelper, UTestHelperDelegates, HandleSubscriptionError); + + Conn->SubscriptionBuilder() + ->OnApplied(SubscriptionApplyDelegate) + ->OnError(SubscriptionErrorDelegate) + ->Subscribe(Queries); +} + +bool AssertTableEmpty(FAutomationTestBase* Test, + URemoteTables* Db, + const FString& TableName) +{ + if (!Db) + { + Test->AddError(TEXT("URemoteTables is null.")); + return false; + } + + + FProperty* TableProperty = Db->GetClass()->FindPropertyByName(*TableName); + + if (!TableProperty) + { + Test->AddError(FString::Printf(TEXT("No property named '%s' found on URemoteTables."), *TableName)); + return false; + } + + FObjectProperty* ObjectProp = CastField(TableProperty); + if (!ObjectProp) + { + Test->AddError(FString::Printf(TEXT("Property '%s' is not an object property."), *TableName)); + return false; + } + + UObject* TableObject = ObjectProp->GetObjectPropertyValue_InContainer(Db); + if (!TableObject) + { + Test->AddError(FString::Printf(TEXT("Property '%s' is null."), *TableName)); + return false; + } + + UFunction* CountFunc = TableObject->FindFunction(TEXT("Count")); + if (!CountFunc || !CountFunc->GetReturnProperty() || !CountFunc->GetReturnProperty()->IsA(FIntProperty::StaticClass())) + { + Test->AddError(FString::Printf(TEXT("Function 'Count' not found or invalid on table '%s'."), *TableName)); + return false; + } + + int32 RowCount = 0; + TableObject->ProcessEvent(CountFunc, &RowCount); + + if (RowCount != 0) + { + Test->AddError(FString::Printf(TEXT("Expected table '%s' to be empty, but found %d rows."), *TableName, RowCount)); + return false; + } + + return true; +} + +bool AssertAllTablesEmpty(FAutomationTestBase* Test, URemoteTables* Db) +{ + if (!Db) + { + Test->AddError(TEXT("URemoteTables is null.")); + return false; + } + + bool bAllEmpty = true; + + for (TFieldIterator It(Db->GetClass()); It; ++It) + { + FObjectProperty* Property = *It; + UObject* PropertyValue = Property->GetObjectPropertyValue_InContainer(Db); + + if (!PropertyValue) + { + Test->AddError(FString::Printf(TEXT("Property '%s' is null."), *Property->GetName())); + bAllEmpty = false; + continue; + } + + UFunction* CountFunc = PropertyValue->FindFunction(TEXT("Count")); + + if (!CountFunc || !CountFunc->GetReturnProperty() || !CountFunc->GetReturnProperty()->IsA(FIntProperty::StaticClass())) + { + Test->AddError(FString::Printf(TEXT("Function 'Count' not found or invalid on property '%s'."), *Property->GetName())); + bAllEmpty = false; + continue; + } + + int32 RowCount = 0; + PropertyValue->ProcessEvent(CountFunc, &RowCount); + + if (RowCount > 0) + { + Test->AddError(FString::Printf(TEXT("Table '%s' is not empty (Count = %d)."), *Property->GetName(), RowCount)); + bAllEmpty = false; + } + } + + return bAllEmpty; +} + +bool GetDbName(FString& DBName, FString& Error) +{ + + const FString DbNameEnv = FPlatformMisc::GetEnvironmentVariable(TEXT("SPACETIME_SDK_TEST_DB_NAME")); + if (!DbNameEnv.IsEmpty()) + { + DBName = DbNameEnv; + return true; + } + + FString CmdValue; + if (FParse::Value(FCommandLine::Get(), TEXT("-SpacetimeDbName="), CmdValue)) + { + DBName = CmdValue; + return true; + } + + // Config fallback (lets Session Frontend runs work without CLI args) + const USpacetimeDBSettings* Settings = GetDefault(); + if (!Settings->SpacetimeDbTestName.IsEmpty()) + { + DBName = Settings->SpacetimeDbTestName; + return true; + } + + Error = TEXT("No DB name. Pass -SpacetimeDbName= or set SPACETIME_SDK_TEST_DB_NAME."); + return false; +} + +bool ValidateParameterConfig(FAutomationTestBase* Test) +{ + FString DbName; + FString DbNameError; + if (!GetDbName(DbName, DbNameError)) + { + Test->AddError(DbNameError); + return false; + } + return true; +} + +bool ReportTestResult(FAutomationTestBase& Test, const FString& TestName, TSharedPtr Counter, bool bTimedOut) +{ + bool bHasFailure = false; + + for (const FString& Msg : Counter->GetFailures()) + { + TESTLOG_FAIL(Test, TEXT("Operation - %s"), *Msg); + bHasFailure = true; + } + for(const FString& Msg : Counter->GetSuccesses()) + { + TESTLOG_SUCCESS(Test, TEXT("Operation - %s"), *Msg); + } + + + if (bTimedOut) + { + TESTLOG_FAIL(Test, TEXT("Timed out waiting for operation")); + bHasFailure = true; + } + if (Counter->IsAborted()) + { + TESTLOG_FAIL(Test, TEXT("Test aborted due to precondition failure")); + bHasFailure = true; + } + + + if (!bHasFailure) + { + TESTLOG_SUCCESS(Test, TEXT("Test Success")); + Test.TestTrue(*TestName, true); + } + else + { + TESTLOG_FAIL(Test, TEXT("Test failed")); + } + + return !bHasFailure; +} \ No newline at end of file diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/Tests/SpacetimeFullClientTests.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/Tests/SpacetimeFullClientTests.cpp new file mode 100644 index 00000000000..68e0025ec5f --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/Tests/SpacetimeFullClientTests.cpp @@ -0,0 +1,2259 @@ +#include "Tests/SpacetimeFullClientTests.h" + +#include "Tests/UmbreallaHeaderaTables.h" +#include "Tests/UmbreallaHeaderTypes.h" +#include "Tests/UmbreallaHeaderReducers.h" + +#include "CoreMinimal.h" +#include "Misc/AutomationTest.h" + +#include "ModuleBindings/SpacetimeDBClient.g.h" + +#include "Tests/TestCounter.h" +#include "Tests/CommonTestFunctions.h" +#include "Tests/TestHandler.h" + +#include "Tests/PrimitiveHandlerList.def" + +#include "Connection/Credentials.h" + +// #include "HAL/IPlatformFile.h" + +/** + * @return True if the counter is complete or if the timeout is reached. + */ +bool FWaitForTestCounter::Update() +{ + const double Timeout = 90.0; + bool bStopped = false; + bool bTimedOut = false; + + if (Counter->IsAborted()) + { + bStopped = true; + } + + if (Counter->IsComplete()) + { + bStopped = true; + } + + if (FPlatformTime::Seconds() - StartTime > Timeout) + { + bTimedOut = true; + bStopped = true; + } + + if (bStopped) + { + ReportTestResult(Test, TestName, Counter, bTimedOut); + } + + return bStopped; +} + +// Helpers +static FString TrimFloat(double V) +{ + FString S = LexToString(V); + // Remove trailing zeros after decimal and possible trailing dot + int32 Dot = INDEX_NONE; + if (S.FindChar(TEXT('.'), Dot)) + { + while (S.Len() > Dot + 1 && S.EndsWith(TEXT("0"))) + { + S.RemoveAt(S.Len() - 1); + } + if (S.EndsWith(TEXT("."))) + { + S.RemoveAt(S.Len() - 1); + } + } + if (S == TEXT("-0")) + { + S = TEXT("0"); + } + return S; +} + +static FString NormalizeTimestamp(const FSpacetimeDBTimestamp &Ts) +{ + // Headers show ToString() -> "YYYY-MM-DDTHH:MM:SS.ffffffZ" + // Your payload uses "+00:00". + FString Out = Ts.ToString(); + if (Out.EndsWith(TEXT("Z"))) + { + Out.LeftChopInline(1, EAllowShrinking::No); + Out += TEXT("+00:00"); + } + return Out; +} + +static FString NormalizeDuration(const FSpacetimeDBTimeDuration &Dur) +{ + // Headers expose microseconds; payload prints seconds with fraction. + const double Seconds = static_cast(Dur.GetMicroseconds()) / 1'000'000.0; + return TrimFloat(Seconds); +} +// + +bool FInsertPrimitiveTest::RunTest(const FString &Parameters) +{ + + TestName = "InsertPrimitive"; + + if (!ValidateParameterConfig(this)) + return false; + UInsertPrimitiveHandler *Handler = CreateTestHandler(); + +#define REG(Suffix, Expected, RowStructType) Handler->Counter->Register(TEXT("InsertOne" #Suffix)); + FOREACH_PRIMITIVE(REG) +#undef REG + + UDbConnection *Connection = ConnectThen(Handler->Counter, TestName, [this, Handler](UDbConnection *Conn) + { +#define BIND_HANDLER(Suffix, Expected, RowStructType) Conn->Db->One##Suffix->OnInsert.AddDynamic(Handler, &UInsertPrimitiveHandler::OnInsertOne##Suffix); + FOREACH_PRIMITIVE(BIND_HANDLER) +#undef BIND_HANDLER + + //Conn->Db->OneI8->OnInsert.AddDynamic(Handler, &UTestHandler::OnInsertOneI8); + + SubscribeAllThen(Conn,[this, Handler, Conn](FSubscriptionEventContext Ctx) + { + if (!AssertAllTablesEmpty(this, Conn->Db)) + { + Handler->Counter->Abort(); + return; + } + +#define CALL_INSERT(Suffix, Expected, RowStructType) Ctx.Reducers->InsertOne##Suffix(Expected); + FOREACH_PRIMITIVE(CALL_INSERT) +#undef CALL_INSERT + }); }); + + ADD_LATENT_AUTOMATION_COMMAND(FWaitForTestCounter(*this, TestName, Handler->Counter, FPlatformTime::Seconds())); + return true; +} + +bool FSubscribeAndCancelTest::RunTest(const FString &Parameters) +{ + TestName = "SubscribeAndCancel"; + + if (!ValidateParameterConfig(this)) + return false; + + TSharedPtr Counter = MakeShared(); + Counter->Register(TEXT("unsubscribe_then_called")); + + UDbConnection *Connection = ConnectThen(Counter, TestName, [this, Counter](UDbConnection *Conn) + { + UTestHelperDelegates* Helper = NewObject(); + Helper->AddToRoot(); + + Helper->OnSubscriptionError = [Counter](FErrorContext) { Counter->MarkFailure(TEXT("unsubscribe_then_called"), TEXT("Subscription errored")); }; + + FOnSubscriptionApplied AppliedDelegate; BIND_DELEGATE_SAFE(AppliedDelegate, Helper, UTestHelperDelegates, HandleSubscriptionApplied); + FOnSubscriptionError ErrorDelegate; BIND_DELEGATE_SAFE(ErrorDelegate, Helper, UTestHelperDelegates, HandleSubscriptionError); + + USubscriptionHandle* Handle = Conn->SubscriptionBuilder()->OnApplied(AppliedDelegate)->OnError(ErrorDelegate)->Subscribe({ TEXT("SELECT * FROM one_u8;") }); + + UTestHelperDelegates* EndHelper = NewObject(); + EndHelper->AddToRoot(); + EndHelper->OnSubscriptionEnd = [Counter, Handle](FSubscriptionEventContextBase) + { + (!Handle->IsActive() && Handle->IsEnded()) ? Counter->MarkSuccess(TEXT("unsubscribe_then_called")) + : Counter->MarkFailure(TEXT("unsubscribe_then_called"), TEXT("Unexpected handle state")); + }; + FSubscriptionEventDelegate EndDelegate; BIND_DELEGATE_SAFE(EndDelegate, EndHelper, UTestHelperDelegates, HandleSubscriptionEnd); + Handle->UnsubscribeThen(EndDelegate); }); + + ADD_LATENT_AUTOMATION_COMMAND(FWaitForTestCounter(*this, TestName, Counter, FPlatformTime::Seconds())); + return true; +} + +bool FSubscribeAndUnsubscribeTest::RunTest(const FString &Parameters) +{ + TestName = "SubscribeAndUnsubscribe"; + + if (!ValidateParameterConfig(this)) + return false; + + TSharedPtr Counter = MakeShared(); + Counter->Register(TEXT("unsubscribe_then_called")); + + // Use a struct to manage the state across different asynchronous calls. + struct FTestState + { + UTestHelperDelegates *Helper = nullptr; + USubscriptionHandle *Handle = nullptr; + TSharedPtr Counter; + UDbConnection *Conn = nullptr; + }; + TSharedPtr State = MakeShared(); + State->Counter = Counter; + + UDbConnection *Connection = ConnectThen(Counter, TestName, [this, State](UDbConnection *Conn) + { + State->Conn = Conn; + Conn->Reducers->InsertOneU8(1); + + State->Helper = NewObject(); + State->Helper->AddToRoot(); + + State->Helper->OnSubscriptionApplied = [State](FSubscriptionEventContext Ctx) + { + // Ensure the handle is valid and active on subscription. + if (!State->Handle || !State->Handle->IsActive() || State->Handle->IsEnded()) + { + State->Counter->MarkFailure(TEXT("unsubscribe_then_called"), TEXT("Subscription handle is not active after subscription applied.")); + State->Helper->RemoveFromRoot(); + return; + } + + if (Ctx.Db->OneU8->Count() != 1) + { + State->Counter->MarkFailure(TEXT("unsubscribe_then_called"), TEXT("Initial OneU8 row count not 1.")); + State->Helper->RemoveFromRoot(); + return; + } + + // This lambda will run when UnsubscribeThen completes. + State->Helper->OnSubscriptionEnd = [State](FSubscriptionEventContextBase) + { + // Check the final state. + if (State->Handle && State->Handle->IsEnded() && !State->Handle->IsActive()) + { + State->Counter->MarkSuccess(TEXT("unsubscribe_then_called")); + } + else + { + State->Counter->MarkFailure(TEXT("unsubscribe_then_called"), TEXT("Final handle state is incorrect.")); + } + + // Clean up after the test is complete. + if (State->Helper) + { + State->Helper->RemoveFromRoot(); + } + }; + + FSubscriptionEventDelegate EndDelegate; + BIND_DELEGATE_SAFE(EndDelegate, State->Helper, UTestHelperDelegates, HandleSubscriptionEnd); + State->Handle->UnsubscribeThen(EndDelegate); + }; + + State->Helper->OnSubscriptionError = [State](const FErrorContext& ErrorContext) + { + State->Counter->MarkFailure(TEXT("unsubscribe_then_called"), FString::Printf(TEXT("Subscription Error %s"), *ErrorContext.Error)); + if (State->Helper) + { + State->Helper->RemoveFromRoot(); + } + }; + + FOnSubscriptionApplied AppliedDelegate; BIND_DELEGATE_SAFE(AppliedDelegate, State->Helper, UTestHelperDelegates, HandleSubscriptionApplied); + FOnSubscriptionError ErrorDelegate; BIND_DELEGATE_SAFE(ErrorDelegate, State->Helper, UTestHelperDelegates, HandleSubscriptionError); + + // The handle is now stored in the state struct. + State->Handle = Conn->SubscriptionBuilder()->OnApplied(AppliedDelegate)->OnError(ErrorDelegate)->Subscribe({ TEXT("SELECT * FROM one_u8;") }); }); + + ADD_LATENT_AUTOMATION_COMMAND(FWaitForTestCounter(*this, TestName, Counter, FPlatformTime::Seconds())); + return true; +} + +bool FSubscriptionErrorSmokeTest::RunTest(const FString &Parameters) +{ + TestName = "SubscriptionErrorSmokeTest"; + + if (!ValidateParameterConfig(this)) + return false; + + TSharedPtr Counter = MakeShared(); + Counter->Register(TEXT("error_callback_is_called")); + + UDbConnection *Connection = ConnectThen(Counter, TestName, [this, Counter](UDbConnection *Conn) + { + UTestHelperDelegates* Helper = NewObject(); + Helper->AddToRoot(); + Helper->OnSubscriptionApplied = [Counter](FSubscriptionEventContext) { Counter->MarkFailure(TEXT("error_callback_is_called"), TEXT("Subscription should never be applied")); }; + Helper->OnSubscriptionError = [Counter](FErrorContext) { Counter->MarkSuccess(TEXT("error_callback_is_called")); }; + + FOnSubscriptionApplied AppliedDelegate; BIND_DELEGATE_SAFE(AppliedDelegate, Helper, UTestHelperDelegates, HandleSubscriptionApplied); + FOnSubscriptionError ErrorDelegate; BIND_DELEGATE_SAFE(ErrorDelegate, Helper, UTestHelperDelegates, HandleSubscriptionError); + + USubscriptionHandle* Handle = Conn->SubscriptionBuilder()->OnApplied(AppliedDelegate)->OnError(ErrorDelegate)->Subscribe({ TEXT("SELEcCT * FROM one_u8;") }); }); + + ADD_LATENT_AUTOMATION_COMMAND(FWaitForTestCounter(*this, TestName, Counter, FPlatformTime::Seconds())); + return true; +} + +bool FDeletePrimitiveTest::RunTest(const FString &Parameters) +{ + TestName = "DeletePrimitive"; + + if (!ValidateParameterConfig(this)) + return false; + UDeletePrimitiveHandler *Handler = CreateTestHandler(); + +#define REG_UNIQUE(Suffix, Field, Literal, Expected, RowStructType) \ + Handler->Counter->Register(TEXT("InsertUnique" #Suffix)); \ + Handler->Counter->Register(TEXT("DeleteUnique" #Suffix)); + FOREACH_UNIQUE_PRIMITIVE(REG_UNIQUE) +#undef REG_UNIQUE + + UDbConnection *Connection = ConnectThen(Handler->Counter, TestName, [this, Handler](UDbConnection *Conn) + { +#define BIND_UNIQUE(Suffix, Field, Literal, Expected, RowStructType) \ + Conn->Db->Unique##Suffix->OnInsert.AddDynamic(Handler, &UDeletePrimitiveHandler::OnInsertUnique##Suffix); \ + Conn->Db->Unique##Suffix->OnDelete.AddDynamic(Handler, &UDeletePrimitiveHandler::OnDeleteUnique##Suffix); + FOREACH_UNIQUE_PRIMITIVE(BIND_UNIQUE) +#undef BIND_UNIQUE + + SubscribeAllThen(Conn, [Handler](FSubscriptionEventContext Ctx) + { +#define CALL_UNIQUE(Suffix, Field, Literal, Expected, RowStructType) Ctx.Reducers->InsertUnique##Suffix(Literal, Expected); + FOREACH_UNIQUE_PRIMITIVE(CALL_UNIQUE) +#undef CALL_UNIQUE + }); }); + + ADD_LATENT_AUTOMATION_COMMAND(FWaitForTestCounter(*this, TestName, Handler->Counter, FPlatformTime::Seconds())); + return true; +} + +bool FUpdatePrimitiveTest::RunTest(const FString &Parameters) +{ + TestName = "UpdatePrimitive"; + + if (!ValidateParameterConfig(this)) + return false; + UUpdatePrimitiveHandler *Handler = CreateTestHandler(); + +#define REG_PK(Suffix, Field, Literal, Expected, Updated, RowStructType) \ + Handler->Counter->Register(TEXT("InsertPk" #Suffix)); \ + Handler->Counter->Register(TEXT("UpdatePk" #Suffix)); \ + Handler->Counter->Register(TEXT("DeletePk" #Suffix)); + FOREACH_PK_PRIMITIVE(REG_PK) +#undef REG_PK + + UDbConnection *Connection = ConnectThen(Handler->Counter, TestName, [this, Handler](UDbConnection *Conn) + { +#define BIND_PK(Suffix, Field, Literal, Expected, Updated, RowStructType) \ + Conn->Db->Pk##Suffix->OnInsert.AddDynamic(Handler, &UUpdatePrimitiveHandler::OnInsertPk##Suffix); \ + Conn->Db->Pk##Suffix->OnUpdate.AddDynamic(Handler, &UUpdatePrimitiveHandler::OnUpdatePk##Suffix); \ + Conn->Db->Pk##Suffix->OnDelete.AddDynamic(Handler, &UUpdatePrimitiveHandler::OnDeletePk##Suffix); + FOREACH_PK_PRIMITIVE(BIND_PK) +#undef BIND_PK + + SubscribeAllThen(Conn, [Handler](FSubscriptionEventContext Ctx) + { +#define CALL_PK(Suffix, Field, Literal, Expected, Updated, RowStructType) Ctx.Reducers->InsertPk##Suffix(Literal, Expected); + FOREACH_PK_PRIMITIVE(CALL_PK) +#undef CALL_PK + }); }); + + ADD_LATENT_AUTOMATION_COMMAND(FWaitForTestCounter(*this, TestName, Handler->Counter, FPlatformTime::Seconds())); + return true; +} + +bool FInsertOneIdentityTest::RunTest(const FString &Parameters) +{ + TestName = "InsertIdentity"; + + if (!ValidateParameterConfig(this)) + { + return false; + } + + UIdentityActionsHandler *Handler = CreateTestHandler(); + Handler->Counter->Register(TEXT("InsertIdentity")); + + UDbConnection *Connection = ConnectThen(Handler->Counter, TestName, [this, Handler](UDbConnection *Conn) + { + Conn->Db->OneIdentity->OnInsert.AddDynamic(Handler, &UIdentityActionsHandler::OnInsertOneIdentity); + + SubscribeAllThen(Conn, [this, Handler, Conn](FSubscriptionEventContext Ctx) + { + if (!AssertAllTablesEmpty(this, Conn->Db)) + { + Handler->Counter->Abort(); + return; + } + + // Create a sample FSpacetimeDBIdentity. + FSpacetimeDBIdentity Identity; + Identity.FromHex("0xc2006697ed2cc4ebc5384a50527a92245ee7432cebe028e5648cb00a17c02a0e"); + Handler->SetExpectedValue(Identity); + + // Call the reducer to insert the new identity. + Ctx.Reducers->InsertOneIdentity(Identity); + }); }); + + ADD_LATENT_AUTOMATION_COMMAND(FWaitForTestCounter(*this, TestName, Handler->Counter, FPlatformTime::Seconds())); + return true; +} + +bool FInsertOneConnectionIdTest::RunTest(const FString &Parameters) +{ + TestName = "InsertConnectionId"; + + if (!ValidateParameterConfig(this)) + { + return false; + } + + UConnectionIdActionsHandler *Handler = CreateTestHandler(); + Handler->Counter->Register(TEXT("InsertConnectionId")); + + UDbConnection *Connection = ConnectThen(Handler->Counter, TestName, [this, Handler](UDbConnection *Conn) + { + Conn->Db->OneConnectionId->OnInsert.AddDynamic(Handler, &UConnectionIdActionsHandler::OnInsertOneConnectionId); + + SubscribeAllThen(Conn, [this, Handler, Conn](FSubscriptionEventContext Ctx) + { + if (Ctx.Db->OneConnectionId->Count() != 0) + { + Handler->Counter->Abort(); + return; + } + + // Create a sample ConnectionId. + FSpacetimeDBConnectionId ConnectionId; + Handler->SetExpectedvalue(ConnectionId, 1); + + // Call the reducer to insert the new connectionId. + Ctx.Reducers->InsertOneConnectionId(ConnectionId); + }); }); + + ADD_LATENT_AUTOMATION_COMMAND(FWaitForTestCounter(*this, TestName, Handler->Counter, FPlatformTime::Seconds())); + return true; +} + +bool FInsertUniqueConnectionIdTest::RunTest(const FString &Parameters) +{ + TestName = "InsertUniqueConnectionId"; + + if (!ValidateParameterConfig(this)) + { + return false; + } + + UConnectionIdActionsHandler *InsertHandler = CreateTestHandler(); + InsertHandler->Counter->Register(TEXT("InsertUniqueConnectionId")); + + UDbConnection *Connection = ConnectThen(InsertHandler->Counter, TestName, [this, InsertHandler](UDbConnection *Conn) + { + Conn->Db->UniqueConnectionId->OnInsert.AddDynamic(InsertHandler, &UConnectionIdActionsHandler::OnInsertUniqueConnectionId); + + SubscribeAllThen(Conn, [this, InsertHandler, Conn](FSubscriptionEventContext Ctx) + { + if (!AssertAllTablesEmpty(this, Conn->Db)) + { + InsertHandler->Counter->Abort(); + return; + } + // Create a sample FSpacetimeDBIdentity. + FSpacetimeDBConnectionId ConnectionId; + + int32 Data = 1; + InsertHandler->SetExpectedvalue(ConnectionId, Data); + + // Call the reducer to insert the identity first. + Ctx.Reducers->InsertUniqueConnectionId(ConnectionId, Data); + + }); }); + ADD_LATENT_AUTOMATION_COMMAND(FWaitForTestCounter(*this, TestName, InsertHandler->Counter, FPlatformTime::Seconds())); + return true; +} + +bool FInsertCallerIdentityTest::RunTest(const FString &Parameters) +{ + TestName = "InsertCallerIdentity"; + + if (!ValidateParameterConfig(this)) + { + return false; + } + + UIdentityActionsHandler *InsertHandler = CreateTestHandler(); + InsertHandler->Counter->Register(TEXT("InsertCallerIdentity")); + + UDbConnection *Connection = ConnectThen(InsertHandler->Counter, TestName, [this, InsertHandler](UDbConnection *Conn) + { + Conn->Db->OneIdentity->OnInsert.AddDynamic(InsertHandler, &UIdentityActionsHandler::OnInsertCallerIdentity); + + SubscribeAllThen(Conn, [this, InsertHandler, Conn](FSubscriptionEventContext Ctx) + { + if (!AssertAllTablesEmpty(this, Conn->Db)) + { + InsertHandler->Counter->Abort(); + return; + } + + // Call the reducer to insert the identity first. + Ctx.Reducers->InsertCallerOneIdentity(); + + }); }); + ADD_LATENT_AUTOMATION_COMMAND(FWaitForTestCounter(*this, TestName, InsertHandler->Counter, FPlatformTime::Seconds())); + return true; +} + +bool FInsertCallerConnectionIdTest::RunTest(const FString &Parameters) +{ + TestName = "InsertCallerConnectionId"; + + if (!ValidateParameterConfig(this)) + { + return false; + } + + UConnectionIdActionsHandler *InsertHandler = CreateTestHandler(); + InsertHandler->Counter->Register(TEXT("InsertCallerConnectionId")); + + UDbConnection *Connection = ConnectThen(InsertHandler->Counter, TestName, [this, InsertHandler](UDbConnection *Conn) + { + Conn->Db->OneConnectionId->OnInsert.AddDynamic(InsertHandler, &UConnectionIdActionsHandler::OnInsertCallerConnectionId); + + SubscribeAllThen(Conn, [this, InsertHandler, Conn](FSubscriptionEventContext Ctx) + { + if (!AssertAllTablesEmpty(this, Conn->Db)) + { + InsertHandler->Counter->Abort(); + return; + } + + // Call the reducer to insert the identity first. + Ctx.Reducers->InsertCallerOneConnectionId(); + }); }); + ADD_LATENT_AUTOMATION_COMMAND(FWaitForTestCounter(*this, TestName, InsertHandler->Counter, FPlatformTime::Seconds())); + return true; +} + +bool FInsertOneTimestampTest::RunTest(const FString &Parameters) +{ + TestName = "InsertTimestamp"; + + if (!ValidateParameterConfig(this)) + { + return false; + } + + UTimestampActionsHandler *Handler = CreateTestHandler(); + Handler->Counter->Register(TEXT("InsertTimestamp")); + + UDbConnection *Connection = ConnectThen(Handler->Counter, TestName, [this, Handler](UDbConnection *Conn) + { + Conn->Db->OneTimestamp->OnInsert.AddDynamic(Handler, &UTimestampActionsHandler::OnInsertOneTimestamp); + + SubscribeAllThen(Conn, [this, Handler, Conn](FSubscriptionEventContext Ctx) + { + if (Ctx.Db->OneTimestamp->Count() != 0) + { + Handler->Counter->Abort(); + return; + } + + FSpacetimeDBTimestamp TimeStamp; + Handler->SetExpectedvalue(TimeStamp); + + // Call the reducer to insert the new Timestamp. + Ctx.Reducers->InsertOneTimestamp(TimeStamp); + }); }); + + ADD_LATENT_AUTOMATION_COMMAND(FWaitForTestCounter(*this, TestName, Handler->Counter, FPlatformTime::Seconds())); + return true; +} + +bool FInsertCallTimestampTest::RunTest(const FString &Parameters) +{ + TestName = "InsertCallTimestamp"; + + if (!ValidateParameterConfig(this)) + { + return false; + } + + UTimestampActionsHandler *Handler = CreateTestHandler(); + Handler->Counter->Register(TEXT("InsertCallTimestamp")); + + UDbConnection *Connection = ConnectThen(Handler->Counter, TestName, [this, Handler](UDbConnection *Conn) + { + Conn->Reducers->OnInsertCallTimestamp.AddDynamic(Handler, &UTimestampActionsHandler::OnInsertCallTimestamp); + + SubscribeAllThen(Conn, [this, Handler, Conn](FSubscriptionEventContext Ctx) + { + if (Ctx.Db->OneTimestamp->Count() != 0) + { + Handler->Counter->Abort(); + return; + } + + // Call the reducer to insert the new Timestamp. + Ctx.Reducers->InsertCallTimestamp(); + }); }); + + ADD_LATENT_AUTOMATION_COMMAND(FWaitForTestCounter(*this, TestName, Handler->Counter, FPlatformTime::Seconds())); + return true; +} + +// Updates +bool FUpdatePkIdentityTest::RunTest(const FString &Parameters) +{ + TestName = "UpdateIdentity"; + + if (!ValidateParameterConfig(this)) + return false; + + UIdentityActionsHandler *Handler = CreateTestHandler(); + Handler->Counter->Register(TEXT("PkIdentity_Insert")); + Handler->Counter->Register(TEXT("PkIdentity_Update")); + Handler->Counter->Register(TEXT("PkIdentity_Delete")); + + UDbConnection *Connection = ConnectThen(Handler->Counter, TestName, [this, Handler](UDbConnection *Conn) + { + Conn->Db->PkIdentity->OnInsert.AddDynamic(Handler, &UIdentityActionsHandler::OnInsertPkIdentity); + Conn->Db->PkIdentity->OnUpdate.AddDynamic(Handler, &UIdentityActionsHandler::OnUpdatePkIdentity); + Conn->Db->PkIdentity->OnDelete.AddDynamic(Handler, &UIdentityActionsHandler::OnDeletePkIdentity); + + SubscribeAllThen(Conn, [this, Handler, Conn](FSubscriptionEventContext Ctx) + { + if (!AssertAllTablesEmpty(this, Conn->Db)) + { + Handler->Counter->Abort(); + return; + } + + // Create a sample FSpacetimeDBIdentity. + FSpacetimeDBIdentity Identity; + Ctx.TryGetIdentity(Identity); + int32 InsertData = 3; + int32 UpdateData = 4; + Handler->SetExpectedValue(Identity, InsertData, UpdateData); + + // Call the reducer to insert the new identity. + Ctx.Reducers->InsertPkIdentity(Identity, InsertData); + }); }); + + ADD_LATENT_AUTOMATION_COMMAND(FWaitForTestCounter(*this, TestName, Handler->Counter, FPlatformTime::Seconds())); + return true; +} + +bool FUpdatePkConnectionIdTest::RunTest(const FString &Parameters) +{ + TestName = "UpdateConnectionId"; + + if (!ValidateParameterConfig(this)) + return false; + + UConnectionIdActionsHandler *InsertHandler = CreateTestHandler(); + InsertHandler->Counter->Register(TEXT("PkConnectionId_Insert")); + InsertHandler->Counter->Register(TEXT("PkConnectionId_Update")); + + UDbConnection *Connection = ConnectThen(InsertHandler->Counter, TestName, [this, InsertHandler](UDbConnection *Conn) + { + Conn->Db->PkConnectionId->OnInsert.AddDynamic(InsertHandler, &UConnectionIdActionsHandler::OnInsertPkConnectionId); + Conn->Db->PkConnectionId->OnUpdate.AddDynamic(InsertHandler, &UConnectionIdActionsHandler::OnUpdatePkConnectionId); + + SubscribeAllThen(Conn, [this, InsertHandler, Conn](FSubscriptionEventContext Ctx) + { + if (!AssertAllTablesEmpty(this, Conn->Db)) + { + InsertHandler->Counter->Abort(); + return; + } + + FSpacetimeDBConnectionId ConnectionId; + int32 Data = 1; + + Ctx.Reducers->InsertPkConnectionId(ConnectionId, Data); + }); }); + ADD_LATENT_AUTOMATION_COMMAND(FWaitForTestCounter(*this, TestName, InsertHandler->Counter, FPlatformTime::Seconds())); + return true; +} + +// +bool FDeleteUniqueIdentityTest::RunTest(const FString &Parameters) +{ + TestName = "DeleteIdentity"; + + if (!ValidateParameterConfig(this)) + { + return false; + } + + UIdentityActionsHandler *Handler = CreateTestHandler(); + Handler->Counter->Register(TEXT("UniqueIdentity_Insert")); + Handler->Counter->Register(TEXT("UniqueIdentity_Delete")); + + UDbConnection *Connection = ConnectThen(Handler->Counter, TestName, [this, Handler](UDbConnection *Conn) + { + Conn->Db->UniqueIdentity->OnInsert.AddDynamic(Handler, &UIdentityActionsHandler::OnInsertUniqueIdentity); + Conn->Db->UniqueIdentity->OnDelete.AddDynamic(Handler, &UIdentityActionsHandler::OnDeleteUniqueIdentity); + + SubscribeAllThen(Conn, [this, Handler, Conn](FSubscriptionEventContext Ctx) + { + // Create a sample FSpacetimeDBIdentity. + FSpacetimeDBIdentity Identity; + int32 Data = 0; + + // Call the reducer to insert the identity first. + Ctx.Reducers->InsertUniqueIdentity(Identity, Data); + }); }); + + ADD_LATENT_AUTOMATION_COMMAND(FWaitForTestCounter(*this, TestName, Handler->Counter, FPlatformTime::Seconds())); + return true; +} + +bool FDeletePkConnectionIdTest::RunTest(const FString &Parameters) +{ + TestName = "DeleteConnectionId"; + + if (!ValidateParameterConfig(this)) + { + return false; + } + + UConnectionIdActionsHandler *Handler = CreateTestHandler(); + Handler->Counter->Register(TEXT("PkConnectionId_Insert")); + Handler->Counter->Register(TEXT("PkConnectionId_Update")); + Handler->Counter->Register(TEXT("PkConnectionId_Delete")); + + UDbConnection *Connection = ConnectThen(Handler->Counter, TestName, [this, Handler](UDbConnection *Conn) + { + Conn->Db->PkConnectionId->OnInsert.AddDynamic(Handler, &UConnectionIdActionsHandler::OnInsertPkConnectionId); + Conn->Db->PkConnectionId->OnUpdate.AddDynamic(Handler, &UConnectionIdActionsHandler::OnUpdatePkConnectionId); + Conn->Db->PkConnectionId->OnDelete.AddDynamic(Handler, &UConnectionIdActionsHandler::OnDeletePkConnectionId); + + SubscribeAllThen(Conn, [this, Handler, Conn](FSubscriptionEventContext Ctx) + { + // Create a sample ConnectionId. + FSpacetimeDBConnectionId ConnectionId; + int32 Data = 0; + + Handler->SetExpectedvalue(ConnectionId, Data); + + // Call the reducer to insert the ConnectionId first. + Ctx.Reducers->InsertPkConnectionId(ConnectionId, Data); + }); }); + + ADD_LATENT_AUTOMATION_COMMAND(FWaitForTestCounter(*this, TestName, Handler->Counter, FPlatformTime::Seconds())); + return true; +} + +bool FOnReducerTest::RunTest(const FString &Parameters) +{ + TestName = "OnReducer"; + + if (!ValidateParameterConfig(this)) + { + return false; + } + + UOnReducerActionsHandler *Handler = CreateTestHandler(); + Handler->Counter->Register(TEXT("OnReducer")); + + UDbConnection *Connection = ConnectThen(Handler->Counter, TestName, [this, Handler](UDbConnection *Conn) + { + Conn->Reducers->OnInsertOneU8.AddDynamic(Handler, &UOnReducerActionsHandler::OnInsertOneU8); + + SubscribeAllThen(Conn, [this, Handler, Conn](FSubscriptionEventContext Ctx) + { + if (!AssertAllTablesEmpty(this, Conn->Db)) + { + Handler->Counter->Abort(); + return; + } + + // Create a sample FSpacetimeDBIdentity. + uint8 Value = 0; + Handler->SetExpectedvalue(Value); + + // Call the reducer to insert the new identity. + Ctx.Reducers->InsertOneU8(Value); + }); }); + + ADD_LATENT_AUTOMATION_COMMAND(FWaitForTestCounter(*this, TestName, Handler->Counter, FPlatformTime::Seconds())); + return true; +} + +bool FOnFailReducerTest::RunTest(const FString &Parameters) +{ + TestName = "FailReducer"; + + if (!ValidateParameterConfig(this)) + { + return false; + } + + UOnReducerActionsHandler *Handler = CreateTestHandler(); + + // Register counters for both success and failure states. + Handler->Counter->Register(TEXT("Reducer-Callback-Success")); + Handler->Counter->Register(TEXT("Reducer-Callback-Fail")); + + UDbConnection *Connection = ConnectThen(Handler->Counter, TestName, [this, Handler](UDbConnection *Conn) + { + Conn->Reducers->OnInsertPkU8.AddDynamic(Handler, &UOnReducerActionsHandler::OnInsertPkU8); + + SubscribeAllThen(Conn, [this, Handler, Conn](FSubscriptionEventContext Ctx) + { + if (!AssertAllTablesEmpty(this, Conn->Db)) + { + Handler->Counter->Abort(); + return; + } + + // Use a key-value pair for a table with a primary key. + uint8 Key = 128; + int32 InitialData = 0xbeef; + int32 FailData = 0xbabe; + Handler->SetExpectedKeyAndValue(Key, InitialData, FailData); + + // Trigger the first, successful insertion. + Ctx.Reducers->InsertPkU8(Key, InitialData); + }); }); + + ADD_LATENT_AUTOMATION_COMMAND(FWaitForTestCounter(*this, TestName, Handler->Counter, FPlatformTime::Seconds())); + return true; +} + +bool FInsertVecTest::RunTest(const FString &Parameters) +{ + TestName = "InsertVec"; + + if (!ValidateParameterConfig(this)) + { + return false; + } + + // Create and register a test counter to track completion. + UVectorDataActionsHandler *VectorHandler = CreateTestHandler(); + VectorHandler->Counter->Register(TEXT("InsertVecU8")); + VectorHandler->Counter->Register(TEXT("InsertVecU16")); + VectorHandler->Counter->Register(TEXT("InsertVecU32")); + VectorHandler->Counter->Register(TEXT("InsertVecU64")); + VectorHandler->Counter->Register(TEXT("InsertVecU128")); + VectorHandler->Counter->Register(TEXT("InsertVecU256")); + VectorHandler->Counter->Register(TEXT("InsertVecI8")); + VectorHandler->Counter->Register(TEXT("InsertVecI16")); + VectorHandler->Counter->Register(TEXT("InsertVecI32")); + VectorHandler->Counter->Register(TEXT("InsertVecI64")); + VectorHandler->Counter->Register(TEXT("InsertVecI128")); + VectorHandler->Counter->Register(TEXT("InsertVecI256")); + + VectorHandler->Counter->Register(TEXT("InsertVecBool")); + VectorHandler->Counter->Register(TEXT("InsertVecF32")); + VectorHandler->Counter->Register(TEXT("InsertVecF64")); + VectorHandler->Counter->Register(TEXT("InsertVecString")); + + VectorHandler->Counter->Register(TEXT("InsertVecIdentity")); + VectorHandler->Counter->Register(TEXT("InsertVecConnectionId")); + VectorHandler->Counter->Register(TEXT("InsertVecTimestamp")); + + UDbConnection *Connection = ConnectThen(VectorHandler->Counter, TestName, [this, VectorHandler](UDbConnection *Conn) + { + // Subscribe to the insert event for each table. + // These handlers will contain the validation logic (the "unwrap" equivalent). + Conn->Db->VecU8->OnInsert.AddDynamic(VectorHandler, &UVectorDataActionsHandler::OnInsertVecU8); + Conn->Db->VecU16->OnInsert.AddDynamic(VectorHandler, &UVectorDataActionsHandler::OnInsertVecU16); + Conn->Db->VecU32->OnInsert.AddDynamic(VectorHandler, &UVectorDataActionsHandler::OnInsertVecU32); + Conn->Db->VecU64->OnInsert.AddDynamic(VectorHandler, &UVectorDataActionsHandler::OnInsertVecU64); + Conn->Db->VecU128->OnInsert.AddDynamic(VectorHandler, &UVectorDataActionsHandler::OnInsertVecU128); + Conn->Db->VecU256->OnInsert.AddDynamic(VectorHandler, &UVectorDataActionsHandler::OnInsertVecU256); + + Conn->Db->VecI8->OnInsert.AddDynamic(VectorHandler, &UVectorDataActionsHandler::OnInsertVecI8); + Conn->Db->VecI16->OnInsert.AddDynamic(VectorHandler, &UVectorDataActionsHandler::OnInsertVecI16); + Conn->Db->VecI32->OnInsert.AddDynamic(VectorHandler, &UVectorDataActionsHandler::OnInsertVecI32); + Conn->Db->VecI64->OnInsert.AddDynamic(VectorHandler, &UVectorDataActionsHandler::OnInsertVecI64); + Conn->Db->VecI128->OnInsert.AddDynamic(VectorHandler, &UVectorDataActionsHandler::OnInsertVecI128); + Conn->Db->VecI256->OnInsert.AddDynamic(VectorHandler, &UVectorDataActionsHandler::OnInsertVecI256); + + Conn->Db->VecBool->OnInsert.AddDynamic(VectorHandler, &UVectorDataActionsHandler::OnInsertVecBool); + + Conn->Db->VecF32->OnInsert.AddDynamic(VectorHandler, &UVectorDataActionsHandler::OnInsertVecF32); + Conn->Db->VecF64->OnInsert.AddDynamic(VectorHandler, &UVectorDataActionsHandler::OnInsertVecF64); + + Conn->Db->VecString->OnInsert.AddDynamic(VectorHandler, &UVectorDataActionsHandler::OnInsertVecString); + + Conn->Db->VecIdentity->OnInsert.AddDynamic(VectorHandler, &UVectorDataActionsHandler::OnInsertVecIdentity); + Conn->Db->VecConnectionId->OnInsert.AddDynamic(VectorHandler, &UVectorDataActionsHandler::OnInsertVecConnectionId); + Conn->Db->VecTimestamp->OnInsert.AddDynamic(VectorHandler, &UVectorDataActionsHandler::OnInsertVecTimestamp); + + SubscribeAllThen(Conn, [this, VectorHandler, Conn](FSubscriptionEventContext Ctx) + { + // Perform initial check to ensure all tables are empty before the test. + if (!AssertAllTablesEmpty(this, Conn->Db)) + { + VectorHandler->Counter->Abort(); + return; + } + + // --- Replicating the 'insert_one' calls --- + FSpacetimeDBUInt128 UInt128_One = { 0, 1 }; + FSpacetimeDBUInt128 UInt128_Zero = { 0, 0 }; + FSpacetimeDBUInt256 UInt256_One = { UInt128_Zero, UInt128_One }; + FSpacetimeDBUInt256 UInt256_Zero = { UInt128_Zero, UInt128_Zero }; + + FSpacetimeDBInt128 Int128_One = { 0, 1 }; + FSpacetimeDBInt128 Int128_Zero = { 0, 0 }; + FSpacetimeDBInt256 Int256_One = { UInt128_Zero, UInt128_One }; + FSpacetimeDBInt256 Int256_Zero = { UInt128_Zero, UInt128_One }; + + // Unsigned Integers + Ctx.Reducers->InsertVecU8({ 2, 6 }); + VectorHandler->ExpectedVecU8 = FVecU8Type({ 2, 6 }); + Ctx.Reducers->InsertVecU16({ 3, 5 }); + VectorHandler->ExpectedVecU16 = FVecU16Type({ 3, 5 }); + Ctx.Reducers->InsertVecU32({ 1, 9 }); + VectorHandler->ExpectedVecU32 = FVecU32Type({ 1, 9 }); + Ctx.Reducers->InsertVecU64({ 3, 8 }); + VectorHandler->ExpectedVecU64 = FVecU64Type({ 3, 8 }); + Ctx.Reducers->InsertVecU128({ UInt128_Zero, UInt128_One }); + VectorHandler->ExpectedVecU128 = FVecU128Type({ UInt128_Zero, UInt128_One }); + Ctx.Reducers->InsertVecU256({ UInt256_Zero, UInt256_One }); + VectorHandler->ExpectedVecU256 = FVecU256Type({ UInt256_Zero, UInt256_One }); + + // Signed Integers + Ctx.Reducers->InsertVecI8({ 4, 5 }); + VectorHandler->ExpectedVecI8 = FVecI8Type({ 4, 5 }); + Ctx.Reducers->InsertVecI16({ 6, 3 }); + VectorHandler->ExpectedVecI16 = FVecI16Type({ 6, 3 }); + Ctx.Reducers->InsertVecI32({ 2, 1 }); + VectorHandler->ExpectedVecI32 = FVecI32Type({ 2, 1 }); + Ctx.Reducers->InsertVecI64({ 7, 9 }); + VectorHandler->ExpectedVecI64 = FVecI64Type({ 7, 9 }); + Ctx.Reducers->InsertVecI128({ Int128_Zero, Int128_One }); + VectorHandler->ExpectedVecI128 = FVecI128Type({ Int128_Zero, Int128_One }); + Ctx.Reducers->InsertVecI256({ Int256_Zero, Int256_One }); + VectorHandler->ExpectedVecI256 = FVecI256Type({ Int256_Zero, Int256_One }); + + // Booleans + Ctx.Reducers->InsertVecBool({ false, true }); + VectorHandler->ExpectedVecBool = FVecBoolType({ false, true }); + + // Floating-point numbers + Ctx.Reducers->InsertVecF32({ 0.0f, 1.0f }); + VectorHandler->ExpectedVecF32 = FVecF32Type({ 0.0f, 1.0f }); + Ctx.Reducers->InsertVecF64({ 0.0, 1.0 }); + VectorHandler->ExpectedVecF64 = FVecF64Type({ 0.0, 1.0 }); + + // Strings + Ctx.Reducers->InsertVecString({ "zero", "one" }); + VectorHandler->ExpectedVecString = FVecStringType({ "zero", "one" }); + + // Other types + FSpacetimeDBIdentity Identity; + FSpacetimeDBConnectionId ConnectionId; + FSpacetimeDBTimestamp TimeStamp; + + Ctx.Reducers->InsertVecIdentity({ Identity }); + VectorHandler->ExpectedVecIdentity = FVecIdentityType({ Identity }); + Ctx.Reducers->InsertVecConnectionId({ ConnectionId }); + VectorHandler->ExpectedVecConnectionId = FVecConnectionIdType({ ConnectionId }); + Ctx.Reducers->InsertVecTimestamp({ TimeStamp }); + VectorHandler->ExpectedVecTimestamp = FVecTimestampType({ TimeStamp }); + }); }); + + // Wait for the test counter to signal completion. + ADD_LATENT_AUTOMATION_COMMAND(FWaitForTestCounter(*this, TestName, VectorHandler->Counter, FPlatformTime::Seconds())); + + return true; +} + +bool FInsertOptionSomeTest::RunTest(const FString &Parameters) +{ + TestName = "InsertOptionSome"; + + if (!ValidateParameterConfig(this)) + { + return false; + } + + // Create and register a test counter to track completion. + UOptionActionsHandler *Handler = CreateTestHandler(); + Handler->Counter->Register(TEXT("InsertOptionI32")); + Handler->Counter->Register(TEXT("InsertOptionString")); + Handler->Counter->Register(TEXT("InsertOptionIdentity")); + Handler->Counter->Register(TEXT("InsertOptionSimpleEnum")); + Handler->Counter->Register(TEXT("InsertOptionEveryPrimitiveStruct")); + Handler->Counter->Register(TEXT("InsertOptionVecOptionI32")); + + UDbConnection *Connection = ConnectThen(Handler->Counter, TestName, [this, Handler](UDbConnection *Conn) + { + // Subscribe to the insert event for each table. + // These handlers will contain the validation logic (the "unwrap" equivalent). + Conn->Db->OptionI32->OnInsert.AddDynamic(Handler, &UOptionActionsHandler::OnInsertOptionI32); + Conn->Db->OptionString->OnInsert.AddDynamic(Handler, &UOptionActionsHandler::OnInsertOptionString); + Conn->Db->OptionIdentity->OnInsert.AddDynamic(Handler, &UOptionActionsHandler::OnInsertOptionIdentity); + Conn->Db->OptionSimpleEnum->OnInsert.AddDynamic(Handler, &UOptionActionsHandler::OnInsertOptionSimpleEnum); + Conn->Db->OptionEveryPrimitiveStruct->OnInsert.AddDynamic(Handler, &UOptionActionsHandler::OnInsertOptionPrimitiveStruct); + Conn->Db->OptionVecOptionI32->OnInsert.AddDynamic(Handler, &UOptionActionsHandler::OnInsertOptionVecOptionI32); + + SubscribeAllThen(Conn, [this, Handler, Conn](FSubscriptionEventContext Ctx) + { + // Perform initial check to ensure all tables are empty before the test. + if (!AssertAllTablesEmpty(this, Conn->Db)) + { + Handler->Counter->Abort(); + return; + } + + // --- Replicating the 'insert_one' calls --// + FTestClientOptionalIdentity OptionalIdentity; + FSpacetimeDBIdentity Identity; + Ctx.TryGetIdentity(Identity); + + Handler->ExpectedI32Type = FTestClientOptionalInt32(0); + Handler->ExpectedStringType = FTestClientOptionalString("string"); + Handler->ExpectedIdentityType = FTestClientOptionalIdentity(Identity); + Handler->ExpectedEnumType = FTestClientOptionalSimpleEnum(ESimpleEnumType::Zero); + Handler->ExpectedEveryPrimitiveStructType = FTestClientOptionalEveryPrimitiveStruct(); + Handler->ExpectedVecOptionI32Type = FTestClientOptionalVecInt32(TArray({ FTestClientOptionalInt32(0), FTestClientOptionalInt32() })); + + Ctx.Reducers->InsertOptionI32(FTestClientOptionalInt32(0)); + Ctx.Reducers->InsertOptionString(FTestClientOptionalString("string")); + Ctx.Reducers->InsertOptionIdentity(FTestClientOptionalIdentity(Identity)); + Ctx.Reducers->InsertOptionSimpleEnum(FTestClientOptionalSimpleEnum(ESimpleEnumType::Zero)); + Ctx.Reducers->InsertOptionEveryPrimitiveStruct(FTestClientOptionalEveryPrimitiveStruct()); + Ctx.Reducers->InsertOptionVecOptionI32(FTestClientOptionalVecInt32(TArray({ FTestClientOptionalInt32(0), FTestClientOptionalInt32() }))); + }); }); + + // Wait for the test counter to signal completion. + ADD_LATENT_AUTOMATION_COMMAND(FWaitForTestCounter(*this, TestName, Handler->Counter, FPlatformTime::Seconds())); + + return true; +} + +bool FInsertOptionNoneTest::RunTest(const FString &Parameters) +{ + TestName = "InsertOptionNone"; + + if (!ValidateParameterConfig(this)) + { + return false; + } + + // Create and register a test counter to track completion. + UOptionActionsHandler *Handler = CreateTestHandler(); + Handler->Counter->Register(TEXT("InsertOptionI32")); + Handler->Counter->Register(TEXT("InsertOptionString")); + Handler->Counter->Register(TEXT("InsertOptionIdentity")); + Handler->Counter->Register(TEXT("InsertOptionSimpleEnum")); + Handler->Counter->Register(TEXT("InsertOptionEveryPrimitiveStruct")); + Handler->Counter->Register(TEXT("InsertOptionVecOptionI32")); + + UDbConnection *Connection = ConnectThen(Handler->Counter, TestName, [this, Handler](UDbConnection *Conn) + { + // Subscribe to the insert event for each table. + // These handlers will contain the validation logic (the "unwrap" equivalent). + Conn->Db->OptionI32->OnInsert.AddDynamic(Handler, &UOptionActionsHandler::OnInsertOptionI32); + Conn->Db->OptionString->OnInsert.AddDynamic(Handler, &UOptionActionsHandler::OnInsertOptionString); + Conn->Db->OptionIdentity->OnInsert.AddDynamic(Handler, &UOptionActionsHandler::OnInsertOptionIdentity); + Conn->Db->OptionSimpleEnum->OnInsert.AddDynamic(Handler, &UOptionActionsHandler::OnInsertOptionSimpleEnum); + Conn->Db->OptionEveryPrimitiveStruct->OnInsert.AddDynamic(Handler, &UOptionActionsHandler::OnInsertOptionPrimitiveStruct); + Conn->Db->OptionVecOptionI32->OnInsert.AddDynamic(Handler, &UOptionActionsHandler::OnInsertOptionVecOptionI32); + + SubscribeAllThen(Conn, [this, Handler, Conn](FSubscriptionEventContext Ctx) + { + // Perform initial check to ensure all tables are empty before the test. + if (!AssertAllTablesEmpty(this, Conn->Db)) + { + Handler->Counter->Abort(); + return; + } + + // --- Replicating the 'insert_one' calls --// + + Ctx.Reducers->InsertOptionI32(FTestClientOptionalInt32()); + Ctx.Reducers->InsertOptionString(FTestClientOptionalString()); + Ctx.Reducers->InsertOptionIdentity(FTestClientOptionalIdentity()); + Ctx.Reducers->InsertOptionSimpleEnum(FTestClientOptionalSimpleEnum()); + Ctx.Reducers->InsertOptionEveryPrimitiveStruct(FTestClientOptionalEveryPrimitiveStruct()); + Ctx.Reducers->InsertOptionVecOptionI32(FTestClientOptionalVecInt32()); + }); }); + + // Wait for the test counter to signal completion. + ADD_LATENT_AUTOMATION_COMMAND(FWaitForTestCounter(*this, TestName, Handler->Counter, FPlatformTime::Seconds())); + + return true; +} + +bool FInsertStructTest::RunTest(const FString &Parameters) +{ + TestName = "InsertStruct"; + + if (!ValidateParameterConfig(this)) + { + return false; + } + + // Create and register a test counter to track completion. + UStructActionsHandler *Handler = CreateTestHandler(); + Handler->Counter->Register(TEXT("InsertOneUnitStruct")); + Handler->Counter->Register(TEXT("InsertOneByteStruct")); + Handler->Counter->Register(TEXT("InsertOneEveryPrimitiveStruct")); + Handler->Counter->Register(TEXT("InsertOneEveryVecStruct")); + + Handler->Counter->Register(TEXT("InsertVecUnitStruct")); + Handler->Counter->Register(TEXT("InsertVecByteStruct")); + Handler->Counter->Register(TEXT("InsertVecEveryPrimitiveStruct")); + Handler->Counter->Register(TEXT("InsertVecEveryVecStruct")); + + UDbConnection *Connection = ConnectThen(Handler->Counter, TestName, [this, Handler](UDbConnection *Conn) + { + // Subscribe to the insert event for each table. + // These handlers will contain the validation logic (the "unwrap" equivalent). + Conn->Db->OneUnitStruct->OnInsert.AddDynamic(Handler, &UStructActionsHandler::OnInsertOneUnitStruct); + Conn->Db->OneByteStruct->OnInsert.AddDynamic(Handler, &UStructActionsHandler::OnInsertOneByteStruct); + Conn->Db->OneEveryPrimitiveStruct->OnInsert.AddDynamic(Handler, &UStructActionsHandler::OnInsertOneEveryPrimitiveStruct); + Conn->Db->OneEveryVecStruct->OnInsert.AddDynamic(Handler, &UStructActionsHandler::OnInsertOneEveryVecStruct); + + Conn->Db->VecUnitStruct->OnInsert.AddDynamic(Handler, &UStructActionsHandler::OnInsertVecUnitStruct); + Conn->Db->VecByteStruct->OnInsert.AddDynamic(Handler, &UStructActionsHandler::OnInsertVecByteStruct); + Conn->Db->VecEveryPrimitiveStruct->OnInsert.AddDynamic(Handler, &UStructActionsHandler::OnInsertVecEveryPrimitiveStruct); + Conn->Db->VecEveryVecStruct->OnInsert.AddDynamic(Handler, &UStructActionsHandler::OnInsertVecEveryVecStruct); + + SubscribeAllThen(Conn, [this, Handler, Conn](FSubscriptionEventContext Ctx) + { + // Perform initial check to ensure all tables are empty before the test. + if (!AssertAllTablesEmpty(this, Conn->Db)) + { + Handler->Counter->Abort(); + return; + } + + // --- Replicating the 'insert_one' calls --// + + FByteStructType OneByteStruct; + OneByteStruct.B = 0; + Handler->ExpectedByteStruct = OneByteStruct; + + TArray VecByteStruct; + VecByteStruct.Add(OneByteStruct); + Handler->ExpectedVecByteStruct = VecByteStruct; + + FSpacetimeDBUInt128 UInt128 = { 0, 4 }; + FSpacetimeDBUInt256 UInt256 = { FSpacetimeDBUInt128(0, 0), FSpacetimeDBUInt128(0, 5) }; + + FSpacetimeDBInt128 Int128 = { 0, static_cast(-5) }; + FSpacetimeDBInt256 Int256 = { FSpacetimeDBUInt128(0, 0), FSpacetimeDBUInt128(0, static_cast(-5)) }; + + FSpacetimeDBUInt128 UInt128p = { 0x0102030405060708, 0x090a0b0c0d0e0f10 }; + FSpacetimeDBUInt256 UInt256p = { FSpacetimeDBUInt128(0x0102030405060708, 0x090a0b0c0d0e0f10), FSpacetimeDBUInt128(0x1112131415161718, 0x191a1b1c1d1e1f20)}; + + FSpacetimeDBInt128 Int128p = { static_cast(-0x0102030405060708), static_cast(-0x090a0b0c0d0e0f10)}; + FSpacetimeDBInt256 Int256p = { FSpacetimeDBUInt128(static_cast(-0x0102030405060708), static_cast(-0x090a0b0c0d0e0f10)), + FSpacetimeDBUInt128(static_cast(-0x1112131415161718), static_cast(-0x191a1b1c1d1e1f20)) }; + + TArray PrimitiveArray; + FEveryPrimitiveStructType EveryPrimitiveStructType; + EveryPrimitiveStructType.A = { 0x01 }; + EveryPrimitiveStructType.B = { 0x0102 }; + EveryPrimitiveStructType.C = { 0x01020304 }; + EveryPrimitiveStructType.D = { 0x0102030405060708 }; + EveryPrimitiveStructType.E = { UInt128p }; + EveryPrimitiveStructType.F = { UInt256p }; + EveryPrimitiveStructType.G = { -0x01 }; + EveryPrimitiveStructType.H = { -0x0102 }; + EveryPrimitiveStructType.I = { -0x01020304 }; + EveryPrimitiveStructType.J = { -0x0102030405060708 }; + EveryPrimitiveStructType.K = { Int128p }; + EveryPrimitiveStructType.L = { Int256p }; + EveryPrimitiveStructType.M = { false }; + EveryPrimitiveStructType.N = { 1.0 }; + EveryPrimitiveStructType.O = { -1.0 }; + EveryPrimitiveStructType.P = { "string" }; + EveryPrimitiveStructType.Q = { FSpacetimeDBIdentity() }; + EveryPrimitiveStructType.R = { FSpacetimeDBConnectionId() }; + EveryPrimitiveStructType.S = { FSpacetimeDBTimestamp(9876543210) }; + EveryPrimitiveStructType.T = { FSpacetimeDBTimeDuration(-67419000000003LL) }; + PrimitiveArray.Add(EveryPrimitiveStructType); + Handler->ExpectedEveryPrimitiveStruct = EveryPrimitiveStructType; + Handler->ExpectedVecPrimitiveStruct = PrimitiveArray; + + TArray VecArray; + FEveryVecStructType VecEveryVecStructType; + VecEveryVecStructType.A = { }; + VecEveryVecStructType.B = { 1 }; + VecEveryVecStructType.C = { 2, 2 }; + VecEveryVecStructType.D = { 3, 3, 3 }; + VecEveryVecStructType.E = { UInt128, UInt128, UInt128, UInt128 }; + VecEveryVecStructType.F = { UInt256, UInt256, UInt256, UInt256, UInt256 }; + VecEveryVecStructType.G = { -1 }; + VecEveryVecStructType.H = { -2, -2 }; + VecEveryVecStructType.I = { -3, -3, -3 }; + VecEveryVecStructType.J = { -4, -4, -4, -4 }; + VecEveryVecStructType.K = { Int128, Int128, Int128, Int128, Int128 }; + VecEveryVecStructType.L = { Int256, Int256, Int256, Int256, Int256, Int256 }; + VecEveryVecStructType.M = { false, true, true, false }; + VecEveryVecStructType.N = { 0.0, -1.0, 1.0, -2.0, 2.0 }; + VecEveryVecStructType.O = { 0.0, -0.5, 0.5, -1.5, 1.5 }; + VecEveryVecStructType.P = { "vec", "of", "strings" }; + VecEveryVecStructType.Q = { FSpacetimeDBIdentity() }; + VecEveryVecStructType.R = { FSpacetimeDBConnectionId() }; + VecEveryVecStructType.S = { FSpacetimeDBTimestamp(9876543210) }; + VecEveryVecStructType.T = { FSpacetimeDBTimeDuration(-67419000000003LL) }; + VecArray.Add(VecEveryVecStructType); + Handler->ExpectedEveryVecStruct = VecEveryVecStructType; + Handler->ExpectedVecEveryVecStruct = VecArray; + + Ctx.Reducers->InsertOneUnitStruct(FUnitStructType()); + Ctx.Reducers->InsertOneByteStruct(OneByteStruct); + Ctx.Reducers->InsertOneEveryPrimitiveStruct(EveryPrimitiveStructType); + Ctx.Reducers->InsertOneEveryVecStruct(VecEveryVecStructType); + + Ctx.Reducers->InsertVecUnitStruct(TArray()); + Ctx.Reducers->InsertVecByteStruct(VecByteStruct); + Ctx.Reducers->InsertVecEveryPrimitiveStruct(PrimitiveArray); + Ctx.Reducers->InsertVecEveryVecStruct(VecArray); + }); }); + + // Wait for the test counter to signal completion. + ADD_LATENT_AUTOMATION_COMMAND(FWaitForTestCounter(*this, TestName, Handler->Counter, FPlatformTime::Seconds())); + + return true; +} + +bool FInsertSimpleEnumTest::RunTest(const FString &Parameters) +{ + TestName = "InsertSimpleEnum"; + + if (!ValidateParameterConfig(this)) + { + return false; + } + + // Create and register a test counter to track completion. + UEnumActionsHandler *Handler = CreateTestHandler(); + Handler->Counter->Register(TEXT("InsertOneSimpleEnum")); + Handler->Counter->Register(TEXT("InsertVecSimpleEnum")); + + UDbConnection *Connection = ConnectThen(Handler->Counter, TestName, [this, Handler](UDbConnection *Conn) + { + // Subscribe to the insert event for each table. + // These handlers will contain the validation logic (the "unwrap" equivalent). + Conn->Db->OneSimpleEnum->OnInsert.AddDynamic(Handler, &UEnumActionsHandler::OnInsertOneSimpleEnum); + Conn->Db->VecSimpleEnum->OnInsert.AddDynamic(Handler, &UEnumActionsHandler::OnInsertVecSimpleEnum); + + SubscribeAllThen(Conn, [this, Handler, Conn](FSubscriptionEventContext Ctx) + { + // Perform initial check to ensure all tables are empty before the test. + if (!AssertAllTablesEmpty(this, Conn->Db)) + { + Handler->Counter->Abort(); + return; + } + + // --- Replicating the 'insert_one' calls --// + FOneSimpleEnumType OneSimpleEnum; + OneSimpleEnum.E = ESimpleEnumType::One; + Handler->ExpectedSimpleEnum = OneSimpleEnum; + + FVecSimpleEnumType VecSimpleEnum; + VecSimpleEnum.E = { ESimpleEnumType::Zero, ESimpleEnumType::One, ESimpleEnumType::Two }; + Handler->ExpectedVecEnum = VecSimpleEnum; + + Ctx.Reducers->InsertOneSimpleEnum(OneSimpleEnum.E); + Ctx.Reducers->InsertVecSimpleEnum(VecSimpleEnum.E); + }); }); + + // Wait for the test counter to signal completion. + ADD_LATENT_AUTOMATION_COMMAND(FWaitForTestCounter(*this, TestName, Handler->Counter, FPlatformTime::Seconds())); + + return true; +} + +bool FInsertEnumWithPayloadTest::RunTest(const FString &Parameters) +{ + TestName = "InsertEnumWithPayload"; + + if (!ValidateParameterConfig(this)) + { + return false; + } + + // Create and register a test counter to track completion. + UEnumActionsHandler *Handler = CreateTestHandler(); + Handler->Counter->Register(TEXT("InsertOneEnumWithPayload")); + Handler->Counter->Register(TEXT("InsertVecEnumWithPayload")); + + UDbConnection *Connection = ConnectThen(Handler->Counter, TestName, [this, Handler](UDbConnection *Conn) + { + // Subscribe to the insert event for each table. + // These handlers will contain the validation logic (the "unwrap" equivalent). + Conn->Db->OneEnumWithPayload->OnInsert.AddDynamic(Handler, &UEnumActionsHandler::OnInsertOneEnumWithPayload); + Conn->Db->VecEnumWithPayload->OnInsert.AddDynamic(Handler, &UEnumActionsHandler::OnInsertVecEnumWithPayload); + + SubscribeAllThen(Conn, [this, Handler, Conn](FSubscriptionEventContext Ctx) + { + // Perform initial check to ensure all tables are empty before the test. + if (!AssertAllTablesEmpty(this, Conn->Db)) + { + Handler->Counter->Abort(); + return; + } + + // --- Replicating the 'insert_one' calls --// + FSpacetimeDBIdentity Identity; + Ctx.TryGetIdentity(Identity); + + FVecEnumWithPayloadType VecEnumWithPayload; + VecEnumWithPayload.E.Add(FEnumWithPayloadType::U8(0)); + VecEnumWithPayload.E.Add(FEnumWithPayloadType::U16(1)); + VecEnumWithPayload.E.Add(FEnumWithPayloadType::U32(2)); + VecEnumWithPayload.E.Add(FEnumWithPayloadType::U64(3)); + VecEnumWithPayload.E.Add(FEnumWithPayloadType::U128(FSpacetimeDBUInt128(0, 4))); + VecEnumWithPayload.E.Add(FEnumWithPayloadType::U256(FSpacetimeDBUInt256(FSpacetimeDBUInt128(0, 0), FSpacetimeDBUInt128(0, 5)))); + VecEnumWithPayload.E.Add(FEnumWithPayloadType::I8(0)); + VecEnumWithPayload.E.Add(FEnumWithPayloadType::I16(-1)); + VecEnumWithPayload.E.Add(FEnumWithPayloadType::I32(-2)); + VecEnumWithPayload.E.Add(FEnumWithPayloadType::I64(-3)); + VecEnumWithPayload.E.Add(FEnumWithPayloadType::I128(FSpacetimeDBInt128(0, static_cast(-4)))); + VecEnumWithPayload.E.Add(FEnumWithPayloadType::I256(FSpacetimeDBInt256(FSpacetimeDBUInt128(0, 0), FSpacetimeDBUInt128(0, static_cast(-5))))); + VecEnumWithPayload.E.Add(FEnumWithPayloadType::Bool(true)); + VecEnumWithPayload.E.Add(FEnumWithPayloadType::F32(0.0)); + VecEnumWithPayload.E.Add(FEnumWithPayloadType::F64(100.0)); + VecEnumWithPayload.E.Add(FEnumWithPayloadType::Str("enum holds string")); + VecEnumWithPayload.E.Add(FEnumWithPayloadType::Identity(Identity)); + VecEnumWithPayload.E.Add(FEnumWithPayloadType::Bytes({ 0xde, 0xad, 0xbe, 0xef })); + VecEnumWithPayload.E.Add(FEnumWithPayloadType::Strings({ "enum", "of", "vec", "of", "strings" })); + VecEnumWithPayload.E.Add(FEnumWithPayloadType::SimpleEnums({ ESimpleEnumType::Zero, ESimpleEnumType::One, ESimpleEnumType::Two })); + + Handler->ExpectedVecEnumWithPayload = VecEnumWithPayload; + + Ctx.Reducers->InsertOneEnumWithPayload(FEnumWithPayloadType::U8(0)); + Ctx.Reducers->InsertVecEnumWithPayload(VecEnumWithPayload.E); + }); }); + + // Wait for the test counter to signal completion. + ADD_LATENT_AUTOMATION_COMMAND(FWaitForTestCounter(*this, TestName, Handler->Counter, FPlatformTime::Seconds())); + + return true; +} + +bool FInsertDeleteLargeTableTest::RunTest(const FString &Parameters) +{ + TestName = "InsertDeleteLargeTable"; + + if (!ValidateParameterConfig(this)) + { + return false; + } + + // --- 1. SETUP --- + // Create the handler that will contain our test logic and state. + ULargeTableActionHandler *Handler = CreateTestHandler(); + Handler->Counter->Register(TEXT("InsertLargeTable")); + Handler->Counter->Register(TEXT("DeleteLargeTable")); + + UDbConnection *Connection = ConnectThen(Handler->Counter, TestName, [this, Handler](UDbConnection *Conn) + { + // --- 2. SUBSCRIBE TO EVENTS --- + // Bind the handler's member functions to the database delegates. + Conn->Db->LargeTable->OnInsert.AddDynamic(Handler, &ULargeTableActionHandler::OnInsertLargeTable); + Conn->Db->LargeTable->OnDelete.AddDynamic(Handler, &ULargeTableActionHandler::OnDeleteLargeTable); + + SubscribeAllThen(Conn, [this, Handler, Conn](FSubscriptionEventContext Ctx) + { + // Perform initial check to ensure all tables are empty before the test. + if (!AssertAllTablesEmpty(this, Conn->Db)) + { + Handler->Counter->Abort(); + return; + } + + FLargeTableType LargeTable; + + FByteStructType ByteStruct; + ByteStruct.B = 0; + + FSpacetimeDBUInt128 UInt128 = { 0, 4 }; + FSpacetimeDBUInt256 UInt256 = { FSpacetimeDBUInt128(0, 0), FSpacetimeDBUInt128(0, 5) }; + + FSpacetimeDBInt128 Int128 = { 0, static_cast(-5) }; + FSpacetimeDBInt256 Int256 = { FSpacetimeDBUInt128(0, 0), FSpacetimeDBUInt128(0, static_cast(-5)) }; + + FSpacetimeDBUInt128 UInt128p = { 0x0102030405060708, 0x090a0b0c0d0e0f10 }; + FSpacetimeDBUInt256 UInt256p = { FSpacetimeDBUInt128(0x0102030405060708, 0x090a0b0c0d0e0f10), FSpacetimeDBUInt128(0x1112131415161718, 0x191a1b1c1d1e1f20) }; + + FSpacetimeDBInt128 Int128p = { static_cast(-0x0102030405060708), static_cast(-0x090a0b0c0d0e0f10) }; + FSpacetimeDBInt256 Int256p = { FSpacetimeDBUInt128(static_cast(-0x0102030405060708), static_cast(-0x090a0b0c0d0e0f10)), + FSpacetimeDBUInt128(static_cast(-0x1112131415161718), static_cast(-0x191a1b1c1d1e1f20)) }; + + FEveryPrimitiveStructType EveryPrimitiveStructType; + EveryPrimitiveStructType.A = { 0x01 }; + EveryPrimitiveStructType.B = { 0x0102 }; + EveryPrimitiveStructType.C = { 0x01020304 }; + EveryPrimitiveStructType.D = { 0x0102030405060708 }; + EveryPrimitiveStructType.E = { UInt128p }; + EveryPrimitiveStructType.F = { UInt256p }; + EveryPrimitiveStructType.G = { -0x01 }; + EveryPrimitiveStructType.H = { -0x0102 }; + EveryPrimitiveStructType.I = { -0x01020304 }; + EveryPrimitiveStructType.J = { -0x0102030405060708 }; + EveryPrimitiveStructType.K = { Int128p }; + EveryPrimitiveStructType.L = { Int256p }; + EveryPrimitiveStructType.M = { false }; + EveryPrimitiveStructType.N = { 1.0 }; + EveryPrimitiveStructType.O = { -1.0 }; + EveryPrimitiveStructType.P = { "string" }; + EveryPrimitiveStructType.Q = { FSpacetimeDBIdentity() }; + EveryPrimitiveStructType.R = { FSpacetimeDBConnectionId() }; + EveryPrimitiveStructType.S = { FSpacetimeDBTimestamp(9876543210) }; + EveryPrimitiveStructType.T = { FSpacetimeDBTimeDuration(-67419000000003LL) }; + + FEveryVecStructType VecEveryVecStructType; + VecEveryVecStructType.A = { }; + VecEveryVecStructType.B = { 1 }; + VecEveryVecStructType.C = { 2, 2 }; + VecEveryVecStructType.D = { 3, 3, 3 }; + VecEveryVecStructType.E = { UInt128, UInt128, UInt128, UInt128 }; + VecEveryVecStructType.F = { UInt256, UInt256, UInt256, UInt256, UInt256 }; + VecEveryVecStructType.G = { -1 }; + VecEveryVecStructType.H = { -2, -2 }; + VecEveryVecStructType.I = { -3, -3, -3 }; + VecEveryVecStructType.J = { -4, -4, -4, -4 }; + VecEveryVecStructType.K = { Int128, Int128, Int128, Int128, Int128 }; + VecEveryVecStructType.L = { Int256, Int256, Int256, Int256, Int256, Int256 }; + VecEveryVecStructType.M = { false, true, true, false }; + VecEveryVecStructType.N = { 0.0, -1.0, 1.0, -2.0, 2.0 }; + VecEveryVecStructType.O = { 0.0, -0.5, 0.5, -1.5, 1.5 }; + VecEveryVecStructType.P = { "vec", "of", "strings" }; + VecEveryVecStructType.Q = { FSpacetimeDBIdentity() }; + VecEveryVecStructType.R = { FSpacetimeDBConnectionId() }; + VecEveryVecStructType.S = { FSpacetimeDBTimestamp(9876543210) }; + VecEveryVecStructType.T = { FSpacetimeDBTimeDuration(-67419000000003LL) }; + + LargeTable.A = 0; + LargeTable.B = 1; + LargeTable.C = 2; + LargeTable.D = 3; + LargeTable.E = UInt128; + LargeTable.F = UInt256; + LargeTable.G = 0; + LargeTable.H = -1; + LargeTable.I = -2; + LargeTable.J = -3; + LargeTable.K = Int128; + LargeTable.L = Int256; + LargeTable.M = false; + LargeTable.N = 0.0; + LargeTable.O = 1.0; + LargeTable.P = "string"; + LargeTable.Q = ESimpleEnumType::Zero; + LargeTable.R = FEnumWithPayloadType::Bool(false); + LargeTable.S = FUnitStructType(); + LargeTable.T = ByteStruct; + LargeTable.U = EveryPrimitiveStructType; + LargeTable.V = VecEveryVecStructType; + + Handler->ExpectedLargeTable = LargeTable; + + // Call the insert reducer, which will trigger the 'OnInsertLargeTable' callback. + Ctx.Reducers->InsertLargeTable( + LargeTable.A, + LargeTable.B, + LargeTable.C, + LargeTable.D, + LargeTable.E, + LargeTable.F, + LargeTable.G, + LargeTable.H, + LargeTable.I, + LargeTable.J, + LargeTable.K, + LargeTable.L, + LargeTable.M, + LargeTable.N, + LargeTable.O, + LargeTable.P, + LargeTable.Q, + LargeTable.R, + LargeTable.S, + LargeTable.T, + LargeTable.U, + LargeTable.V + ); + }); }); + + // --- 4. WAIT FOR COMPLETION --- + // The latent command waits until both 'InsertLargeTable' and 'DeleteLargeTable' + // have been marked as done in the handler. + ADD_LATENT_AUTOMATION_COMMAND(FWaitForTestCounter(*this, TestName, Handler->Counter, FPlatformTime::Seconds())); + + return true; +} + +bool FInsertPrimitivesAsStringTest::RunTest(const FString &Parameters) +{ + TestName = "InsertPrimitivesAsString"; + + if (!ValidateParameterConfig(this)) + { + return false; + } + + // Create and register a test counter to track completion. + UInsertPrimitiveHandler *Handler = CreateTestHandler(); + Handler->Counter->Register(TEXT("InsertPrimitivesAsString")); + + UDbConnection *Connection = ConnectThen(Handler->Counter, TestName, [this, Handler](UDbConnection *Conn) + { + // Subscribe to the insert event for each table. + // These handlers will contain the validation logic (the "unwrap" equivalent). + Conn->Db->VecString->OnInsert.AddDynamic(Handler, &UInsertPrimitiveHandler::OnInsertPrimitivesAsString); + + SubscribeAllThen(Conn, [this, Handler, Conn](FSubscriptionEventContext Ctx) + { + // Perform initial check to ensure all tables are empty before the test. + if (!AssertAllTablesEmpty(this, Conn->Db)) + { + Handler->Counter->Abort(); + return; + } + + // --- Replicating the 'insert_one' calls --// + // Populate every field mirroring Rust's every_primitive_struct(). + FEveryPrimitiveStructType PrimitiveStructType; + PrimitiveStructType.A = 0x01; + PrimitiveStructType.B = 0x0102; + PrimitiveStructType.C = 0x01020304; + PrimitiveStructType.D = 0x0102030405060708ULL; + PrimitiveStructType.E = FSpacetimeDBUInt128(0x0102030405060708ULL, 0x090A0B0C0D0E0F10ULL); + PrimitiveStructType.F = FSpacetimeDBUInt256( + FSpacetimeDBUInt128(0x0102030405060708ULL, 0x090A0B0C0D0E0F10ULL), + FSpacetimeDBUInt128(0x1112131415161718ULL, 0x191A1B1C1D1E1F20ULL)); + PrimitiveStructType.G = -0x01; + PrimitiveStructType.H = -0x0102; + PrimitiveStructType.I = -0x01020304; + PrimitiveStructType.J = -0x0102030405060708LL; + PrimitiveStructType.K = FSpacetimeDBInt128(0xFEFDFCFBFAF9F8F7ULL, 0xF6F5F4F3F2F1F0F0ULL); + PrimitiveStructType.L = FSpacetimeDBInt256( + FSpacetimeDBUInt128(0xFEFDFCFBFAF9F8F7ULL, 0xF6F5F4F3F2F1F0EFULL), + FSpacetimeDBUInt128(0xEEEDECEBEAE9E8E7ULL, 0xE6E5E4E3E2E1E0E0ULL)); + PrimitiveStructType.M = false; + PrimitiveStructType.N = 1.0f; + PrimitiveStructType.O = -1.0; + PrimitiveStructType.P = TEXT("string"); + PrimitiveStructType.Q = FSpacetimeDBIdentity(); + PrimitiveStructType.R = FSpacetimeDBConnectionId(); + PrimitiveStructType.S = FSpacetimeDBTimestamp(9876543210LL); + PrimitiveStructType.T = FSpacetimeDBTimeDuration(-67419000000003LL); + + TArray ExpectedStrings; + ExpectedStrings.Reserve(20); + + ExpectedStrings.Add(LexToString(PrimitiveStructType.A)); + ExpectedStrings.Add(LexToString(PrimitiveStructType.B)); + ExpectedStrings.Add(LexToString(PrimitiveStructType.C)); + ExpectedStrings.Add(LexToString(PrimitiveStructType.D)); + + ExpectedStrings.Add(PrimitiveStructType.E.ToDecimalString()); // UInt128 + ExpectedStrings.Add(PrimitiveStructType.F.ToDecimalString()); // UInt256 + + ExpectedStrings.Add(LexToString(PrimitiveStructType.G)); + ExpectedStrings.Add(LexToString(PrimitiveStructType.H)); + ExpectedStrings.Add(LexToString(PrimitiveStructType.I)); + ExpectedStrings.Add(LexToString(PrimitiveStructType.J)); + + ExpectedStrings.Add(PrimitiveStructType.K.ToDecimalString()); // Int128 + ExpectedStrings.Add(PrimitiveStructType.L.ToDecimalString()); // Int256 + + ExpectedStrings.Add(LexToString(PrimitiveStructType.M)); + + // Floats + ExpectedStrings.Add(TrimFloat(PrimitiveStructType.N)); + ExpectedStrings.Add(TrimFloat(PrimitiveStructType.O)); + + ExpectedStrings.Add(PrimitiveStructType.P); + + // Identity/ConnectionId + ExpectedStrings.Add(PrimitiveStructType.Q.ToHex().Replace(TEXT("0x"), TEXT(""))); + ExpectedStrings.Add(PrimitiveStructType.R.ToHex().Replace(TEXT("0x"), TEXT(""))); + + ExpectedStrings.Add(NormalizeTimestamp(PrimitiveStructType.S)); + ExpectedStrings.Add(NormalizeDuration(PrimitiveStructType.T)); + + // Push the normalized expectation into the same handler instance + Handler->ExpectedStrings = MoveTemp(ExpectedStrings); + + //Call Reducer + Ctx.Reducers->InsertPrimitivesAsStrings(PrimitiveStructType); + }); }); + + // Wait for the test counter to signal completion. + ADD_LATENT_AUTOMATION_COMMAND(FWaitForTestCounter(*this, TestName, Handler->Counter, FPlatformTime::Seconds())); + + return true; +} + +static FString GetReauthTokenPath() +{ + const FString Dir = FPaths::Combine(FPaths::ProjectSavedDir(), TEXT("Tests")); + IFileManager::Get().MakeDirectory(*Dir, /*Tree*/true); + return FPaths::Combine(Dir, TEXT("reauth_token.txt")); +} + +bool FReauth1Test::RunTest(const FString &Parameters) +{ + TestName = "Reauth"; + + if (!ValidateParameterConfig(this)) + { + return false; + } + + // Create and register a test counter to track completion. + UTestHandler *Handler = CreateTestHandler(); + Handler->Counter->Register(TEXT("ReauthPart1")); + + UDbConnection *Connection = ConnectThen(Handler->Counter, TestName, [this, Handler](UDbConnection *Conn) + { + UCredentials::Init(TestName); + const FString Token = UCredentials::LoadToken(); + UE_LOG(LogTemp, Display, TEXT("[Reauth1] Loaded token: '%s'"), *Token); + if (!Token.IsEmpty()) + { + const FString TokenFilePath = GetReauthTokenPath(); + const bool bOK = FFileHelper::SaveStringToFile(Token, *TokenFilePath); + UE_LOG(LogTemp, Display, TEXT("[Reauth1] Save token -> %s (ok=%d)"), *TokenFilePath, bOK); + + UCredentials::SaveToken(Token); + Handler->Counter->MarkSuccess("ReauthPart1"); + } + else + { + Handler->Counter->MarkFailure("ReauthPart1", TEXT("Token was not saved")); + } }); + + // Wait for the test counter to signal completion. + ADD_LATENT_AUTOMATION_COMMAND(FWaitForTestCounter(*this, TestName, Handler->Counter, FPlatformTime::Seconds())); + + return true; +} + +bool FReauth2Test::RunTest(const FString &Parameters) +{ + TestName = "Reauth"; + + if (!ValidateParameterConfig(this)) + { + return false; + } + + // Create and register a test counter to track completion. + UTestHandler *Handler = CreateTestHandler(); + Handler->Counter->Register(TEXT("ReauthPart2")); + + UCredentials::Init(TestName); + const FString TokenFilePath = GetReauthTokenPath(); + //const FString OldToken = UCredentials::LoadToken(); + FString OldToken; + const bool bRead = FFileHelper::LoadFileToString(OldToken, *TokenFilePath); + + UE_LOG(LogTemp, Display, TEXT("[Reauth2] Read token (ok=%d) from %s: '%s'"), + bRead, *TokenFilePath, *OldToken); + if (!bRead || OldToken.IsEmpty()) + { + Handler->Counter->MarkFailure("ReauthPart2", TEXT("Missing/empty token file")); + ADD_LATENT_AUTOMATION_COMMAND(FWaitForTestCounter(*this, TestName, Handler->Counter, FPlatformTime::Seconds())); + return true; + } + + UDbConnection *Connection = ConnectWithThen( + Handler->Counter, + TestName, + [OldToken](UDbConnectionBuilder *Builder) + { + return Builder->WithToken(OldToken); + }, + [this, Handler, OldToken](UDbConnection *Conn) + { + const FString CurrentToken = UCredentials::LoadToken(); + UE_LOG(LogTemp, Display, TEXT("[Reauth2] CurrentToken='%s' OldToken='%s'"), + *CurrentToken, *OldToken); + if (CurrentToken == OldToken) + { + Handler->Counter->MarkSuccess("ReauthPart2"); + } + else + { + Handler->Counter->MarkFailure("ReauthPart2", FString(TEXT("Unexpected Token: ")) + CurrentToken); + } + }); + + // Wait for the test counter to signal completion. + ADD_LATENT_AUTOMATION_COMMAND(FWaitForTestCounter(*this, TestName, Handler->Counter, FPlatformTime::Seconds())); + + return true; +} + +bool FShouldFailTest::RunTest(const FString &Parameters) +{ + TestName = "ShouldFail"; + + if (!ValidateParameterConfig(this)) + { + return false; + } + + UTestHandler *Handler = CreateTestHandler(); + Handler->Counter->Register(TEXT("ShouldFail")); + Handler->Counter->MarkFailure("ShouldFail", "This is an intentional failure."); + + ADD_LATENT_AUTOMATION_COMMAND(FWaitForTestCounter(*this, TestName, Handler->Counter, FPlatformTime::Seconds())); + + return true; +} + +bool FCallerAlwaysNotifiedTest::RunTest(const FString &Parameters) +{ + TestName = "CallerAlwaysNotified"; + + if (!ValidateParameterConfig(this)) + { + return false; + } + + // Create and register a test counter to track completion. + UTestHandler *Handler = CreateTestHandler(); + Handler->Counter->Register(TEXT("NoOpSucceeds")); + + UDbConnection *Connection = ConnectThen(Handler->Counter, TestName, [this, Handler](UDbConnection *Conn) + { SubscribeAllThen(Conn, [this, Handler, Conn](FSubscriptionEventContext Ctx) + { + // Perform initial check to ensure all tables are empty before the test. + if (!AssertAllTablesEmpty(this, Conn->Db)) + { + Handler->Counter->Abort(); + return; + } + + Ctx.Reducers->OnNoOpSucceeds.AddDynamic(Handler, &UTestHandler::OnNoOpSucceeds); + Ctx.Reducers->NoOpSucceeds(); }); }); + + // Wait for the test counter to signal completion. + ADD_LATENT_AUTOMATION_COMMAND(FWaitForTestCounter(*this, TestName, Handler->Counter, FPlatformTime::Seconds())); + + return true; +} + +bool FSubscribeAllSelectStarTest::RunTest(const FString &Parameters) +{ + TestName = "SubscribeAllSelectStar"; + + if (!ValidateParameterConfig(this)) + return false; + UInsertPrimitiveHandler *Handler = CreateTestHandler(); + + Handler->Counter->Register(TEXT("on_subscription_applied_nothing")); +#define REG(Suffix, Expected, RowStructType) Handler->Counter->Register(TEXT("InsertOne" #Suffix)); + FOREACH_PRIMITIVE(REG) +#undef REG + + UDbConnection *Connection = ConnectThen(Handler->Counter, TestName, [this, Handler](UDbConnection *Conn) + { +#define BIND_HANDLER(Suffix, Expected, RowStructType) Conn->Db->One##Suffix->OnInsert.AddDynamic(Handler, &UInsertPrimitiveHandler::OnInsertOne##Suffix); + FOREACH_PRIMITIVE(BIND_HANDLER) +#undef BIND_HANDLER + + SubscribeAllThen(Conn, [this, Handler, Conn](FSubscriptionEventContext Ctx) + { + if (!AssertAllTablesEmpty(this, Conn->Db)) + { + Handler->Counter->MarkFailure(TEXT("on_subscription_applied_nothing"), TEXT("Tables not empty")); + return; + } + + Handler->Counter->MarkSuccess(TEXT("on_subscription_applied_nothing")); + +#define CALL_INSERT(Suffix, Expected, RowStructType) Ctx.Reducers->InsertOne##Suffix(Expected); + FOREACH_PRIMITIVE(CALL_INSERT) +#undef CALL_INSERT + }); }); + + ADD_LATENT_AUTOMATION_COMMAND(FWaitForTestCounter(*this, TestName, Handler->Counter, FPlatformTime::Seconds())); + return true; +} + +bool FRowDeduplicationTest::RunTest(const FString &Parameters) +{ + TestName = "RowDeduplication"; + + if (!ValidateParameterConfig(this)) + { + return false; + } + + URowDeduplicationHandler *Handler = CreateTestHandler(); + Handler->Counter->Register(TEXT("on_subscription_applied_nothing")); + Handler->Counter->Register(TEXT("ins_24")); + Handler->Counter->Register(TEXT("ins_42")); + Handler->Counter->Register(TEXT("del_24")); + Handler->Counter->Register(TEXT("upd_42")); + + UDbConnection *Connection = ConnectThen(Handler->Counter, TestName, [this, Handler](UDbConnection *Conn) + { + Conn->Db->PkU32->OnInsert.AddDynamic(Handler, &URowDeduplicationHandler::OnInsertPkU32); + Conn->Db->PkU32->OnDelete.AddDynamic(Handler, &URowDeduplicationHandler::OnDeletePkU32); + Conn->Db->PkU32->OnUpdate.AddDynamic(Handler, &URowDeduplicationHandler::OnUpdatePkU32); + + TArray Queries = { + TEXT("SELECT * FROM pk_u32 WHERE pk_u32.n < 100;"), + TEXT("SELECT * FROM pk_u32 WHERE pk_u32.n < 200;") + }; + + SubscribeTheseThen(Conn, Queries, [this, Handler, Conn](FSubscriptionEventContext Ctx) + { + if (!AssertAllTablesEmpty(this, Conn->Db)) + { + Handler->Counter->MarkFailure(TEXT("on_subscription_applied_nothing"), TEXT("tables not empty")); + Handler->Counter->Abort(); + return; + } + Handler->Counter->MarkSuccess(TEXT("on_subscription_applied_nothing")); + Ctx.Reducers->InsertPkU32(24, 0xbeef); + Ctx.Reducers->InsertPkU32(42, 0xbeef); + }); }); + + ADD_LATENT_AUTOMATION_COMMAND(FWaitForTestCounter(*this, TestName, Handler->Counter, FPlatformTime::Seconds())); + return true; +} + +bool FRowDeduplicationJoinRAndSTest::RunTest(const FString &Parameters) +{ + TestName = "RowDeduplicationJoinRAndS"; + + if (!ValidateParameterConfig(this)) + { + return false; + } + + URowDeduplicationJoinHandler *Handler = CreateTestHandler(); + Handler->Counter->Register(TEXT("on_subscription_applied_nothing")); + Handler->Counter->Register(TEXT("pk_u32_on_insert")); + Handler->Counter->Register(TEXT("pk_u32_on_update")); + Handler->Counter->Register(TEXT("unique_u32_on_insert")); + + UDbConnection *Connection = ConnectThen(Handler->Counter, TestName, [this, Handler](UDbConnection *Conn) + { + Conn->Db->PkU32->OnInsert.AddDynamic(Handler, &URowDeduplicationJoinHandler::OnInsertPkU32); + Conn->Db->PkU32->OnUpdate.AddDynamic(Handler, &URowDeduplicationJoinHandler::OnUpdatePkU32); + Conn->Db->PkU32->OnDelete.AddDynamic(Handler, &URowDeduplicationJoinHandler::OnDeletePkU32); + Conn->Db->UniqueU32->OnInsert.AddDynamic(Handler, &URowDeduplicationJoinHandler::OnInsertUniqueU32); + Conn->Db->UniqueU32->OnDelete.AddDynamic(Handler, &URowDeduplicationJoinHandler::OnDeleteUniqueU32); + + TArray Queries = { + TEXT("SELECT * FROM pk_u32;"), + TEXT("SELECT unique_u32.* FROM unique_u32 JOIN pk_u32 ON unique_u32.n = pk_u32.n;") + }; + + SubscribeTheseThen(Conn, Queries, [Handler](FSubscriptionEventContext Ctx) + { + Handler->Counter->MarkSuccess(TEXT("on_subscription_applied_nothing")); + Ctx.Reducers->InsertPkU32(42, 50); + }); }); + + ADD_LATENT_AUTOMATION_COMMAND(FWaitForTestCounter(*this, TestName, Handler->Counter, FPlatformTime::Seconds())); + return true; +} + +bool FRowDeduplicationRJoinSandRJoinTTest::RunTest(const FString &Parameters) +{ + TestName = "RowDeduplicationRJoinSAndRJoinT"; + + if (!ValidateParameterConfig(this)) + return false; + + TSharedPtr Counter = MakeShared(); + + ADD_LATENT_AUTOMATION_COMMAND(FWaitForTestCounter(*this, TestName, Counter, FPlatformTime::Seconds())); + return true; +} + +bool FLhsJoinUpdateTest::RunTest(const FString &Parameters) +{ + TestName = "TestLhsJoinUpdate"; + + if (!ValidateParameterConfig(this)) + return false; + + ULhsJoinUpdateHandler *Handler = CreateTestHandler(); + Handler->Counter->Register(TEXT("on_insert_1")); + Handler->Counter->Register(TEXT("on_insert_2")); + Handler->Counter->Register(TEXT("on_update_1")); + Handler->Counter->Register(TEXT("on_update_2")); + + UDbConnection *Connection = ConnectThen(Handler->Counter, TestName, [Handler](UDbConnection *Conn) + { + Conn->Reducers->OnInsertPkU32.AddDynamic(Handler, &ULhsJoinUpdateHandler::OnInsertPkU32); + Conn->Reducers->OnUpdatePkU32.AddDynamic(Handler, &ULhsJoinUpdateHandler::OnUpdatePkU32); + + TArray Queries = { + TEXT("SELECT p.* FROM pk_u32 p WHERE n = 1"), + TEXT("SELECT p.* FROM pk_u32 p JOIN unique_u32 u ON p.n = u.n WHERE u.data > 0 AND u.data < 5") + }; + + SubscribeTheseThen(Conn, Queries, [Handler](FSubscriptionEventContext Ctx) + { + Ctx.Reducers->InsertPkU32(1, 0); + Ctx.Reducers->InsertPkU32(2, 0); + Ctx.Reducers->InsertUniqueU32(1, 3); + Ctx.Reducers->InsertUniqueU32(2, 4); + }); }); + + ADD_LATENT_AUTOMATION_COMMAND(FWaitForTestCounter(*this, TestName, Handler->Counter, FPlatformTime::Seconds())); + return true; +} + +bool FLhsJoinUpdateDisjointQueriesTest::RunTest(const FString &Parameters) +{ + TestName = "TestLhsJoinUpdateDisjointQueries"; + + if (!ValidateParameterConfig(this)) + return false; + + ULhsJoinUpdateDisjointQueriesHandler *Handler = CreateTestHandler(); + Handler->Counter->Register(TEXT("on_insert_1")); + Handler->Counter->Register(TEXT("on_insert_2")); + Handler->Counter->Register(TEXT("on_update_1")); + Handler->Counter->Register(TEXT("on_update_2")); + + UDbConnection *Connection = ConnectThen(Handler->Counter, TestName, [Handler](UDbConnection *Conn) + { + Conn->Reducers->OnInsertPkU32.AddDynamic(Handler, &ULhsJoinUpdateDisjointQueriesHandler::OnInsertPkU32Reducer); + Conn->Reducers->OnUpdatePkU32.AddDynamic(Handler, &ULhsJoinUpdateDisjointQueriesHandler::OnUpdatePkU32Reducer); + + TArray Queries = { + TEXT("SELECT p.* FROM pk_u32 p WHERE n = 1;"), + TEXT("SELECT p.* FROM pk_u32 p JOIN unique_u32 u ON p.n = u.n WHERE u.data > 0 AND u.data < 5 AND u.n != 1;") + }; + + SubscribeTheseThen(Conn, Queries, [Handler](FSubscriptionEventContext Ctx) + { + Ctx.Reducers->InsertPkU32(1, 0); + Ctx.Reducers->InsertPkU32(2, 0); + Ctx.Reducers->InsertUniqueU32(1, 3); + Ctx.Reducers->InsertUniqueU32(2, 4); + }); }); + + ADD_LATENT_AUTOMATION_COMMAND(FWaitForTestCounter(*this, TestName, Handler->Counter, FPlatformTime::Seconds())); + return true; +} + +bool FIntraQueryBagSemanticsForJoinTest::RunTest(const FString &Parameters) +{ + TestName = "TestIntraQueryBagSemanticsForJoin"; + + if (!ValidateParameterConfig(this)) + { + return false; + } + + // Create the handler for this test. + UBagSemanticsTestHandler *Handler = CreateTestHandler(); + Handler->Counter->Register(TEXT("on_subscription_applied_nothing")); + Handler->Counter->Register(TEXT("pk_u32_on_delete")); + + UDbConnection *Connection = ConnectThen(Handler->Counter, TestName, [this, Handler](UDbConnection *Conn) + { + // Bind the on_delete handler for the PkU32 table. + Conn->Db->PkU32->OnDelete.AddDynamic(Handler, &UBagSemanticsTestHandler::OnDeletePkU32); + + // Subscribe to both tables and the join query. + // Subscribe to both tables and the join query. + TArray Queries = { + TEXT("SELECT * FROM btree_u32"), + TEXT("SELECT pk_u32.* FROM pk_u32 JOIN btree_u32 ON pk_u32.n = btree_u32.n"), + }; + SubscribeTheseThen(Conn, Queries, [this, Handler, Conn](FSubscriptionEventContext Ctx) + { + // Insert (n: 0, data: 0) into btree_u32. + // No on_insert for PkU32 should fire because it is empty. + Ctx.Reducers->InsertIntoBtreeU32(TArray({ FBTreeU32Type(0, 0) })); + + // Now insert a row into pk_u32 and a duplicate into btree_u32. + // This creates a multiplicity of 2 for the join result. + // An on_insert for PkU32 should fire now. + Ctx.Reducers->InsertIntoPkBtreeU32(TArray({ FPkU32Type(0, 0) }), TArray({ FBTreeU32Type(0, 1) })); + + // Delete one of the joining rows from btree_u32. + // The multiplicity of the join result becomes 1, so no on_delete for PkU32 fires. + Ctx.Reducers->DeleteFromBtreeU32(TArray({ FBTreeU32Type(0, 0) })); + + // Delete the last joining row from btree_u32. + // The multiplicity of the join result becomes 0, so on_delete for PkU32 fires. + Ctx.Reducers->DeleteFromBtreeU32(TArray({ FBTreeU32Type(0, 1) })); + + if (!AssertAllTablesEmpty(this, Conn->Db)) + { + Handler->Counter->MarkFailure(TEXT("on_subscription_applied_nothing"), TEXT("tables not empty")); + Handler->Counter->Abort(); + return; + } + Handler->Counter->MarkSuccess(TEXT("on_subscription_applied_nothing")); + }); }); + + // Wait for the final `on_delete` event to signal completion. + ADD_LATENT_AUTOMATION_COMMAND(FWaitForTestCounter(*this, TestName, Handler->Counter, FPlatformTime::Seconds())); + + return true; +} + +bool FPkSimpleEnumTest::RunTest(const FString &Parameters) +{ + TestName = "PkSimpleEnum"; + + if (!ValidateParameterConfig(this)) + { + return false; + } + + UPkSimpleEnumHandler *Handler = CreateTestHandler(); + Handler->Counter->Register(TEXT("InsertPkSimpleEnum")); + Handler->Counter->Register(TEXT("UpdatePkPkSimpleEnum")); + + UDbConnection *Connection = ConnectThen(Handler->Counter, TestName, [Handler](UDbConnection *Conn) + { + Conn->Db->PkSimpleEnum->OnInsert.AddDynamic(Handler, &UPkSimpleEnumHandler::OnInsertPkSimpleEnum); + Conn->Db->PkSimpleEnum->OnUpdate.AddDynamic(Handler, &UPkSimpleEnumHandler::OnUpdatePkSimpleEnum); + Conn->Db->PkSimpleEnum->OnDelete.AddDynamic(Handler, &UPkSimpleEnumHandler::OnDeletePkSimpleEnum); + + TArray Queries; + Queries.Add(TEXT("SELECT * FROM pk_simple_enum")); + SubscribeTheseThen(Conn, Queries, [Handler](FSubscriptionEventContext Ctx) + { + Handler->Data1 = 42; + Handler->Data2 = 24; + Handler->A = ESimpleEnumType::Two; + Ctx.Reducers->InsertPkSimpleEnum(Handler->A, Handler->Data1); + }); }); + + ADD_LATENT_AUTOMATION_COMMAND(FWaitForTestCounter(*this, TestName, Handler->Counter, FPlatformTime::Seconds())); + return true; +} + +bool FParameterizedSubscriptionTest::RunTest(const FString &Parameters) +{ + TestName = "TestParameterizedSubscription"; + + if (!ValidateParameterConfig(this)) + { + return false; + } + + // Create a counter for the subscription phase. + UTestHandler *SubscriptionCounter = CreateTestHandler(); + SubscriptionCounter->Counter->Register(TEXT("client_0")); + SubscriptionCounter->Counter->Register(TEXT("client_1")); + + // Create the main test counter to track the final insert and update events. + UTestHandler *MainCounter = CreateTestHandler(); + MainCounter->Counter->Register(TEXT("insert_1")); // For client 0 + MainCounter->Counter->Register(TEXT("update_2")); // For client 0 + MainCounter->Counter->Register(TEXT("insert_3")); // For client 1 + MainCounter->Counter->Register(TEXT("update_4")); // For client 1 + + // --- Client 0: Alice --- + // Create a new handler for the first client + UParameterizedSubscriptionHandler *AliceHandler = CreateTestHandler(); + AliceHandler->Counters = MainCounter; + AliceHandler->ExpectedOldData = 1; + AliceHandler->ExpectedNewData = 2; + + UDbConnection *Connection = ConnectThen(AliceHandler->Counter, FString::Printf(TEXT("%s_client_0"), *TestName), [this, AliceHandler, SubscriptionCounter](UDbConnection *Conn) + { + // Subscribe to the 'pk_identity' table's insert and update events + Conn->Db->PkIdentity->OnInsert.AddDynamic(AliceHandler, &UParameterizedSubscriptionHandler::OnInsertPkIdentity); + Conn->Db->PkIdentity->OnUpdate.AddDynamic(AliceHandler, &UParameterizedSubscriptionHandler::OnUpdatePkIdentity); + + // Subscribe with the parameterized query + FSpacetimeDBIdentity ClientIdentity; + Conn->TryGetIdentity(ClientIdentity); + AliceHandler->ExpectedIdentity = ClientIdentity; + + TArray Queries; + Queries.Add(TEXT("SELECT * FROM pk_identity WHERE i = :sender")); + SubscribeTheseThen(Conn, Queries, [this, AliceHandler, Conn, SubscriptionCounter](FSubscriptionEventContext Ctx) + { + // Signal that this client has successfully subscribed + SubscriptionCounter->Counter->MarkSuccess("client_0"); + + // Perform the insert and update calls + Conn->Reducers->InsertPkIdentity(AliceHandler->ExpectedIdentity, AliceHandler->ExpectedOldData); + Conn->Reducers->UpdatePkIdentity(AliceHandler->ExpectedIdentity, AliceHandler->ExpectedNewData); + }); }); + + // --- Client 1: Bob --- + // Create a new handler for the second client + UParameterizedSubscriptionHandler *BobHandler = CreateTestHandler(); + BobHandler->Counters = MainCounter; + BobHandler->ExpectedOldData = 3; + BobHandler->ExpectedNewData = 4; + + UDbConnection *Connection2 = ConnectThen(BobHandler->Counter, FString::Printf(TEXT("%s_client_1"), *TestName), [this, BobHandler, SubscriptionCounter](UDbConnection *Conn) + { + // Subscribe to the 'pk_identity' table's insert and update events + Conn->Db->PkIdentity->OnInsert.AddDynamic(BobHandler, &UParameterizedSubscriptionHandler::OnInsertPkIdentity); + Conn->Db->PkIdentity->OnUpdate.AddDynamic(BobHandler, &UParameterizedSubscriptionHandler::OnUpdatePkIdentity); + + // Subscribe with the parameterized query + FSpacetimeDBIdentity ClientIdentity; + Conn->TryGetIdentity(ClientIdentity); + BobHandler->ExpectedIdentity = ClientIdentity; + + TArray Queries; + Queries.Add(TEXT("SELECT * FROM pk_identity WHERE i = :sender")); + SubscribeTheseThen(Conn, Queries, [this, BobHandler, Conn, SubscriptionCounter](FSubscriptionEventContext Ctx) + { + // Signal that this client has successfully subscribed + SubscriptionCounter->Counter->MarkSuccess("client_1"); + + // Perform the insert and update calls + Conn->Reducers->InsertPkIdentity(BobHandler->ExpectedIdentity, BobHandler->ExpectedOldData); + Conn->Reducers->UpdatePkIdentity(BobHandler->ExpectedIdentity, BobHandler->ExpectedNewData); + }); }); + + // Wait for all final insert and update events to complete. + ADD_LATENT_AUTOMATION_COMMAND(FWaitForTestCounter(*this, TestName, SubscriptionCounter->Counter, FPlatformTime::Seconds())); + ADD_LATENT_AUTOMATION_COMMAND(FWaitForTestCounter(*this, TestName, MainCounter->Counter, FPlatformTime::Seconds())); + return true; +} + +bool FRlsSubscriptionTest::RunTest(const FString &Parameters) +{ + TestName = "TestRlsSubscription"; + + if (!ValidateParameterConfig(this)) + { + return false; + } + + // Create a single test counter to track the final insert events. + URLSSubscriptionHandler *MainHandler = CreateTestHandler(); + MainHandler->Counter->Register(TEXT("Alice")); + MainHandler->Counter->Register(TEXT("Bob")); + + // --- Client 0: Alice --- + // Create a new handler for the first client + URLSSubscriptionHandler *AliceHandler = CreateTestHandler(); + AliceHandler->MainCounter = MainHandler; + + UDbConnection *Connection = ConnectThen(AliceHandler->Counter, FString::Printf(TEXT("%s_client_0"), *TestName), [this, AliceHandler, MainHandler](UDbConnection *Conn) + { + // Subscribe to the 'users' table insert event + Conn->Db->Users->OnInsert.AddDynamic(AliceHandler, &URLSSubscriptionHandler::OnInsertUser); + + // Subscribe to the 'users' table + TArray Queries; + Queries.Add(TEXT("SELECT * FROM users")); + SubscribeTheseThen(Conn, Queries, [this, AliceHandler, Conn, MainHandler](FSubscriptionEventContext Ctx) + { + // Get the identity for later validation + FSpacetimeDBIdentity Identity; + if (Ctx.TryGetIdentity(Identity)) + { + AliceHandler->ExpectedUserType = FUsersType(Identity, FString("Alice")); + + // We perform the insert directly here without waiting for the other client. + // The subscription is what matters. Both clients will insert, and both will receive the other's insert. + Ctx.Reducers->InsertUser(AliceHandler->ExpectedUserType.Name, AliceHandler->ExpectedUserType.Identity); + } + else + { + MainHandler->Counter->MarkFailure("Alice", "Failed to get identity for Alice"); + } + + }); }); + + // --- Client 1: Bob --- + // Create a new handler for the second client + URLSSubscriptionHandler *BobHandler = CreateTestHandler(); + BobHandler->MainCounter = MainHandler; + + UDbConnection *Connection2 = ConnectThen(BobHandler->Counter, FString::Printf(TEXT("%s_client_1"), *TestName), [this, BobHandler, MainHandler](UDbConnection *Conn) + { + // Subscribe to the 'users' table insert event + Conn->Db->Users->OnInsert.AddDynamic(BobHandler, &URLSSubscriptionHandler::OnInsertUser); + + // Subscribe to the 'users' table + TArray Queries; + Queries.Add(TEXT("SELECT * FROM users")); + SubscribeTheseThen(Conn, Queries, [this, BobHandler, Conn, MainHandler](FSubscriptionEventContext Ctx) + { + FSpacetimeDBIdentity Identity; + if (Ctx.TryGetIdentity(Identity)) + { + BobHandler->ExpectedUserType = FUsersType(Identity, FString("Bob")); + + // We perform the insert directly here without waiting for the other client. + // The subscription is what matters. Both clients will insert, and both will receive the other's insert. + Ctx.Reducers->InsertUser(BobHandler->ExpectedUserType.Name, BobHandler->ExpectedUserType.Identity); + } + else + { + MainHandler->Counter->MarkFailure("Bob", "Failed to get identity for Bob"); + } + }); }); + + // Wait for all final insert events to complete. + ADD_LATENT_AUTOMATION_COMMAND(FWaitForTestCounter(*this, TestName, MainHandler->Counter, FPlatformTime::Seconds())); + + return true; +} + +bool FIndexedSimpleEnumTest::RunTest(const FString &Parameters) +{ + TestName = "IndexedSimpleEnum"; + + if (!ValidateParameterConfig(this)) + { + return false; + } + + UIndexedSimpleEnumHandler *Handler = CreateTestHandler(); + + Handler->Counter->Register(TEXT("IndexedSimpleEnum")); + + UDbConnection *Connection = ConnectThen(Handler->Counter, TestName, [Handler](UDbConnection *Conn) + { + Conn->Db->IndexedSimpleEnum->OnInsert.AddDynamic(Handler, &UIndexedSimpleEnumHandler::OnInsertIndexedSimpleEnum); + + TArray Queries; + Queries.Add(TEXT("SELECT * FROM indexed_simple_enum")); + SubscribeTheseThen(Conn, Queries, [Handler](FSubscriptionEventContext Ctx) + { + Handler->A1 = ESimpleEnumType::Two; + Handler->A2 = ESimpleEnumType::One; + + Ctx.Reducers->InsertIntoIndexedSimpleEnum(Handler->A1); + }); }); + + ADD_LATENT_AUTOMATION_COMMAND(FWaitForTestCounter(*this, TestName, Handler->Counter, FPlatformTime::Seconds())); + return true; +} + +bool FOverlappingSubscriptionsTest::RunTest(const FString &Parameters) +{ + TestName = "OverlappingSubscriptions"; + + if (!ValidateParameterConfig(this)) + return false; + UOverlappingSubscriptionsHandler *Handler = CreateTestHandler(); + Handler->Counter->Register(TEXT("OverlappingSubscriptions_call_insert_reducer")); + Handler->Counter->Register(TEXT("OverlappingSubscriptions_insert_reducer_done")); + Handler->Counter->Register(TEXT("OverlappingSubscriptions_subscribe_with_row_present")); + Handler->Counter->Register(TEXT("OverlappingSubscriptions_call_update_reducer")); + Handler->Counter->Register(TEXT("OverlappingSubscriptions_update_row")); + + UDbConnection *Connection = ConnectThen(Handler->Counter, TestName, [Handler](UDbConnection *Conn) + { + Handler->Connection = Conn; + Conn->Reducers->OnInsertPkU8.AddDynamic(Handler, &UOverlappingSubscriptionsHandler::OnInsertPkU8Reducer); + Conn->Db->PkU8->OnUpdate.AddDynamic(Handler, &UOverlappingSubscriptionsHandler::OnUpdatePkU8); + + Conn->Reducers->InsertPkU8(1, 0); + Handler->Counter->MarkSuccess(TEXT("OverlappingSubscriptions_call_insert_reducer")); }); + + ADD_LATENT_AUTOMATION_COMMAND(FWaitForTestCounter(*this, TestName, Handler->Counter, FPlatformTime::Seconds())); + return true; +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/Tests/TestCounter.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/Tests/TestCounter.cpp new file mode 100644 index 00000000000..332e61064b2 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/Tests/TestCounter.cpp @@ -0,0 +1,87 @@ +#include "Tests/TestCounter.h" + +void FTestCounter::Register(const FString& TestName) +{ + FScopeLock Lock(&Mutex); + if (Registered.Contains(TestName)) + { + UE_LOG(LogTemp, Error, TEXT("Duplicate test name: %s"), *TestName); + } + Registered.Add(TestName); +} + +void FTestCounter::MarkSuccess(const FString& TestName) +{ + FScopeLock Lock(&Mutex); + Outcomes.Add(TestName, { true, FString() }); + UE_LOG(LogTemp, Log, TEXT("Operation success: %s"), *TestName); +} + +void FTestCounter::MarkFailure(const FString& TestName, const FString& Error) +{ + FScopeLock Lock(&Mutex); + Outcomes.Add(TestName, { false, Error }); + UE_LOG(LogTemp, Error, TEXT("Operation failed: %s, %s"), *TestName, *Error); +} + +bool FTestCounter::IsComplete() const +{ + FScopeLock Lock(&Mutex); + return Outcomes.Num() == Registered.Num(); +} + +bool FTestCounter::AllSucceeded() const +{ + FScopeLock Lock(&Mutex); + if (Outcomes.Num() != Registered.Num()) + { + return false; + } + for (const auto& Elem : Outcomes) + { + if (!Elem.Value.bSuccess) + { + return false; + } + } + return true; +} + +TArray FTestCounter::GetFailures() const +{ + FScopeLock Lock(&Mutex); + TArray Failures; + for (const FString& Name : Registered) + { + const FTestOutcome* Outcome = Outcomes.Find(Name); + if (!Outcome) + { + Failures.Add(FString::Printf(TEXT("TIMEOUT: %s"), *Name)); + } + else if (!Outcome->bSuccess) + { + Failures.Add(FString::Printf(TEXT("FAILED: %s: %s"), *Name, *Outcome->Error)); + } + } + return Failures; +} + +TArray FTestCounter::GetSuccesses() const +{ + FScopeLock Lock(&Mutex); + TArray Successes; + for (const FString& Name : Registered) + { + const FTestOutcome* Outcome = Outcomes.Find(Name); + if (Outcome && Outcome->bSuccess) + { + Successes.Add(FString::Printf(TEXT("SUCCESS: %s"), *Name)); + } + } + return Successes; +} + +void FTestCounter::Abort() +{ + bAborted = true; +} \ No newline at end of file diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Private/Tests/TestHandler.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/Private/Tests/TestHandler.cpp new file mode 100644 index 00000000000..852f67b3244 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Private/Tests/TestHandler.cpp @@ -0,0 +1,1615 @@ +#include "Tests/TestHandler.h" +#include "Tests/TestCounter.h" +#include "Tests/CommonTestFunctions.h" + +/* Implementation for every primitive ---------------------------------- */ +#define DEFINE_UFUNC(Suffix, Expected, RowStructType) \ +void UInsertPrimitiveHandler::OnInsertOne##Suffix(const FEventContext& Context, const RowStructType& Value) \ +{ \ + static const FString Name(TEXT("InsertOne" #Suffix)); \ + RowStructType ExpectedValue = RowStructType(Expected); \ + (Value == ExpectedValue) ? Counter->MarkSuccess(Name) : Counter->MarkFailure(Name, TEXT("Unexpected value")); \ +} + +FOREACH_PRIMITIVE(DEFINE_UFUNC) +#undef DEFINE_UFUNC + +/* DeletePrimitive handler functions ------------------------------------ */ +#define DEFINE_DELETE_UNIQUE(Suffix, Field, Literal, Expected, RowStructType) \ +void UDeletePrimitiveHandler::OnInsertUnique##Suffix(const FEventContext& Context, const RowStructType& Value) \ +{ \ + static const FString Name(TEXT("InsertUnique" #Suffix)); \ + RowStructType ExpectedValue; \ + ExpectedValue.Field = Literal; \ + ExpectedValue.Data = Expected; \ + if (Value == ExpectedValue) { \ + Counter->MarkSuccess(Name); \ + } else { \ + Counter->MarkFailure(Name, TEXT("Unexpected value")); \ + } \ + Context.Reducers->DeleteUnique##Suffix(Value.Field); \ +} \ + \ +void UDeletePrimitiveHandler::OnDeleteUnique##Suffix(const FEventContext& Context, const RowStructType& Value) \ +{ \ + static const FString Name(TEXT("DeleteUnique" #Suffix)); \ + RowStructType ExpectedValue; \ + ExpectedValue.Field = Literal; \ + ExpectedValue.Data = Expected; \ + (Value == ExpectedValue) ? Counter->MarkSuccess(Name) : Counter->MarkFailure(Name, TEXT("Unexpected value")); \ +} + +FOREACH_UNIQUE_PRIMITIVE(DEFINE_DELETE_UNIQUE) +#undef DEFINE_DELETE_UNIQUE + +/* UpdatePrimitive handler functions ------------------------------------ */ +#define DEFINE_UPDATE_PK(Suffix, Field, Literal, Expected, Updated, RowStructType) \ +void UUpdatePrimitiveHandler::OnInsertPk##Suffix(const FEventContext& Context, const RowStructType& Value) \ +{ \ + static const FString Name(TEXT("InsertPk" #Suffix)); \ + RowStructType ExpectedValue; \ + ExpectedValue.Field = Literal; \ + ExpectedValue.Data = Expected; \ + if (Value == ExpectedValue) { \ + Counter->MarkSuccess(Name); \ + } else { \ + Counter->MarkFailure(Name, TEXT("Unexpected value")); \ + } \ + Context.Reducers->UpdatePk##Suffix(Value.Field, Updated); \ +} \ + \ +void UUpdatePrimitiveHandler::OnUpdatePk##Suffix(const FEventContext& Context, const RowStructType& OldValue, const RowStructType& NewValue) \ +{ \ + static const FString Name(TEXT("UpdatePk" #Suffix)); \ + RowStructType ExpectedOld; ExpectedOld.Field = Literal; ExpectedOld.Data = Expected; \ + RowStructType ExpectedNew; ExpectedNew.Field = Literal; ExpectedNew.Data = Updated; \ + if (OldValue == ExpectedOld && NewValue == ExpectedNew) { \ + Counter->MarkSuccess(Name); \ + } else { \ + Counter->MarkFailure(Name, TEXT("Unexpected value")); \ + } \ + Context.Reducers->DeletePk##Suffix(NewValue.Field); \ +} \ + \ +void UUpdatePrimitiveHandler::OnDeletePk##Suffix(const FEventContext& Context, const RowStructType& Value) \ +{ \ + static const FString Name(TEXT("DeletePk" #Suffix)); \ + RowStructType ExpectedValue; ExpectedValue.Field = Literal; ExpectedValue.Data = Updated; \ + (Value == ExpectedValue) ? Counter->MarkSuccess(Name) : Counter->MarkFailure(Name, TEXT("Unexpected value")); \ +} + +FOREACH_PK_PRIMITIVE(DEFINE_UPDATE_PK) +#undef DEFINE_UPDATE_PK + +void UIdentityActionsHandler::SetExpectedValue(const FSpacetimeDBIdentity& Expected, int32 InsertData, int32 UpdateData) +{ + ExpectedValue = Expected; + ExpectedInsertData = InsertData; + ExpectedUpdateData = UpdateData; +} + +void UConnectionIdActionsHandler::SetExpectedvalue(const FSpacetimeDBConnectionId& Expected, const int32& Data) +{ + ExpectedValue = Expected; + ExpectedData = Data; +} + +void UIdentityActionsHandler::OnInsertOneIdentity(const FEventContext& Context, const FOneIdentityType& Value) +{ + static const FString Name(TEXT("InsertIdentity")); + + FOneIdentityType Expectedstruct = FOneIdentityType(ExpectedValue); + if (Value == Expectedstruct) + { + Counter->MarkSuccess(Name); + } + else + { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } +} + +void UIdentityActionsHandler::OnInsertUniqueIdentity(const FEventContext& Context, const FUniqueIdentityType& Value) +{ + static const FString Name(TEXT("UniqueIdentity_Insert")); + + FUniqueIdentityType Expectedstruct = FUniqueIdentityType(ExpectedValue); + if (Value == Expectedstruct) + { + Counter->MarkSuccess(Name); + } + else + { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } + Context.Reducers->DeleteUniqueIdentity(ExpectedValue); +} + +void UIdentityActionsHandler::OnInsertCallerIdentity(const FEventContext& Context, const FOneIdentityType& Value) +{ + static const FString Name(TEXT("InsertCallerIdentity")); + + FSpacetimeDBIdentity Identity; + if (Context.TryGetIdentity(Identity)) + { + if (Value.I == Identity) + { + Counter->MarkSuccess(Name); + } + else + { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } + } + else { + Counter->MarkFailure(Name, TEXT("Identity not found")); + } +} + +void UIdentityActionsHandler::OnInsertPkIdentity(const FEventContext& Context, const FPkIdentityType& Value) +{ + static const FString Name(TEXT("PkIdentity_Insert")); + + FPkIdentityType ExpectedStruct = FPkIdentityType(ExpectedValue, ExpectedInsertData); + if (Value == ExpectedStruct) + { + Counter->MarkSuccess(Name); + } + else + { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } + Context.Reducers->UpdatePkIdentity(ExpectedValue, ExpectedUpdateData); + Context.Db->PkIdentity->OnInsert.RemoveDynamic(this, &UIdentityActionsHandler::OnInsertPkIdentity); + +} + +void UIdentityActionsHandler::OnUpdatePkIdentity(const FEventContext& Context, const FPkIdentityType& OldValue, const FPkIdentityType& NewValue) +{ + static const FString Name(TEXT("PkIdentity_Update")); + + FPkIdentityType ExpectedNewStruct = FPkIdentityType(ExpectedValue, ExpectedUpdateData); + FPkIdentityType ExpectedOldStruct = FPkIdentityType(ExpectedValue, ExpectedInsertData); + if (OldValue == ExpectedOldStruct && + NewValue == ExpectedNewStruct) + { + Counter->MarkSuccess(Name); + } + else + { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } + Context.Reducers->DeletePkIdentity(ExpectedValue); + Context.Db->PkIdentity->OnUpdate.RemoveDynamic(this, &UIdentityActionsHandler::OnUpdatePkIdentity); +} + +void UIdentityActionsHandler::OnDeletePkIdentity(const FEventContext& Context, const FPkIdentityType& Value) +{ + static const FString Name(TEXT("PkIdentity_Delete")); + FPkIdentityType ExpectedStruct = FPkIdentityType(ExpectedValue, ExpectedUpdateData); + if (Value == ExpectedStruct) + { + Counter->MarkSuccess(Name); + } + else + { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } + Context.Db->PkIdentity->OnDelete.RemoveDynamic(this, &UIdentityActionsHandler::OnDeletePkIdentity); +} + +void UIdentityActionsHandler::OnDeleteUniqueIdentity(const FEventContext& Context, const FUniqueIdentityType& Value) +{ + static const FString Name(TEXT("UniqueIdentity_Delete")); + + if (Value.I == ExpectedValue) + { + Counter->MarkSuccess(Name); + } + else + { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } +} + +void UConnectionIdActionsHandler::OnInsertOneConnectionId(const FEventContext& Context, const FOneConnectionIdType& Value) +{ + static const FString Name(TEXT("InsertConnectionId")); + + if (Value.A == ExpectedValue) + { + Counter->MarkSuccess(Name); + } + else + { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } +} + +void UConnectionIdActionsHandler::OnInsertPkConnectionId(const FEventContext& Context, const FPkConnectionIdType& Value) +{ + static const FString Name(TEXT("PkConnectionId_Insert")); + + if (Value.A == ExpectedValue) + { + Counter->MarkSuccess(Name); + } + else + { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } + ExpectedData = 2; + Context.Reducers->UpdatePkConnectionId(ExpectedValue, 2); +} + +void UConnectionIdActionsHandler::OnInsertUniqueConnectionId(const FEventContext& Context, const FUniqueConnectionIdType& Value) +{ + static const FString Name(TEXT("InsertUniqueConnectionId")); + + if (Value.Data == ExpectedData) + { + Counter->MarkSuccess(Name); + } + else + { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } + Context.Reducers->UpdateUniqueConnectionId(Value.A, Value.Data); +} + +void UConnectionIdActionsHandler::OnInsertCallerConnectionId(const FEventContext& Context, const FOneConnectionIdType& Value) +{ + static const FString Name(TEXT("InsertCallerConnectionId")); + + if (Value.A == Context.GetConnectionId()) + { + Counter->MarkSuccess(Name); + } + else + { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } +} + +void UConnectionIdActionsHandler::OnDeletePkConnectionId(const FEventContext& Context, const FPkConnectionIdType& Value) +{ + static const FString Name(TEXT("PkConnectionId_Delete")); + + if (Value.A == ExpectedValue) + { + Counter->MarkSuccess(Name); + } + else + { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } +} + +void UConnectionIdActionsHandler::OnUpdatePkConnectionId(const FEventContext& Context, const FPkConnectionIdType& OldValue, const FPkConnectionIdType& NewValue) +{ + static const FString Name(TEXT("PkConnectionId_Update")); + + if (NewValue.Data == ExpectedData && NewValue.A == ExpectedValue) + { + Counter->MarkSuccess(Name); + } + else + { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } + Context.Reducers->DeletePkConnectionId(ExpectedValue); +} + +void UConnectionIdActionsHandler::OnUpdateUniqueConnectionId(const FEventContext& Context, const FUniqueConnectionIdType& OldValue, const FUniqueConnectionIdType& NewValue) +{ + static const FString Name(TEXT("UpdateUniqueConnectionId")); + + if (NewValue.Data == ExpectedData && NewValue.A == ExpectedValue) + { + Counter->MarkSuccess(Name); + } + else + { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } + + SetExpectedvalue(NewValue.A, 3); + + // Call the reducer to insert the identity first. + Context.Reducers->UpdateUniqueConnectionId(NewValue.A, 3); +} + +void UTimestampActionsHandler::SetExpectedvalue(const FSpacetimeDBTimestamp& Expected) +{ + ExpectedValue = Expected; +} + +void UOnReducerActionsHandler::SetExpectedvalue(const uint8& Expected) +{ + ExpectedValue = Expected; +} + +void UOnReducerActionsHandler::SetExpectedKeyAndValue(const uint8& Key, int32 SuccessValue, int32 FailValue) +{ + ExpectedKey = Key; + ExpectedValue = SuccessValue; + ExpectedFailValue = FailValue; + bShouldSucceed = true; +} + +void UVectorDataActionsHandler::OnInsertVecU8(const FEventContext& Context, const FVecU8Type& Value) +{ + static const FString Name(TEXT("InsertVecU8")); + + if (ExpectedVecU8 == Value) + { + Counter->MarkSuccess(Name); + } + else + { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } +} + +void UVectorDataActionsHandler::OnInsertVecU16(const FEventContext& Context, const FVecU16Type& Value) +{ + static const FString Name(TEXT("InsertVecU16")); + + if (ExpectedVecU16 == Value) + { + Counter->MarkSuccess(Name); + } + else + { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } +} + +void UVectorDataActionsHandler::OnInsertVecU32(const FEventContext& Context, const FVecU32Type& Value) +{ + static const FString Name(TEXT("InsertVecU32")); + + if (ExpectedVecU32 == Value) + { + Counter->MarkSuccess(Name); + } + else + { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } +} + +void UVectorDataActionsHandler::OnInsertVecU64(const FEventContext& Context, const FVecU64Type& Value) +{ + static const FString Name(TEXT("InsertVecU64")); + + if (ExpectedVecU64 == Value) + { + Counter->MarkSuccess(Name); + } + else + { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } +} + +void UVectorDataActionsHandler::OnInsertVecU128(const FEventContext& Context, const FVecU128Type& Value) +{ + static const FString Name(TEXT("InsertVecU128")); + + if (ExpectedVecU128 == Value) + { + Counter->MarkSuccess(Name); + } + else + { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } +} + +void UVectorDataActionsHandler::OnInsertVecU256(const FEventContext& Context, const FVecU256Type& Value) +{ + static const FString Name(TEXT("InsertVecU256")); + + if (ExpectedVecU256 == Value) + { + Counter->MarkSuccess(Name); + } + else + { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } +} + +void UVectorDataActionsHandler::OnInsertVecI8(const FEventContext& Context, const FVecI8Type& Value) +{ + static const FString Name(TEXT("InsertVecI8")); + + if (ExpectedVecI8 == Value) + { + Counter->MarkSuccess(Name); + } + else + { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } +} + +void UVectorDataActionsHandler::OnInsertVecI16(const FEventContext& Context, const FVecI16Type& Value) +{ + static const FString Name(TEXT("InsertVecI16")); + + if (ExpectedVecI16 == Value) + { + Counter->MarkSuccess(Name); + } + else + { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } +} + +void UVectorDataActionsHandler::OnInsertVecI32(const FEventContext& Context, const FVecI32Type& Value) +{ + static const FString Name(TEXT("InsertVecI32")); + + if (ExpectedVecI32 == Value) + { + Counter->MarkSuccess(Name); + } + else + { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } +} + +void UVectorDataActionsHandler::OnInsertVecI64(const FEventContext& Context, const FVecI64Type& Value) +{ + static const FString Name(TEXT("InsertVecI64")); + + if (ExpectedVecI64 == Value) + { + Counter->MarkSuccess(Name); + } + else + { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } +} + +void UVectorDataActionsHandler::OnInsertVecI128(const FEventContext& Context, const FVecI128Type& Value) +{ + static const FString Name(TEXT("InsertVecI128")); + + if (ExpectedVecI128 == Value) + { + Counter->MarkSuccess(Name); + } + else + { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } +} + +void UVectorDataActionsHandler::OnInsertVecI256(const FEventContext& Context, const FVecI256Type& Value) +{ + static const FString Name(TEXT("InsertVecI256")); + + if (ExpectedVecI256 == Value) + { + Counter->MarkSuccess(Name); + } + else + { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } +} + +void UVectorDataActionsHandler::OnInsertVecBool(const FEventContext& Context, const FVecBoolType& Value) +{ + static const FString Name(TEXT("InsertVecBool")); + + if (ExpectedVecBool == Value) + { + Counter->MarkSuccess(Name); + } + else + { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } +} + +void UVectorDataActionsHandler::OnInsertVecF32(const FEventContext& Context, const FVecF32Type& Value) +{ + static const FString Name(TEXT("InsertVecF32")); + + if (ExpectedVecF32 == Value) + { + Counter->MarkSuccess(Name); + } + else + { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } +} + +void UVectorDataActionsHandler::OnInsertVecF64(const FEventContext& Context, const FVecF64Type& Value) +{ + static const FString Name(TEXT("InsertVecF64")); + + if (ExpectedVecF64 == Value) + { + Counter->MarkSuccess(Name); + } + else + { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } +} + +void UVectorDataActionsHandler::OnInsertVecString(const FEventContext& Context, const FVecStringType& Value) +{ + static const FString Name(TEXT("InsertVecString")); + + if (ExpectedVecString.S == Value.S) + { + Counter->MarkSuccess(Name); + } + else + { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } +} + +void UVectorDataActionsHandler::OnInsertVecIdentity(const FEventContext& Context, const FVecIdentityType& Value) +{ + static const FString Name(TEXT("InsertVecIdentity")); + + if (ExpectedVecIdentity.I == Value.I) + { + Counter->MarkSuccess(Name); + } + else + { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } +} + +void UVectorDataActionsHandler::OnInsertVecConnectionId(const FEventContext& Context, const FVecConnectionIdType& Value) +{ + static const FString Name(TEXT("InsertVecConnectionId")); + + if (ExpectedVecConnectionId.A == Value.A) + { + Counter->MarkSuccess(Name); + } + else + { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } +} + +void UVectorDataActionsHandler::OnInsertVecTimestamp(const FEventContext& Context, const FVecTimestampType& Value) +{ + static const FString Name(TEXT("InsertVecTimestamp")); + + if (ExpectedVecTimestamp.T == Value.T) + { + Counter->MarkSuccess(Name); + } + else + { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } +} + +void UOnReducerActionsHandler::OnInsertOneU8(const FReducerEventContext& Context, uint8 Value) +{ + static const FString Name(TEXT("OnReducer")); + + // Check 1: Validate the inserted value. + if (Value != ExpectedValue) + { + // Log an error and abort the test. + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } + + // Check 2: Validate identity with caller identity + FSpacetimeDBIdentity Identity; + if (Context.TryGetIdentity(Identity)) { + if (Identity != Context.Event.CallerIdentity) + { + Counter->MarkFailure(Name, TEXT("Caller_identity is not equal to my own identity")); + } + } + else { + Counter->MarkFailure(Name, TEXT("No identity found")); + } + + // Check 3: Validate connection_id with caller_connection_id + if (Context.GetConnectionId() != Context.Event.CallerConnectionId) + { + Counter->MarkFailure(Name, TEXT("Caller_connection_id is not equal to my own connection_id")); + } + + // Check 4: Validate status of reducer call + if (!Context.Event.Status.IsCommitted()) + { + Counter->MarkFailure(Name, TEXT("Unexpected status.")); + } + + // Check 5: Validate row count in the table + if (Context.Db->OneU8->Count() != 1) + { + Counter->MarkFailure(Name, TEXT("There is more than one row in the table")); + } + + // All checks passed. The "unwrap" was successful. + // Mark the test as complete. + Counter->MarkSuccess(Name); +} + +// Within your UOnReducerActionsHandler class +void UOnReducerActionsHandler::OnInsertPkU8(const FReducerEventContext& Context, uint8 Key, int32 Value) +{ + if (bShouldSucceed) + { + static const FString Name(TEXT("Reducer-Callback-Success")); + + if (Key != ExpectedKey || Value != ExpectedValue) + { + Counter->MarkFailure(Name, TEXT("Unexpected reducer argument")); + } + + FSpacetimeDBIdentity Identity; + if (Context.TryGetIdentity(Identity)) + { + if (Identity != Context.Event.CallerIdentity) + { + Counter->MarkFailure(Name, TEXT("Caller_identity is not equal to my own identity")); + } + } + else + { + Counter->MarkFailure(Name, TEXT("No identity found")); + } + + if (Context.GetConnectionId() != Context.Event.CallerConnectionId) + { + Counter->MarkFailure(Name, TEXT("Caller_connection_id is not equal to my own connection_id")); + } + + if (!Context.Event.Status.IsCommitted()) + { + Counter->MarkFailure(Name, TEXT("Unexpected status.")); + } + + if (Context.Db->PkU8->Count() != 1) + { + Counter->MarkFailure(Name, TEXT("Expected one row in the table")); + } + else + { + FPkU8Type Row = Context.Db->PkU8->Iter()[0]; + if (Row.N != ExpectedKey || Row.Data != ExpectedValue) + { + Counter->MarkFailure(Name, TEXT("Unexpected row value")); + } + } + + bShouldSucceed = false; + Context.Reducers->InsertPkU8(ExpectedKey, ExpectedFailValue); + Counter->MarkSuccess(Name); + } + else + { + static const FString Name(TEXT("Reducer-Callback-Fail")); + + if (Key != ExpectedKey || Value != ExpectedFailValue) + { + Counter->MarkFailure(Name, TEXT("Unexpected reducer argument")); + } + + FSpacetimeDBIdentity Identity; + if (Context.TryGetIdentity(Identity)) + { + if (Identity != Context.Event.CallerIdentity) + { + Counter->MarkFailure(Name, TEXT("Caller_identity is not equal to my own identity")); + } + } + else + { + Counter->MarkFailure(Name, TEXT("No identity found")); + } + + if (Context.GetConnectionId() != Context.Event.CallerConnectionId) + { + Counter->MarkFailure(Name, TEXT("Caller_connection_id is not equal to my own connection_id")); + } + + if (!Context.Event.Status.IsFailed()) + { + Counter->MarkFailure(Name, TEXT("Unexpected status.")); + } + + if (Context.Db->PkU8->Count() != 1) + { + Counter->MarkFailure(Name, TEXT("Expected one row in the table")); + } + else + { + FPkU8Type Row = Context.Db->PkU8->Iter()[0]; + if (Row.N != ExpectedKey || Row.Data != ExpectedValue) + { + Counter->MarkFailure(Name, TEXT("Unexpected row value")); + } + } + + Counter->MarkSuccess(Name); + } +} + +void UTimestampActionsHandler::OnInsertOneTimestamp(const FEventContext& Context, const FOneTimestampType& Value) +{ + static const FString Name(TEXT("InsertTimestamp")); + + if (Value.T == ExpectedValue) + { + Counter->MarkSuccess(Name); + } + else + { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } +} + +void UTimestampActionsHandler::OnInsertCallTimestamp(const FReducerEventContext& Context) +{ + static const FString Name(TEXT("InsertCallTimestamp")); + + Counter->MarkSuccess(Name); +} + +void URowDeduplicationHandler::OnInsertPkU32(const FEventContext& Context, const FPkU32Type& Value) +{ + if (Value.N == 24) + { + static const FString Name(TEXT("ins_24")); + if (bInserted24) + { + Counter->MarkFailure(Name, TEXT("duplicate insert")); + Counter->Abort(); + return; + } + bInserted24 = true; + Counter->MarkSuccess(Name); + Context.Reducers->DeletePkU32(Value.N); + } + else if (Value.N == 42) + { + static const FString Name(TEXT("ins_42")); + if (bInserted42) + { + Counter->MarkFailure(Name, TEXT("duplicate insert")); + Counter->Abort(); + return; + } + bInserted42 = true; + Counter->MarkSuccess(Name); + Context.Reducers->UpdatePkU32(Value.N, 0xfeeb); + } + else + { + Counter->MarkFailure(TEXT("unexpected_insert"), TEXT("unexpected key")); + Counter->Abort(); + } +} + +void URowDeduplicationHandler::OnDeletePkU32(const FEventContext& Context, const FPkU32Type& Value) +{ + static const FString Name(TEXT("del_24")); + if (Value.N != 24 || bDeleted24) + { + Counter->MarkFailure(Name, TEXT("unexpected delete")); + Counter->Abort(); + return; + } + bDeleted24 = true; + Counter->MarkSuccess(Name); +} + +void URowDeduplicationHandler::OnUpdatePkU32(const FEventContext& Context, const FPkU32Type& OldValue, const FPkU32Type& NewValue) +{ + static const FString Name(TEXT("upd_42")); + if (bUpdated42) + { + Counter->MarkFailure(Name, TEXT("duplicate update")); + Counter->Abort(); + return; + } + if (OldValue.N == 42 && NewValue.N == 42 && OldValue.Data == 0xbeef && NewValue.Data == 0xfeeb) + { + bUpdated42 = true; + Counter->MarkSuccess(Name); + } + else + { + Counter->MarkFailure(Name, TEXT("unexpected value")); + Counter->Abort(); + } +} + +void URowDeduplicationJoinHandler::OnInsertPkU32(const FEventContext& Context, const FPkU32Type& Value) +{ + static const FString Name(TEXT("pk_u32_on_insert")); + const uint32 KEY = 42; + const int32 D1 = 50; + const int32 DU = 0xbeef; + const int32 D2 = 100; + if (bPkInsert) + { + Counter->MarkFailure(Name, TEXT("duplicate insert")); + Counter->Abort(); + return; + } + if (Value.N == KEY && Value.Data == D1) + { + bPkInsert = true; + Counter->MarkSuccess(Name); + Context.Reducers->InsertUniqueU32UpdatePkU32(KEY, DU, D2); + } + else + { + Counter->MarkFailure(Name, TEXT("unexpected value")); + Counter->Abort(); + } +} + +void URowDeduplicationJoinHandler::OnUpdatePkU32(const FEventContext& Context, const FPkU32Type& OldValue, const FPkU32Type& NewValue) +{ + static const FString Name(TEXT("pk_u32_on_update")); + const uint32 KEY = 42; + const int32 D1 = 50; + const int32 D2 = 100; + if (bPkUpdate) + { + Counter->MarkFailure(Name, TEXT("duplicate update")); + Counter->Abort(); + return; + } + if (OldValue.N == KEY && NewValue.N == KEY && OldValue.Data == D1 && NewValue.Data == D2) + { + bPkUpdate = true; + Counter->MarkSuccess(Name); + } + else + { + Counter->MarkFailure(Name, TEXT("unexpected value")); + Counter->Abort(); + } +} + +void URowDeduplicationJoinHandler::OnDeletePkU32(const FEventContext& Context, const FPkU32Type& Value) +{ + Counter->MarkFailure(TEXT("pk_u32_on_delete"), TEXT("unexpected delete")); + Counter->Abort(); +} + +void URowDeduplicationJoinHandler::OnInsertUniqueU32(const FEventContext& Context, const FUniqueU32Type& Value) +{ + static const FString Name(TEXT("unique_u32_on_insert")); + const uint32 KEY = 42; + const int32 DU = 0xbeef; + if (bUniqueInsert) + { + Counter->MarkFailure(Name, TEXT("duplicate insert")); + Counter->Abort(); + return; + } + if (Value.N == KEY && Value.Data == DU) + { + bUniqueInsert = true; + Counter->MarkSuccess(Name); + } + else + { + Counter->MarkFailure(Name, TEXT("unexpected value")); + Counter->Abort(); + } +} + +void URowDeduplicationJoinHandler::OnDeleteUniqueU32(const FEventContext& Context, const FUniqueU32Type& Value) +{ + Counter->MarkFailure(TEXT("unique_u32_on_delete"), TEXT("unexpected delete")); + Counter->Abort(); +} + + + + + + + + + + + + + + + + + + + + + + + + + +/* PkSimpleEnum handler functions -------------------------------------- */ +void UPkSimpleEnumHandler::OnInsertPkSimpleEnum(const FEventContext& Context, const FPkSimpleEnumType& Value) +{ + if (Value.Data == Data1 && Value.A == A) + { + Counter->MarkSuccess(TEXT("InsertPkSimpleEnum")); + Context.Reducers->UpdatePkSimpleEnum(A, Data2); + } + else { + Counter->MarkFailure(TEXT("InsertPkSimpleEnum"), TEXT("Unexpected value")); + } +} +void UPkSimpleEnumHandler::OnUpdatePkSimpleEnum(const FEventContext& Context, const FPkSimpleEnumType& OldValue, + const FPkSimpleEnumType& NewValue) +{ + if (OldValue.Data == Data1 && NewValue.Data == Data2 && OldValue.A == A && NewValue.A == A) + { + Counter->MarkSuccess("UpdatePkPkSimpleEnum"); + } + else { + Counter->MarkFailure("UpdatePkPkSimpleEnum", TEXT("Unexpected value")); + } +} +void UPkSimpleEnumHandler::OnDeletePkSimpleEnum(const FEventContext& Context, const FPkSimpleEnumType& Value) +{ + Counter->MarkFailure(TEXT("InsertPkSimpleEnum"), TEXT("OnDeletePkSimpleEnum should not be reached")); + Counter->MarkFailure(TEXT("UpdatePkPkSimpleEnum"), TEXT("OnDeletePkSimpleEnum should not be reached")); +} + +/* IndexedSimpleEnum handler functions --------------------------------- */ +void UIndexedSimpleEnumHandler::OnInsertIndexedSimpleEnum(const FEventContext& Context, const FIndexedSimpleEnumType& Value) +{ + static const FString Name(TEXT("IndexedSimpleEnum")); + if (Value.N == A1) + { + Context.Reducers->UpdateIndexedSimpleEnum(A1, A2); + } + else if (Value.N == A2) + { + Counter->MarkSuccess(Name); + } + else { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } +} + + +/* OverlappingSubscriptions handler functions -------------------------- */ +void UOverlappingSubscriptionsHandler::OnInsertPkU8Reducer(const FReducerEventContext& Context, uint8 N, int32 Data) +{ + Counter->MarkSuccess(TEXT("OverlappingSubscriptions_insert_reducer_done")); + + TArray Queries; + Queries.Add(TEXT("select * from pk_u8 where n < 100")); + Queries.Add(TEXT("select * from pk_u8 where n > 0")); + SubscribeTheseThen( Connection, Queries, [this](FSubscriptionEventContext Ctx) + { + if (Ctx.Db->PkU8->Count() == 1) + { + Counter->MarkSuccess(TEXT("OverlappingSubscriptions_subscribe_with_row_present")); + } + else + { + Counter->MarkFailure(TEXT("OverlappingSubscriptions_subscribe_with_row_present"), TEXT("Expected one row")); + } + Ctx.Reducers->UpdatePkU8(1, 1); + Counter->MarkSuccess(TEXT("OverlappingSubscriptions_call_update_reducer")); + }); +} + +void UOverlappingSubscriptionsHandler::OnUpdatePkU8(const FEventContext& Context, const FPkU8Type& OldValue, const FPkU8Type& NewValue) +{ + static const FString Name(TEXT("OverlappingSubscriptions_update_row")); + if (OldValue.N == 1 && OldValue.Data == 0 && NewValue.N == 1 && NewValue.Data == 1 && Context.Db->PkU8->Count() == 1) + { + Counter->MarkSuccess(Name); + } + else { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } +} + +void UOptionActionsHandler::OnInsertOptionI32(const FEventContext& Context, const FOptionI32Type& Value) +{ + static const FString Name(TEXT("InsertOptionI32")); + + if (ExpectedI32Type == Value.N) + { + Counter->MarkSuccess(Name); + } + else { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } +} + +void UOptionActionsHandler::OnInsertOptionString(const FEventContext& Context, const FOptionStringType& Value) +{ + static const FString Name(TEXT("InsertOptionString")); + + if (ExpectedStringType == Value.S) + { + Counter->MarkSuccess(Name); + } + else { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } +} + +void UOptionActionsHandler::OnInsertOptionIdentity(const FEventContext& Context, const FOptionIdentityType& Value) +{ + static const FString Name(TEXT("InsertOptionIdentity")); + + if (ExpectedIdentityType == Value.I) + { + Counter->MarkSuccess(Name); + } + else { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } +} + +void UOptionActionsHandler::OnInsertOptionSimpleEnum(const FEventContext& Context, const FOptionSimpleEnumType& Value) +{ + static const FString Name(TEXT("InsertOptionSimpleEnum")); + + if (ExpectedEnumType == Value.E) + { + Counter->MarkSuccess(Name); + } + else { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } +} + +void UOptionActionsHandler::OnInsertOptionPrimitiveStruct(const FEventContext& Context, const FOptionEveryPrimitiveStructType& Value) +{ + static const FString Name(TEXT("InsertOptionEveryPrimitiveStruct")); + + if (ExpectedEveryPrimitiveStructType == Value.S) + { + Counter->MarkSuccess(Name); + } + else { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } +} + +void UOptionActionsHandler::OnInsertOptionVecOptionI32(const FEventContext& Context, const FOptionVecOptionI32Type& Value) +{ + static const FString Name(TEXT("InsertOptionVecOptionI32")); + + if (ExpectedVecOptionI32Type == Value.V) + { + Counter->MarkSuccess(Name); + } + else { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } +} + +void UStructActionsHandler::OnInsertOneUnitStruct(const FEventContext& Context, const FOneUnitStructType& Value) +{ + static const FString Name(TEXT("InsertOneUnitStruct")); + + if (Value.S == FUnitStructType()) { + Counter->MarkSuccess(Name); + } + else + { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } +} + +void UStructActionsHandler::OnInsertOneByteStruct(const FEventContext& Context, const FOneByteStructType& Value) +{ + static const FString Name(TEXT("InsertOneByteStruct")); + + if (ExpectedByteStruct == Value.S) + { + Counter->MarkSuccess(Name); + } + else { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } +} + +void UStructActionsHandler::OnInsertOneEveryPrimitiveStruct(const FEventContext& Context, const FOneEveryPrimitiveStructType& Value) +{ + static const FString Name(TEXT("InsertOneEveryPrimitiveStruct")); + + if (Value.S == ExpectedEveryPrimitiveStruct) + { + Counter->MarkSuccess(Name); + } + else { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } +} + +void UStructActionsHandler::OnInsertOneEveryVecStruct(const FEventContext& Context, const FOneEveryVecStructType& Value) +{ + static const FString Name(TEXT("InsertOneEveryVecStruct")); + + if (Value.S == ExpectedEveryVecStruct) + { + Counter->MarkSuccess(Name); + } + else { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } +} + +void UStructActionsHandler::OnInsertVecUnitStruct(const FEventContext& Context, const FVecUnitStructType& Value) +{ + static const FString Name(TEXT("InsertVecUnitStruct")); + + if (Value.S == TArray()) + { + Counter->MarkSuccess(Name); + } + else + { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } +} + +void UStructActionsHandler::OnInsertVecByteStruct(const FEventContext& Context, const FVecByteStructType& Value) +{ + static const FString Name(TEXT("InsertVecByteStruct")); + + if (ExpectedVecByteStruct == Value.S) + { + Counter->MarkSuccess(Name); + } + else { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } +} + +void UStructActionsHandler::OnInsertVecEveryPrimitiveStruct(const FEventContext& Context, const FVecEveryPrimitiveStructType& Value) +{ + static const FString Name(TEXT("InsertVecEveryPrimitiveStruct")); + + if (ExpectedVecPrimitiveStruct == Value.S) + { + Counter->MarkSuccess(Name); + } + else { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } +} + +void UStructActionsHandler::OnInsertVecEveryVecStruct(const FEventContext& Context, const FVecEveryVecStructType& Value) +{ + static const FString Name(TEXT("InsertVecEveryVecStruct")); + + if (ExpectedVecEveryVecStruct == Value.S) + { + Counter->MarkSuccess(Name); + } + else { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } +} + +void UEnumActionsHandler::OnInsertOneSimpleEnum(const FEventContext& Context, const FOneSimpleEnumType& Value) +{ + static const FString Name(TEXT("InsertOneSimpleEnum")); + + if (ExpectedSimpleEnum == Value) + { + Counter->MarkSuccess(Name); + } + else { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } +} + +void UEnumActionsHandler::OnInsertVecSimpleEnum(const FEventContext& Context, const FVecSimpleEnumType& Value) +{ + static const FString Name(TEXT("InsertVecSimpleEnum")); + + if (ExpectedVecEnum == Value) + { + Counter->MarkSuccess(Name); + } + else { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } +} + +void UEnumActionsHandler::OnInsertOneEnumWithPayload(const FEventContext& Context, const FOneEnumWithPayloadType& Value) +{ + static const FString Name(TEXT("InsertOneEnumWithPayload")); + + if (FEnumWithPayloadType::U8(0) == Value.E) + { + Counter->MarkSuccess(Name); + } + else { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } +} + +void UEnumActionsHandler::OnInsertVecEnumWithPayload(const FEventContext& Context, const FVecEnumWithPayloadType& Value) +{ + static const FString Name(TEXT("InsertVecEnumWithPayload")); + + if (ExpectedVecEnumWithPayload.E == Value.E) + { + Counter->MarkSuccess(Name); + } + else { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } +} + +static void LogArraysSideBySide(const FString& Name, const TArray& Value, const TArray& Expected) +{ + int32 Count = FMath::Max(Value.Num(), Expected.Num()); + for (int32 i = 0; i < Count; ++i) + { + const FString& ValValue = Value.IsValidIndex(i) ? Value[i] : TEXT(""); + const FString& ValExpected = Expected.IsValidIndex(i) ? Expected[i] : TEXT(""); + UE_LOG(LogTemp, Log, TEXT("[%s] Index %d: Value = %s | Expected = %s"), + *Name, i, *ValValue, *ValExpected); + } +} + +void UInsertPrimitiveHandler::OnInsertPrimitivesAsString(const FEventContext& Context, const FVecStringType& Value) +{ + static const FString Name(TEXT("InsertPrimitivesAsString")); + + // Detailed side-by-side log + LogArraysSideBySide(Name, Value.S, ExpectedStrings); + + FVecStringType ExpectedStruct = FVecStringType(ExpectedStrings); + if (Value == ExpectedStruct) + { + Counter->MarkSuccess(Name); + } + else + { + Counter->MarkFailure(Name, TEXT("Unexpected value")); + } +} + +void UTestHandler::OnNoOpSucceeds(const FReducerEventContext& Context) +{ + static const FString Name(TEXT("NoOpSucceeds")); + + if (Context.Event.Status.IsCommitted()) + { + if (Context.Event.Reducer.IsNoOpSucceeds()) + { + Counter->MarkSuccess(Name); + } + else + { + Counter->MarkFailure(Name, "Wrong Reducer should be NoOpSucceeds"); + } + } + else + { + Counter->MarkFailure(Name, "Not committed"); + } +} + +void UTestHandler::OnConnectionDone(UDbConnection* Connection) +{ + static const FString Name(TEXT("OnConnect")); + InitialConnectionId = Connection->GetConnectionId(); + + Counter->MarkSuccess(Name); +} + +void UTestHandler::OnReConnectionDone(UDbConnection* Connection) +{ + static const FString Name(TEXT("OnReconnect")); + + const FSpacetimeDBConnectionId NewId = Connection->GetConnectionId(); + if (InitialConnectionId == NewId) + { + Counter->MarkSuccess(Name); + } + else + { + Counter->MarkFailure( + Name, + TEXT("Connection ID changed. Stored: ") + InitialConnectionId.ToHex() + + TEXT(" New: ") + NewId.ToHex()); + } +} + +void URLSSubscriptionHandler::OnInsertUser(const FEventContext& Context, const FUsersType& UserType) +{ + static const FString Name(TEXT("RLSSubscription")); + + if (UserType == ExpectedUserType) + { + if (MainCounter && MainCounter->Counter.IsValid()) + { + MainCounter->Counter->MarkSuccess(ExpectedUserType.Name); + } + } + else + { + if (MainCounter && MainCounter->Counter.IsValid()) + { + //One instance wont be equal so we do not mark failure here. + //MainCounter->Counter->MarkFailure(Name, TEXT("UserName or Identity is not equal!")); + } + } +} + +void UParameterizedSubscriptionHandler::OnInsertPkIdentity(const FEventContext& Context, const FPkIdentityType& Identity) +{ + const FString TestName = FString::Printf(TEXT("insert_%d"), ExpectedOldData); + FPkIdentityType ExpectedStruct = FPkIdentityType( ExpectedIdentity, ExpectedOldData ); + if (ExpectedStruct == Identity) + { + Counters->Counter->MarkSuccess(TestName); + } + else + { + Counters->Counter->MarkFailure(TestName, TEXT("Unexpected identity or data")); + } +} + +void UParameterizedSubscriptionHandler::OnUpdatePkIdentity(const FEventContext& Context, const FPkIdentityType& OldIdentity, const FPkIdentityType& NewIdentity) +{ + + const FString TestName = FString::Printf(TEXT("update_%d"), ExpectedNewData); + FPkIdentityType ExpectedOldStruct = FPkIdentityType(ExpectedIdentity, ExpectedOldData); + FPkIdentityType ExpectedNewStruct = FPkIdentityType(ExpectedIdentity, ExpectedNewData); + if (ExpectedOldStruct == OldIdentity + && ExpectedNewStruct == NewIdentity) + { + Counters->Counter->MarkSuccess(TestName); + } + else + { + Counters->Counter->MarkFailure(TestName, TEXT("Unexpected identity or data")); + } +} + +void UBagSemanticsTestHandler::OnDeletePkU32(const FEventContext& Context, const FPkU32Type& Value) +{ + static const FString Name(TEXT("pk_u32_on_delete")); + + if (Context.Db->BtreeU32->Count() == 0) + { + Counter->MarkSuccess(Name); + } + else + { + Counter->MarkFailure(Name, TEXT("Bag semantics not implemented correctly")); + } +} + +/* LhsJoinUpdate handler functions ------------------------------------- */ +void ULhsJoinUpdateHandler::OnInsertPkU32(const FReducerEventContext& Context, uint32 N, int32 Data) +{ + static const uint32 KEY1 = 1; + static const uint32 KEY2 = 2; + static const int32 DATA0 = 0; + + if (N == KEY1 && Data == DATA0) + { + if (bInsert1) + { + Counter->MarkFailure(TEXT("on_insert_1"), TEXT("duplicate insert")); + Counter->Abort(); + return; + } + bInsert1 = true; + Counter->MarkSuccess(TEXT("on_insert_1")); + } + else if (N == KEY2 && Data == DATA0) + { + if (bInsert2) + { + Counter->MarkFailure(TEXT("on_insert_2"), TEXT("duplicate insert")); + Counter->Abort(); + return; + } + bInsert2 = true; + Counter->MarkSuccess(TEXT("on_insert_2")); + } + else + { + Counter->MarkFailure(TEXT("unexpected_insert"), TEXT("unexpected value")); + Counter->Abort(); + } + + if (!bUpdateRequested && bInsert1 && bInsert2) + { + bUpdateRequested = true; + Context.Reducers->UpdatePkU32(2, 1); + } +} + +void ULhsJoinUpdateHandler::OnUpdatePkU32(const FReducerEventContext& Context, uint32 N, int32 Data) +{ + static const uint32 KEY2 = 2; + if (!bUpdate1) + { + if (N == KEY2 && Data == 1) + { + bUpdate1 = true; + Counter->MarkSuccess(TEXT("on_update_1")); + Context.Reducers->UpdatePkU32(KEY2, 0); + } + else + { + Counter->MarkFailure(TEXT("on_update_1"), TEXT("unexpected value")); + Counter->Abort(); + } + return; + } + + if (!bUpdate2) + { + if (N == KEY2 && Data == 0) + { + bUpdate2 = true; + Counter->MarkSuccess(TEXT("on_update_2")); + } + else + { + Counter->MarkFailure(TEXT("on_update_2"), TEXT("unexpected value")); + Counter->Abort(); + } + return; + } + + Counter->MarkFailure(TEXT("on_update_unexpected"), TEXT("duplicate update")); + Counter->Abort(); +} + +void ULhsJoinUpdateDisjointQueriesHandler::OnInsertPkU32Reducer(const FReducerEventContext& Context, uint32 N, int32 Data) +{ + if (N == 1 && Data == 0) + { + static const FString Name(TEXT("on_insert_1")); + if (bInserted1) + { + Counter->MarkFailure(Name, TEXT("duplicate insert")); + Counter->Abort(); + return; + } + bInserted1 = true; + Counter->MarkSuccess(Name); + } + else if (N == 2 && Data == 0) + { + static const FString Name(TEXT("on_insert_2")); + if (bInserted2) + { + Counter->MarkFailure(Name, TEXT("duplicate insert")); + Counter->Abort(); + return; + } + bInserted2 = true; + Counter->MarkSuccess(Name); + } + else + { + Counter->MarkFailure(TEXT("unexpected_insert"), TEXT("unexpected value")); + Counter->Abort(); + } + + if (!bUpdateRequested && bInserted1 && bInserted2) + { + bUpdateRequested = true; + Context.Reducers->UpdatePkU32(2, 1); + } +} + +void ULhsJoinUpdateDisjointQueriesHandler::OnUpdatePkU32Reducer(const FReducerEventContext& Context, uint32 N, int32 Data) +{ + if (N == 2 && Data == 1) + { + static const FString Name(TEXT("on_update_1")); + if (bUpdated1) + { + Counter->MarkFailure(Name, TEXT("duplicate update")); + Counter->Abort(); + return; + } + bUpdated1 = true; + Counter->MarkSuccess(Name); + Context.Reducers->UpdatePkU32(N, 0); + } + else if (N == 2 && Data == 0) + { + static const FString Name(TEXT("on_update_2")); + if (bUpdated2) + { + Counter->MarkFailure(Name, TEXT("duplicate update")); + Counter->Abort(); + return; + } + bUpdated2 = true; + Counter->MarkSuccess(Name); + } + else + { + Counter->MarkFailure(TEXT("unexpected_update"), TEXT("unexpected value")); + Counter->Abort(); + } +} + +void ULargeTableActionHandler::OnInsertLargeTable(const FEventContext& Context, const FLargeTableType& InsertedRow) +{ + static const FString Name(TEXT("InsertLargeTable")); + + if (InsertedRow == ExpectedLargeTable) + { + Counter->MarkSuccess(Name); + } + else + { + Counter->MarkFailure(Name, "Unexpected Value!"); + } + Context.Reducers->DeleteLargeTable( + ExpectedLargeTable.A, + ExpectedLargeTable.B, + ExpectedLargeTable.C, + ExpectedLargeTable.D, + ExpectedLargeTable.E, + ExpectedLargeTable.F, + ExpectedLargeTable.G, + ExpectedLargeTable.H, + ExpectedLargeTable.I, + ExpectedLargeTable.J, + ExpectedLargeTable.K, + ExpectedLargeTable.L, + ExpectedLargeTable.M, + ExpectedLargeTable.N, + ExpectedLargeTable.O, + ExpectedLargeTable.P, + ExpectedLargeTable.Q, + ExpectedLargeTable.R, + ExpectedLargeTable.S, + ExpectedLargeTable.T, + ExpectedLargeTable.U, + ExpectedLargeTable.V + ); +} + +void ULargeTableActionHandler::OnDeleteLargeTable(const FEventContext& Context, const FLargeTableType& DeletedRow) +{ + static const FString Name(TEXT("DeleteLargeTable")); + + if (DeletedRow == ExpectedLargeTable) + { + Counter->MarkSuccess(Name); + } + else + { + Counter->MarkFailure(Name, "Unexpected Value!"); + } +} \ No newline at end of file diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Optionals/TestClientOptionalEveryPrimitiveStruct.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Optionals/TestClientOptionalEveryPrimitiveStruct.g.h new file mode 100644 index 00000000000..e012ce243d3 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Optionals/TestClientOptionalEveryPrimitiveStruct.g.h @@ -0,0 +1,62 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Types/EveryPrimitiveStructType.g.h" +#include "TestClientOptionalEveryPrimitiveStruct.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FTestClientOptionalEveryPrimitiveStruct +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + bool bHasValue = false; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB", meta = (EditCondition = "bHasValue")) + FEveryPrimitiveStructType Value; + + FTestClientOptionalEveryPrimitiveStruct() = default; + + explicit FTestClientOptionalEveryPrimitiveStruct(const FEveryPrimitiveStructType& InValue) + : bHasValue(true), Value(InValue) {} + + bool IsSet() const { return bHasValue; } + void Reset() { bHasValue = false; } + + FORCEINLINE bool operator==(const FTestClientOptionalEveryPrimitiveStruct& Other) const + { + if (bHasValue != Other.bHasValue) return false; + return !bHasValue || Value == Other.Value; + } + + FORCEINLINE bool operator!=(const FTestClientOptionalEveryPrimitiveStruct& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FTestClientOptionalEveryPrimitiveStruct. + * Hashes the HasValue flag and the Value if present. + * @param Optional The FTestClientOptionalEveryPrimitiveStruct instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FTestClientOptionalEveryPrimitiveStruct& Optional) +{ + uint32 Hash = GetTypeHash(Optional.bHasValue); + if (Optional.bHasValue) + { + Hash = HashCombine(Hash, GetTypeHash(Optional.Value)); + } + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FTestClientOptionalEveryPrimitiveStruct); + + UE_SPACETIMEDB_OPTIONAL(FTestClientOptionalEveryPrimitiveStruct, bHasValue, Value); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Optionals/TestClientOptionalIdentity.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Optionals/TestClientOptionalIdentity.g.h new file mode 100644 index 00000000000..aba5ea23570 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Optionals/TestClientOptionalIdentity.g.h @@ -0,0 +1,62 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "TestClientOptionalIdentity.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FTestClientOptionalIdentity +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + bool bHasValue = false; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB", meta = (EditCondition = "bHasValue")) + FSpacetimeDBIdentity Value; + + FTestClientOptionalIdentity() = default; + + explicit FTestClientOptionalIdentity(const FSpacetimeDBIdentity& InValue) + : bHasValue(true), Value(InValue) {} + + bool IsSet() const { return bHasValue; } + void Reset() { bHasValue = false; } + + FORCEINLINE bool operator==(const FTestClientOptionalIdentity& Other) const + { + if (bHasValue != Other.bHasValue) return false; + return !bHasValue || Value == Other.Value; + } + + FORCEINLINE bool operator!=(const FTestClientOptionalIdentity& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FTestClientOptionalIdentity. + * Hashes the HasValue flag and the Value if present. + * @param Optional The FTestClientOptionalIdentity instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FTestClientOptionalIdentity& Optional) +{ + uint32 Hash = GetTypeHash(Optional.bHasValue); + if (Optional.bHasValue) + { + Hash = HashCombine(Hash, GetTypeHash(Optional.Value)); + } + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FTestClientOptionalIdentity); + + UE_SPACETIMEDB_OPTIONAL(FTestClientOptionalIdentity, bHasValue, Value); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Optionals/TestClientOptionalInt32.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Optionals/TestClientOptionalInt32.g.h new file mode 100644 index 00000000000..3fcc5bfdda0 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Optionals/TestClientOptionalInt32.g.h @@ -0,0 +1,61 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "TestClientOptionalInt32.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FTestClientOptionalInt32 +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + bool bHasValue = false; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB", meta = (EditCondition = "bHasValue")) + int32 Value; + + FTestClientOptionalInt32() = default; + + explicit FTestClientOptionalInt32(const int32& InValue) + : bHasValue(true), Value(InValue) {} + + bool IsSet() const { return bHasValue; } + void Reset() { bHasValue = false; } + + FORCEINLINE bool operator==(const FTestClientOptionalInt32& Other) const + { + if (bHasValue != Other.bHasValue) return false; + return !bHasValue || Value == Other.Value; + } + + FORCEINLINE bool operator!=(const FTestClientOptionalInt32& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FTestClientOptionalInt32. + * Hashes the HasValue flag and the Value if present. + * @param Optional The FTestClientOptionalInt32 instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FTestClientOptionalInt32& Optional) +{ + uint32 Hash = GetTypeHash(Optional.bHasValue); + if (Optional.bHasValue) + { + Hash = HashCombine(Hash, GetTypeHash(Optional.Value)); + } + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FTestClientOptionalInt32); + + UE_SPACETIMEDB_OPTIONAL(FTestClientOptionalInt32, bHasValue, Value); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Optionals/TestClientOptionalSimpleEnum.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Optionals/TestClientOptionalSimpleEnum.g.h new file mode 100644 index 00000000000..4889acee798 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Optionals/TestClientOptionalSimpleEnum.g.h @@ -0,0 +1,62 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Types/SimpleEnumType.g.h" +#include "TestClientOptionalSimpleEnum.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FTestClientOptionalSimpleEnum +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + bool bHasValue = false; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB", meta = (EditCondition = "bHasValue")) + ESimpleEnumType Value; + + FTestClientOptionalSimpleEnum() = default; + + explicit FTestClientOptionalSimpleEnum(const ESimpleEnumType& InValue) + : bHasValue(true), Value(InValue) {} + + bool IsSet() const { return bHasValue; } + void Reset() { bHasValue = false; } + + FORCEINLINE bool operator==(const FTestClientOptionalSimpleEnum& Other) const + { + if (bHasValue != Other.bHasValue) return false; + return !bHasValue || Value == Other.Value; + } + + FORCEINLINE bool operator!=(const FTestClientOptionalSimpleEnum& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FTestClientOptionalSimpleEnum. + * Hashes the HasValue flag and the Value if present. + * @param Optional The FTestClientOptionalSimpleEnum instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FTestClientOptionalSimpleEnum& Optional) +{ + uint32 Hash = GetTypeHash(Optional.bHasValue); + if (Optional.bHasValue) + { + Hash = HashCombine(Hash, GetTypeHash(Optional.Value)); + } + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FTestClientOptionalSimpleEnum); + + UE_SPACETIMEDB_OPTIONAL(FTestClientOptionalSimpleEnum, bHasValue, Value); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Optionals/TestClientOptionalString.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Optionals/TestClientOptionalString.g.h new file mode 100644 index 00000000000..39116b13c1f --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Optionals/TestClientOptionalString.g.h @@ -0,0 +1,61 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "TestClientOptionalString.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FTestClientOptionalString +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + bool bHasValue = false; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB", meta = (EditCondition = "bHasValue")) + FString Value; + + FTestClientOptionalString() = default; + + explicit FTestClientOptionalString(const FString& InValue) + : bHasValue(true), Value(InValue) {} + + bool IsSet() const { return bHasValue; } + void Reset() { bHasValue = false; } + + FORCEINLINE bool operator==(const FTestClientOptionalString& Other) const + { + if (bHasValue != Other.bHasValue) return false; + return !bHasValue || Value == Other.Value; + } + + FORCEINLINE bool operator!=(const FTestClientOptionalString& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FTestClientOptionalString. + * Hashes the HasValue flag and the Value if present. + * @param Optional The FTestClientOptionalString instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FTestClientOptionalString& Optional) +{ + uint32 Hash = GetTypeHash(Optional.bHasValue); + if (Optional.bHasValue) + { + Hash = HashCombine(Hash, GetTypeHash(Optional.Value)); + } + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FTestClientOptionalString); + + UE_SPACETIMEDB_OPTIONAL(FTestClientOptionalString, bHasValue, Value); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Optionals/TestClientOptionalVecInt32.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Optionals/TestClientOptionalVecInt32.g.h new file mode 100644 index 00000000000..aeb08e45ee1 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Optionals/TestClientOptionalVecInt32.g.h @@ -0,0 +1,62 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Optionals/TestClientOptionalInt32.g.h" +#include "TestClientOptionalVecInt32.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FTestClientOptionalVecInt32 +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + bool bHasValue = false; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB", meta = (EditCondition = "bHasValue")) + TArray Value; + + FTestClientOptionalVecInt32() = default; + + explicit FTestClientOptionalVecInt32(const TArray& InValue) + : bHasValue(true), Value(InValue) {} + + bool IsSet() const { return bHasValue; } + void Reset() { bHasValue = false; } + + FORCEINLINE bool operator==(const FTestClientOptionalVecInt32& Other) const + { + if (bHasValue != Other.bHasValue) return false; + return !bHasValue || Value == Other.Value; + } + + FORCEINLINE bool operator!=(const FTestClientOptionalVecInt32& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FTestClientOptionalVecInt32. + * Hashes the HasValue flag and the Value if present. + * @param Optional The FTestClientOptionalVecInt32 instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FTestClientOptionalVecInt32& Optional) +{ + uint32 Hash = GetTypeHash(Optional.bHasValue); + if (Optional.bHasValue) + { + Hash = HashCombine(Hash, GetTypeHash(Optional.Value)); + } + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FTestClientOptionalVecInt32); + + UE_SPACETIMEDB_OPTIONAL(FTestClientOptionalVecInt32, bHasValue, Value); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/ReducerBase.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/ReducerBase.g.h new file mode 100644 index 00000000000..44e6dae948d --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/ReducerBase.g.h @@ -0,0 +1,18 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ReducerBase.g.generated.h" + +// Abstract Reducer base class +UCLASS(Abstract, BlueprintType) +class TESTCLIENT_API UReducerBase : public UObject +{ + GENERATED_BODY() + +public: + virtual ~UReducerBase() = default; +}; + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteFromBtreeU32.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteFromBtreeU32.g.h new file mode 100644 index 00000000000..c3fafaac617 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteFromBtreeU32.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "ModuleBindings/Types/BTreeU32Type.g.h" +#include "DeleteFromBtreeU32.g.generated.h" + +// Reducer arguments struct for DeleteFromBtreeU32 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FDeleteFromBtreeU32Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + TArray Rows; + + FDeleteFromBtreeU32Args() = default; + + FDeleteFromBtreeU32Args(const TArray& InRows) + : Rows(InRows) + {} + + + FORCEINLINE bool operator==(const FDeleteFromBtreeU32Args& Other) const + { + return Rows == Other.Rows; + } + FORCEINLINE bool operator!=(const FDeleteFromBtreeU32Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FDeleteFromBtreeU32Args, Rows); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UDeleteFromBtreeU32Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + TArray Rows; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteLargeTable.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteLargeTable.g.h new file mode 100644 index 00000000000..59824331cbf --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteLargeTable.g.h @@ -0,0 +1,165 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "ModuleBindings/Types/ByteStructType.g.h" +#include "ModuleBindings/Types/EnumWithPayloadType.g.h" +#include "ModuleBindings/Types/EveryPrimitiveStructType.g.h" +#include "ModuleBindings/Types/EveryVecStructType.g.h" +#include "ModuleBindings/Types/SimpleEnumType.g.h" +#include "ModuleBindings/Types/UnitStructType.g.h" +#include "Types/Builtins.h" +#include "DeleteLargeTable.g.generated.h" + +// Reducer arguments struct for DeleteLargeTable +USTRUCT(BlueprintType) +struct TESTCLIENT_API FDeleteLargeTableArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + uint8 A; + + // NOTE: uint16 field not exposed to Blueprint due to non-blueprintable elements + uint16 B; + + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 C; + + // NOTE: uint64 field not exposed to Blueprint due to non-blueprintable elements + uint64 D; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBUInt128 E; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBUInt256 F; + + // NOTE: int8 field not exposed to Blueprint due to non-blueprintable elements + int8 G; + + // NOTE: int16 field not exposed to Blueprint due to non-blueprintable elements + int16 H; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 I; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int64 J; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBInt128 K; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBInt256 L; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + bool M; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + float N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + double O; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FString P; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + ESimpleEnumType Q; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FEnumWithPayloadType R; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FUnitStructType S; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FByteStructType T; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FEveryPrimitiveStructType U; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FEveryVecStructType V; + + FDeleteLargeTableArgs() = default; + + FDeleteLargeTableArgs(const uint8& InA, const uint16& InB, const uint32& InC, const uint64& InD, const FSpacetimeDBUInt128& InE, const FSpacetimeDBUInt256& InF, const int8& InG, const int16& InH, const int32& InI, const int64& InJ, const FSpacetimeDBInt128& InK, const FSpacetimeDBInt256& InL, const bool& InM, const float& InN, const double& InO, const FString& InP, const ESimpleEnumType& InQ, const FEnumWithPayloadType& InR, const FUnitStructType& InS, const FByteStructType& InT, const FEveryPrimitiveStructType& InU, const FEveryVecStructType& InV) + : A(InA), B(InB), C(InC), D(InD), E(InE), F(InF), G(InG), H(InH), I(InI), J(InJ), K(InK), L(InL), M(InM), N(InN), O(InO), P(InP), Q(InQ), R(InR), S(InS), T(InT), U(InU), V(InV) + {} + + + FORCEINLINE bool operator==(const FDeleteLargeTableArgs& Other) const + { + return A == Other.A && B == Other.B && C == Other.C && D == Other.D && E == Other.E && F == Other.F && G == Other.G && H == Other.H && I == Other.I && J == Other.J && K == Other.K && L == Other.L && M == Other.M && N == Other.N && O == Other.O && P == Other.P && Q == Other.Q && R == Other.R && S == Other.S && T == Other.T && U == Other.U && V == Other.V; + } + FORCEINLINE bool operator!=(const FDeleteLargeTableArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FDeleteLargeTableArgs, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UDeleteLargeTableReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + uint8 A; + // NOTE: uint16 field not exposed to Blueprint due to non-blueprintable elements + uint16 B; + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 C; + // NOTE: uint64 field not exposed to Blueprint due to non-blueprintable elements + uint64 D; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBUInt128 E; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBUInt256 F; + // NOTE: int8 field not exposed to Blueprint due to non-blueprintable elements + int8 G; + // NOTE: int16 field not exposed to Blueprint due to non-blueprintable elements + int16 H; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 I; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int64 J; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBInt128 K; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBInt256 L; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + bool M; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + float N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + double O; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FString P; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + ESimpleEnumType Q; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FEnumWithPayloadType R; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FUnitStructType S; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FByteStructType T; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FEveryPrimitiveStructType U; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FEveryVecStructType V; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkBool.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkBool.g.h new file mode 100644 index 00000000000..25e1c0e2aff --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkBool.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "DeletePkBool.g.generated.h" + +// Reducer arguments struct for DeletePkBool +USTRUCT(BlueprintType) +struct TESTCLIENT_API FDeletePkBoolArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + bool B; + + FDeletePkBoolArgs() = default; + + FDeletePkBoolArgs(const bool& InB) + : B(InB) + {} + + + FORCEINLINE bool operator==(const FDeletePkBoolArgs& Other) const + { + return B == Other.B; + } + FORCEINLINE bool operator!=(const FDeletePkBoolArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FDeletePkBoolArgs, B); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UDeletePkBoolReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + bool B; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkConnectionId.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkConnectionId.g.h new file mode 100644 index 00000000000..cedf0c12546 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkConnectionId.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "DeletePkConnectionId.g.generated.h" + +// Reducer arguments struct for DeletePkConnectionId +USTRUCT(BlueprintType) +struct TESTCLIENT_API FDeletePkConnectionIdArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBConnectionId A; + + FDeletePkConnectionIdArgs() = default; + + FDeletePkConnectionIdArgs(const FSpacetimeDBConnectionId& InA) + : A(InA) + {} + + + FORCEINLINE bool operator==(const FDeletePkConnectionIdArgs& Other) const + { + return A == Other.A; + } + FORCEINLINE bool operator!=(const FDeletePkConnectionIdArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FDeletePkConnectionIdArgs, A); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UDeletePkConnectionIdReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBConnectionId A; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkI128.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkI128.g.h new file mode 100644 index 00000000000..9561df41fac --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkI128.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "DeletePkI128.g.generated.h" + +// Reducer arguments struct for DeletePkI128 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FDeletePkI128Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBInt128 N; + + FDeletePkI128Args() = default; + + FDeletePkI128Args(const FSpacetimeDBInt128& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FDeletePkI128Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FDeletePkI128Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FDeletePkI128Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UDeletePkI128Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBInt128 N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkI16.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkI16.g.h new file mode 100644 index 00000000000..033f1a67a71 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkI16.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "DeletePkI16.g.generated.h" + +// Reducer arguments struct for DeletePkI16 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FDeletePkI16Args +{ + GENERATED_BODY() + + // NOTE: int16 field not exposed to Blueprint due to non-blueprintable elements + int16 N; + + FDeletePkI16Args() = default; + + FDeletePkI16Args(const int16& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FDeletePkI16Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FDeletePkI16Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FDeletePkI16Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UDeletePkI16Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + // NOTE: int16 field not exposed to Blueprint due to non-blueprintable elements + int16 N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkI256.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkI256.g.h new file mode 100644 index 00000000000..2f5b4f2aa04 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkI256.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "DeletePkI256.g.generated.h" + +// Reducer arguments struct for DeletePkI256 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FDeletePkI256Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBInt256 N; + + FDeletePkI256Args() = default; + + FDeletePkI256Args(const FSpacetimeDBInt256& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FDeletePkI256Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FDeletePkI256Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FDeletePkI256Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UDeletePkI256Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBInt256 N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkI32.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkI32.g.h new file mode 100644 index 00000000000..d2f8c00c553 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkI32.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "DeletePkI32.g.generated.h" + +// Reducer arguments struct for DeletePkI32 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FDeletePkI32Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 N; + + FDeletePkI32Args() = default; + + FDeletePkI32Args(const int32& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FDeletePkI32Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FDeletePkI32Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FDeletePkI32Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UDeletePkI32Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkI64.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkI64.g.h new file mode 100644 index 00000000000..58d1d5fe26c --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkI64.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "DeletePkI64.g.generated.h" + +// Reducer arguments struct for DeletePkI64 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FDeletePkI64Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int64 N; + + FDeletePkI64Args() = default; + + FDeletePkI64Args(const int64& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FDeletePkI64Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FDeletePkI64Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FDeletePkI64Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UDeletePkI64Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int64 N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkI8.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkI8.g.h new file mode 100644 index 00000000000..90837a2ccdf --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkI8.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "DeletePkI8.g.generated.h" + +// Reducer arguments struct for DeletePkI8 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FDeletePkI8Args +{ + GENERATED_BODY() + + // NOTE: int8 field not exposed to Blueprint due to non-blueprintable elements + int8 N; + + FDeletePkI8Args() = default; + + FDeletePkI8Args(const int8& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FDeletePkI8Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FDeletePkI8Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FDeletePkI8Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UDeletePkI8Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + // NOTE: int8 field not exposed to Blueprint due to non-blueprintable elements + int8 N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkIdentity.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkIdentity.g.h new file mode 100644 index 00000000000..d6d28b98693 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkIdentity.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "DeletePkIdentity.g.generated.h" + +// Reducer arguments struct for DeletePkIdentity +USTRUCT(BlueprintType) +struct TESTCLIENT_API FDeletePkIdentityArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBIdentity I; + + FDeletePkIdentityArgs() = default; + + FDeletePkIdentityArgs(const FSpacetimeDBIdentity& InI) + : I(InI) + {} + + + FORCEINLINE bool operator==(const FDeletePkIdentityArgs& Other) const + { + return I == Other.I; + } + FORCEINLINE bool operator!=(const FDeletePkIdentityArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FDeletePkIdentityArgs, I); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UDeletePkIdentityReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBIdentity I; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkString.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkString.g.h new file mode 100644 index 00000000000..4e032bc040a --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkString.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "DeletePkString.g.generated.h" + +// Reducer arguments struct for DeletePkString +USTRUCT(BlueprintType) +struct TESTCLIENT_API FDeletePkStringArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FString S; + + FDeletePkStringArgs() = default; + + FDeletePkStringArgs(const FString& InS) + : S(InS) + {} + + + FORCEINLINE bool operator==(const FDeletePkStringArgs& Other) const + { + return S == Other.S; + } + FORCEINLINE bool operator!=(const FDeletePkStringArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FDeletePkStringArgs, S); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UDeletePkStringReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FString S; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkU128.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkU128.g.h new file mode 100644 index 00000000000..750efd6656b --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkU128.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "DeletePkU128.g.generated.h" + +// Reducer arguments struct for DeletePkU128 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FDeletePkU128Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBUInt128 N; + + FDeletePkU128Args() = default; + + FDeletePkU128Args(const FSpacetimeDBUInt128& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FDeletePkU128Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FDeletePkU128Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FDeletePkU128Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UDeletePkU128Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBUInt128 N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkU16.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkU16.g.h new file mode 100644 index 00000000000..ad38cb0d968 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkU16.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "DeletePkU16.g.generated.h" + +// Reducer arguments struct for DeletePkU16 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FDeletePkU16Args +{ + GENERATED_BODY() + + // NOTE: uint16 field not exposed to Blueprint due to non-blueprintable elements + uint16 N; + + FDeletePkU16Args() = default; + + FDeletePkU16Args(const uint16& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FDeletePkU16Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FDeletePkU16Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FDeletePkU16Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UDeletePkU16Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + // NOTE: uint16 field not exposed to Blueprint due to non-blueprintable elements + uint16 N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkU256.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkU256.g.h new file mode 100644 index 00000000000..836f01c9479 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkU256.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "DeletePkU256.g.generated.h" + +// Reducer arguments struct for DeletePkU256 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FDeletePkU256Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBUInt256 N; + + FDeletePkU256Args() = default; + + FDeletePkU256Args(const FSpacetimeDBUInt256& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FDeletePkU256Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FDeletePkU256Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FDeletePkU256Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UDeletePkU256Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBUInt256 N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkU32.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkU32.g.h new file mode 100644 index 00000000000..9c57cfeb826 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkU32.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "DeletePkU32.g.generated.h" + +// Reducer arguments struct for DeletePkU32 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FDeletePkU32Args +{ + GENERATED_BODY() + + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 N; + + FDeletePkU32Args() = default; + + FDeletePkU32Args(const uint32& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FDeletePkU32Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FDeletePkU32Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FDeletePkU32Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UDeletePkU32Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkU32InsertPkU32Two.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkU32InsertPkU32Two.g.h new file mode 100644 index 00000000000..fb7bc6b401c --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkU32InsertPkU32Two.g.h @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "DeletePkU32InsertPkU32Two.g.generated.h" + +// Reducer arguments struct for DeletePkU32InsertPkU32Two +USTRUCT(BlueprintType) +struct TESTCLIENT_API FDeletePkU32InsertPkU32TwoArgs +{ + GENERATED_BODY() + + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FDeletePkU32InsertPkU32TwoArgs() = default; + + FDeletePkU32InsertPkU32TwoArgs(const uint32& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FDeletePkU32InsertPkU32TwoArgs& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FDeletePkU32InsertPkU32TwoArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FDeletePkU32InsertPkU32TwoArgs, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UDeletePkU32InsertPkU32TwoReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkU32Two.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkU32Two.g.h new file mode 100644 index 00000000000..ba2958a8318 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkU32Two.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "DeletePkU32Two.g.generated.h" + +// Reducer arguments struct for DeletePkU32Two +USTRUCT(BlueprintType) +struct TESTCLIENT_API FDeletePkU32TwoArgs +{ + GENERATED_BODY() + + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 N; + + FDeletePkU32TwoArgs() = default; + + FDeletePkU32TwoArgs(const uint32& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FDeletePkU32TwoArgs& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FDeletePkU32TwoArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FDeletePkU32TwoArgs, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UDeletePkU32TwoReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkU64.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkU64.g.h new file mode 100644 index 00000000000..9896bd42c37 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkU64.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "DeletePkU64.g.generated.h" + +// Reducer arguments struct for DeletePkU64 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FDeletePkU64Args +{ + GENERATED_BODY() + + // NOTE: uint64 field not exposed to Blueprint due to non-blueprintable elements + uint64 N; + + FDeletePkU64Args() = default; + + FDeletePkU64Args(const uint64& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FDeletePkU64Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FDeletePkU64Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FDeletePkU64Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UDeletePkU64Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + // NOTE: uint64 field not exposed to Blueprint due to non-blueprintable elements + uint64 N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkU8.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkU8.g.h new file mode 100644 index 00000000000..bdeb42e70b3 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeletePkU8.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "DeletePkU8.g.generated.h" + +// Reducer arguments struct for DeletePkU8 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FDeletePkU8Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + uint8 N; + + FDeletePkU8Args() = default; + + FDeletePkU8Args(const uint8& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FDeletePkU8Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FDeletePkU8Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FDeletePkU8Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UDeletePkU8Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + uint8 N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteUniqueBool.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteUniqueBool.g.h new file mode 100644 index 00000000000..c9a8a1573fa --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteUniqueBool.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "DeleteUniqueBool.g.generated.h" + +// Reducer arguments struct for DeleteUniqueBool +USTRUCT(BlueprintType) +struct TESTCLIENT_API FDeleteUniqueBoolArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + bool B; + + FDeleteUniqueBoolArgs() = default; + + FDeleteUniqueBoolArgs(const bool& InB) + : B(InB) + {} + + + FORCEINLINE bool operator==(const FDeleteUniqueBoolArgs& Other) const + { + return B == Other.B; + } + FORCEINLINE bool operator!=(const FDeleteUniqueBoolArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FDeleteUniqueBoolArgs, B); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UDeleteUniqueBoolReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + bool B; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteUniqueConnectionId.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteUniqueConnectionId.g.h new file mode 100644 index 00000000000..c70d2a4314d --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteUniqueConnectionId.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "DeleteUniqueConnectionId.g.generated.h" + +// Reducer arguments struct for DeleteUniqueConnectionId +USTRUCT(BlueprintType) +struct TESTCLIENT_API FDeleteUniqueConnectionIdArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBConnectionId A; + + FDeleteUniqueConnectionIdArgs() = default; + + FDeleteUniqueConnectionIdArgs(const FSpacetimeDBConnectionId& InA) + : A(InA) + {} + + + FORCEINLINE bool operator==(const FDeleteUniqueConnectionIdArgs& Other) const + { + return A == Other.A; + } + FORCEINLINE bool operator!=(const FDeleteUniqueConnectionIdArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FDeleteUniqueConnectionIdArgs, A); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UDeleteUniqueConnectionIdReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBConnectionId A; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteUniqueI128.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteUniqueI128.g.h new file mode 100644 index 00000000000..8b3f37dd039 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteUniqueI128.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "DeleteUniqueI128.g.generated.h" + +// Reducer arguments struct for DeleteUniqueI128 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FDeleteUniqueI128Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBInt128 N; + + FDeleteUniqueI128Args() = default; + + FDeleteUniqueI128Args(const FSpacetimeDBInt128& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FDeleteUniqueI128Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FDeleteUniqueI128Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FDeleteUniqueI128Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UDeleteUniqueI128Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBInt128 N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteUniqueI16.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteUniqueI16.g.h new file mode 100644 index 00000000000..5f4e34d8770 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteUniqueI16.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "DeleteUniqueI16.g.generated.h" + +// Reducer arguments struct for DeleteUniqueI16 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FDeleteUniqueI16Args +{ + GENERATED_BODY() + + // NOTE: int16 field not exposed to Blueprint due to non-blueprintable elements + int16 N; + + FDeleteUniqueI16Args() = default; + + FDeleteUniqueI16Args(const int16& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FDeleteUniqueI16Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FDeleteUniqueI16Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FDeleteUniqueI16Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UDeleteUniqueI16Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + // NOTE: int16 field not exposed to Blueprint due to non-blueprintable elements + int16 N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteUniqueI256.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteUniqueI256.g.h new file mode 100644 index 00000000000..94829211fed --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteUniqueI256.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "DeleteUniqueI256.g.generated.h" + +// Reducer arguments struct for DeleteUniqueI256 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FDeleteUniqueI256Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBInt256 N; + + FDeleteUniqueI256Args() = default; + + FDeleteUniqueI256Args(const FSpacetimeDBInt256& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FDeleteUniqueI256Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FDeleteUniqueI256Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FDeleteUniqueI256Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UDeleteUniqueI256Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBInt256 N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteUniqueI32.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteUniqueI32.g.h new file mode 100644 index 00000000000..6167f785140 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteUniqueI32.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "DeleteUniqueI32.g.generated.h" + +// Reducer arguments struct for DeleteUniqueI32 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FDeleteUniqueI32Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 N; + + FDeleteUniqueI32Args() = default; + + FDeleteUniqueI32Args(const int32& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FDeleteUniqueI32Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FDeleteUniqueI32Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FDeleteUniqueI32Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UDeleteUniqueI32Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteUniqueI64.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteUniqueI64.g.h new file mode 100644 index 00000000000..33d73a6e70e --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteUniqueI64.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "DeleteUniqueI64.g.generated.h" + +// Reducer arguments struct for DeleteUniqueI64 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FDeleteUniqueI64Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int64 N; + + FDeleteUniqueI64Args() = default; + + FDeleteUniqueI64Args(const int64& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FDeleteUniqueI64Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FDeleteUniqueI64Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FDeleteUniqueI64Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UDeleteUniqueI64Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int64 N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteUniqueI8.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteUniqueI8.g.h new file mode 100644 index 00000000000..d5e613e53fa --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteUniqueI8.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "DeleteUniqueI8.g.generated.h" + +// Reducer arguments struct for DeleteUniqueI8 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FDeleteUniqueI8Args +{ + GENERATED_BODY() + + // NOTE: int8 field not exposed to Blueprint due to non-blueprintable elements + int8 N; + + FDeleteUniqueI8Args() = default; + + FDeleteUniqueI8Args(const int8& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FDeleteUniqueI8Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FDeleteUniqueI8Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FDeleteUniqueI8Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UDeleteUniqueI8Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + // NOTE: int8 field not exposed to Blueprint due to non-blueprintable elements + int8 N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteUniqueIdentity.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteUniqueIdentity.g.h new file mode 100644 index 00000000000..58fe24416ab --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteUniqueIdentity.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "DeleteUniqueIdentity.g.generated.h" + +// Reducer arguments struct for DeleteUniqueIdentity +USTRUCT(BlueprintType) +struct TESTCLIENT_API FDeleteUniqueIdentityArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBIdentity I; + + FDeleteUniqueIdentityArgs() = default; + + FDeleteUniqueIdentityArgs(const FSpacetimeDBIdentity& InI) + : I(InI) + {} + + + FORCEINLINE bool operator==(const FDeleteUniqueIdentityArgs& Other) const + { + return I == Other.I; + } + FORCEINLINE bool operator!=(const FDeleteUniqueIdentityArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FDeleteUniqueIdentityArgs, I); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UDeleteUniqueIdentityReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBIdentity I; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteUniqueString.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteUniqueString.g.h new file mode 100644 index 00000000000..a4bc4fb9ba0 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteUniqueString.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "DeleteUniqueString.g.generated.h" + +// Reducer arguments struct for DeleteUniqueString +USTRUCT(BlueprintType) +struct TESTCLIENT_API FDeleteUniqueStringArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FString S; + + FDeleteUniqueStringArgs() = default; + + FDeleteUniqueStringArgs(const FString& InS) + : S(InS) + {} + + + FORCEINLINE bool operator==(const FDeleteUniqueStringArgs& Other) const + { + return S == Other.S; + } + FORCEINLINE bool operator!=(const FDeleteUniqueStringArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FDeleteUniqueStringArgs, S); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UDeleteUniqueStringReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FString S; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteUniqueU128.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteUniqueU128.g.h new file mode 100644 index 00000000000..277a7919622 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteUniqueU128.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "DeleteUniqueU128.g.generated.h" + +// Reducer arguments struct for DeleteUniqueU128 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FDeleteUniqueU128Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBUInt128 N; + + FDeleteUniqueU128Args() = default; + + FDeleteUniqueU128Args(const FSpacetimeDBUInt128& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FDeleteUniqueU128Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FDeleteUniqueU128Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FDeleteUniqueU128Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UDeleteUniqueU128Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBUInt128 N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteUniqueU16.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteUniqueU16.g.h new file mode 100644 index 00000000000..e067c011bd5 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteUniqueU16.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "DeleteUniqueU16.g.generated.h" + +// Reducer arguments struct for DeleteUniqueU16 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FDeleteUniqueU16Args +{ + GENERATED_BODY() + + // NOTE: uint16 field not exposed to Blueprint due to non-blueprintable elements + uint16 N; + + FDeleteUniqueU16Args() = default; + + FDeleteUniqueU16Args(const uint16& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FDeleteUniqueU16Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FDeleteUniqueU16Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FDeleteUniqueU16Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UDeleteUniqueU16Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + // NOTE: uint16 field not exposed to Blueprint due to non-blueprintable elements + uint16 N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteUniqueU256.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteUniqueU256.g.h new file mode 100644 index 00000000000..f38b369aaa0 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteUniqueU256.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "DeleteUniqueU256.g.generated.h" + +// Reducer arguments struct for DeleteUniqueU256 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FDeleteUniqueU256Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBUInt256 N; + + FDeleteUniqueU256Args() = default; + + FDeleteUniqueU256Args(const FSpacetimeDBUInt256& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FDeleteUniqueU256Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FDeleteUniqueU256Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FDeleteUniqueU256Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UDeleteUniqueU256Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBUInt256 N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteUniqueU32.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteUniqueU32.g.h new file mode 100644 index 00000000000..783621f9434 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteUniqueU32.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "DeleteUniqueU32.g.generated.h" + +// Reducer arguments struct for DeleteUniqueU32 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FDeleteUniqueU32Args +{ + GENERATED_BODY() + + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 N; + + FDeleteUniqueU32Args() = default; + + FDeleteUniqueU32Args(const uint32& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FDeleteUniqueU32Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FDeleteUniqueU32Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FDeleteUniqueU32Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UDeleteUniqueU32Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteUniqueU64.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteUniqueU64.g.h new file mode 100644 index 00000000000..6e9aa4a89b3 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteUniqueU64.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "DeleteUniqueU64.g.generated.h" + +// Reducer arguments struct for DeleteUniqueU64 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FDeleteUniqueU64Args +{ + GENERATED_BODY() + + // NOTE: uint64 field not exposed to Blueprint due to non-blueprintable elements + uint64 N; + + FDeleteUniqueU64Args() = default; + + FDeleteUniqueU64Args(const uint64& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FDeleteUniqueU64Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FDeleteUniqueU64Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FDeleteUniqueU64Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UDeleteUniqueU64Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + // NOTE: uint64 field not exposed to Blueprint due to non-blueprintable elements + uint64 N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteUniqueU8.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteUniqueU8.g.h new file mode 100644 index 00000000000..d83f8fce7a0 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/DeleteUniqueU8.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "DeleteUniqueU8.g.generated.h" + +// Reducer arguments struct for DeleteUniqueU8 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FDeleteUniqueU8Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + uint8 N; + + FDeleteUniqueU8Args() = default; + + FDeleteUniqueU8Args(const uint8& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FDeleteUniqueU8Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FDeleteUniqueU8Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FDeleteUniqueU8Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UDeleteUniqueU8Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + uint8 N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertCallTimestamp.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertCallTimestamp.g.h new file mode 100644 index 00000000000..a667e21c0bc --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertCallTimestamp.g.h @@ -0,0 +1,43 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertCallTimestamp.g.generated.h" + +// Reducer arguments struct for InsertCallTimestamp +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertCallTimestampArgs +{ + GENERATED_BODY() + + FInsertCallTimestampArgs() = default; + + + FORCEINLINE bool operator==(const FInsertCallTimestampArgs& Other) const + { + return true; + } + FORCEINLINE bool operator!=(const FInsertCallTimestampArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT_EMPTY(FInsertCallTimestampArgs); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertCallTimestampReducer : public UReducerBase +{ + GENERATED_BODY() + +public: +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertCallerOneConnectionId.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertCallerOneConnectionId.g.h new file mode 100644 index 00000000000..5ba09ecb600 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertCallerOneConnectionId.g.h @@ -0,0 +1,43 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertCallerOneConnectionId.g.generated.h" + +// Reducer arguments struct for InsertCallerOneConnectionId +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertCallerOneConnectionIdArgs +{ + GENERATED_BODY() + + FInsertCallerOneConnectionIdArgs() = default; + + + FORCEINLINE bool operator==(const FInsertCallerOneConnectionIdArgs& Other) const + { + return true; + } + FORCEINLINE bool operator!=(const FInsertCallerOneConnectionIdArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT_EMPTY(FInsertCallerOneConnectionIdArgs); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertCallerOneConnectionIdReducer : public UReducerBase +{ + GENERATED_BODY() + +public: +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertCallerOneIdentity.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertCallerOneIdentity.g.h new file mode 100644 index 00000000000..fb6abec82fe --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertCallerOneIdentity.g.h @@ -0,0 +1,43 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertCallerOneIdentity.g.generated.h" + +// Reducer arguments struct for InsertCallerOneIdentity +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertCallerOneIdentityArgs +{ + GENERATED_BODY() + + FInsertCallerOneIdentityArgs() = default; + + + FORCEINLINE bool operator==(const FInsertCallerOneIdentityArgs& Other) const + { + return true; + } + FORCEINLINE bool operator!=(const FInsertCallerOneIdentityArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT_EMPTY(FInsertCallerOneIdentityArgs); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertCallerOneIdentityReducer : public UReducerBase +{ + GENERATED_BODY() + +public: +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertCallerPkConnectionId.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertCallerPkConnectionId.g.h new file mode 100644 index 00000000000..9da7fa1ef88 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertCallerPkConnectionId.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertCallerPkConnectionId.g.generated.h" + +// Reducer arguments struct for InsertCallerPkConnectionId +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertCallerPkConnectionIdArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FInsertCallerPkConnectionIdArgs() = default; + + FInsertCallerPkConnectionIdArgs(const int32& InData) + : Data(InData) + {} + + + FORCEINLINE bool operator==(const FInsertCallerPkConnectionIdArgs& Other) const + { + return Data == Other.Data; + } + FORCEINLINE bool operator!=(const FInsertCallerPkConnectionIdArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertCallerPkConnectionIdArgs, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertCallerPkConnectionIdReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertCallerPkIdentity.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertCallerPkIdentity.g.h new file mode 100644 index 00000000000..888606a0763 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertCallerPkIdentity.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertCallerPkIdentity.g.generated.h" + +// Reducer arguments struct for InsertCallerPkIdentity +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertCallerPkIdentityArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FInsertCallerPkIdentityArgs() = default; + + FInsertCallerPkIdentityArgs(const int32& InData) + : Data(InData) + {} + + + FORCEINLINE bool operator==(const FInsertCallerPkIdentityArgs& Other) const + { + return Data == Other.Data; + } + FORCEINLINE bool operator!=(const FInsertCallerPkIdentityArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertCallerPkIdentityArgs, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertCallerPkIdentityReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertCallerUniqueConnectionId.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertCallerUniqueConnectionId.g.h new file mode 100644 index 00000000000..50342be7d15 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertCallerUniqueConnectionId.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertCallerUniqueConnectionId.g.generated.h" + +// Reducer arguments struct for InsertCallerUniqueConnectionId +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertCallerUniqueConnectionIdArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FInsertCallerUniqueConnectionIdArgs() = default; + + FInsertCallerUniqueConnectionIdArgs(const int32& InData) + : Data(InData) + {} + + + FORCEINLINE bool operator==(const FInsertCallerUniqueConnectionIdArgs& Other) const + { + return Data == Other.Data; + } + FORCEINLINE bool operator!=(const FInsertCallerUniqueConnectionIdArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertCallerUniqueConnectionIdArgs, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertCallerUniqueConnectionIdReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertCallerUniqueIdentity.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertCallerUniqueIdentity.g.h new file mode 100644 index 00000000000..1fb2d4ae1a3 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertCallerUniqueIdentity.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertCallerUniqueIdentity.g.generated.h" + +// Reducer arguments struct for InsertCallerUniqueIdentity +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertCallerUniqueIdentityArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FInsertCallerUniqueIdentityArgs() = default; + + FInsertCallerUniqueIdentityArgs(const int32& InData) + : Data(InData) + {} + + + FORCEINLINE bool operator==(const FInsertCallerUniqueIdentityArgs& Other) const + { + return Data == Other.Data; + } + FORCEINLINE bool operator!=(const FInsertCallerUniqueIdentityArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertCallerUniqueIdentityArgs, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertCallerUniqueIdentityReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertCallerVecConnectionId.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertCallerVecConnectionId.g.h new file mode 100644 index 00000000000..716106f9d94 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertCallerVecConnectionId.g.h @@ -0,0 +1,43 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertCallerVecConnectionId.g.generated.h" + +// Reducer arguments struct for InsertCallerVecConnectionId +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertCallerVecConnectionIdArgs +{ + GENERATED_BODY() + + FInsertCallerVecConnectionIdArgs() = default; + + + FORCEINLINE bool operator==(const FInsertCallerVecConnectionIdArgs& Other) const + { + return true; + } + FORCEINLINE bool operator!=(const FInsertCallerVecConnectionIdArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT_EMPTY(FInsertCallerVecConnectionIdArgs); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertCallerVecConnectionIdReducer : public UReducerBase +{ + GENERATED_BODY() + +public: +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertCallerVecIdentity.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertCallerVecIdentity.g.h new file mode 100644 index 00000000000..bd06f9ba944 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertCallerVecIdentity.g.h @@ -0,0 +1,43 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertCallerVecIdentity.g.generated.h" + +// Reducer arguments struct for InsertCallerVecIdentity +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertCallerVecIdentityArgs +{ + GENERATED_BODY() + + FInsertCallerVecIdentityArgs() = default; + + + FORCEINLINE bool operator==(const FInsertCallerVecIdentityArgs& Other) const + { + return true; + } + FORCEINLINE bool operator!=(const FInsertCallerVecIdentityArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT_EMPTY(FInsertCallerVecIdentityArgs); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertCallerVecIdentityReducer : public UReducerBase +{ + GENERATED_BODY() + +public: +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertIntoBtreeU32.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertIntoBtreeU32.g.h new file mode 100644 index 00000000000..2e56c2eb5c9 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertIntoBtreeU32.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "ModuleBindings/Types/BTreeU32Type.g.h" +#include "InsertIntoBtreeU32.g.generated.h" + +// Reducer arguments struct for InsertIntoBtreeU32 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertIntoBtreeU32Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + TArray Rows; + + FInsertIntoBtreeU32Args() = default; + + FInsertIntoBtreeU32Args(const TArray& InRows) + : Rows(InRows) + {} + + + FORCEINLINE bool operator==(const FInsertIntoBtreeU32Args& Other) const + { + return Rows == Other.Rows; + } + FORCEINLINE bool operator!=(const FInsertIntoBtreeU32Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertIntoBtreeU32Args, Rows); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertIntoBtreeU32Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + TArray Rows; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertIntoIndexedSimpleEnum.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertIntoIndexedSimpleEnum.g.h new file mode 100644 index 00000000000..feb218fcc7d --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertIntoIndexedSimpleEnum.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "ModuleBindings/Types/SimpleEnumType.g.h" +#include "InsertIntoIndexedSimpleEnum.g.generated.h" + +// Reducer arguments struct for InsertIntoIndexedSimpleEnum +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertIntoIndexedSimpleEnumArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + ESimpleEnumType N; + + FInsertIntoIndexedSimpleEnumArgs() = default; + + FInsertIntoIndexedSimpleEnumArgs(const ESimpleEnumType& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FInsertIntoIndexedSimpleEnumArgs& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FInsertIntoIndexedSimpleEnumArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertIntoIndexedSimpleEnumArgs, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertIntoIndexedSimpleEnumReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + ESimpleEnumType N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertIntoPkBtreeU32.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertIntoPkBtreeU32.g.h new file mode 100644 index 00000000000..8aff730a29e --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertIntoPkBtreeU32.g.h @@ -0,0 +1,60 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "ModuleBindings/Types/BTreeU32Type.g.h" +#include "ModuleBindings/Types/PkU32Type.g.h" +#include "InsertIntoPkBtreeU32.g.generated.h" + +// Reducer arguments struct for InsertIntoPkBtreeU32 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertIntoPkBtreeU32Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + TArray PkU32; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + TArray BtU32; + + FInsertIntoPkBtreeU32Args() = default; + + FInsertIntoPkBtreeU32Args(const TArray& InPkU32, const TArray& InBtU32) + : PkU32(InPkU32), BtU32(InBtU32) + {} + + + FORCEINLINE bool operator==(const FInsertIntoPkBtreeU32Args& Other) const + { + return PkU32 == Other.PkU32 && BtU32 == Other.BtU32; + } + FORCEINLINE bool operator!=(const FInsertIntoPkBtreeU32Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertIntoPkBtreeU32Args, PkU32, BtU32); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertIntoPkBtreeU32Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + TArray PkU32; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + TArray BtU32; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertLargeTable.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertLargeTable.g.h new file mode 100644 index 00000000000..cc7414a19fb --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertLargeTable.g.h @@ -0,0 +1,165 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "ModuleBindings/Types/ByteStructType.g.h" +#include "ModuleBindings/Types/EnumWithPayloadType.g.h" +#include "ModuleBindings/Types/EveryPrimitiveStructType.g.h" +#include "ModuleBindings/Types/EveryVecStructType.g.h" +#include "ModuleBindings/Types/SimpleEnumType.g.h" +#include "ModuleBindings/Types/UnitStructType.g.h" +#include "Types/Builtins.h" +#include "InsertLargeTable.g.generated.h" + +// Reducer arguments struct for InsertLargeTable +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertLargeTableArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + uint8 A; + + // NOTE: uint16 field not exposed to Blueprint due to non-blueprintable elements + uint16 B; + + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 C; + + // NOTE: uint64 field not exposed to Blueprint due to non-blueprintable elements + uint64 D; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBUInt128 E; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBUInt256 F; + + // NOTE: int8 field not exposed to Blueprint due to non-blueprintable elements + int8 G; + + // NOTE: int16 field not exposed to Blueprint due to non-blueprintable elements + int16 H; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 I; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int64 J; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBInt128 K; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBInt256 L; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + bool M; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + float N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + double O; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FString P; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + ESimpleEnumType Q; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FEnumWithPayloadType R; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FUnitStructType S; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FByteStructType T; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FEveryPrimitiveStructType U; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FEveryVecStructType V; + + FInsertLargeTableArgs() = default; + + FInsertLargeTableArgs(const uint8& InA, const uint16& InB, const uint32& InC, const uint64& InD, const FSpacetimeDBUInt128& InE, const FSpacetimeDBUInt256& InF, const int8& InG, const int16& InH, const int32& InI, const int64& InJ, const FSpacetimeDBInt128& InK, const FSpacetimeDBInt256& InL, const bool& InM, const float& InN, const double& InO, const FString& InP, const ESimpleEnumType& InQ, const FEnumWithPayloadType& InR, const FUnitStructType& InS, const FByteStructType& InT, const FEveryPrimitiveStructType& InU, const FEveryVecStructType& InV) + : A(InA), B(InB), C(InC), D(InD), E(InE), F(InF), G(InG), H(InH), I(InI), J(InJ), K(InK), L(InL), M(InM), N(InN), O(InO), P(InP), Q(InQ), R(InR), S(InS), T(InT), U(InU), V(InV) + {} + + + FORCEINLINE bool operator==(const FInsertLargeTableArgs& Other) const + { + return A == Other.A && B == Other.B && C == Other.C && D == Other.D && E == Other.E && F == Other.F && G == Other.G && H == Other.H && I == Other.I && J == Other.J && K == Other.K && L == Other.L && M == Other.M && N == Other.N && O == Other.O && P == Other.P && Q == Other.Q && R == Other.R && S == Other.S && T == Other.T && U == Other.U && V == Other.V; + } + FORCEINLINE bool operator!=(const FInsertLargeTableArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertLargeTableArgs, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertLargeTableReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + uint8 A; + // NOTE: uint16 field not exposed to Blueprint due to non-blueprintable elements + uint16 B; + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 C; + // NOTE: uint64 field not exposed to Blueprint due to non-blueprintable elements + uint64 D; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBUInt128 E; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBUInt256 F; + // NOTE: int8 field not exposed to Blueprint due to non-blueprintable elements + int8 G; + // NOTE: int16 field not exposed to Blueprint due to non-blueprintable elements + int16 H; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 I; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int64 J; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBInt128 K; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBInt256 L; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + bool M; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + float N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + double O; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FString P; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + ESimpleEnumType Q; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FEnumWithPayloadType R; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FUnitStructType S; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FByteStructType T; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FEveryPrimitiveStructType U; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FEveryVecStructType V; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneBool.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneBool.g.h new file mode 100644 index 00000000000..aec69d4e6aa --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneBool.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertOneBool.g.generated.h" + +// Reducer arguments struct for InsertOneBool +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertOneBoolArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + bool B; + + FInsertOneBoolArgs() = default; + + FInsertOneBoolArgs(const bool& InB) + : B(InB) + {} + + + FORCEINLINE bool operator==(const FInsertOneBoolArgs& Other) const + { + return B == Other.B; + } + FORCEINLINE bool operator!=(const FInsertOneBoolArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertOneBoolArgs, B); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertOneBoolReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + bool B; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneByteStruct.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneByteStruct.g.h new file mode 100644 index 00000000000..cd397eb2570 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneByteStruct.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "ModuleBindings/Types/ByteStructType.g.h" +#include "InsertOneByteStruct.g.generated.h" + +// Reducer arguments struct for InsertOneByteStruct +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertOneByteStructArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FByteStructType S; + + FInsertOneByteStructArgs() = default; + + FInsertOneByteStructArgs(const FByteStructType& InS) + : S(InS) + {} + + + FORCEINLINE bool operator==(const FInsertOneByteStructArgs& Other) const + { + return S == Other.S; + } + FORCEINLINE bool operator!=(const FInsertOneByteStructArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertOneByteStructArgs, S); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertOneByteStructReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FByteStructType S; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneConnectionId.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneConnectionId.g.h new file mode 100644 index 00000000000..bd60b3fa2fa --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneConnectionId.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "InsertOneConnectionId.g.generated.h" + +// Reducer arguments struct for InsertOneConnectionId +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertOneConnectionIdArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBConnectionId A; + + FInsertOneConnectionIdArgs() = default; + + FInsertOneConnectionIdArgs(const FSpacetimeDBConnectionId& InA) + : A(InA) + {} + + + FORCEINLINE bool operator==(const FInsertOneConnectionIdArgs& Other) const + { + return A == Other.A; + } + FORCEINLINE bool operator!=(const FInsertOneConnectionIdArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertOneConnectionIdArgs, A); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertOneConnectionIdReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBConnectionId A; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneEnumWithPayload.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneEnumWithPayload.g.h new file mode 100644 index 00000000000..06bbf308b49 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneEnumWithPayload.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "ModuleBindings/Types/EnumWithPayloadType.g.h" +#include "InsertOneEnumWithPayload.g.generated.h" + +// Reducer arguments struct for InsertOneEnumWithPayload +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertOneEnumWithPayloadArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FEnumWithPayloadType E; + + FInsertOneEnumWithPayloadArgs() = default; + + FInsertOneEnumWithPayloadArgs(const FEnumWithPayloadType& InE) + : E(InE) + {} + + + FORCEINLINE bool operator==(const FInsertOneEnumWithPayloadArgs& Other) const + { + return E == Other.E; + } + FORCEINLINE bool operator!=(const FInsertOneEnumWithPayloadArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertOneEnumWithPayloadArgs, E); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertOneEnumWithPayloadReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FEnumWithPayloadType E; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneEveryPrimitiveStruct.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneEveryPrimitiveStruct.g.h new file mode 100644 index 00000000000..375c89c830c --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneEveryPrimitiveStruct.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "ModuleBindings/Types/EveryPrimitiveStructType.g.h" +#include "InsertOneEveryPrimitiveStruct.g.generated.h" + +// Reducer arguments struct for InsertOneEveryPrimitiveStruct +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertOneEveryPrimitiveStructArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FEveryPrimitiveStructType S; + + FInsertOneEveryPrimitiveStructArgs() = default; + + FInsertOneEveryPrimitiveStructArgs(const FEveryPrimitiveStructType& InS) + : S(InS) + {} + + + FORCEINLINE bool operator==(const FInsertOneEveryPrimitiveStructArgs& Other) const + { + return S == Other.S; + } + FORCEINLINE bool operator!=(const FInsertOneEveryPrimitiveStructArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertOneEveryPrimitiveStructArgs, S); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertOneEveryPrimitiveStructReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FEveryPrimitiveStructType S; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneEveryVecStruct.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneEveryVecStruct.g.h new file mode 100644 index 00000000000..f8848ee97ef --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneEveryVecStruct.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "ModuleBindings/Types/EveryVecStructType.g.h" +#include "InsertOneEveryVecStruct.g.generated.h" + +// Reducer arguments struct for InsertOneEveryVecStruct +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertOneEveryVecStructArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FEveryVecStructType S; + + FInsertOneEveryVecStructArgs() = default; + + FInsertOneEveryVecStructArgs(const FEveryVecStructType& InS) + : S(InS) + {} + + + FORCEINLINE bool operator==(const FInsertOneEveryVecStructArgs& Other) const + { + return S == Other.S; + } + FORCEINLINE bool operator!=(const FInsertOneEveryVecStructArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertOneEveryVecStructArgs, S); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertOneEveryVecStructReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FEveryVecStructType S; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneF32.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneF32.g.h new file mode 100644 index 00000000000..4777f461882 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneF32.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertOneF32.g.generated.h" + +// Reducer arguments struct for InsertOneF32 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertOneF32Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + float F; + + FInsertOneF32Args() = default; + + FInsertOneF32Args(const float& InF) + : F(InF) + {} + + + FORCEINLINE bool operator==(const FInsertOneF32Args& Other) const + { + return F == Other.F; + } + FORCEINLINE bool operator!=(const FInsertOneF32Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertOneF32Args, F); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertOneF32Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + float F; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneF64.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneF64.g.h new file mode 100644 index 00000000000..ba465b082c1 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneF64.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertOneF64.g.generated.h" + +// Reducer arguments struct for InsertOneF64 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertOneF64Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + double F; + + FInsertOneF64Args() = default; + + FInsertOneF64Args(const double& InF) + : F(InF) + {} + + + FORCEINLINE bool operator==(const FInsertOneF64Args& Other) const + { + return F == Other.F; + } + FORCEINLINE bool operator!=(const FInsertOneF64Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertOneF64Args, F); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertOneF64Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + double F; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneI128.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneI128.g.h new file mode 100644 index 00000000000..24959694d08 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneI128.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "InsertOneI128.g.generated.h" + +// Reducer arguments struct for InsertOneI128 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertOneI128Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBInt128 N; + + FInsertOneI128Args() = default; + + FInsertOneI128Args(const FSpacetimeDBInt128& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FInsertOneI128Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FInsertOneI128Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertOneI128Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertOneI128Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBInt128 N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneI16.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneI16.g.h new file mode 100644 index 00000000000..3d03f093a0f --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneI16.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertOneI16.g.generated.h" + +// Reducer arguments struct for InsertOneI16 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertOneI16Args +{ + GENERATED_BODY() + + // NOTE: int16 field not exposed to Blueprint due to non-blueprintable elements + int16 N; + + FInsertOneI16Args() = default; + + FInsertOneI16Args(const int16& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FInsertOneI16Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FInsertOneI16Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertOneI16Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertOneI16Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + // NOTE: int16 field not exposed to Blueprint due to non-blueprintable elements + int16 N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneI256.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneI256.g.h new file mode 100644 index 00000000000..7b403aca265 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneI256.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "InsertOneI256.g.generated.h" + +// Reducer arguments struct for InsertOneI256 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertOneI256Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBInt256 N; + + FInsertOneI256Args() = default; + + FInsertOneI256Args(const FSpacetimeDBInt256& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FInsertOneI256Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FInsertOneI256Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertOneI256Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertOneI256Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBInt256 N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneI32.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneI32.g.h new file mode 100644 index 00000000000..45b3cc4d105 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneI32.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertOneI32.g.generated.h" + +// Reducer arguments struct for InsertOneI32 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertOneI32Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 N; + + FInsertOneI32Args() = default; + + FInsertOneI32Args(const int32& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FInsertOneI32Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FInsertOneI32Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertOneI32Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertOneI32Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneI64.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneI64.g.h new file mode 100644 index 00000000000..9ed638daeed --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneI64.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertOneI64.g.generated.h" + +// Reducer arguments struct for InsertOneI64 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertOneI64Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int64 N; + + FInsertOneI64Args() = default; + + FInsertOneI64Args(const int64& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FInsertOneI64Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FInsertOneI64Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertOneI64Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertOneI64Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int64 N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneI8.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneI8.g.h new file mode 100644 index 00000000000..088c8d180bd --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneI8.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertOneI8.g.generated.h" + +// Reducer arguments struct for InsertOneI8 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertOneI8Args +{ + GENERATED_BODY() + + // NOTE: int8 field not exposed to Blueprint due to non-blueprintable elements + int8 N; + + FInsertOneI8Args() = default; + + FInsertOneI8Args(const int8& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FInsertOneI8Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FInsertOneI8Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertOneI8Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertOneI8Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + // NOTE: int8 field not exposed to Blueprint due to non-blueprintable elements + int8 N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneIdentity.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneIdentity.g.h new file mode 100644 index 00000000000..6dfeb0c7df9 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneIdentity.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "InsertOneIdentity.g.generated.h" + +// Reducer arguments struct for InsertOneIdentity +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertOneIdentityArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBIdentity I; + + FInsertOneIdentityArgs() = default; + + FInsertOneIdentityArgs(const FSpacetimeDBIdentity& InI) + : I(InI) + {} + + + FORCEINLINE bool operator==(const FInsertOneIdentityArgs& Other) const + { + return I == Other.I; + } + FORCEINLINE bool operator!=(const FInsertOneIdentityArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertOneIdentityArgs, I); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertOneIdentityReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBIdentity I; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneSimpleEnum.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneSimpleEnum.g.h new file mode 100644 index 00000000000..8cac0a1405d --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneSimpleEnum.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "ModuleBindings/Types/SimpleEnumType.g.h" +#include "InsertOneSimpleEnum.g.generated.h" + +// Reducer arguments struct for InsertOneSimpleEnum +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertOneSimpleEnumArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + ESimpleEnumType E; + + FInsertOneSimpleEnumArgs() = default; + + FInsertOneSimpleEnumArgs(const ESimpleEnumType& InE) + : E(InE) + {} + + + FORCEINLINE bool operator==(const FInsertOneSimpleEnumArgs& Other) const + { + return E == Other.E; + } + FORCEINLINE bool operator!=(const FInsertOneSimpleEnumArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertOneSimpleEnumArgs, E); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertOneSimpleEnumReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + ESimpleEnumType E; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneString.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneString.g.h new file mode 100644 index 00000000000..e5fed83d914 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneString.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertOneString.g.generated.h" + +// Reducer arguments struct for InsertOneString +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertOneStringArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FString S; + + FInsertOneStringArgs() = default; + + FInsertOneStringArgs(const FString& InS) + : S(InS) + {} + + + FORCEINLINE bool operator==(const FInsertOneStringArgs& Other) const + { + return S == Other.S; + } + FORCEINLINE bool operator!=(const FInsertOneStringArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertOneStringArgs, S); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertOneStringReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FString S; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneTimestamp.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneTimestamp.g.h new file mode 100644 index 00000000000..ff4524d2eb0 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneTimestamp.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "InsertOneTimestamp.g.generated.h" + +// Reducer arguments struct for InsertOneTimestamp +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertOneTimestampArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBTimestamp T; + + FInsertOneTimestampArgs() = default; + + FInsertOneTimestampArgs(const FSpacetimeDBTimestamp& InT) + : T(InT) + {} + + + FORCEINLINE bool operator==(const FInsertOneTimestampArgs& Other) const + { + return T == Other.T; + } + FORCEINLINE bool operator!=(const FInsertOneTimestampArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertOneTimestampArgs, T); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertOneTimestampReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBTimestamp T; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneU128.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneU128.g.h new file mode 100644 index 00000000000..e1f0b681ad9 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneU128.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "InsertOneU128.g.generated.h" + +// Reducer arguments struct for InsertOneU128 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertOneU128Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBUInt128 N; + + FInsertOneU128Args() = default; + + FInsertOneU128Args(const FSpacetimeDBUInt128& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FInsertOneU128Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FInsertOneU128Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertOneU128Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertOneU128Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBUInt128 N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneU16.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneU16.g.h new file mode 100644 index 00000000000..c3bda020b77 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneU16.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertOneU16.g.generated.h" + +// Reducer arguments struct for InsertOneU16 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertOneU16Args +{ + GENERATED_BODY() + + // NOTE: uint16 field not exposed to Blueprint due to non-blueprintable elements + uint16 N; + + FInsertOneU16Args() = default; + + FInsertOneU16Args(const uint16& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FInsertOneU16Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FInsertOneU16Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertOneU16Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertOneU16Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + // NOTE: uint16 field not exposed to Blueprint due to non-blueprintable elements + uint16 N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneU256.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneU256.g.h new file mode 100644 index 00000000000..39eae46dd0e --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneU256.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "InsertOneU256.g.generated.h" + +// Reducer arguments struct for InsertOneU256 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertOneU256Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBUInt256 N; + + FInsertOneU256Args() = default; + + FInsertOneU256Args(const FSpacetimeDBUInt256& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FInsertOneU256Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FInsertOneU256Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertOneU256Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertOneU256Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBUInt256 N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneU32.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneU32.g.h new file mode 100644 index 00000000000..076bf6f8d0e --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneU32.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertOneU32.g.generated.h" + +// Reducer arguments struct for InsertOneU32 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertOneU32Args +{ + GENERATED_BODY() + + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 N; + + FInsertOneU32Args() = default; + + FInsertOneU32Args(const uint32& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FInsertOneU32Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FInsertOneU32Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertOneU32Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertOneU32Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneU64.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneU64.g.h new file mode 100644 index 00000000000..485ceca3b79 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneU64.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertOneU64.g.generated.h" + +// Reducer arguments struct for InsertOneU64 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertOneU64Args +{ + GENERATED_BODY() + + // NOTE: uint64 field not exposed to Blueprint due to non-blueprintable elements + uint64 N; + + FInsertOneU64Args() = default; + + FInsertOneU64Args(const uint64& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FInsertOneU64Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FInsertOneU64Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertOneU64Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertOneU64Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + // NOTE: uint64 field not exposed to Blueprint due to non-blueprintable elements + uint64 N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneU8.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneU8.g.h new file mode 100644 index 00000000000..bcdae01d7fa --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneU8.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertOneU8.g.generated.h" + +// Reducer arguments struct for InsertOneU8 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertOneU8Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + uint8 N; + + FInsertOneU8Args() = default; + + FInsertOneU8Args(const uint8& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FInsertOneU8Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FInsertOneU8Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertOneU8Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertOneU8Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + uint8 N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneUnitStruct.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneUnitStruct.g.h new file mode 100644 index 00000000000..2b6e7b6931a --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOneUnitStruct.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "ModuleBindings/Types/UnitStructType.g.h" +#include "InsertOneUnitStruct.g.generated.h" + +// Reducer arguments struct for InsertOneUnitStruct +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertOneUnitStructArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FUnitStructType S; + + FInsertOneUnitStructArgs() = default; + + FInsertOneUnitStructArgs(const FUnitStructType& InS) + : S(InS) + {} + + + FORCEINLINE bool operator==(const FInsertOneUnitStructArgs& Other) const + { + return S == Other.S; + } + FORCEINLINE bool operator!=(const FInsertOneUnitStructArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertOneUnitStructArgs, S); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertOneUnitStructReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FUnitStructType S; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOptionEveryPrimitiveStruct.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOptionEveryPrimitiveStruct.g.h new file mode 100644 index 00000000000..37feec82129 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOptionEveryPrimitiveStruct.g.h @@ -0,0 +1,55 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Optionals/TestClientOptionalEveryPrimitiveStruct.g.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "ModuleBindings/Types/EveryPrimitiveStructType.g.h" +#include "InsertOptionEveryPrimitiveStruct.g.generated.h" + +// Reducer arguments struct for InsertOptionEveryPrimitiveStruct +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertOptionEveryPrimitiveStructArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FTestClientOptionalEveryPrimitiveStruct S; + + FInsertOptionEveryPrimitiveStructArgs() = default; + + FInsertOptionEveryPrimitiveStructArgs(const FTestClientOptionalEveryPrimitiveStruct& InS) + : S(InS) + {} + + + FORCEINLINE bool operator==(const FInsertOptionEveryPrimitiveStructArgs& Other) const + { + return S == Other.S; + } + FORCEINLINE bool operator!=(const FInsertOptionEveryPrimitiveStructArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertOptionEveryPrimitiveStructArgs, S); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertOptionEveryPrimitiveStructReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FTestClientOptionalEveryPrimitiveStruct S; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOptionI32.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOptionI32.g.h new file mode 100644 index 00000000000..a36578ae3dd --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOptionI32.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Optionals/TestClientOptionalInt32.g.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertOptionI32.g.generated.h" + +// Reducer arguments struct for InsertOptionI32 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertOptionI32Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FTestClientOptionalInt32 N; + + FInsertOptionI32Args() = default; + + FInsertOptionI32Args(const FTestClientOptionalInt32& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FInsertOptionI32Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FInsertOptionI32Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertOptionI32Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertOptionI32Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FTestClientOptionalInt32 N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOptionIdentity.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOptionIdentity.g.h new file mode 100644 index 00000000000..318ded3985b --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOptionIdentity.g.h @@ -0,0 +1,55 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Optionals/TestClientOptionalIdentity.g.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "InsertOptionIdentity.g.generated.h" + +// Reducer arguments struct for InsertOptionIdentity +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertOptionIdentityArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FTestClientOptionalIdentity I; + + FInsertOptionIdentityArgs() = default; + + FInsertOptionIdentityArgs(const FTestClientOptionalIdentity& InI) + : I(InI) + {} + + + FORCEINLINE bool operator==(const FInsertOptionIdentityArgs& Other) const + { + return I == Other.I; + } + FORCEINLINE bool operator!=(const FInsertOptionIdentityArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertOptionIdentityArgs, I); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertOptionIdentityReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FTestClientOptionalIdentity I; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOptionSimpleEnum.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOptionSimpleEnum.g.h new file mode 100644 index 00000000000..d62261d09d7 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOptionSimpleEnum.g.h @@ -0,0 +1,55 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Optionals/TestClientOptionalSimpleEnum.g.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "ModuleBindings/Types/SimpleEnumType.g.h" +#include "InsertOptionSimpleEnum.g.generated.h" + +// Reducer arguments struct for InsertOptionSimpleEnum +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertOptionSimpleEnumArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FTestClientOptionalSimpleEnum E; + + FInsertOptionSimpleEnumArgs() = default; + + FInsertOptionSimpleEnumArgs(const FTestClientOptionalSimpleEnum& InE) + : E(InE) + {} + + + FORCEINLINE bool operator==(const FInsertOptionSimpleEnumArgs& Other) const + { + return E == Other.E; + } + FORCEINLINE bool operator!=(const FInsertOptionSimpleEnumArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertOptionSimpleEnumArgs, E); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertOptionSimpleEnumReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FTestClientOptionalSimpleEnum E; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOptionString.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOptionString.g.h new file mode 100644 index 00000000000..7ee33baba27 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOptionString.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Optionals/TestClientOptionalString.g.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertOptionString.g.generated.h" + +// Reducer arguments struct for InsertOptionString +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertOptionStringArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FTestClientOptionalString S; + + FInsertOptionStringArgs() = default; + + FInsertOptionStringArgs(const FTestClientOptionalString& InS) + : S(InS) + {} + + + FORCEINLINE bool operator==(const FInsertOptionStringArgs& Other) const + { + return S == Other.S; + } + FORCEINLINE bool operator!=(const FInsertOptionStringArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertOptionStringArgs, S); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertOptionStringReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FTestClientOptionalString S; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOptionVecOptionI32.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOptionVecOptionI32.g.h new file mode 100644 index 00000000000..a68ff536b24 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertOptionVecOptionI32.g.h @@ -0,0 +1,55 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Optionals/TestClientOptionalInt32.g.h" +#include "ModuleBindings/Optionals/TestClientOptionalVecInt32.g.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertOptionVecOptionI32.g.generated.h" + +// Reducer arguments struct for InsertOptionVecOptionI32 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertOptionVecOptionI32Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FTestClientOptionalVecInt32 V; + + FInsertOptionVecOptionI32Args() = default; + + FInsertOptionVecOptionI32Args(const FTestClientOptionalVecInt32& InV) + : V(InV) + {} + + + FORCEINLINE bool operator==(const FInsertOptionVecOptionI32Args& Other) const + { + return V == Other.V; + } + FORCEINLINE bool operator!=(const FInsertOptionVecOptionI32Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertOptionVecOptionI32Args, V); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertOptionVecOptionI32Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FTestClientOptionalVecInt32 V; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkBool.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkBool.g.h new file mode 100644 index 00000000000..2e82ac31691 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkBool.g.h @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertPkBool.g.generated.h" + +// Reducer arguments struct for InsertPkBool +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertPkBoolArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + bool B; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FInsertPkBoolArgs() = default; + + FInsertPkBoolArgs(const bool& InB, const int32& InData) + : B(InB), Data(InData) + {} + + + FORCEINLINE bool operator==(const FInsertPkBoolArgs& Other) const + { + return B == Other.B && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FInsertPkBoolArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertPkBoolArgs, B, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertPkBoolReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + bool B; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkConnectionId.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkConnectionId.g.h new file mode 100644 index 00000000000..6cdf10ae644 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkConnectionId.g.h @@ -0,0 +1,59 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "InsertPkConnectionId.g.generated.h" + +// Reducer arguments struct for InsertPkConnectionId +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertPkConnectionIdArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBConnectionId A; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FInsertPkConnectionIdArgs() = default; + + FInsertPkConnectionIdArgs(const FSpacetimeDBConnectionId& InA, const int32& InData) + : A(InA), Data(InData) + {} + + + FORCEINLINE bool operator==(const FInsertPkConnectionIdArgs& Other) const + { + return A == Other.A && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FInsertPkConnectionIdArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertPkConnectionIdArgs, A, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertPkConnectionIdReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBConnectionId A; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkI128.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkI128.g.h new file mode 100644 index 00000000000..2247cbcc275 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkI128.g.h @@ -0,0 +1,59 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "InsertPkI128.g.generated.h" + +// Reducer arguments struct for InsertPkI128 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertPkI128Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBInt128 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FInsertPkI128Args() = default; + + FInsertPkI128Args(const FSpacetimeDBInt128& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FInsertPkI128Args& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FInsertPkI128Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertPkI128Args, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertPkI128Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBInt128 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkI16.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkI16.g.h new file mode 100644 index 00000000000..e2d71c39f41 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkI16.g.h @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertPkI16.g.generated.h" + +// Reducer arguments struct for InsertPkI16 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertPkI16Args +{ + GENERATED_BODY() + + // NOTE: int16 field not exposed to Blueprint due to non-blueprintable elements + int16 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FInsertPkI16Args() = default; + + FInsertPkI16Args(const int16& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FInsertPkI16Args& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FInsertPkI16Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertPkI16Args, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertPkI16Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + // NOTE: int16 field not exposed to Blueprint due to non-blueprintable elements + int16 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkI256.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkI256.g.h new file mode 100644 index 00000000000..12dc1af35bd --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkI256.g.h @@ -0,0 +1,59 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "InsertPkI256.g.generated.h" + +// Reducer arguments struct for InsertPkI256 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertPkI256Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBInt256 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FInsertPkI256Args() = default; + + FInsertPkI256Args(const FSpacetimeDBInt256& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FInsertPkI256Args& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FInsertPkI256Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertPkI256Args, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertPkI256Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBInt256 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkI32.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkI32.g.h new file mode 100644 index 00000000000..1879cca6fb8 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkI32.g.h @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertPkI32.g.generated.h" + +// Reducer arguments struct for InsertPkI32 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertPkI32Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FInsertPkI32Args() = default; + + FInsertPkI32Args(const int32& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FInsertPkI32Args& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FInsertPkI32Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertPkI32Args, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertPkI32Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkI64.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkI64.g.h new file mode 100644 index 00000000000..f09e8ab50c7 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkI64.g.h @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertPkI64.g.generated.h" + +// Reducer arguments struct for InsertPkI64 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertPkI64Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int64 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FInsertPkI64Args() = default; + + FInsertPkI64Args(const int64& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FInsertPkI64Args& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FInsertPkI64Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertPkI64Args, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertPkI64Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int64 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkI8.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkI8.g.h new file mode 100644 index 00000000000..f5c975a0be3 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkI8.g.h @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertPkI8.g.generated.h" + +// Reducer arguments struct for InsertPkI8 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertPkI8Args +{ + GENERATED_BODY() + + // NOTE: int8 field not exposed to Blueprint due to non-blueprintable elements + int8 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FInsertPkI8Args() = default; + + FInsertPkI8Args(const int8& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FInsertPkI8Args& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FInsertPkI8Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertPkI8Args, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertPkI8Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + // NOTE: int8 field not exposed to Blueprint due to non-blueprintable elements + int8 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkIdentity.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkIdentity.g.h new file mode 100644 index 00000000000..27c6ef102f4 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkIdentity.g.h @@ -0,0 +1,59 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "InsertPkIdentity.g.generated.h" + +// Reducer arguments struct for InsertPkIdentity +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertPkIdentityArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBIdentity I; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FInsertPkIdentityArgs() = default; + + FInsertPkIdentityArgs(const FSpacetimeDBIdentity& InI, const int32& InData) + : I(InI), Data(InData) + {} + + + FORCEINLINE bool operator==(const FInsertPkIdentityArgs& Other) const + { + return I == Other.I && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FInsertPkIdentityArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertPkIdentityArgs, I, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertPkIdentityReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBIdentity I; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkSimpleEnum.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkSimpleEnum.g.h new file mode 100644 index 00000000000..a906da03cc3 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkSimpleEnum.g.h @@ -0,0 +1,59 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "ModuleBindings/Types/SimpleEnumType.g.h" +#include "InsertPkSimpleEnum.g.generated.h" + +// Reducer arguments struct for InsertPkSimpleEnum +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertPkSimpleEnumArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + ESimpleEnumType A; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FInsertPkSimpleEnumArgs() = default; + + FInsertPkSimpleEnumArgs(const ESimpleEnumType& InA, const int32& InData) + : A(InA), Data(InData) + {} + + + FORCEINLINE bool operator==(const FInsertPkSimpleEnumArgs& Other) const + { + return A == Other.A && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FInsertPkSimpleEnumArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertPkSimpleEnumArgs, A, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertPkSimpleEnumReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + ESimpleEnumType A; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkString.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkString.g.h new file mode 100644 index 00000000000..e980118776c --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkString.g.h @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertPkString.g.generated.h" + +// Reducer arguments struct for InsertPkString +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertPkStringArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FString S; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FInsertPkStringArgs() = default; + + FInsertPkStringArgs(const FString& InS, const int32& InData) + : S(InS), Data(InData) + {} + + + FORCEINLINE bool operator==(const FInsertPkStringArgs& Other) const + { + return S == Other.S && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FInsertPkStringArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertPkStringArgs, S, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertPkStringReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FString S; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkU128.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkU128.g.h new file mode 100644 index 00000000000..c5bf0e0657c --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkU128.g.h @@ -0,0 +1,59 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "InsertPkU128.g.generated.h" + +// Reducer arguments struct for InsertPkU128 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertPkU128Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBUInt128 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FInsertPkU128Args() = default; + + FInsertPkU128Args(const FSpacetimeDBUInt128& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FInsertPkU128Args& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FInsertPkU128Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertPkU128Args, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertPkU128Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBUInt128 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkU16.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkU16.g.h new file mode 100644 index 00000000000..4975162171c --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkU16.g.h @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertPkU16.g.generated.h" + +// Reducer arguments struct for InsertPkU16 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertPkU16Args +{ + GENERATED_BODY() + + // NOTE: uint16 field not exposed to Blueprint due to non-blueprintable elements + uint16 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FInsertPkU16Args() = default; + + FInsertPkU16Args(const uint16& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FInsertPkU16Args& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FInsertPkU16Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertPkU16Args, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertPkU16Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + // NOTE: uint16 field not exposed to Blueprint due to non-blueprintable elements + uint16 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkU256.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkU256.g.h new file mode 100644 index 00000000000..3c7a5409db2 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkU256.g.h @@ -0,0 +1,59 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "InsertPkU256.g.generated.h" + +// Reducer arguments struct for InsertPkU256 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertPkU256Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBUInt256 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FInsertPkU256Args() = default; + + FInsertPkU256Args(const FSpacetimeDBUInt256& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FInsertPkU256Args& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FInsertPkU256Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertPkU256Args, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertPkU256Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBUInt256 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkU32.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkU32.g.h new file mode 100644 index 00000000000..0c441669838 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkU32.g.h @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertPkU32.g.generated.h" + +// Reducer arguments struct for InsertPkU32 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertPkU32Args +{ + GENERATED_BODY() + + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FInsertPkU32Args() = default; + + FInsertPkU32Args(const uint32& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FInsertPkU32Args& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FInsertPkU32Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertPkU32Args, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertPkU32Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkU32Two.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkU32Two.g.h new file mode 100644 index 00000000000..40f3a34f828 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkU32Two.g.h @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertPkU32Two.g.generated.h" + +// Reducer arguments struct for InsertPkU32Two +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertPkU32TwoArgs +{ + GENERATED_BODY() + + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FInsertPkU32TwoArgs() = default; + + FInsertPkU32TwoArgs(const uint32& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FInsertPkU32TwoArgs& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FInsertPkU32TwoArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertPkU32TwoArgs, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertPkU32TwoReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkU64.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkU64.g.h new file mode 100644 index 00000000000..2e6246d7c2e --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkU64.g.h @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertPkU64.g.generated.h" + +// Reducer arguments struct for InsertPkU64 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertPkU64Args +{ + GENERATED_BODY() + + // NOTE: uint64 field not exposed to Blueprint due to non-blueprintable elements + uint64 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FInsertPkU64Args() = default; + + FInsertPkU64Args(const uint64& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FInsertPkU64Args& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FInsertPkU64Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertPkU64Args, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertPkU64Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + // NOTE: uint64 field not exposed to Blueprint due to non-blueprintable elements + uint64 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkU8.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkU8.g.h new file mode 100644 index 00000000000..53b7dcdaf0e --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPkU8.g.h @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertPkU8.g.generated.h" + +// Reducer arguments struct for InsertPkU8 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertPkU8Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + uint8 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FInsertPkU8Args() = default; + + FInsertPkU8Args(const uint8& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FInsertPkU8Args& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FInsertPkU8Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertPkU8Args, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertPkU8Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + uint8 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPrimitivesAsStrings.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPrimitivesAsStrings.g.h new file mode 100644 index 00000000000..70585303ef6 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertPrimitivesAsStrings.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "ModuleBindings/Types/EveryPrimitiveStructType.g.h" +#include "InsertPrimitivesAsStrings.g.generated.h" + +// Reducer arguments struct for InsertPrimitivesAsStrings +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertPrimitivesAsStringsArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FEveryPrimitiveStructType S; + + FInsertPrimitivesAsStringsArgs() = default; + + FInsertPrimitivesAsStringsArgs(const FEveryPrimitiveStructType& InS) + : S(InS) + {} + + + FORCEINLINE bool operator==(const FInsertPrimitivesAsStringsArgs& Other) const + { + return S == Other.S; + } + FORCEINLINE bool operator!=(const FInsertPrimitivesAsStringsArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertPrimitivesAsStringsArgs, S); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertPrimitivesAsStringsReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FEveryPrimitiveStructType S; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertTableHoldsTable.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertTableHoldsTable.g.h new file mode 100644 index 00000000000..108942c5d75 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertTableHoldsTable.g.h @@ -0,0 +1,60 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "ModuleBindings/Types/OneU8Type.g.h" +#include "ModuleBindings/Types/VecU8Type.g.h" +#include "InsertTableHoldsTable.g.generated.h" + +// Reducer arguments struct for InsertTableHoldsTable +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertTableHoldsTableArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FOneU8Type A; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FVecU8Type B; + + FInsertTableHoldsTableArgs() = default; + + FInsertTableHoldsTableArgs(const FOneU8Type& InA, const FVecU8Type& InB) + : A(InA), B(InB) + {} + + + FORCEINLINE bool operator==(const FInsertTableHoldsTableArgs& Other) const + { + return A == Other.A && B == Other.B; + } + FORCEINLINE bool operator!=(const FInsertTableHoldsTableArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertTableHoldsTableArgs, A, B); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertTableHoldsTableReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FOneU8Type A; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FVecU8Type B; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueBool.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueBool.g.h new file mode 100644 index 00000000000..d67afcbd9b6 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueBool.g.h @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertUniqueBool.g.generated.h" + +// Reducer arguments struct for InsertUniqueBool +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertUniqueBoolArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + bool B; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FInsertUniqueBoolArgs() = default; + + FInsertUniqueBoolArgs(const bool& InB, const int32& InData) + : B(InB), Data(InData) + {} + + + FORCEINLINE bool operator==(const FInsertUniqueBoolArgs& Other) const + { + return B == Other.B && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FInsertUniqueBoolArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertUniqueBoolArgs, B, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertUniqueBoolReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + bool B; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueConnectionId.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueConnectionId.g.h new file mode 100644 index 00000000000..78e7012edba --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueConnectionId.g.h @@ -0,0 +1,59 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "InsertUniqueConnectionId.g.generated.h" + +// Reducer arguments struct for InsertUniqueConnectionId +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertUniqueConnectionIdArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBConnectionId A; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FInsertUniqueConnectionIdArgs() = default; + + FInsertUniqueConnectionIdArgs(const FSpacetimeDBConnectionId& InA, const int32& InData) + : A(InA), Data(InData) + {} + + + FORCEINLINE bool operator==(const FInsertUniqueConnectionIdArgs& Other) const + { + return A == Other.A && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FInsertUniqueConnectionIdArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertUniqueConnectionIdArgs, A, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertUniqueConnectionIdReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBConnectionId A; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueI128.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueI128.g.h new file mode 100644 index 00000000000..5f295565bf7 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueI128.g.h @@ -0,0 +1,59 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "InsertUniqueI128.g.generated.h" + +// Reducer arguments struct for InsertUniqueI128 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertUniqueI128Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBInt128 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FInsertUniqueI128Args() = default; + + FInsertUniqueI128Args(const FSpacetimeDBInt128& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FInsertUniqueI128Args& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FInsertUniqueI128Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertUniqueI128Args, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertUniqueI128Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBInt128 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueI16.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueI16.g.h new file mode 100644 index 00000000000..ae9aec9046d --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueI16.g.h @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertUniqueI16.g.generated.h" + +// Reducer arguments struct for InsertUniqueI16 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertUniqueI16Args +{ + GENERATED_BODY() + + // NOTE: int16 field not exposed to Blueprint due to non-blueprintable elements + int16 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FInsertUniqueI16Args() = default; + + FInsertUniqueI16Args(const int16& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FInsertUniqueI16Args& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FInsertUniqueI16Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertUniqueI16Args, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertUniqueI16Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + // NOTE: int16 field not exposed to Blueprint due to non-blueprintable elements + int16 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueI256.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueI256.g.h new file mode 100644 index 00000000000..b1c4d4fb25c --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueI256.g.h @@ -0,0 +1,59 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "InsertUniqueI256.g.generated.h" + +// Reducer arguments struct for InsertUniqueI256 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertUniqueI256Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBInt256 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FInsertUniqueI256Args() = default; + + FInsertUniqueI256Args(const FSpacetimeDBInt256& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FInsertUniqueI256Args& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FInsertUniqueI256Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertUniqueI256Args, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertUniqueI256Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBInt256 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueI32.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueI32.g.h new file mode 100644 index 00000000000..c812bb58f6e --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueI32.g.h @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertUniqueI32.g.generated.h" + +// Reducer arguments struct for InsertUniqueI32 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertUniqueI32Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FInsertUniqueI32Args() = default; + + FInsertUniqueI32Args(const int32& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FInsertUniqueI32Args& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FInsertUniqueI32Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertUniqueI32Args, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertUniqueI32Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueI64.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueI64.g.h new file mode 100644 index 00000000000..b427f4885e6 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueI64.g.h @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertUniqueI64.g.generated.h" + +// Reducer arguments struct for InsertUniqueI64 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertUniqueI64Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int64 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FInsertUniqueI64Args() = default; + + FInsertUniqueI64Args(const int64& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FInsertUniqueI64Args& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FInsertUniqueI64Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertUniqueI64Args, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertUniqueI64Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int64 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueI8.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueI8.g.h new file mode 100644 index 00000000000..fc585f2484b --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueI8.g.h @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertUniqueI8.g.generated.h" + +// Reducer arguments struct for InsertUniqueI8 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertUniqueI8Args +{ + GENERATED_BODY() + + // NOTE: int8 field not exposed to Blueprint due to non-blueprintable elements + int8 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FInsertUniqueI8Args() = default; + + FInsertUniqueI8Args(const int8& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FInsertUniqueI8Args& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FInsertUniqueI8Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertUniqueI8Args, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertUniqueI8Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + // NOTE: int8 field not exposed to Blueprint due to non-blueprintable elements + int8 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueIdentity.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueIdentity.g.h new file mode 100644 index 00000000000..139fb2fec21 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueIdentity.g.h @@ -0,0 +1,59 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "InsertUniqueIdentity.g.generated.h" + +// Reducer arguments struct for InsertUniqueIdentity +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertUniqueIdentityArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBIdentity I; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FInsertUniqueIdentityArgs() = default; + + FInsertUniqueIdentityArgs(const FSpacetimeDBIdentity& InI, const int32& InData) + : I(InI), Data(InData) + {} + + + FORCEINLINE bool operator==(const FInsertUniqueIdentityArgs& Other) const + { + return I == Other.I && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FInsertUniqueIdentityArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertUniqueIdentityArgs, I, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertUniqueIdentityReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBIdentity I; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueString.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueString.g.h new file mode 100644 index 00000000000..fd4beb2d9b6 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueString.g.h @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertUniqueString.g.generated.h" + +// Reducer arguments struct for InsertUniqueString +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertUniqueStringArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FString S; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FInsertUniqueStringArgs() = default; + + FInsertUniqueStringArgs(const FString& InS, const int32& InData) + : S(InS), Data(InData) + {} + + + FORCEINLINE bool operator==(const FInsertUniqueStringArgs& Other) const + { + return S == Other.S && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FInsertUniqueStringArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertUniqueStringArgs, S, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertUniqueStringReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FString S; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueU128.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueU128.g.h new file mode 100644 index 00000000000..3620b201f3f --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueU128.g.h @@ -0,0 +1,59 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "InsertUniqueU128.g.generated.h" + +// Reducer arguments struct for InsertUniqueU128 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertUniqueU128Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBUInt128 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FInsertUniqueU128Args() = default; + + FInsertUniqueU128Args(const FSpacetimeDBUInt128& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FInsertUniqueU128Args& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FInsertUniqueU128Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertUniqueU128Args, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertUniqueU128Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBUInt128 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueU16.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueU16.g.h new file mode 100644 index 00000000000..45e6a25129d --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueU16.g.h @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertUniqueU16.g.generated.h" + +// Reducer arguments struct for InsertUniqueU16 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertUniqueU16Args +{ + GENERATED_BODY() + + // NOTE: uint16 field not exposed to Blueprint due to non-blueprintable elements + uint16 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FInsertUniqueU16Args() = default; + + FInsertUniqueU16Args(const uint16& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FInsertUniqueU16Args& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FInsertUniqueU16Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertUniqueU16Args, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertUniqueU16Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + // NOTE: uint16 field not exposed to Blueprint due to non-blueprintable elements + uint16 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueU256.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueU256.g.h new file mode 100644 index 00000000000..da682ff5fba --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueU256.g.h @@ -0,0 +1,59 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "InsertUniqueU256.g.generated.h" + +// Reducer arguments struct for InsertUniqueU256 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertUniqueU256Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBUInt256 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FInsertUniqueU256Args() = default; + + FInsertUniqueU256Args(const FSpacetimeDBUInt256& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FInsertUniqueU256Args& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FInsertUniqueU256Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertUniqueU256Args, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertUniqueU256Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBUInt256 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueU32.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueU32.g.h new file mode 100644 index 00000000000..edceb8e1b20 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueU32.g.h @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertUniqueU32.g.generated.h" + +// Reducer arguments struct for InsertUniqueU32 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertUniqueU32Args +{ + GENERATED_BODY() + + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FInsertUniqueU32Args() = default; + + FInsertUniqueU32Args(const uint32& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FInsertUniqueU32Args& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FInsertUniqueU32Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertUniqueU32Args, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertUniqueU32Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueU32UpdatePkU32.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueU32UpdatePkU32.g.h new file mode 100644 index 00000000000..4043ae8f749 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueU32UpdatePkU32.g.h @@ -0,0 +1,63 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertUniqueU32UpdatePkU32.g.generated.h" + +// Reducer arguments struct for InsertUniqueU32UpdatePkU32 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertUniqueU32UpdatePkU32Args +{ + GENERATED_BODY() + + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 DUnique; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 DPk; + + FInsertUniqueU32UpdatePkU32Args() = default; + + FInsertUniqueU32UpdatePkU32Args(const uint32& InN, const int32& InDUnique, const int32& InDPk) + : N(InN), DUnique(InDUnique), DPk(InDPk) + {} + + + FORCEINLINE bool operator==(const FInsertUniqueU32UpdatePkU32Args& Other) const + { + return N == Other.N && DUnique == Other.DUnique && DPk == Other.DPk; + } + FORCEINLINE bool operator!=(const FInsertUniqueU32UpdatePkU32Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertUniqueU32UpdatePkU32Args, N, DUnique, DPk); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertUniqueU32UpdatePkU32Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 DUnique; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 DPk; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueU64.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueU64.g.h new file mode 100644 index 00000000000..5bd306f7465 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueU64.g.h @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertUniqueU64.g.generated.h" + +// Reducer arguments struct for InsertUniqueU64 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertUniqueU64Args +{ + GENERATED_BODY() + + // NOTE: uint64 field not exposed to Blueprint due to non-blueprintable elements + uint64 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FInsertUniqueU64Args() = default; + + FInsertUniqueU64Args(const uint64& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FInsertUniqueU64Args& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FInsertUniqueU64Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertUniqueU64Args, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertUniqueU64Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + // NOTE: uint64 field not exposed to Blueprint due to non-blueprintable elements + uint64 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueU8.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueU8.g.h new file mode 100644 index 00000000000..0661985e02f --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUniqueU8.g.h @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertUniqueU8.g.generated.h" + +// Reducer arguments struct for InsertUniqueU8 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertUniqueU8Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + uint8 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FInsertUniqueU8Args() = default; + + FInsertUniqueU8Args(const uint8& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FInsertUniqueU8Args& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FInsertUniqueU8Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertUniqueU8Args, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertUniqueU8Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + uint8 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUser.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUser.g.h new file mode 100644 index 00000000000..a910421669d --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertUser.g.h @@ -0,0 +1,59 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "InsertUser.g.generated.h" + +// Reducer arguments struct for InsertUser +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertUserArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FString Name; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBIdentity Identity; + + FInsertUserArgs() = default; + + FInsertUserArgs(const FString& InName, const FSpacetimeDBIdentity& InIdentity) + : Name(InName), Identity(InIdentity) + {} + + + FORCEINLINE bool operator==(const FInsertUserArgs& Other) const + { + return Name == Other.Name && Identity == Other.Identity; + } + FORCEINLINE bool operator!=(const FInsertUserArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertUserArgs, Name, Identity); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertUserReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FString Name; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBIdentity Identity; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecBool.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecBool.g.h new file mode 100644 index 00000000000..9bfc6f40d4b --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecBool.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertVecBool.g.generated.h" + +// Reducer arguments struct for InsertVecBool +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertVecBoolArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + TArray B; + + FInsertVecBoolArgs() = default; + + FInsertVecBoolArgs(const TArray& InB) + : B(InB) + {} + + + FORCEINLINE bool operator==(const FInsertVecBoolArgs& Other) const + { + return B == Other.B; + } + FORCEINLINE bool operator!=(const FInsertVecBoolArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertVecBoolArgs, B); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertVecBoolReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + TArray B; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecByteStruct.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecByteStruct.g.h new file mode 100644 index 00000000000..e76a18e55c5 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecByteStruct.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "ModuleBindings/Types/ByteStructType.g.h" +#include "InsertVecByteStruct.g.generated.h" + +// Reducer arguments struct for InsertVecByteStruct +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertVecByteStructArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + TArray S; + + FInsertVecByteStructArgs() = default; + + FInsertVecByteStructArgs(const TArray& InS) + : S(InS) + {} + + + FORCEINLINE bool operator==(const FInsertVecByteStructArgs& Other) const + { + return S == Other.S; + } + FORCEINLINE bool operator!=(const FInsertVecByteStructArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertVecByteStructArgs, S); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertVecByteStructReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + TArray S; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecConnectionId.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecConnectionId.g.h new file mode 100644 index 00000000000..88c88347d12 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecConnectionId.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "InsertVecConnectionId.g.generated.h" + +// Reducer arguments struct for InsertVecConnectionId +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertVecConnectionIdArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + TArray A; + + FInsertVecConnectionIdArgs() = default; + + FInsertVecConnectionIdArgs(const TArray& InA) + : A(InA) + {} + + + FORCEINLINE bool operator==(const FInsertVecConnectionIdArgs& Other) const + { + return A == Other.A; + } + FORCEINLINE bool operator!=(const FInsertVecConnectionIdArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertVecConnectionIdArgs, A); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertVecConnectionIdReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + TArray A; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecEnumWithPayload.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecEnumWithPayload.g.h new file mode 100644 index 00000000000..22576559b68 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecEnumWithPayload.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "ModuleBindings/Types/EnumWithPayloadType.g.h" +#include "InsertVecEnumWithPayload.g.generated.h" + +// Reducer arguments struct for InsertVecEnumWithPayload +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertVecEnumWithPayloadArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + TArray E; + + FInsertVecEnumWithPayloadArgs() = default; + + FInsertVecEnumWithPayloadArgs(const TArray& InE) + : E(InE) + {} + + + FORCEINLINE bool operator==(const FInsertVecEnumWithPayloadArgs& Other) const + { + return E == Other.E; + } + FORCEINLINE bool operator!=(const FInsertVecEnumWithPayloadArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertVecEnumWithPayloadArgs, E); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertVecEnumWithPayloadReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + TArray E; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecEveryPrimitiveStruct.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecEveryPrimitiveStruct.g.h new file mode 100644 index 00000000000..31184666aab --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecEveryPrimitiveStruct.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "ModuleBindings/Types/EveryPrimitiveStructType.g.h" +#include "InsertVecEveryPrimitiveStruct.g.generated.h" + +// Reducer arguments struct for InsertVecEveryPrimitiveStruct +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertVecEveryPrimitiveStructArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + TArray S; + + FInsertVecEveryPrimitiveStructArgs() = default; + + FInsertVecEveryPrimitiveStructArgs(const TArray& InS) + : S(InS) + {} + + + FORCEINLINE bool operator==(const FInsertVecEveryPrimitiveStructArgs& Other) const + { + return S == Other.S; + } + FORCEINLINE bool operator!=(const FInsertVecEveryPrimitiveStructArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertVecEveryPrimitiveStructArgs, S); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertVecEveryPrimitiveStructReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + TArray S; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecEveryVecStruct.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecEveryVecStruct.g.h new file mode 100644 index 00000000000..ac943cd7095 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecEveryVecStruct.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "ModuleBindings/Types/EveryVecStructType.g.h" +#include "InsertVecEveryVecStruct.g.generated.h" + +// Reducer arguments struct for InsertVecEveryVecStruct +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertVecEveryVecStructArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + TArray S; + + FInsertVecEveryVecStructArgs() = default; + + FInsertVecEveryVecStructArgs(const TArray& InS) + : S(InS) + {} + + + FORCEINLINE bool operator==(const FInsertVecEveryVecStructArgs& Other) const + { + return S == Other.S; + } + FORCEINLINE bool operator!=(const FInsertVecEveryVecStructArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertVecEveryVecStructArgs, S); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertVecEveryVecStructReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + TArray S; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecF32.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecF32.g.h new file mode 100644 index 00000000000..17f546b1240 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecF32.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertVecF32.g.generated.h" + +// Reducer arguments struct for InsertVecF32 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertVecF32Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + TArray F; + + FInsertVecF32Args() = default; + + FInsertVecF32Args(const TArray& InF) + : F(InF) + {} + + + FORCEINLINE bool operator==(const FInsertVecF32Args& Other) const + { + return F == Other.F; + } + FORCEINLINE bool operator!=(const FInsertVecF32Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertVecF32Args, F); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertVecF32Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + TArray F; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecF64.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecF64.g.h new file mode 100644 index 00000000000..62a45c0d9a2 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecF64.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertVecF64.g.generated.h" + +// Reducer arguments struct for InsertVecF64 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertVecF64Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + TArray F; + + FInsertVecF64Args() = default; + + FInsertVecF64Args(const TArray& InF) + : F(InF) + {} + + + FORCEINLINE bool operator==(const FInsertVecF64Args& Other) const + { + return F == Other.F; + } + FORCEINLINE bool operator!=(const FInsertVecF64Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertVecF64Args, F); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertVecF64Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + TArray F; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecI128.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecI128.g.h new file mode 100644 index 00000000000..c9e7832ce92 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecI128.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "InsertVecI128.g.generated.h" + +// Reducer arguments struct for InsertVecI128 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertVecI128Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + TArray N; + + FInsertVecI128Args() = default; + + FInsertVecI128Args(const TArray& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FInsertVecI128Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FInsertVecI128Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertVecI128Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertVecI128Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + TArray N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecI16.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecI16.g.h new file mode 100644 index 00000000000..8b4da4468a2 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecI16.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertVecI16.g.generated.h" + +// Reducer arguments struct for InsertVecI16 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertVecI16Args +{ + GENERATED_BODY() + + // NOTE: TArray field not exposed to Blueprint due to non-blueprintable elements + TArray N; + + FInsertVecI16Args() = default; + + FInsertVecI16Args(const TArray& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FInsertVecI16Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FInsertVecI16Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertVecI16Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertVecI16Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + // NOTE: TArray field not exposed to Blueprint due to non-blueprintable elements + TArray N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecI256.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecI256.g.h new file mode 100644 index 00000000000..4e83a731b92 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecI256.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "InsertVecI256.g.generated.h" + +// Reducer arguments struct for InsertVecI256 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertVecI256Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + TArray N; + + FInsertVecI256Args() = default; + + FInsertVecI256Args(const TArray& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FInsertVecI256Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FInsertVecI256Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertVecI256Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertVecI256Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + TArray N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecI32.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecI32.g.h new file mode 100644 index 00000000000..f518ba219e7 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecI32.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertVecI32.g.generated.h" + +// Reducer arguments struct for InsertVecI32 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertVecI32Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + TArray N; + + FInsertVecI32Args() = default; + + FInsertVecI32Args(const TArray& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FInsertVecI32Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FInsertVecI32Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertVecI32Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertVecI32Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + TArray N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecI64.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecI64.g.h new file mode 100644 index 00000000000..c6ca997137f --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecI64.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertVecI64.g.generated.h" + +// Reducer arguments struct for InsertVecI64 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertVecI64Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + TArray N; + + FInsertVecI64Args() = default; + + FInsertVecI64Args(const TArray& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FInsertVecI64Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FInsertVecI64Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertVecI64Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertVecI64Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + TArray N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecI8.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecI8.g.h new file mode 100644 index 00000000000..0fc9621c5d2 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecI8.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertVecI8.g.generated.h" + +// Reducer arguments struct for InsertVecI8 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertVecI8Args +{ + GENERATED_BODY() + + // NOTE: TArray field not exposed to Blueprint due to non-blueprintable elements + TArray N; + + FInsertVecI8Args() = default; + + FInsertVecI8Args(const TArray& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FInsertVecI8Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FInsertVecI8Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertVecI8Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertVecI8Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + // NOTE: TArray field not exposed to Blueprint due to non-blueprintable elements + TArray N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecIdentity.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecIdentity.g.h new file mode 100644 index 00000000000..67a9e052a38 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecIdentity.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "InsertVecIdentity.g.generated.h" + +// Reducer arguments struct for InsertVecIdentity +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertVecIdentityArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + TArray I; + + FInsertVecIdentityArgs() = default; + + FInsertVecIdentityArgs(const TArray& InI) + : I(InI) + {} + + + FORCEINLINE bool operator==(const FInsertVecIdentityArgs& Other) const + { + return I == Other.I; + } + FORCEINLINE bool operator!=(const FInsertVecIdentityArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertVecIdentityArgs, I); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertVecIdentityReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + TArray I; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecSimpleEnum.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecSimpleEnum.g.h new file mode 100644 index 00000000000..cafcd1d3da0 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecSimpleEnum.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "ModuleBindings/Types/SimpleEnumType.g.h" +#include "InsertVecSimpleEnum.g.generated.h" + +// Reducer arguments struct for InsertVecSimpleEnum +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertVecSimpleEnumArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + TArray E; + + FInsertVecSimpleEnumArgs() = default; + + FInsertVecSimpleEnumArgs(const TArray& InE) + : E(InE) + {} + + + FORCEINLINE bool operator==(const FInsertVecSimpleEnumArgs& Other) const + { + return E == Other.E; + } + FORCEINLINE bool operator!=(const FInsertVecSimpleEnumArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertVecSimpleEnumArgs, E); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertVecSimpleEnumReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + TArray E; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecString.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecString.g.h new file mode 100644 index 00000000000..3e496e270dd --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecString.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertVecString.g.generated.h" + +// Reducer arguments struct for InsertVecString +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertVecStringArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + TArray S; + + FInsertVecStringArgs() = default; + + FInsertVecStringArgs(const TArray& InS) + : S(InS) + {} + + + FORCEINLINE bool operator==(const FInsertVecStringArgs& Other) const + { + return S == Other.S; + } + FORCEINLINE bool operator!=(const FInsertVecStringArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertVecStringArgs, S); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertVecStringReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + TArray S; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecTimestamp.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecTimestamp.g.h new file mode 100644 index 00000000000..8e2f10ec227 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecTimestamp.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "InsertVecTimestamp.g.generated.h" + +// Reducer arguments struct for InsertVecTimestamp +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertVecTimestampArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + TArray T; + + FInsertVecTimestampArgs() = default; + + FInsertVecTimestampArgs(const TArray& InT) + : T(InT) + {} + + + FORCEINLINE bool operator==(const FInsertVecTimestampArgs& Other) const + { + return T == Other.T; + } + FORCEINLINE bool operator!=(const FInsertVecTimestampArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertVecTimestampArgs, T); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertVecTimestampReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + TArray T; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecU128.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecU128.g.h new file mode 100644 index 00000000000..cdc68afe475 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecU128.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "InsertVecU128.g.generated.h" + +// Reducer arguments struct for InsertVecU128 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertVecU128Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + TArray N; + + FInsertVecU128Args() = default; + + FInsertVecU128Args(const TArray& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FInsertVecU128Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FInsertVecU128Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertVecU128Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertVecU128Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + TArray N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecU16.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecU16.g.h new file mode 100644 index 00000000000..8d8a1d88cb1 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecU16.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertVecU16.g.generated.h" + +// Reducer arguments struct for InsertVecU16 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertVecU16Args +{ + GENERATED_BODY() + + // NOTE: TArray field not exposed to Blueprint due to non-blueprintable elements + TArray N; + + FInsertVecU16Args() = default; + + FInsertVecU16Args(const TArray& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FInsertVecU16Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FInsertVecU16Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertVecU16Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertVecU16Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + // NOTE: TArray field not exposed to Blueprint due to non-blueprintable elements + TArray N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecU256.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecU256.g.h new file mode 100644 index 00000000000..5a318265f95 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecU256.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "InsertVecU256.g.generated.h" + +// Reducer arguments struct for InsertVecU256 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertVecU256Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + TArray N; + + FInsertVecU256Args() = default; + + FInsertVecU256Args(const TArray& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FInsertVecU256Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FInsertVecU256Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertVecU256Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertVecU256Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + TArray N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecU32.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecU32.g.h new file mode 100644 index 00000000000..e2d87d460fc --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecU32.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertVecU32.g.generated.h" + +// Reducer arguments struct for InsertVecU32 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertVecU32Args +{ + GENERATED_BODY() + + // NOTE: TArray field not exposed to Blueprint due to non-blueprintable elements + TArray N; + + FInsertVecU32Args() = default; + + FInsertVecU32Args(const TArray& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FInsertVecU32Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FInsertVecU32Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertVecU32Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertVecU32Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + // NOTE: TArray field not exposed to Blueprint due to non-blueprintable elements + TArray N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecU64.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecU64.g.h new file mode 100644 index 00000000000..0144f0e1eb7 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecU64.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertVecU64.g.generated.h" + +// Reducer arguments struct for InsertVecU64 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertVecU64Args +{ + GENERATED_BODY() + + // NOTE: TArray field not exposed to Blueprint due to non-blueprintable elements + TArray N; + + FInsertVecU64Args() = default; + + FInsertVecU64Args(const TArray& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FInsertVecU64Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FInsertVecU64Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertVecU64Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertVecU64Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + // NOTE: TArray field not exposed to Blueprint due to non-blueprintable elements + TArray N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecU8.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecU8.g.h new file mode 100644 index 00000000000..12b685f47d4 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecU8.g.h @@ -0,0 +1,53 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "InsertVecU8.g.generated.h" + +// Reducer arguments struct for InsertVecU8 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertVecU8Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + TArray N; + + FInsertVecU8Args() = default; + + FInsertVecU8Args(const TArray& InN) + : N(InN) + {} + + + FORCEINLINE bool operator==(const FInsertVecU8Args& Other) const + { + return N == Other.N; + } + FORCEINLINE bool operator!=(const FInsertVecU8Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertVecU8Args, N); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertVecU8Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + TArray N; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecUnitStruct.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecUnitStruct.g.h new file mode 100644 index 00000000000..cc07bdd7cbf --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/InsertVecUnitStruct.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "ModuleBindings/Types/UnitStructType.g.h" +#include "InsertVecUnitStruct.g.generated.h" + +// Reducer arguments struct for InsertVecUnitStruct +USTRUCT(BlueprintType) +struct TESTCLIENT_API FInsertVecUnitStructArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + TArray S; + + FInsertVecUnitStructArgs() = default; + + FInsertVecUnitStructArgs(const TArray& InS) + : S(InS) + {} + + + FORCEINLINE bool operator==(const FInsertVecUnitStructArgs& Other) const + { + return S == Other.S; + } + FORCEINLINE bool operator!=(const FInsertVecUnitStructArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FInsertVecUnitStructArgs, S); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UInsertVecUnitStructReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + TArray S; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/NoOpSucceeds.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/NoOpSucceeds.g.h new file mode 100644 index 00000000000..8f1ffcbc47b --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/NoOpSucceeds.g.h @@ -0,0 +1,43 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "NoOpSucceeds.g.generated.h" + +// Reducer arguments struct for NoOpSucceeds +USTRUCT(BlueprintType) +struct TESTCLIENT_API FNoOpSucceedsArgs +{ + GENERATED_BODY() + + FNoOpSucceedsArgs() = default; + + + FORCEINLINE bool operator==(const FNoOpSucceedsArgs& Other) const + { + return true; + } + FORCEINLINE bool operator!=(const FNoOpSucceedsArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT_EMPTY(FNoOpSucceedsArgs); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UNoOpSucceedsReducer : public UReducerBase +{ + GENERATED_BODY() + +public: +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/SendScheduledMessage.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/SendScheduledMessage.g.h new file mode 100644 index 00000000000..2f691428fa6 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/SendScheduledMessage.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "ModuleBindings/Types/ScheduledTableType.g.h" +#include "SendScheduledMessage.g.generated.h" + +// Reducer arguments struct for SendScheduledMessage +USTRUCT(BlueprintType) +struct TESTCLIENT_API FSendScheduledMessageArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FScheduledTableType Arg; + + FSendScheduledMessageArgs() = default; + + FSendScheduledMessageArgs(const FScheduledTableType& InArg) + : Arg(InArg) + {} + + + FORCEINLINE bool operator==(const FSendScheduledMessageArgs& Other) const + { + return Arg == Other.Arg; + } + FORCEINLINE bool operator!=(const FSendScheduledMessageArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FSendScheduledMessageArgs, Arg); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API USendScheduledMessageReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FScheduledTableType Arg; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateIndexedSimpleEnum.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateIndexedSimpleEnum.g.h new file mode 100644 index 00000000000..a5cd1606efa --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateIndexedSimpleEnum.g.h @@ -0,0 +1,59 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "ModuleBindings/Types/SimpleEnumType.g.h" +#include "UpdateIndexedSimpleEnum.g.generated.h" + +// Reducer arguments struct for UpdateIndexedSimpleEnum +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUpdateIndexedSimpleEnumArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + ESimpleEnumType A; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + ESimpleEnumType B; + + FUpdateIndexedSimpleEnumArgs() = default; + + FUpdateIndexedSimpleEnumArgs(const ESimpleEnumType& InA, const ESimpleEnumType& InB) + : A(InA), B(InB) + {} + + + FORCEINLINE bool operator==(const FUpdateIndexedSimpleEnumArgs& Other) const + { + return A == Other.A && B == Other.B; + } + FORCEINLINE bool operator!=(const FUpdateIndexedSimpleEnumArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FUpdateIndexedSimpleEnumArgs, A, B); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UUpdateIndexedSimpleEnumReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + ESimpleEnumType A; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + ESimpleEnumType B; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkBool.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkBool.g.h new file mode 100644 index 00000000000..8c68f39bd67 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkBool.g.h @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "UpdatePkBool.g.generated.h" + +// Reducer arguments struct for UpdatePkBool +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUpdatePkBoolArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + bool B; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FUpdatePkBoolArgs() = default; + + FUpdatePkBoolArgs(const bool& InB, const int32& InData) + : B(InB), Data(InData) + {} + + + FORCEINLINE bool operator==(const FUpdatePkBoolArgs& Other) const + { + return B == Other.B && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FUpdatePkBoolArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FUpdatePkBoolArgs, B, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UUpdatePkBoolReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + bool B; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkConnectionId.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkConnectionId.g.h new file mode 100644 index 00000000000..312230cdb12 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkConnectionId.g.h @@ -0,0 +1,59 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "UpdatePkConnectionId.g.generated.h" + +// Reducer arguments struct for UpdatePkConnectionId +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUpdatePkConnectionIdArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBConnectionId A; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FUpdatePkConnectionIdArgs() = default; + + FUpdatePkConnectionIdArgs(const FSpacetimeDBConnectionId& InA, const int32& InData) + : A(InA), Data(InData) + {} + + + FORCEINLINE bool operator==(const FUpdatePkConnectionIdArgs& Other) const + { + return A == Other.A && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FUpdatePkConnectionIdArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FUpdatePkConnectionIdArgs, A, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UUpdatePkConnectionIdReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBConnectionId A; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkI128.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkI128.g.h new file mode 100644 index 00000000000..ed75d512bf9 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkI128.g.h @@ -0,0 +1,59 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "UpdatePkI128.g.generated.h" + +// Reducer arguments struct for UpdatePkI128 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUpdatePkI128Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBInt128 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FUpdatePkI128Args() = default; + + FUpdatePkI128Args(const FSpacetimeDBInt128& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FUpdatePkI128Args& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FUpdatePkI128Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FUpdatePkI128Args, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UUpdatePkI128Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBInt128 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkI16.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkI16.g.h new file mode 100644 index 00000000000..f3d66144a28 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkI16.g.h @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "UpdatePkI16.g.generated.h" + +// Reducer arguments struct for UpdatePkI16 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUpdatePkI16Args +{ + GENERATED_BODY() + + // NOTE: int16 field not exposed to Blueprint due to non-blueprintable elements + int16 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FUpdatePkI16Args() = default; + + FUpdatePkI16Args(const int16& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FUpdatePkI16Args& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FUpdatePkI16Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FUpdatePkI16Args, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UUpdatePkI16Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + // NOTE: int16 field not exposed to Blueprint due to non-blueprintable elements + int16 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkI256.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkI256.g.h new file mode 100644 index 00000000000..2e6ae69366a --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkI256.g.h @@ -0,0 +1,59 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "UpdatePkI256.g.generated.h" + +// Reducer arguments struct for UpdatePkI256 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUpdatePkI256Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBInt256 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FUpdatePkI256Args() = default; + + FUpdatePkI256Args(const FSpacetimeDBInt256& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FUpdatePkI256Args& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FUpdatePkI256Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FUpdatePkI256Args, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UUpdatePkI256Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBInt256 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkI32.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkI32.g.h new file mode 100644 index 00000000000..f2f1c06b646 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkI32.g.h @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "UpdatePkI32.g.generated.h" + +// Reducer arguments struct for UpdatePkI32 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUpdatePkI32Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FUpdatePkI32Args() = default; + + FUpdatePkI32Args(const int32& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FUpdatePkI32Args& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FUpdatePkI32Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FUpdatePkI32Args, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UUpdatePkI32Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkI64.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkI64.g.h new file mode 100644 index 00000000000..b06c48638a1 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkI64.g.h @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "UpdatePkI64.g.generated.h" + +// Reducer arguments struct for UpdatePkI64 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUpdatePkI64Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int64 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FUpdatePkI64Args() = default; + + FUpdatePkI64Args(const int64& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FUpdatePkI64Args& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FUpdatePkI64Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FUpdatePkI64Args, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UUpdatePkI64Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int64 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkI8.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkI8.g.h new file mode 100644 index 00000000000..9f80bbd2758 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkI8.g.h @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "UpdatePkI8.g.generated.h" + +// Reducer arguments struct for UpdatePkI8 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUpdatePkI8Args +{ + GENERATED_BODY() + + // NOTE: int8 field not exposed to Blueprint due to non-blueprintable elements + int8 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FUpdatePkI8Args() = default; + + FUpdatePkI8Args(const int8& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FUpdatePkI8Args& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FUpdatePkI8Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FUpdatePkI8Args, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UUpdatePkI8Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + // NOTE: int8 field not exposed to Blueprint due to non-blueprintable elements + int8 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkIdentity.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkIdentity.g.h new file mode 100644 index 00000000000..1922d275bb9 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkIdentity.g.h @@ -0,0 +1,59 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "UpdatePkIdentity.g.generated.h" + +// Reducer arguments struct for UpdatePkIdentity +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUpdatePkIdentityArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBIdentity I; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FUpdatePkIdentityArgs() = default; + + FUpdatePkIdentityArgs(const FSpacetimeDBIdentity& InI, const int32& InData) + : I(InI), Data(InData) + {} + + + FORCEINLINE bool operator==(const FUpdatePkIdentityArgs& Other) const + { + return I == Other.I && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FUpdatePkIdentityArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FUpdatePkIdentityArgs, I, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UUpdatePkIdentityReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBIdentity I; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkSimpleEnum.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkSimpleEnum.g.h new file mode 100644 index 00000000000..18db2b63fd6 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkSimpleEnum.g.h @@ -0,0 +1,59 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "ModuleBindings/Types/SimpleEnumType.g.h" +#include "UpdatePkSimpleEnum.g.generated.h" + +// Reducer arguments struct for UpdatePkSimpleEnum +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUpdatePkSimpleEnumArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + ESimpleEnumType A; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FUpdatePkSimpleEnumArgs() = default; + + FUpdatePkSimpleEnumArgs(const ESimpleEnumType& InA, const int32& InData) + : A(InA), Data(InData) + {} + + + FORCEINLINE bool operator==(const FUpdatePkSimpleEnumArgs& Other) const + { + return A == Other.A && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FUpdatePkSimpleEnumArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FUpdatePkSimpleEnumArgs, A, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UUpdatePkSimpleEnumReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + ESimpleEnumType A; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkString.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkString.g.h new file mode 100644 index 00000000000..4e06bb78fad --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkString.g.h @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "UpdatePkString.g.generated.h" + +// Reducer arguments struct for UpdatePkString +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUpdatePkStringArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FString S; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FUpdatePkStringArgs() = default; + + FUpdatePkStringArgs(const FString& InS, const int32& InData) + : S(InS), Data(InData) + {} + + + FORCEINLINE bool operator==(const FUpdatePkStringArgs& Other) const + { + return S == Other.S && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FUpdatePkStringArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FUpdatePkStringArgs, S, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UUpdatePkStringReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FString S; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkU128.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkU128.g.h new file mode 100644 index 00000000000..2f7743a0755 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkU128.g.h @@ -0,0 +1,59 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "UpdatePkU128.g.generated.h" + +// Reducer arguments struct for UpdatePkU128 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUpdatePkU128Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBUInt128 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FUpdatePkU128Args() = default; + + FUpdatePkU128Args(const FSpacetimeDBUInt128& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FUpdatePkU128Args& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FUpdatePkU128Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FUpdatePkU128Args, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UUpdatePkU128Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBUInt128 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkU16.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkU16.g.h new file mode 100644 index 00000000000..722555f3ebc --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkU16.g.h @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "UpdatePkU16.g.generated.h" + +// Reducer arguments struct for UpdatePkU16 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUpdatePkU16Args +{ + GENERATED_BODY() + + // NOTE: uint16 field not exposed to Blueprint due to non-blueprintable elements + uint16 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FUpdatePkU16Args() = default; + + FUpdatePkU16Args(const uint16& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FUpdatePkU16Args& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FUpdatePkU16Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FUpdatePkU16Args, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UUpdatePkU16Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + // NOTE: uint16 field not exposed to Blueprint due to non-blueprintable elements + uint16 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkU256.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkU256.g.h new file mode 100644 index 00000000000..222316c5d12 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkU256.g.h @@ -0,0 +1,59 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "UpdatePkU256.g.generated.h" + +// Reducer arguments struct for UpdatePkU256 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUpdatePkU256Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBUInt256 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FUpdatePkU256Args() = default; + + FUpdatePkU256Args(const FSpacetimeDBUInt256& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FUpdatePkU256Args& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FUpdatePkU256Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FUpdatePkU256Args, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UUpdatePkU256Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBUInt256 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkU32.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkU32.g.h new file mode 100644 index 00000000000..8554674322f --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkU32.g.h @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "UpdatePkU32.g.generated.h" + +// Reducer arguments struct for UpdatePkU32 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUpdatePkU32Args +{ + GENERATED_BODY() + + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FUpdatePkU32Args() = default; + + FUpdatePkU32Args(const uint32& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FUpdatePkU32Args& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FUpdatePkU32Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FUpdatePkU32Args, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UUpdatePkU32Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkU32Two.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkU32Two.g.h new file mode 100644 index 00000000000..7e7b9c127ac --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkU32Two.g.h @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "UpdatePkU32Two.g.generated.h" + +// Reducer arguments struct for UpdatePkU32Two +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUpdatePkU32TwoArgs +{ + GENERATED_BODY() + + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FUpdatePkU32TwoArgs() = default; + + FUpdatePkU32TwoArgs(const uint32& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FUpdatePkU32TwoArgs& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FUpdatePkU32TwoArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FUpdatePkU32TwoArgs, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UUpdatePkU32TwoReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkU64.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkU64.g.h new file mode 100644 index 00000000000..aab1941e3eb --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkU64.g.h @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "UpdatePkU64.g.generated.h" + +// Reducer arguments struct for UpdatePkU64 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUpdatePkU64Args +{ + GENERATED_BODY() + + // NOTE: uint64 field not exposed to Blueprint due to non-blueprintable elements + uint64 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FUpdatePkU64Args() = default; + + FUpdatePkU64Args(const uint64& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FUpdatePkU64Args& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FUpdatePkU64Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FUpdatePkU64Args, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UUpdatePkU64Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + // NOTE: uint64 field not exposed to Blueprint due to non-blueprintable elements + uint64 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkU8.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkU8.g.h new file mode 100644 index 00000000000..89b1ca7687f --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdatePkU8.g.h @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "UpdatePkU8.g.generated.h" + +// Reducer arguments struct for UpdatePkU8 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUpdatePkU8Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + uint8 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FUpdatePkU8Args() = default; + + FUpdatePkU8Args(const uint8& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FUpdatePkU8Args& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FUpdatePkU8Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FUpdatePkU8Args, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UUpdatePkU8Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + uint8 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateUniqueBool.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateUniqueBool.g.h new file mode 100644 index 00000000000..50519d529b7 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateUniqueBool.g.h @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "UpdateUniqueBool.g.generated.h" + +// Reducer arguments struct for UpdateUniqueBool +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUpdateUniqueBoolArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + bool B; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FUpdateUniqueBoolArgs() = default; + + FUpdateUniqueBoolArgs(const bool& InB, const int32& InData) + : B(InB), Data(InData) + {} + + + FORCEINLINE bool operator==(const FUpdateUniqueBoolArgs& Other) const + { + return B == Other.B && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FUpdateUniqueBoolArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FUpdateUniqueBoolArgs, B, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UUpdateUniqueBoolReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + bool B; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateUniqueConnectionId.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateUniqueConnectionId.g.h new file mode 100644 index 00000000000..4cb4d980de6 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateUniqueConnectionId.g.h @@ -0,0 +1,59 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "UpdateUniqueConnectionId.g.generated.h" + +// Reducer arguments struct for UpdateUniqueConnectionId +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUpdateUniqueConnectionIdArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBConnectionId A; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FUpdateUniqueConnectionIdArgs() = default; + + FUpdateUniqueConnectionIdArgs(const FSpacetimeDBConnectionId& InA, const int32& InData) + : A(InA), Data(InData) + {} + + + FORCEINLINE bool operator==(const FUpdateUniqueConnectionIdArgs& Other) const + { + return A == Other.A && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FUpdateUniqueConnectionIdArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FUpdateUniqueConnectionIdArgs, A, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UUpdateUniqueConnectionIdReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBConnectionId A; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateUniqueI128.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateUniqueI128.g.h new file mode 100644 index 00000000000..840c31f2224 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateUniqueI128.g.h @@ -0,0 +1,59 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "UpdateUniqueI128.g.generated.h" + +// Reducer arguments struct for UpdateUniqueI128 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUpdateUniqueI128Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBInt128 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FUpdateUniqueI128Args() = default; + + FUpdateUniqueI128Args(const FSpacetimeDBInt128& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FUpdateUniqueI128Args& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FUpdateUniqueI128Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FUpdateUniqueI128Args, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UUpdateUniqueI128Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBInt128 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateUniqueI16.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateUniqueI16.g.h new file mode 100644 index 00000000000..00bedeb3c46 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateUniqueI16.g.h @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "UpdateUniqueI16.g.generated.h" + +// Reducer arguments struct for UpdateUniqueI16 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUpdateUniqueI16Args +{ + GENERATED_BODY() + + // NOTE: int16 field not exposed to Blueprint due to non-blueprintable elements + int16 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FUpdateUniqueI16Args() = default; + + FUpdateUniqueI16Args(const int16& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FUpdateUniqueI16Args& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FUpdateUniqueI16Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FUpdateUniqueI16Args, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UUpdateUniqueI16Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + // NOTE: int16 field not exposed to Blueprint due to non-blueprintable elements + int16 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateUniqueI256.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateUniqueI256.g.h new file mode 100644 index 00000000000..6bda00d747c --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateUniqueI256.g.h @@ -0,0 +1,59 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "UpdateUniqueI256.g.generated.h" + +// Reducer arguments struct for UpdateUniqueI256 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUpdateUniqueI256Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBInt256 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FUpdateUniqueI256Args() = default; + + FUpdateUniqueI256Args(const FSpacetimeDBInt256& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FUpdateUniqueI256Args& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FUpdateUniqueI256Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FUpdateUniqueI256Args, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UUpdateUniqueI256Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBInt256 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateUniqueI32.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateUniqueI32.g.h new file mode 100644 index 00000000000..526b7d276ab --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateUniqueI32.g.h @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "UpdateUniqueI32.g.generated.h" + +// Reducer arguments struct for UpdateUniqueI32 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUpdateUniqueI32Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FUpdateUniqueI32Args() = default; + + FUpdateUniqueI32Args(const int32& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FUpdateUniqueI32Args& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FUpdateUniqueI32Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FUpdateUniqueI32Args, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UUpdateUniqueI32Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateUniqueI64.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateUniqueI64.g.h new file mode 100644 index 00000000000..63ae2597aff --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateUniqueI64.g.h @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "UpdateUniqueI64.g.generated.h" + +// Reducer arguments struct for UpdateUniqueI64 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUpdateUniqueI64Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int64 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FUpdateUniqueI64Args() = default; + + FUpdateUniqueI64Args(const int64& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FUpdateUniqueI64Args& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FUpdateUniqueI64Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FUpdateUniqueI64Args, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UUpdateUniqueI64Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int64 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateUniqueI8.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateUniqueI8.g.h new file mode 100644 index 00000000000..647bde6e06b --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateUniqueI8.g.h @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "UpdateUniqueI8.g.generated.h" + +// Reducer arguments struct for UpdateUniqueI8 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUpdateUniqueI8Args +{ + GENERATED_BODY() + + // NOTE: int8 field not exposed to Blueprint due to non-blueprintable elements + int8 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FUpdateUniqueI8Args() = default; + + FUpdateUniqueI8Args(const int8& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FUpdateUniqueI8Args& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FUpdateUniqueI8Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FUpdateUniqueI8Args, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UUpdateUniqueI8Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + // NOTE: int8 field not exposed to Blueprint due to non-blueprintable elements + int8 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateUniqueIdentity.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateUniqueIdentity.g.h new file mode 100644 index 00000000000..1ddf459dfc6 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateUniqueIdentity.g.h @@ -0,0 +1,59 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "UpdateUniqueIdentity.g.generated.h" + +// Reducer arguments struct for UpdateUniqueIdentity +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUpdateUniqueIdentityArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBIdentity I; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FUpdateUniqueIdentityArgs() = default; + + FUpdateUniqueIdentityArgs(const FSpacetimeDBIdentity& InI, const int32& InData) + : I(InI), Data(InData) + {} + + + FORCEINLINE bool operator==(const FUpdateUniqueIdentityArgs& Other) const + { + return I == Other.I && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FUpdateUniqueIdentityArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FUpdateUniqueIdentityArgs, I, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UUpdateUniqueIdentityReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBIdentity I; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateUniqueString.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateUniqueString.g.h new file mode 100644 index 00000000000..7dc1ad2da86 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateUniqueString.g.h @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "UpdateUniqueString.g.generated.h" + +// Reducer arguments struct for UpdateUniqueString +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUpdateUniqueStringArgs +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FString S; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FUpdateUniqueStringArgs() = default; + + FUpdateUniqueStringArgs(const FString& InS, const int32& InData) + : S(InS), Data(InData) + {} + + + FORCEINLINE bool operator==(const FUpdateUniqueStringArgs& Other) const + { + return S == Other.S && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FUpdateUniqueStringArgs& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FUpdateUniqueStringArgs, S, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UUpdateUniqueStringReducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FString S; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateUniqueU128.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateUniqueU128.g.h new file mode 100644 index 00000000000..7d1f015faa1 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateUniqueU128.g.h @@ -0,0 +1,59 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "UpdateUniqueU128.g.generated.h" + +// Reducer arguments struct for UpdateUniqueU128 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUpdateUniqueU128Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBUInt128 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FUpdateUniqueU128Args() = default; + + FUpdateUniqueU128Args(const FSpacetimeDBUInt128& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FUpdateUniqueU128Args& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FUpdateUniqueU128Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FUpdateUniqueU128Args, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UUpdateUniqueU128Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBUInt128 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateUniqueU16.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateUniqueU16.g.h new file mode 100644 index 00000000000..3d73b91b099 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateUniqueU16.g.h @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "UpdateUniqueU16.g.generated.h" + +// Reducer arguments struct for UpdateUniqueU16 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUpdateUniqueU16Args +{ + GENERATED_BODY() + + // NOTE: uint16 field not exposed to Blueprint due to non-blueprintable elements + uint16 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FUpdateUniqueU16Args() = default; + + FUpdateUniqueU16Args(const uint16& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FUpdateUniqueU16Args& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FUpdateUniqueU16Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FUpdateUniqueU16Args, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UUpdateUniqueU16Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + // NOTE: uint16 field not exposed to Blueprint due to non-blueprintable elements + uint16 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateUniqueU256.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateUniqueU256.g.h new file mode 100644 index 00000000000..dadb65e86f0 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateUniqueU256.g.h @@ -0,0 +1,59 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "Types/Builtins.h" +#include "UpdateUniqueU256.g.generated.h" + +// Reducer arguments struct for UpdateUniqueU256 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUpdateUniqueU256Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBUInt256 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FUpdateUniqueU256Args() = default; + + FUpdateUniqueU256Args(const FSpacetimeDBUInt256& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FUpdateUniqueU256Args& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FUpdateUniqueU256Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FUpdateUniqueU256Args, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UUpdateUniqueU256Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FSpacetimeDBUInt256 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateUniqueU32.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateUniqueU32.g.h new file mode 100644 index 00000000000..44996e2649e --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateUniqueU32.g.h @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "UpdateUniqueU32.g.generated.h" + +// Reducer arguments struct for UpdateUniqueU32 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUpdateUniqueU32Args +{ + GENERATED_BODY() + + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FUpdateUniqueU32Args() = default; + + FUpdateUniqueU32Args(const uint32& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FUpdateUniqueU32Args& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FUpdateUniqueU32Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FUpdateUniqueU32Args, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UUpdateUniqueU32Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateUniqueU64.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateUniqueU64.g.h new file mode 100644 index 00000000000..bec5bfe8f18 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateUniqueU64.g.h @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "UpdateUniqueU64.g.generated.h" + +// Reducer arguments struct for UpdateUniqueU64 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUpdateUniqueU64Args +{ + GENERATED_BODY() + + // NOTE: uint64 field not exposed to Blueprint due to non-blueprintable elements + uint64 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FUpdateUniqueU64Args() = default; + + FUpdateUniqueU64Args(const uint64& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FUpdateUniqueU64Args& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FUpdateUniqueU64Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FUpdateUniqueU64Args, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UUpdateUniqueU64Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + // NOTE: uint64 field not exposed to Blueprint due to non-blueprintable elements + uint64 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateUniqueU8.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateUniqueU8.g.h new file mode 100644 index 00000000000..3087615ced7 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Reducers/UpdateUniqueU8.g.h @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "UpdateUniqueU8.g.generated.h" + +// Reducer arguments struct for UpdateUniqueU8 +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUpdateUniqueU8Args +{ + GENERATED_BODY() + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + uint8 N; + + UPROPERTY(BlueprintReadWrite, Category="SpacetimeDB") + int32 Data; + + FUpdateUniqueU8Args() = default; + + FUpdateUniqueU8Args(const uint8& InN, const int32& InData) + : N(InN), Data(InData) + {} + + + FORCEINLINE bool operator==(const FUpdateUniqueU8Args& Other) const + { + return N == Other.N && Data == Other.Data; + } + FORCEINLINE bool operator!=(const FUpdateUniqueU8Args& Other) const + { + return !(*this == Other); + } +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_STRUCT(FUpdateUniqueU8Args, N, Data); +} + +// Reducer class for internal dispatching +UCLASS(BlueprintType) +class TESTCLIENT_API UUpdateUniqueU8Reducer : public UReducerBase +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + uint8 N; + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + int32 Data; + +}; + + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/SpacetimeDBClient.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/SpacetimeDBClient.g.h new file mode 100644 index 00000000000..70cef272d7f --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/SpacetimeDBClient.g.h @@ -0,0 +1,9753 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +// This was generated using spacetimedb cli version 1.4.0 (commit dc59211c1453848981aeb2efce2249c9a07947b2). + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Connection/Callback.h" +#include "Connection/DbConnectionBase.h" +#include "Connection/DbConnectionBuilder.h" +#include "Connection/SetReducerFlags.h" +#include "Connection/Subscription.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "ModuleBindings/Optionals/TestClientOptionalEveryPrimitiveStruct.g.h" +#include "ModuleBindings/Optionals/TestClientOptionalIdentity.g.h" +#include "ModuleBindings/Optionals/TestClientOptionalInt32.g.h" +#include "ModuleBindings/Optionals/TestClientOptionalSimpleEnum.g.h" +#include "ModuleBindings/Optionals/TestClientOptionalString.g.h" +#include "ModuleBindings/Optionals/TestClientOptionalVecInt32.g.h" +#include "ModuleBindings/ReducerBase.g.h" +#include "ModuleBindings/Reducers/DeleteFromBtreeU32.g.h" +#include "ModuleBindings/Reducers/DeleteLargeTable.g.h" +#include "ModuleBindings/Reducers/DeletePkBool.g.h" +#include "ModuleBindings/Reducers/DeletePkConnectionId.g.h" +#include "ModuleBindings/Reducers/DeletePkI128.g.h" +#include "ModuleBindings/Reducers/DeletePkI16.g.h" +#include "ModuleBindings/Reducers/DeletePkI256.g.h" +#include "ModuleBindings/Reducers/DeletePkI32.g.h" +#include "ModuleBindings/Reducers/DeletePkI64.g.h" +#include "ModuleBindings/Reducers/DeletePkI8.g.h" +#include "ModuleBindings/Reducers/DeletePkIdentity.g.h" +#include "ModuleBindings/Reducers/DeletePkString.g.h" +#include "ModuleBindings/Reducers/DeletePkU128.g.h" +#include "ModuleBindings/Reducers/DeletePkU16.g.h" +#include "ModuleBindings/Reducers/DeletePkU256.g.h" +#include "ModuleBindings/Reducers/DeletePkU32.g.h" +#include "ModuleBindings/Reducers/DeletePkU32InsertPkU32Two.g.h" +#include "ModuleBindings/Reducers/DeletePkU32Two.g.h" +#include "ModuleBindings/Reducers/DeletePkU64.g.h" +#include "ModuleBindings/Reducers/DeletePkU8.g.h" +#include "ModuleBindings/Reducers/DeleteUniqueBool.g.h" +#include "ModuleBindings/Reducers/DeleteUniqueConnectionId.g.h" +#include "ModuleBindings/Reducers/DeleteUniqueI128.g.h" +#include "ModuleBindings/Reducers/DeleteUniqueI16.g.h" +#include "ModuleBindings/Reducers/DeleteUniqueI256.g.h" +#include "ModuleBindings/Reducers/DeleteUniqueI32.g.h" +#include "ModuleBindings/Reducers/DeleteUniqueI64.g.h" +#include "ModuleBindings/Reducers/DeleteUniqueI8.g.h" +#include "ModuleBindings/Reducers/DeleteUniqueIdentity.g.h" +#include "ModuleBindings/Reducers/DeleteUniqueString.g.h" +#include "ModuleBindings/Reducers/DeleteUniqueU128.g.h" +#include "ModuleBindings/Reducers/DeleteUniqueU16.g.h" +#include "ModuleBindings/Reducers/DeleteUniqueU256.g.h" +#include "ModuleBindings/Reducers/DeleteUniqueU32.g.h" +#include "ModuleBindings/Reducers/DeleteUniqueU64.g.h" +#include "ModuleBindings/Reducers/DeleteUniqueU8.g.h" +#include "ModuleBindings/Reducers/InsertCallTimestamp.g.h" +#include "ModuleBindings/Reducers/InsertCallerOneConnectionId.g.h" +#include "ModuleBindings/Reducers/InsertCallerOneIdentity.g.h" +#include "ModuleBindings/Reducers/InsertCallerPkConnectionId.g.h" +#include "ModuleBindings/Reducers/InsertCallerPkIdentity.g.h" +#include "ModuleBindings/Reducers/InsertCallerUniqueConnectionId.g.h" +#include "ModuleBindings/Reducers/InsertCallerUniqueIdentity.g.h" +#include "ModuleBindings/Reducers/InsertCallerVecConnectionId.g.h" +#include "ModuleBindings/Reducers/InsertCallerVecIdentity.g.h" +#include "ModuleBindings/Reducers/InsertIntoBtreeU32.g.h" +#include "ModuleBindings/Reducers/InsertIntoIndexedSimpleEnum.g.h" +#include "ModuleBindings/Reducers/InsertIntoPkBtreeU32.g.h" +#include "ModuleBindings/Reducers/InsertLargeTable.g.h" +#include "ModuleBindings/Reducers/InsertOneBool.g.h" +#include "ModuleBindings/Reducers/InsertOneByteStruct.g.h" +#include "ModuleBindings/Reducers/InsertOneConnectionId.g.h" +#include "ModuleBindings/Reducers/InsertOneEnumWithPayload.g.h" +#include "ModuleBindings/Reducers/InsertOneEveryPrimitiveStruct.g.h" +#include "ModuleBindings/Reducers/InsertOneEveryVecStruct.g.h" +#include "ModuleBindings/Reducers/InsertOneF32.g.h" +#include "ModuleBindings/Reducers/InsertOneF64.g.h" +#include "ModuleBindings/Reducers/InsertOneI128.g.h" +#include "ModuleBindings/Reducers/InsertOneI16.g.h" +#include "ModuleBindings/Reducers/InsertOneI256.g.h" +#include "ModuleBindings/Reducers/InsertOneI32.g.h" +#include "ModuleBindings/Reducers/InsertOneI64.g.h" +#include "ModuleBindings/Reducers/InsertOneI8.g.h" +#include "ModuleBindings/Reducers/InsertOneIdentity.g.h" +#include "ModuleBindings/Reducers/InsertOneSimpleEnum.g.h" +#include "ModuleBindings/Reducers/InsertOneString.g.h" +#include "ModuleBindings/Reducers/InsertOneTimestamp.g.h" +#include "ModuleBindings/Reducers/InsertOneU128.g.h" +#include "ModuleBindings/Reducers/InsertOneU16.g.h" +#include "ModuleBindings/Reducers/InsertOneU256.g.h" +#include "ModuleBindings/Reducers/InsertOneU32.g.h" +#include "ModuleBindings/Reducers/InsertOneU64.g.h" +#include "ModuleBindings/Reducers/InsertOneU8.g.h" +#include "ModuleBindings/Reducers/InsertOneUnitStruct.g.h" +#include "ModuleBindings/Reducers/InsertOptionEveryPrimitiveStruct.g.h" +#include "ModuleBindings/Reducers/InsertOptionI32.g.h" +#include "ModuleBindings/Reducers/InsertOptionIdentity.g.h" +#include "ModuleBindings/Reducers/InsertOptionSimpleEnum.g.h" +#include "ModuleBindings/Reducers/InsertOptionString.g.h" +#include "ModuleBindings/Reducers/InsertOptionVecOptionI32.g.h" +#include "ModuleBindings/Reducers/InsertPkBool.g.h" +#include "ModuleBindings/Reducers/InsertPkConnectionId.g.h" +#include "ModuleBindings/Reducers/InsertPkI128.g.h" +#include "ModuleBindings/Reducers/InsertPkI16.g.h" +#include "ModuleBindings/Reducers/InsertPkI256.g.h" +#include "ModuleBindings/Reducers/InsertPkI32.g.h" +#include "ModuleBindings/Reducers/InsertPkI64.g.h" +#include "ModuleBindings/Reducers/InsertPkI8.g.h" +#include "ModuleBindings/Reducers/InsertPkIdentity.g.h" +#include "ModuleBindings/Reducers/InsertPkSimpleEnum.g.h" +#include "ModuleBindings/Reducers/InsertPkString.g.h" +#include "ModuleBindings/Reducers/InsertPkU128.g.h" +#include "ModuleBindings/Reducers/InsertPkU16.g.h" +#include "ModuleBindings/Reducers/InsertPkU256.g.h" +#include "ModuleBindings/Reducers/InsertPkU32.g.h" +#include "ModuleBindings/Reducers/InsertPkU32Two.g.h" +#include "ModuleBindings/Reducers/InsertPkU64.g.h" +#include "ModuleBindings/Reducers/InsertPkU8.g.h" +#include "ModuleBindings/Reducers/InsertPrimitivesAsStrings.g.h" +#include "ModuleBindings/Reducers/InsertTableHoldsTable.g.h" +#include "ModuleBindings/Reducers/InsertUniqueBool.g.h" +#include "ModuleBindings/Reducers/InsertUniqueConnectionId.g.h" +#include "ModuleBindings/Reducers/InsertUniqueI128.g.h" +#include "ModuleBindings/Reducers/InsertUniqueI16.g.h" +#include "ModuleBindings/Reducers/InsertUniqueI256.g.h" +#include "ModuleBindings/Reducers/InsertUniqueI32.g.h" +#include "ModuleBindings/Reducers/InsertUniqueI64.g.h" +#include "ModuleBindings/Reducers/InsertUniqueI8.g.h" +#include "ModuleBindings/Reducers/InsertUniqueIdentity.g.h" +#include "ModuleBindings/Reducers/InsertUniqueString.g.h" +#include "ModuleBindings/Reducers/InsertUniqueU128.g.h" +#include "ModuleBindings/Reducers/InsertUniqueU16.g.h" +#include "ModuleBindings/Reducers/InsertUniqueU256.g.h" +#include "ModuleBindings/Reducers/InsertUniqueU32.g.h" +#include "ModuleBindings/Reducers/InsertUniqueU32UpdatePkU32.g.h" +#include "ModuleBindings/Reducers/InsertUniqueU64.g.h" +#include "ModuleBindings/Reducers/InsertUniqueU8.g.h" +#include "ModuleBindings/Reducers/InsertUser.g.h" +#include "ModuleBindings/Reducers/InsertVecBool.g.h" +#include "ModuleBindings/Reducers/InsertVecByteStruct.g.h" +#include "ModuleBindings/Reducers/InsertVecConnectionId.g.h" +#include "ModuleBindings/Reducers/InsertVecEnumWithPayload.g.h" +#include "ModuleBindings/Reducers/InsertVecEveryPrimitiveStruct.g.h" +#include "ModuleBindings/Reducers/InsertVecEveryVecStruct.g.h" +#include "ModuleBindings/Reducers/InsertVecF32.g.h" +#include "ModuleBindings/Reducers/InsertVecF64.g.h" +#include "ModuleBindings/Reducers/InsertVecI128.g.h" +#include "ModuleBindings/Reducers/InsertVecI16.g.h" +#include "ModuleBindings/Reducers/InsertVecI256.g.h" +#include "ModuleBindings/Reducers/InsertVecI32.g.h" +#include "ModuleBindings/Reducers/InsertVecI64.g.h" +#include "ModuleBindings/Reducers/InsertVecI8.g.h" +#include "ModuleBindings/Reducers/InsertVecIdentity.g.h" +#include "ModuleBindings/Reducers/InsertVecSimpleEnum.g.h" +#include "ModuleBindings/Reducers/InsertVecString.g.h" +#include "ModuleBindings/Reducers/InsertVecTimestamp.g.h" +#include "ModuleBindings/Reducers/InsertVecU128.g.h" +#include "ModuleBindings/Reducers/InsertVecU16.g.h" +#include "ModuleBindings/Reducers/InsertVecU256.g.h" +#include "ModuleBindings/Reducers/InsertVecU32.g.h" +#include "ModuleBindings/Reducers/InsertVecU64.g.h" +#include "ModuleBindings/Reducers/InsertVecU8.g.h" +#include "ModuleBindings/Reducers/InsertVecUnitStruct.g.h" +#include "ModuleBindings/Reducers/NoOpSucceeds.g.h" +#include "ModuleBindings/Reducers/SendScheduledMessage.g.h" +#include "ModuleBindings/Reducers/UpdateIndexedSimpleEnum.g.h" +#include "ModuleBindings/Reducers/UpdatePkBool.g.h" +#include "ModuleBindings/Reducers/UpdatePkConnectionId.g.h" +#include "ModuleBindings/Reducers/UpdatePkI128.g.h" +#include "ModuleBindings/Reducers/UpdatePkI16.g.h" +#include "ModuleBindings/Reducers/UpdatePkI256.g.h" +#include "ModuleBindings/Reducers/UpdatePkI32.g.h" +#include "ModuleBindings/Reducers/UpdatePkI64.g.h" +#include "ModuleBindings/Reducers/UpdatePkI8.g.h" +#include "ModuleBindings/Reducers/UpdatePkIdentity.g.h" +#include "ModuleBindings/Reducers/UpdatePkSimpleEnum.g.h" +#include "ModuleBindings/Reducers/UpdatePkString.g.h" +#include "ModuleBindings/Reducers/UpdatePkU128.g.h" +#include "ModuleBindings/Reducers/UpdatePkU16.g.h" +#include "ModuleBindings/Reducers/UpdatePkU256.g.h" +#include "ModuleBindings/Reducers/UpdatePkU32.g.h" +#include "ModuleBindings/Reducers/UpdatePkU32Two.g.h" +#include "ModuleBindings/Reducers/UpdatePkU64.g.h" +#include "ModuleBindings/Reducers/UpdatePkU8.g.h" +#include "ModuleBindings/Reducers/UpdateUniqueBool.g.h" +#include "ModuleBindings/Reducers/UpdateUniqueConnectionId.g.h" +#include "ModuleBindings/Reducers/UpdateUniqueI128.g.h" +#include "ModuleBindings/Reducers/UpdateUniqueI16.g.h" +#include "ModuleBindings/Reducers/UpdateUniqueI256.g.h" +#include "ModuleBindings/Reducers/UpdateUniqueI32.g.h" +#include "ModuleBindings/Reducers/UpdateUniqueI64.g.h" +#include "ModuleBindings/Reducers/UpdateUniqueI8.g.h" +#include "ModuleBindings/Reducers/UpdateUniqueIdentity.g.h" +#include "ModuleBindings/Reducers/UpdateUniqueString.g.h" +#include "ModuleBindings/Reducers/UpdateUniqueU128.g.h" +#include "ModuleBindings/Reducers/UpdateUniqueU16.g.h" +#include "ModuleBindings/Reducers/UpdateUniqueU256.g.h" +#include "ModuleBindings/Reducers/UpdateUniqueU32.g.h" +#include "ModuleBindings/Reducers/UpdateUniqueU64.g.h" +#include "ModuleBindings/Reducers/UpdateUniqueU8.g.h" +#include "ModuleBindings/Types/BTreeU32Type.g.h" +#include "ModuleBindings/Types/ByteStructType.g.h" +#include "ModuleBindings/Types/EnumWithPayloadType.g.h" +#include "ModuleBindings/Types/EveryPrimitiveStructType.g.h" +#include "ModuleBindings/Types/EveryVecStructType.g.h" +#include "ModuleBindings/Types/OneU8Type.g.h" +#include "ModuleBindings/Types/PkU32Type.g.h" +#include "ModuleBindings/Types/ScheduledTableType.g.h" +#include "ModuleBindings/Types/SimpleEnumType.g.h" +#include "ModuleBindings/Types/UnitStructType.g.h" +#include "ModuleBindings/Types/VecU8Type.g.h" +#include "Types/Builtins.h" +#include "SpacetimeDBClient.g.generated.h" + +// Forward declarations +class UDbConnection; +class URemoteTables; +class URemoteReducers; +class USubscriptionBuilder; +class USubscriptionHandle; + +/** Forward declaration for tables */ +class UBTreeU32Table; +class UIndexedSimpleEnumTable; +class UIndexedTableTable; +class UIndexedTable2Table; +class ULargeTableTable; +class UOneBoolTable; +class UOneByteStructTable; +class UOneConnectionIdTable; +class UOneEnumWithPayloadTable; +class UOneEveryPrimitiveStructTable; +class UOneEveryVecStructTable; +class UOneF32Table; +class UOneF64Table; +class UOneI128Table; +class UOneI16Table; +class UOneI256Table; +class UOneI32Table; +class UOneI64Table; +class UOneI8Table; +class UOneIdentityTable; +class UOneSimpleEnumTable; +class UOneStringTable; +class UOneTimestampTable; +class UOneU128Table; +class UOneU16Table; +class UOneU256Table; +class UOneU32Table; +class UOneU64Table; +class UOneU8Table; +class UOneUnitStructTable; +class UOptionEveryPrimitiveStructTable; +class UOptionI32Table; +class UOptionIdentityTable; +class UOptionSimpleEnumTable; +class UOptionStringTable; +class UOptionVecOptionI32Table; +class UPkBoolTable; +class UPkConnectionIdTable; +class UPkI128Table; +class UPkI16Table; +class UPkI256Table; +class UPkI32Table; +class UPkI64Table; +class UPkI8Table; +class UPkIdentityTable; +class UPkSimpleEnumTable; +class UPkStringTable; +class UPkU128Table; +class UPkU16Table; +class UPkU256Table; +class UPkU32Table; +class UPkU32TwoTable; +class UPkU64Table; +class UPkU8Table; +class UScheduledTableTable; +class UTableHoldsTableTable; +class UUniqueBoolTable; +class UUniqueConnectionIdTable; +class UUniqueI128Table; +class UUniqueI16Table; +class UUniqueI256Table; +class UUniqueI32Table; +class UUniqueI64Table; +class UUniqueI8Table; +class UUniqueIdentityTable; +class UUniqueStringTable; +class UUniqueU128Table; +class UUniqueU16Table; +class UUniqueU256Table; +class UUniqueU32Table; +class UUniqueU64Table; +class UUniqueU8Table; +class UUsersTable; +class UVecBoolTable; +class UVecByteStructTable; +class UVecConnectionIdTable; +class UVecEnumWithPayloadTable; +class UVecEveryPrimitiveStructTable; +class UVecEveryVecStructTable; +class UVecF32Table; +class UVecF64Table; +class UVecI128Table; +class UVecI16Table; +class UVecI256Table; +class UVecI32Table; +class UVecI64Table; +class UVecI8Table; +class UVecIdentityTable; +class UVecSimpleEnumTable; +class UVecStringTable; +class UVecTimestampTable; +class UVecU128Table; +class UVecU16Table; +class UVecU256Table; +class UVecU32Table; +class UVecU64Table; +class UVecU8Table; +class UVecUnitStructTable; +/***/ + +// Delegates using the generated connection type. These wrap the base +// delegates defined in the SDK so that projects can work directly with +// UDbConnection without manual casting in user code. +DECLARE_DYNAMIC_DELEGATE_ThreeParams( + FOnConnectDelegate, + UDbConnection*, Connection, + FSpacetimeDBIdentity, Identity, + const FString&, Token); + +DECLARE_DYNAMIC_DELEGATE_TwoParams( + FOnDisconnectDelegate, + UDbConnection*, Connection, + const FString&, Error); + + +// Context classes for event handling + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FContextBase +{ + GENERATED_BODY() + + FContextBase() = default; + FContextBase(UDbConnection* InConn); + + UPROPERTY(BlueprintReadOnly, Category = "SpacetimeDB") + URemoteTables* Db; + + UPROPERTY(BlueprintReadOnly, Category = "SpacetimeDB") + URemoteReducers* Reducers; + + UPROPERTY(BlueprintReadOnly, Category = "SpacetimeDB") + USetReducerFlags* SetReducerFlags; + + bool IsActive() const; + void Disconnect(); + bool TryGetIdentity(FSpacetimeDBIdentity& OutIdentity) const; + FSpacetimeDBConnectionId GetConnectionId() const; + USubscriptionBuilder* SubscriptionBuilder(); + +protected: + UPROPERTY() + UDbConnection* Conn; + +}; + +UENUM(BlueprintType, Category = "SpacetimeDB") +enum class EReducerTag : uint8 +{ + DeleteFromBtreeU32, + DeleteLargeTable, + DeletePkBool, + DeletePkConnectionId, + DeletePkI128, + DeletePkI16, + DeletePkI256, + DeletePkI32, + DeletePkI64, + DeletePkI8, + DeletePkIdentity, + DeletePkString, + DeletePkU128, + DeletePkU16, + DeletePkU256, + DeletePkU32, + DeletePkU32InsertPkU32Two, + DeletePkU32Two, + DeletePkU64, + DeletePkU8, + DeleteUniqueBool, + DeleteUniqueConnectionId, + DeleteUniqueI128, + DeleteUniqueI16, + DeleteUniqueI256, + DeleteUniqueI32, + DeleteUniqueI64, + DeleteUniqueI8, + DeleteUniqueIdentity, + DeleteUniqueString, + DeleteUniqueU128, + DeleteUniqueU16, + DeleteUniqueU256, + DeleteUniqueU32, + DeleteUniqueU64, + DeleteUniqueU8, + InsertCallTimestamp, + InsertCallerOneConnectionId, + InsertCallerOneIdentity, + InsertCallerPkConnectionId, + InsertCallerPkIdentity, + InsertCallerUniqueConnectionId, + InsertCallerUniqueIdentity, + InsertCallerVecConnectionId, + InsertCallerVecIdentity, + InsertIntoBtreeU32, + InsertIntoIndexedSimpleEnum, + InsertIntoPkBtreeU32, + InsertLargeTable, + InsertOneBool, + InsertOneByteStruct, + InsertOneConnectionId, + InsertOneEnumWithPayload, + InsertOneEveryPrimitiveStruct, + InsertOneEveryVecStruct, + InsertOneF32, + InsertOneF64, + InsertOneI128, + InsertOneI16, + InsertOneI256, + InsertOneI32, + InsertOneI64, + InsertOneI8, + InsertOneIdentity, + InsertOneSimpleEnum, + InsertOneString, + InsertOneTimestamp, + InsertOneU128, + InsertOneU16, + InsertOneU256, + InsertOneU32, + InsertOneU64, + InsertOneU8, + InsertOneUnitStruct, + InsertOptionEveryPrimitiveStruct, + InsertOptionI32, + InsertOptionIdentity, + InsertOptionSimpleEnum, + InsertOptionString, + InsertOptionVecOptionI32, + InsertPkBool, + InsertPkConnectionId, + InsertPkI128, + InsertPkI16, + InsertPkI256, + InsertPkI32, + InsertPkI64, + InsertPkI8, + InsertPkIdentity, + InsertPkSimpleEnum, + InsertPkString, + InsertPkU128, + InsertPkU16, + InsertPkU256, + InsertPkU32, + InsertPkU32Two, + InsertPkU64, + InsertPkU8, + InsertPrimitivesAsStrings, + InsertTableHoldsTable, + InsertUniqueBool, + InsertUniqueConnectionId, + InsertUniqueI128, + InsertUniqueI16, + InsertUniqueI256, + InsertUniqueI32, + InsertUniqueI64, + InsertUniqueI8, + InsertUniqueIdentity, + InsertUniqueString, + InsertUniqueU128, + InsertUniqueU16, + InsertUniqueU256, + InsertUniqueU32, + InsertUniqueU32UpdatePkU32, + InsertUniqueU64, + InsertUniqueU8, + InsertUser, + InsertVecBool, + InsertVecByteStruct, + InsertVecConnectionId, + InsertVecEnumWithPayload, + InsertVecEveryPrimitiveStruct, + InsertVecEveryVecStruct, + InsertVecF32, + InsertVecF64, + InsertVecI128, + InsertVecI16, + InsertVecI256, + InsertVecI32, + InsertVecI64, + InsertVecI8, + InsertVecIdentity, + InsertVecSimpleEnum, + InsertVecString, + InsertVecTimestamp, + InsertVecU128, + InsertVecU16, + InsertVecU256, + InsertVecU32, + InsertVecU64, + InsertVecU8, + InsertVecUnitStruct, + NoOpSucceeds, + SendScheduledMessage, + UpdateIndexedSimpleEnum, + UpdatePkBool, + UpdatePkConnectionId, + UpdatePkI128, + UpdatePkI16, + UpdatePkI256, + UpdatePkI32, + UpdatePkI64, + UpdatePkI8, + UpdatePkIdentity, + UpdatePkSimpleEnum, + UpdatePkString, + UpdatePkU128, + UpdatePkU16, + UpdatePkU256, + UpdatePkU32, + UpdatePkU32Two, + UpdatePkU64, + UpdatePkU8, + UpdateUniqueBool, + UpdateUniqueConnectionId, + UpdateUniqueI128, + UpdateUniqueI16, + UpdateUniqueI256, + UpdateUniqueI32, + UpdateUniqueI64, + UpdateUniqueI8, + UpdateUniqueIdentity, + UpdateUniqueString, + UpdateUniqueU128, + UpdateUniqueU16, + UpdateUniqueU256, + UpdateUniqueU32, + UpdateUniqueU64, + UpdateUniqueU8 +}; + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FReducer +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly, Category = "SpacetimeDB") + EReducerTag Tag; + + TVariant Data; + + // Optional metadata + UPROPERTY(BlueprintReadOnly, Category = "SpacetimeDB") + FString ReducerName; + uint32 ReducerId = 0; + uint32 RequestId = 0; + + static FReducer DeleteFromBtreeU32(const FDeleteFromBtreeU32Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::DeleteFromBtreeU32; + Out.Data.Set(Value); + Out.ReducerName = TEXT("delete_from_btree_u32"); + return Out; + } + + FORCEINLINE bool IsDeleteFromBtreeU32() const { return Tag == EReducerTag::DeleteFromBtreeU32; } + FORCEINLINE FDeleteFromBtreeU32Args GetAsDeleteFromBtreeU32() const + { + ensureMsgf(IsDeleteFromBtreeU32(), TEXT("Reducer does not hold DeleteFromBtreeU32!")); + return Data.Get(); + } + + static FReducer DeleteLargeTable(const FDeleteLargeTableArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::DeleteLargeTable; + Out.Data.Set(Value); + Out.ReducerName = TEXT("delete_large_table"); + return Out; + } + + FORCEINLINE bool IsDeleteLargeTable() const { return Tag == EReducerTag::DeleteLargeTable; } + FORCEINLINE FDeleteLargeTableArgs GetAsDeleteLargeTable() const + { + ensureMsgf(IsDeleteLargeTable(), TEXT("Reducer does not hold DeleteLargeTable!")); + return Data.Get(); + } + + static FReducer DeletePkBool(const FDeletePkBoolArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::DeletePkBool; + Out.Data.Set(Value); + Out.ReducerName = TEXT("delete_pk_bool"); + return Out; + } + + FORCEINLINE bool IsDeletePkBool() const { return Tag == EReducerTag::DeletePkBool; } + FORCEINLINE FDeletePkBoolArgs GetAsDeletePkBool() const + { + ensureMsgf(IsDeletePkBool(), TEXT("Reducer does not hold DeletePkBool!")); + return Data.Get(); + } + + static FReducer DeletePkConnectionId(const FDeletePkConnectionIdArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::DeletePkConnectionId; + Out.Data.Set(Value); + Out.ReducerName = TEXT("delete_pk_connection_id"); + return Out; + } + + FORCEINLINE bool IsDeletePkConnectionId() const { return Tag == EReducerTag::DeletePkConnectionId; } + FORCEINLINE FDeletePkConnectionIdArgs GetAsDeletePkConnectionId() const + { + ensureMsgf(IsDeletePkConnectionId(), TEXT("Reducer does not hold DeletePkConnectionId!")); + return Data.Get(); + } + + static FReducer DeletePkI128(const FDeletePkI128Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::DeletePkI128; + Out.Data.Set(Value); + Out.ReducerName = TEXT("delete_pk_i128"); + return Out; + } + + FORCEINLINE bool IsDeletePkI128() const { return Tag == EReducerTag::DeletePkI128; } + FORCEINLINE FDeletePkI128Args GetAsDeletePkI128() const + { + ensureMsgf(IsDeletePkI128(), TEXT("Reducer does not hold DeletePkI128!")); + return Data.Get(); + } + + static FReducer DeletePkI16(const FDeletePkI16Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::DeletePkI16; + Out.Data.Set(Value); + Out.ReducerName = TEXT("delete_pk_i16"); + return Out; + } + + FORCEINLINE bool IsDeletePkI16() const { return Tag == EReducerTag::DeletePkI16; } + FORCEINLINE FDeletePkI16Args GetAsDeletePkI16() const + { + ensureMsgf(IsDeletePkI16(), TEXT("Reducer does not hold DeletePkI16!")); + return Data.Get(); + } + + static FReducer DeletePkI256(const FDeletePkI256Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::DeletePkI256; + Out.Data.Set(Value); + Out.ReducerName = TEXT("delete_pk_i256"); + return Out; + } + + FORCEINLINE bool IsDeletePkI256() const { return Tag == EReducerTag::DeletePkI256; } + FORCEINLINE FDeletePkI256Args GetAsDeletePkI256() const + { + ensureMsgf(IsDeletePkI256(), TEXT("Reducer does not hold DeletePkI256!")); + return Data.Get(); + } + + static FReducer DeletePkI32(const FDeletePkI32Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::DeletePkI32; + Out.Data.Set(Value); + Out.ReducerName = TEXT("delete_pk_i32"); + return Out; + } + + FORCEINLINE bool IsDeletePkI32() const { return Tag == EReducerTag::DeletePkI32; } + FORCEINLINE FDeletePkI32Args GetAsDeletePkI32() const + { + ensureMsgf(IsDeletePkI32(), TEXT("Reducer does not hold DeletePkI32!")); + return Data.Get(); + } + + static FReducer DeletePkI64(const FDeletePkI64Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::DeletePkI64; + Out.Data.Set(Value); + Out.ReducerName = TEXT("delete_pk_i64"); + return Out; + } + + FORCEINLINE bool IsDeletePkI64() const { return Tag == EReducerTag::DeletePkI64; } + FORCEINLINE FDeletePkI64Args GetAsDeletePkI64() const + { + ensureMsgf(IsDeletePkI64(), TEXT("Reducer does not hold DeletePkI64!")); + return Data.Get(); + } + + static FReducer DeletePkI8(const FDeletePkI8Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::DeletePkI8; + Out.Data.Set(Value); + Out.ReducerName = TEXT("delete_pk_i8"); + return Out; + } + + FORCEINLINE bool IsDeletePkI8() const { return Tag == EReducerTag::DeletePkI8; } + FORCEINLINE FDeletePkI8Args GetAsDeletePkI8() const + { + ensureMsgf(IsDeletePkI8(), TEXT("Reducer does not hold DeletePkI8!")); + return Data.Get(); + } + + static FReducer DeletePkIdentity(const FDeletePkIdentityArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::DeletePkIdentity; + Out.Data.Set(Value); + Out.ReducerName = TEXT("delete_pk_identity"); + return Out; + } + + FORCEINLINE bool IsDeletePkIdentity() const { return Tag == EReducerTag::DeletePkIdentity; } + FORCEINLINE FDeletePkIdentityArgs GetAsDeletePkIdentity() const + { + ensureMsgf(IsDeletePkIdentity(), TEXT("Reducer does not hold DeletePkIdentity!")); + return Data.Get(); + } + + static FReducer DeletePkString(const FDeletePkStringArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::DeletePkString; + Out.Data.Set(Value); + Out.ReducerName = TEXT("delete_pk_string"); + return Out; + } + + FORCEINLINE bool IsDeletePkString() const { return Tag == EReducerTag::DeletePkString; } + FORCEINLINE FDeletePkStringArgs GetAsDeletePkString() const + { + ensureMsgf(IsDeletePkString(), TEXT("Reducer does not hold DeletePkString!")); + return Data.Get(); + } + + static FReducer DeletePkU128(const FDeletePkU128Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::DeletePkU128; + Out.Data.Set(Value); + Out.ReducerName = TEXT("delete_pk_u128"); + return Out; + } + + FORCEINLINE bool IsDeletePkU128() const { return Tag == EReducerTag::DeletePkU128; } + FORCEINLINE FDeletePkU128Args GetAsDeletePkU128() const + { + ensureMsgf(IsDeletePkU128(), TEXT("Reducer does not hold DeletePkU128!")); + return Data.Get(); + } + + static FReducer DeletePkU16(const FDeletePkU16Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::DeletePkU16; + Out.Data.Set(Value); + Out.ReducerName = TEXT("delete_pk_u16"); + return Out; + } + + FORCEINLINE bool IsDeletePkU16() const { return Tag == EReducerTag::DeletePkU16; } + FORCEINLINE FDeletePkU16Args GetAsDeletePkU16() const + { + ensureMsgf(IsDeletePkU16(), TEXT("Reducer does not hold DeletePkU16!")); + return Data.Get(); + } + + static FReducer DeletePkU256(const FDeletePkU256Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::DeletePkU256; + Out.Data.Set(Value); + Out.ReducerName = TEXT("delete_pk_u256"); + return Out; + } + + FORCEINLINE bool IsDeletePkU256() const { return Tag == EReducerTag::DeletePkU256; } + FORCEINLINE FDeletePkU256Args GetAsDeletePkU256() const + { + ensureMsgf(IsDeletePkU256(), TEXT("Reducer does not hold DeletePkU256!")); + return Data.Get(); + } + + static FReducer DeletePkU32(const FDeletePkU32Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::DeletePkU32; + Out.Data.Set(Value); + Out.ReducerName = TEXT("delete_pk_u32"); + return Out; + } + + FORCEINLINE bool IsDeletePkU32() const { return Tag == EReducerTag::DeletePkU32; } + FORCEINLINE FDeletePkU32Args GetAsDeletePkU32() const + { + ensureMsgf(IsDeletePkU32(), TEXT("Reducer does not hold DeletePkU32!")); + return Data.Get(); + } + + static FReducer DeletePkU32InsertPkU32Two(const FDeletePkU32InsertPkU32TwoArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::DeletePkU32InsertPkU32Two; + Out.Data.Set(Value); + Out.ReducerName = TEXT("delete_pk_u32_insert_pk_u32_two"); + return Out; + } + + FORCEINLINE bool IsDeletePkU32InsertPkU32Two() const { return Tag == EReducerTag::DeletePkU32InsertPkU32Two; } + FORCEINLINE FDeletePkU32InsertPkU32TwoArgs GetAsDeletePkU32InsertPkU32Two() const + { + ensureMsgf(IsDeletePkU32InsertPkU32Two(), TEXT("Reducer does not hold DeletePkU32InsertPkU32Two!")); + return Data.Get(); + } + + static FReducer DeletePkU32Two(const FDeletePkU32TwoArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::DeletePkU32Two; + Out.Data.Set(Value); + Out.ReducerName = TEXT("delete_pk_u32_two"); + return Out; + } + + FORCEINLINE bool IsDeletePkU32Two() const { return Tag == EReducerTag::DeletePkU32Two; } + FORCEINLINE FDeletePkU32TwoArgs GetAsDeletePkU32Two() const + { + ensureMsgf(IsDeletePkU32Two(), TEXT("Reducer does not hold DeletePkU32Two!")); + return Data.Get(); + } + + static FReducer DeletePkU64(const FDeletePkU64Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::DeletePkU64; + Out.Data.Set(Value); + Out.ReducerName = TEXT("delete_pk_u64"); + return Out; + } + + FORCEINLINE bool IsDeletePkU64() const { return Tag == EReducerTag::DeletePkU64; } + FORCEINLINE FDeletePkU64Args GetAsDeletePkU64() const + { + ensureMsgf(IsDeletePkU64(), TEXT("Reducer does not hold DeletePkU64!")); + return Data.Get(); + } + + static FReducer DeletePkU8(const FDeletePkU8Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::DeletePkU8; + Out.Data.Set(Value); + Out.ReducerName = TEXT("delete_pk_u8"); + return Out; + } + + FORCEINLINE bool IsDeletePkU8() const { return Tag == EReducerTag::DeletePkU8; } + FORCEINLINE FDeletePkU8Args GetAsDeletePkU8() const + { + ensureMsgf(IsDeletePkU8(), TEXT("Reducer does not hold DeletePkU8!")); + return Data.Get(); + } + + static FReducer DeleteUniqueBool(const FDeleteUniqueBoolArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::DeleteUniqueBool; + Out.Data.Set(Value); + Out.ReducerName = TEXT("delete_unique_bool"); + return Out; + } + + FORCEINLINE bool IsDeleteUniqueBool() const { return Tag == EReducerTag::DeleteUniqueBool; } + FORCEINLINE FDeleteUniqueBoolArgs GetAsDeleteUniqueBool() const + { + ensureMsgf(IsDeleteUniqueBool(), TEXT("Reducer does not hold DeleteUniqueBool!")); + return Data.Get(); + } + + static FReducer DeleteUniqueConnectionId(const FDeleteUniqueConnectionIdArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::DeleteUniqueConnectionId; + Out.Data.Set(Value); + Out.ReducerName = TEXT("delete_unique_connection_id"); + return Out; + } + + FORCEINLINE bool IsDeleteUniqueConnectionId() const { return Tag == EReducerTag::DeleteUniqueConnectionId; } + FORCEINLINE FDeleteUniqueConnectionIdArgs GetAsDeleteUniqueConnectionId() const + { + ensureMsgf(IsDeleteUniqueConnectionId(), TEXT("Reducer does not hold DeleteUniqueConnectionId!")); + return Data.Get(); + } + + static FReducer DeleteUniqueI128(const FDeleteUniqueI128Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::DeleteUniqueI128; + Out.Data.Set(Value); + Out.ReducerName = TEXT("delete_unique_i128"); + return Out; + } + + FORCEINLINE bool IsDeleteUniqueI128() const { return Tag == EReducerTag::DeleteUniqueI128; } + FORCEINLINE FDeleteUniqueI128Args GetAsDeleteUniqueI128() const + { + ensureMsgf(IsDeleteUniqueI128(), TEXT("Reducer does not hold DeleteUniqueI128!")); + return Data.Get(); + } + + static FReducer DeleteUniqueI16(const FDeleteUniqueI16Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::DeleteUniqueI16; + Out.Data.Set(Value); + Out.ReducerName = TEXT("delete_unique_i16"); + return Out; + } + + FORCEINLINE bool IsDeleteUniqueI16() const { return Tag == EReducerTag::DeleteUniqueI16; } + FORCEINLINE FDeleteUniqueI16Args GetAsDeleteUniqueI16() const + { + ensureMsgf(IsDeleteUniqueI16(), TEXT("Reducer does not hold DeleteUniqueI16!")); + return Data.Get(); + } + + static FReducer DeleteUniqueI256(const FDeleteUniqueI256Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::DeleteUniqueI256; + Out.Data.Set(Value); + Out.ReducerName = TEXT("delete_unique_i256"); + return Out; + } + + FORCEINLINE bool IsDeleteUniqueI256() const { return Tag == EReducerTag::DeleteUniqueI256; } + FORCEINLINE FDeleteUniqueI256Args GetAsDeleteUniqueI256() const + { + ensureMsgf(IsDeleteUniqueI256(), TEXT("Reducer does not hold DeleteUniqueI256!")); + return Data.Get(); + } + + static FReducer DeleteUniqueI32(const FDeleteUniqueI32Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::DeleteUniqueI32; + Out.Data.Set(Value); + Out.ReducerName = TEXT("delete_unique_i32"); + return Out; + } + + FORCEINLINE bool IsDeleteUniqueI32() const { return Tag == EReducerTag::DeleteUniqueI32; } + FORCEINLINE FDeleteUniqueI32Args GetAsDeleteUniqueI32() const + { + ensureMsgf(IsDeleteUniqueI32(), TEXT("Reducer does not hold DeleteUniqueI32!")); + return Data.Get(); + } + + static FReducer DeleteUniqueI64(const FDeleteUniqueI64Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::DeleteUniqueI64; + Out.Data.Set(Value); + Out.ReducerName = TEXT("delete_unique_i64"); + return Out; + } + + FORCEINLINE bool IsDeleteUniqueI64() const { return Tag == EReducerTag::DeleteUniqueI64; } + FORCEINLINE FDeleteUniqueI64Args GetAsDeleteUniqueI64() const + { + ensureMsgf(IsDeleteUniqueI64(), TEXT("Reducer does not hold DeleteUniqueI64!")); + return Data.Get(); + } + + static FReducer DeleteUniqueI8(const FDeleteUniqueI8Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::DeleteUniqueI8; + Out.Data.Set(Value); + Out.ReducerName = TEXT("delete_unique_i8"); + return Out; + } + + FORCEINLINE bool IsDeleteUniqueI8() const { return Tag == EReducerTag::DeleteUniqueI8; } + FORCEINLINE FDeleteUniqueI8Args GetAsDeleteUniqueI8() const + { + ensureMsgf(IsDeleteUniqueI8(), TEXT("Reducer does not hold DeleteUniqueI8!")); + return Data.Get(); + } + + static FReducer DeleteUniqueIdentity(const FDeleteUniqueIdentityArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::DeleteUniqueIdentity; + Out.Data.Set(Value); + Out.ReducerName = TEXT("delete_unique_identity"); + return Out; + } + + FORCEINLINE bool IsDeleteUniqueIdentity() const { return Tag == EReducerTag::DeleteUniqueIdentity; } + FORCEINLINE FDeleteUniqueIdentityArgs GetAsDeleteUniqueIdentity() const + { + ensureMsgf(IsDeleteUniqueIdentity(), TEXT("Reducer does not hold DeleteUniqueIdentity!")); + return Data.Get(); + } + + static FReducer DeleteUniqueString(const FDeleteUniqueStringArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::DeleteUniqueString; + Out.Data.Set(Value); + Out.ReducerName = TEXT("delete_unique_string"); + return Out; + } + + FORCEINLINE bool IsDeleteUniqueString() const { return Tag == EReducerTag::DeleteUniqueString; } + FORCEINLINE FDeleteUniqueStringArgs GetAsDeleteUniqueString() const + { + ensureMsgf(IsDeleteUniqueString(), TEXT("Reducer does not hold DeleteUniqueString!")); + return Data.Get(); + } + + static FReducer DeleteUniqueU128(const FDeleteUniqueU128Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::DeleteUniqueU128; + Out.Data.Set(Value); + Out.ReducerName = TEXT("delete_unique_u128"); + return Out; + } + + FORCEINLINE bool IsDeleteUniqueU128() const { return Tag == EReducerTag::DeleteUniqueU128; } + FORCEINLINE FDeleteUniqueU128Args GetAsDeleteUniqueU128() const + { + ensureMsgf(IsDeleteUniqueU128(), TEXT("Reducer does not hold DeleteUniqueU128!")); + return Data.Get(); + } + + static FReducer DeleteUniqueU16(const FDeleteUniqueU16Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::DeleteUniqueU16; + Out.Data.Set(Value); + Out.ReducerName = TEXT("delete_unique_u16"); + return Out; + } + + FORCEINLINE bool IsDeleteUniqueU16() const { return Tag == EReducerTag::DeleteUniqueU16; } + FORCEINLINE FDeleteUniqueU16Args GetAsDeleteUniqueU16() const + { + ensureMsgf(IsDeleteUniqueU16(), TEXT("Reducer does not hold DeleteUniqueU16!")); + return Data.Get(); + } + + static FReducer DeleteUniqueU256(const FDeleteUniqueU256Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::DeleteUniqueU256; + Out.Data.Set(Value); + Out.ReducerName = TEXT("delete_unique_u256"); + return Out; + } + + FORCEINLINE bool IsDeleteUniqueU256() const { return Tag == EReducerTag::DeleteUniqueU256; } + FORCEINLINE FDeleteUniqueU256Args GetAsDeleteUniqueU256() const + { + ensureMsgf(IsDeleteUniqueU256(), TEXT("Reducer does not hold DeleteUniqueU256!")); + return Data.Get(); + } + + static FReducer DeleteUniqueU32(const FDeleteUniqueU32Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::DeleteUniqueU32; + Out.Data.Set(Value); + Out.ReducerName = TEXT("delete_unique_u32"); + return Out; + } + + FORCEINLINE bool IsDeleteUniqueU32() const { return Tag == EReducerTag::DeleteUniqueU32; } + FORCEINLINE FDeleteUniqueU32Args GetAsDeleteUniqueU32() const + { + ensureMsgf(IsDeleteUniqueU32(), TEXT("Reducer does not hold DeleteUniqueU32!")); + return Data.Get(); + } + + static FReducer DeleteUniqueU64(const FDeleteUniqueU64Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::DeleteUniqueU64; + Out.Data.Set(Value); + Out.ReducerName = TEXT("delete_unique_u64"); + return Out; + } + + FORCEINLINE bool IsDeleteUniqueU64() const { return Tag == EReducerTag::DeleteUniqueU64; } + FORCEINLINE FDeleteUniqueU64Args GetAsDeleteUniqueU64() const + { + ensureMsgf(IsDeleteUniqueU64(), TEXT("Reducer does not hold DeleteUniqueU64!")); + return Data.Get(); + } + + static FReducer DeleteUniqueU8(const FDeleteUniqueU8Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::DeleteUniqueU8; + Out.Data.Set(Value); + Out.ReducerName = TEXT("delete_unique_u8"); + return Out; + } + + FORCEINLINE bool IsDeleteUniqueU8() const { return Tag == EReducerTag::DeleteUniqueU8; } + FORCEINLINE FDeleteUniqueU8Args GetAsDeleteUniqueU8() const + { + ensureMsgf(IsDeleteUniqueU8(), TEXT("Reducer does not hold DeleteUniqueU8!")); + return Data.Get(); + } + + static FReducer InsertCallTimestamp(const FInsertCallTimestampArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertCallTimestamp; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_call_timestamp"); + return Out; + } + + FORCEINLINE bool IsInsertCallTimestamp() const { return Tag == EReducerTag::InsertCallTimestamp; } + FORCEINLINE FInsertCallTimestampArgs GetAsInsertCallTimestamp() const + { + ensureMsgf(IsInsertCallTimestamp(), TEXT("Reducer does not hold InsertCallTimestamp!")); + return Data.Get(); + } + + static FReducer InsertCallerOneConnectionId(const FInsertCallerOneConnectionIdArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertCallerOneConnectionId; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_caller_one_connection_id"); + return Out; + } + + FORCEINLINE bool IsInsertCallerOneConnectionId() const { return Tag == EReducerTag::InsertCallerOneConnectionId; } + FORCEINLINE FInsertCallerOneConnectionIdArgs GetAsInsertCallerOneConnectionId() const + { + ensureMsgf(IsInsertCallerOneConnectionId(), TEXT("Reducer does not hold InsertCallerOneConnectionId!")); + return Data.Get(); + } + + static FReducer InsertCallerOneIdentity(const FInsertCallerOneIdentityArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertCallerOneIdentity; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_caller_one_identity"); + return Out; + } + + FORCEINLINE bool IsInsertCallerOneIdentity() const { return Tag == EReducerTag::InsertCallerOneIdentity; } + FORCEINLINE FInsertCallerOneIdentityArgs GetAsInsertCallerOneIdentity() const + { + ensureMsgf(IsInsertCallerOneIdentity(), TEXT("Reducer does not hold InsertCallerOneIdentity!")); + return Data.Get(); + } + + static FReducer InsertCallerPkConnectionId(const FInsertCallerPkConnectionIdArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertCallerPkConnectionId; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_caller_pk_connection_id"); + return Out; + } + + FORCEINLINE bool IsInsertCallerPkConnectionId() const { return Tag == EReducerTag::InsertCallerPkConnectionId; } + FORCEINLINE FInsertCallerPkConnectionIdArgs GetAsInsertCallerPkConnectionId() const + { + ensureMsgf(IsInsertCallerPkConnectionId(), TEXT("Reducer does not hold InsertCallerPkConnectionId!")); + return Data.Get(); + } + + static FReducer InsertCallerPkIdentity(const FInsertCallerPkIdentityArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertCallerPkIdentity; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_caller_pk_identity"); + return Out; + } + + FORCEINLINE bool IsInsertCallerPkIdentity() const { return Tag == EReducerTag::InsertCallerPkIdentity; } + FORCEINLINE FInsertCallerPkIdentityArgs GetAsInsertCallerPkIdentity() const + { + ensureMsgf(IsInsertCallerPkIdentity(), TEXT("Reducer does not hold InsertCallerPkIdentity!")); + return Data.Get(); + } + + static FReducer InsertCallerUniqueConnectionId(const FInsertCallerUniqueConnectionIdArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertCallerUniqueConnectionId; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_caller_unique_connection_id"); + return Out; + } + + FORCEINLINE bool IsInsertCallerUniqueConnectionId() const { return Tag == EReducerTag::InsertCallerUniqueConnectionId; } + FORCEINLINE FInsertCallerUniqueConnectionIdArgs GetAsInsertCallerUniqueConnectionId() const + { + ensureMsgf(IsInsertCallerUniqueConnectionId(), TEXT("Reducer does not hold InsertCallerUniqueConnectionId!")); + return Data.Get(); + } + + static FReducer InsertCallerUniqueIdentity(const FInsertCallerUniqueIdentityArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertCallerUniqueIdentity; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_caller_unique_identity"); + return Out; + } + + FORCEINLINE bool IsInsertCallerUniqueIdentity() const { return Tag == EReducerTag::InsertCallerUniqueIdentity; } + FORCEINLINE FInsertCallerUniqueIdentityArgs GetAsInsertCallerUniqueIdentity() const + { + ensureMsgf(IsInsertCallerUniqueIdentity(), TEXT("Reducer does not hold InsertCallerUniqueIdentity!")); + return Data.Get(); + } + + static FReducer InsertCallerVecConnectionId(const FInsertCallerVecConnectionIdArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertCallerVecConnectionId; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_caller_vec_connection_id"); + return Out; + } + + FORCEINLINE bool IsInsertCallerVecConnectionId() const { return Tag == EReducerTag::InsertCallerVecConnectionId; } + FORCEINLINE FInsertCallerVecConnectionIdArgs GetAsInsertCallerVecConnectionId() const + { + ensureMsgf(IsInsertCallerVecConnectionId(), TEXT("Reducer does not hold InsertCallerVecConnectionId!")); + return Data.Get(); + } + + static FReducer InsertCallerVecIdentity(const FInsertCallerVecIdentityArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertCallerVecIdentity; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_caller_vec_identity"); + return Out; + } + + FORCEINLINE bool IsInsertCallerVecIdentity() const { return Tag == EReducerTag::InsertCallerVecIdentity; } + FORCEINLINE FInsertCallerVecIdentityArgs GetAsInsertCallerVecIdentity() const + { + ensureMsgf(IsInsertCallerVecIdentity(), TEXT("Reducer does not hold InsertCallerVecIdentity!")); + return Data.Get(); + } + + static FReducer InsertIntoBtreeU32(const FInsertIntoBtreeU32Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertIntoBtreeU32; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_into_btree_u32"); + return Out; + } + + FORCEINLINE bool IsInsertIntoBtreeU32() const { return Tag == EReducerTag::InsertIntoBtreeU32; } + FORCEINLINE FInsertIntoBtreeU32Args GetAsInsertIntoBtreeU32() const + { + ensureMsgf(IsInsertIntoBtreeU32(), TEXT("Reducer does not hold InsertIntoBtreeU32!")); + return Data.Get(); + } + + static FReducer InsertIntoIndexedSimpleEnum(const FInsertIntoIndexedSimpleEnumArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertIntoIndexedSimpleEnum; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_into_indexed_simple_enum"); + return Out; + } + + FORCEINLINE bool IsInsertIntoIndexedSimpleEnum() const { return Tag == EReducerTag::InsertIntoIndexedSimpleEnum; } + FORCEINLINE FInsertIntoIndexedSimpleEnumArgs GetAsInsertIntoIndexedSimpleEnum() const + { + ensureMsgf(IsInsertIntoIndexedSimpleEnum(), TEXT("Reducer does not hold InsertIntoIndexedSimpleEnum!")); + return Data.Get(); + } + + static FReducer InsertIntoPkBtreeU32(const FInsertIntoPkBtreeU32Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertIntoPkBtreeU32; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_into_pk_btree_u32"); + return Out; + } + + FORCEINLINE bool IsInsertIntoPkBtreeU32() const { return Tag == EReducerTag::InsertIntoPkBtreeU32; } + FORCEINLINE FInsertIntoPkBtreeU32Args GetAsInsertIntoPkBtreeU32() const + { + ensureMsgf(IsInsertIntoPkBtreeU32(), TEXT("Reducer does not hold InsertIntoPkBtreeU32!")); + return Data.Get(); + } + + static FReducer InsertLargeTable(const FInsertLargeTableArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertLargeTable; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_large_table"); + return Out; + } + + FORCEINLINE bool IsInsertLargeTable() const { return Tag == EReducerTag::InsertLargeTable; } + FORCEINLINE FInsertLargeTableArgs GetAsInsertLargeTable() const + { + ensureMsgf(IsInsertLargeTable(), TEXT("Reducer does not hold InsertLargeTable!")); + return Data.Get(); + } + + static FReducer InsertOneBool(const FInsertOneBoolArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertOneBool; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_one_bool"); + return Out; + } + + FORCEINLINE bool IsInsertOneBool() const { return Tag == EReducerTag::InsertOneBool; } + FORCEINLINE FInsertOneBoolArgs GetAsInsertOneBool() const + { + ensureMsgf(IsInsertOneBool(), TEXT("Reducer does not hold InsertOneBool!")); + return Data.Get(); + } + + static FReducer InsertOneByteStruct(const FInsertOneByteStructArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertOneByteStruct; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_one_byte_struct"); + return Out; + } + + FORCEINLINE bool IsInsertOneByteStruct() const { return Tag == EReducerTag::InsertOneByteStruct; } + FORCEINLINE FInsertOneByteStructArgs GetAsInsertOneByteStruct() const + { + ensureMsgf(IsInsertOneByteStruct(), TEXT("Reducer does not hold InsertOneByteStruct!")); + return Data.Get(); + } + + static FReducer InsertOneConnectionId(const FInsertOneConnectionIdArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertOneConnectionId; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_one_connection_id"); + return Out; + } + + FORCEINLINE bool IsInsertOneConnectionId() const { return Tag == EReducerTag::InsertOneConnectionId; } + FORCEINLINE FInsertOneConnectionIdArgs GetAsInsertOneConnectionId() const + { + ensureMsgf(IsInsertOneConnectionId(), TEXT("Reducer does not hold InsertOneConnectionId!")); + return Data.Get(); + } + + static FReducer InsertOneEnumWithPayload(const FInsertOneEnumWithPayloadArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertOneEnumWithPayload; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_one_enum_with_payload"); + return Out; + } + + FORCEINLINE bool IsInsertOneEnumWithPayload() const { return Tag == EReducerTag::InsertOneEnumWithPayload; } + FORCEINLINE FInsertOneEnumWithPayloadArgs GetAsInsertOneEnumWithPayload() const + { + ensureMsgf(IsInsertOneEnumWithPayload(), TEXT("Reducer does not hold InsertOneEnumWithPayload!")); + return Data.Get(); + } + + static FReducer InsertOneEveryPrimitiveStruct(const FInsertOneEveryPrimitiveStructArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertOneEveryPrimitiveStruct; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_one_every_primitive_struct"); + return Out; + } + + FORCEINLINE bool IsInsertOneEveryPrimitiveStruct() const { return Tag == EReducerTag::InsertOneEveryPrimitiveStruct; } + FORCEINLINE FInsertOneEveryPrimitiveStructArgs GetAsInsertOneEveryPrimitiveStruct() const + { + ensureMsgf(IsInsertOneEveryPrimitiveStruct(), TEXT("Reducer does not hold InsertOneEveryPrimitiveStruct!")); + return Data.Get(); + } + + static FReducer InsertOneEveryVecStruct(const FInsertOneEveryVecStructArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertOneEveryVecStruct; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_one_every_vec_struct"); + return Out; + } + + FORCEINLINE bool IsInsertOneEveryVecStruct() const { return Tag == EReducerTag::InsertOneEveryVecStruct; } + FORCEINLINE FInsertOneEveryVecStructArgs GetAsInsertOneEveryVecStruct() const + { + ensureMsgf(IsInsertOneEveryVecStruct(), TEXT("Reducer does not hold InsertOneEveryVecStruct!")); + return Data.Get(); + } + + static FReducer InsertOneF32(const FInsertOneF32Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertOneF32; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_one_f32"); + return Out; + } + + FORCEINLINE bool IsInsertOneF32() const { return Tag == EReducerTag::InsertOneF32; } + FORCEINLINE FInsertOneF32Args GetAsInsertOneF32() const + { + ensureMsgf(IsInsertOneF32(), TEXT("Reducer does not hold InsertOneF32!")); + return Data.Get(); + } + + static FReducer InsertOneF64(const FInsertOneF64Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertOneF64; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_one_f64"); + return Out; + } + + FORCEINLINE bool IsInsertOneF64() const { return Tag == EReducerTag::InsertOneF64; } + FORCEINLINE FInsertOneF64Args GetAsInsertOneF64() const + { + ensureMsgf(IsInsertOneF64(), TEXT("Reducer does not hold InsertOneF64!")); + return Data.Get(); + } + + static FReducer InsertOneI128(const FInsertOneI128Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertOneI128; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_one_i128"); + return Out; + } + + FORCEINLINE bool IsInsertOneI128() const { return Tag == EReducerTag::InsertOneI128; } + FORCEINLINE FInsertOneI128Args GetAsInsertOneI128() const + { + ensureMsgf(IsInsertOneI128(), TEXT("Reducer does not hold InsertOneI128!")); + return Data.Get(); + } + + static FReducer InsertOneI16(const FInsertOneI16Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertOneI16; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_one_i16"); + return Out; + } + + FORCEINLINE bool IsInsertOneI16() const { return Tag == EReducerTag::InsertOneI16; } + FORCEINLINE FInsertOneI16Args GetAsInsertOneI16() const + { + ensureMsgf(IsInsertOneI16(), TEXT("Reducer does not hold InsertOneI16!")); + return Data.Get(); + } + + static FReducer InsertOneI256(const FInsertOneI256Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertOneI256; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_one_i256"); + return Out; + } + + FORCEINLINE bool IsInsertOneI256() const { return Tag == EReducerTag::InsertOneI256; } + FORCEINLINE FInsertOneI256Args GetAsInsertOneI256() const + { + ensureMsgf(IsInsertOneI256(), TEXT("Reducer does not hold InsertOneI256!")); + return Data.Get(); + } + + static FReducer InsertOneI32(const FInsertOneI32Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertOneI32; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_one_i32"); + return Out; + } + + FORCEINLINE bool IsInsertOneI32() const { return Tag == EReducerTag::InsertOneI32; } + FORCEINLINE FInsertOneI32Args GetAsInsertOneI32() const + { + ensureMsgf(IsInsertOneI32(), TEXT("Reducer does not hold InsertOneI32!")); + return Data.Get(); + } + + static FReducer InsertOneI64(const FInsertOneI64Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertOneI64; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_one_i64"); + return Out; + } + + FORCEINLINE bool IsInsertOneI64() const { return Tag == EReducerTag::InsertOneI64; } + FORCEINLINE FInsertOneI64Args GetAsInsertOneI64() const + { + ensureMsgf(IsInsertOneI64(), TEXT("Reducer does not hold InsertOneI64!")); + return Data.Get(); + } + + static FReducer InsertOneI8(const FInsertOneI8Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertOneI8; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_one_i8"); + return Out; + } + + FORCEINLINE bool IsInsertOneI8() const { return Tag == EReducerTag::InsertOneI8; } + FORCEINLINE FInsertOneI8Args GetAsInsertOneI8() const + { + ensureMsgf(IsInsertOneI8(), TEXT("Reducer does not hold InsertOneI8!")); + return Data.Get(); + } + + static FReducer InsertOneIdentity(const FInsertOneIdentityArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertOneIdentity; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_one_identity"); + return Out; + } + + FORCEINLINE bool IsInsertOneIdentity() const { return Tag == EReducerTag::InsertOneIdentity; } + FORCEINLINE FInsertOneIdentityArgs GetAsInsertOneIdentity() const + { + ensureMsgf(IsInsertOneIdentity(), TEXT("Reducer does not hold InsertOneIdentity!")); + return Data.Get(); + } + + static FReducer InsertOneSimpleEnum(const FInsertOneSimpleEnumArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertOneSimpleEnum; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_one_simple_enum"); + return Out; + } + + FORCEINLINE bool IsInsertOneSimpleEnum() const { return Tag == EReducerTag::InsertOneSimpleEnum; } + FORCEINLINE FInsertOneSimpleEnumArgs GetAsInsertOneSimpleEnum() const + { + ensureMsgf(IsInsertOneSimpleEnum(), TEXT("Reducer does not hold InsertOneSimpleEnum!")); + return Data.Get(); + } + + static FReducer InsertOneString(const FInsertOneStringArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertOneString; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_one_string"); + return Out; + } + + FORCEINLINE bool IsInsertOneString() const { return Tag == EReducerTag::InsertOneString; } + FORCEINLINE FInsertOneStringArgs GetAsInsertOneString() const + { + ensureMsgf(IsInsertOneString(), TEXT("Reducer does not hold InsertOneString!")); + return Data.Get(); + } + + static FReducer InsertOneTimestamp(const FInsertOneTimestampArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertOneTimestamp; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_one_timestamp"); + return Out; + } + + FORCEINLINE bool IsInsertOneTimestamp() const { return Tag == EReducerTag::InsertOneTimestamp; } + FORCEINLINE FInsertOneTimestampArgs GetAsInsertOneTimestamp() const + { + ensureMsgf(IsInsertOneTimestamp(), TEXT("Reducer does not hold InsertOneTimestamp!")); + return Data.Get(); + } + + static FReducer InsertOneU128(const FInsertOneU128Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertOneU128; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_one_u128"); + return Out; + } + + FORCEINLINE bool IsInsertOneU128() const { return Tag == EReducerTag::InsertOneU128; } + FORCEINLINE FInsertOneU128Args GetAsInsertOneU128() const + { + ensureMsgf(IsInsertOneU128(), TEXT("Reducer does not hold InsertOneU128!")); + return Data.Get(); + } + + static FReducer InsertOneU16(const FInsertOneU16Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertOneU16; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_one_u16"); + return Out; + } + + FORCEINLINE bool IsInsertOneU16() const { return Tag == EReducerTag::InsertOneU16; } + FORCEINLINE FInsertOneU16Args GetAsInsertOneU16() const + { + ensureMsgf(IsInsertOneU16(), TEXT("Reducer does not hold InsertOneU16!")); + return Data.Get(); + } + + static FReducer InsertOneU256(const FInsertOneU256Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertOneU256; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_one_u256"); + return Out; + } + + FORCEINLINE bool IsInsertOneU256() const { return Tag == EReducerTag::InsertOneU256; } + FORCEINLINE FInsertOneU256Args GetAsInsertOneU256() const + { + ensureMsgf(IsInsertOneU256(), TEXT("Reducer does not hold InsertOneU256!")); + return Data.Get(); + } + + static FReducer InsertOneU32(const FInsertOneU32Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertOneU32; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_one_u32"); + return Out; + } + + FORCEINLINE bool IsInsertOneU32() const { return Tag == EReducerTag::InsertOneU32; } + FORCEINLINE FInsertOneU32Args GetAsInsertOneU32() const + { + ensureMsgf(IsInsertOneU32(), TEXT("Reducer does not hold InsertOneU32!")); + return Data.Get(); + } + + static FReducer InsertOneU64(const FInsertOneU64Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertOneU64; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_one_u64"); + return Out; + } + + FORCEINLINE bool IsInsertOneU64() const { return Tag == EReducerTag::InsertOneU64; } + FORCEINLINE FInsertOneU64Args GetAsInsertOneU64() const + { + ensureMsgf(IsInsertOneU64(), TEXT("Reducer does not hold InsertOneU64!")); + return Data.Get(); + } + + static FReducer InsertOneU8(const FInsertOneU8Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertOneU8; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_one_u8"); + return Out; + } + + FORCEINLINE bool IsInsertOneU8() const { return Tag == EReducerTag::InsertOneU8; } + FORCEINLINE FInsertOneU8Args GetAsInsertOneU8() const + { + ensureMsgf(IsInsertOneU8(), TEXT("Reducer does not hold InsertOneU8!")); + return Data.Get(); + } + + static FReducer InsertOneUnitStruct(const FInsertOneUnitStructArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertOneUnitStruct; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_one_unit_struct"); + return Out; + } + + FORCEINLINE bool IsInsertOneUnitStruct() const { return Tag == EReducerTag::InsertOneUnitStruct; } + FORCEINLINE FInsertOneUnitStructArgs GetAsInsertOneUnitStruct() const + { + ensureMsgf(IsInsertOneUnitStruct(), TEXT("Reducer does not hold InsertOneUnitStruct!")); + return Data.Get(); + } + + static FReducer InsertOptionEveryPrimitiveStruct(const FInsertOptionEveryPrimitiveStructArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertOptionEveryPrimitiveStruct; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_option_every_primitive_struct"); + return Out; + } + + FORCEINLINE bool IsInsertOptionEveryPrimitiveStruct() const { return Tag == EReducerTag::InsertOptionEveryPrimitiveStruct; } + FORCEINLINE FInsertOptionEveryPrimitiveStructArgs GetAsInsertOptionEveryPrimitiveStruct() const + { + ensureMsgf(IsInsertOptionEveryPrimitiveStruct(), TEXT("Reducer does not hold InsertOptionEveryPrimitiveStruct!")); + return Data.Get(); + } + + static FReducer InsertOptionI32(const FInsertOptionI32Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertOptionI32; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_option_i32"); + return Out; + } + + FORCEINLINE bool IsInsertOptionI32() const { return Tag == EReducerTag::InsertOptionI32; } + FORCEINLINE FInsertOptionI32Args GetAsInsertOptionI32() const + { + ensureMsgf(IsInsertOptionI32(), TEXT("Reducer does not hold InsertOptionI32!")); + return Data.Get(); + } + + static FReducer InsertOptionIdentity(const FInsertOptionIdentityArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertOptionIdentity; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_option_identity"); + return Out; + } + + FORCEINLINE bool IsInsertOptionIdentity() const { return Tag == EReducerTag::InsertOptionIdentity; } + FORCEINLINE FInsertOptionIdentityArgs GetAsInsertOptionIdentity() const + { + ensureMsgf(IsInsertOptionIdentity(), TEXT("Reducer does not hold InsertOptionIdentity!")); + return Data.Get(); + } + + static FReducer InsertOptionSimpleEnum(const FInsertOptionSimpleEnumArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertOptionSimpleEnum; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_option_simple_enum"); + return Out; + } + + FORCEINLINE bool IsInsertOptionSimpleEnum() const { return Tag == EReducerTag::InsertOptionSimpleEnum; } + FORCEINLINE FInsertOptionSimpleEnumArgs GetAsInsertOptionSimpleEnum() const + { + ensureMsgf(IsInsertOptionSimpleEnum(), TEXT("Reducer does not hold InsertOptionSimpleEnum!")); + return Data.Get(); + } + + static FReducer InsertOptionString(const FInsertOptionStringArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertOptionString; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_option_string"); + return Out; + } + + FORCEINLINE bool IsInsertOptionString() const { return Tag == EReducerTag::InsertOptionString; } + FORCEINLINE FInsertOptionStringArgs GetAsInsertOptionString() const + { + ensureMsgf(IsInsertOptionString(), TEXT("Reducer does not hold InsertOptionString!")); + return Data.Get(); + } + + static FReducer InsertOptionVecOptionI32(const FInsertOptionVecOptionI32Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertOptionVecOptionI32; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_option_vec_option_i32"); + return Out; + } + + FORCEINLINE bool IsInsertOptionVecOptionI32() const { return Tag == EReducerTag::InsertOptionVecOptionI32; } + FORCEINLINE FInsertOptionVecOptionI32Args GetAsInsertOptionVecOptionI32() const + { + ensureMsgf(IsInsertOptionVecOptionI32(), TEXT("Reducer does not hold InsertOptionVecOptionI32!")); + return Data.Get(); + } + + static FReducer InsertPkBool(const FInsertPkBoolArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertPkBool; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_pk_bool"); + return Out; + } + + FORCEINLINE bool IsInsertPkBool() const { return Tag == EReducerTag::InsertPkBool; } + FORCEINLINE FInsertPkBoolArgs GetAsInsertPkBool() const + { + ensureMsgf(IsInsertPkBool(), TEXT("Reducer does not hold InsertPkBool!")); + return Data.Get(); + } + + static FReducer InsertPkConnectionId(const FInsertPkConnectionIdArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertPkConnectionId; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_pk_connection_id"); + return Out; + } + + FORCEINLINE bool IsInsertPkConnectionId() const { return Tag == EReducerTag::InsertPkConnectionId; } + FORCEINLINE FInsertPkConnectionIdArgs GetAsInsertPkConnectionId() const + { + ensureMsgf(IsInsertPkConnectionId(), TEXT("Reducer does not hold InsertPkConnectionId!")); + return Data.Get(); + } + + static FReducer InsertPkI128(const FInsertPkI128Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertPkI128; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_pk_i128"); + return Out; + } + + FORCEINLINE bool IsInsertPkI128() const { return Tag == EReducerTag::InsertPkI128; } + FORCEINLINE FInsertPkI128Args GetAsInsertPkI128() const + { + ensureMsgf(IsInsertPkI128(), TEXT("Reducer does not hold InsertPkI128!")); + return Data.Get(); + } + + static FReducer InsertPkI16(const FInsertPkI16Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertPkI16; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_pk_i16"); + return Out; + } + + FORCEINLINE bool IsInsertPkI16() const { return Tag == EReducerTag::InsertPkI16; } + FORCEINLINE FInsertPkI16Args GetAsInsertPkI16() const + { + ensureMsgf(IsInsertPkI16(), TEXT("Reducer does not hold InsertPkI16!")); + return Data.Get(); + } + + static FReducer InsertPkI256(const FInsertPkI256Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertPkI256; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_pk_i256"); + return Out; + } + + FORCEINLINE bool IsInsertPkI256() const { return Tag == EReducerTag::InsertPkI256; } + FORCEINLINE FInsertPkI256Args GetAsInsertPkI256() const + { + ensureMsgf(IsInsertPkI256(), TEXT("Reducer does not hold InsertPkI256!")); + return Data.Get(); + } + + static FReducer InsertPkI32(const FInsertPkI32Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertPkI32; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_pk_i32"); + return Out; + } + + FORCEINLINE bool IsInsertPkI32() const { return Tag == EReducerTag::InsertPkI32; } + FORCEINLINE FInsertPkI32Args GetAsInsertPkI32() const + { + ensureMsgf(IsInsertPkI32(), TEXT("Reducer does not hold InsertPkI32!")); + return Data.Get(); + } + + static FReducer InsertPkI64(const FInsertPkI64Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertPkI64; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_pk_i64"); + return Out; + } + + FORCEINLINE bool IsInsertPkI64() const { return Tag == EReducerTag::InsertPkI64; } + FORCEINLINE FInsertPkI64Args GetAsInsertPkI64() const + { + ensureMsgf(IsInsertPkI64(), TEXT("Reducer does not hold InsertPkI64!")); + return Data.Get(); + } + + static FReducer InsertPkI8(const FInsertPkI8Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertPkI8; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_pk_i8"); + return Out; + } + + FORCEINLINE bool IsInsertPkI8() const { return Tag == EReducerTag::InsertPkI8; } + FORCEINLINE FInsertPkI8Args GetAsInsertPkI8() const + { + ensureMsgf(IsInsertPkI8(), TEXT("Reducer does not hold InsertPkI8!")); + return Data.Get(); + } + + static FReducer InsertPkIdentity(const FInsertPkIdentityArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertPkIdentity; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_pk_identity"); + return Out; + } + + FORCEINLINE bool IsInsertPkIdentity() const { return Tag == EReducerTag::InsertPkIdentity; } + FORCEINLINE FInsertPkIdentityArgs GetAsInsertPkIdentity() const + { + ensureMsgf(IsInsertPkIdentity(), TEXT("Reducer does not hold InsertPkIdentity!")); + return Data.Get(); + } + + static FReducer InsertPkSimpleEnum(const FInsertPkSimpleEnumArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertPkSimpleEnum; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_pk_simple_enum"); + return Out; + } + + FORCEINLINE bool IsInsertPkSimpleEnum() const { return Tag == EReducerTag::InsertPkSimpleEnum; } + FORCEINLINE FInsertPkSimpleEnumArgs GetAsInsertPkSimpleEnum() const + { + ensureMsgf(IsInsertPkSimpleEnum(), TEXT("Reducer does not hold InsertPkSimpleEnum!")); + return Data.Get(); + } + + static FReducer InsertPkString(const FInsertPkStringArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertPkString; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_pk_string"); + return Out; + } + + FORCEINLINE bool IsInsertPkString() const { return Tag == EReducerTag::InsertPkString; } + FORCEINLINE FInsertPkStringArgs GetAsInsertPkString() const + { + ensureMsgf(IsInsertPkString(), TEXT("Reducer does not hold InsertPkString!")); + return Data.Get(); + } + + static FReducer InsertPkU128(const FInsertPkU128Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertPkU128; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_pk_u128"); + return Out; + } + + FORCEINLINE bool IsInsertPkU128() const { return Tag == EReducerTag::InsertPkU128; } + FORCEINLINE FInsertPkU128Args GetAsInsertPkU128() const + { + ensureMsgf(IsInsertPkU128(), TEXT("Reducer does not hold InsertPkU128!")); + return Data.Get(); + } + + static FReducer InsertPkU16(const FInsertPkU16Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertPkU16; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_pk_u16"); + return Out; + } + + FORCEINLINE bool IsInsertPkU16() const { return Tag == EReducerTag::InsertPkU16; } + FORCEINLINE FInsertPkU16Args GetAsInsertPkU16() const + { + ensureMsgf(IsInsertPkU16(), TEXT("Reducer does not hold InsertPkU16!")); + return Data.Get(); + } + + static FReducer InsertPkU256(const FInsertPkU256Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertPkU256; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_pk_u256"); + return Out; + } + + FORCEINLINE bool IsInsertPkU256() const { return Tag == EReducerTag::InsertPkU256; } + FORCEINLINE FInsertPkU256Args GetAsInsertPkU256() const + { + ensureMsgf(IsInsertPkU256(), TEXT("Reducer does not hold InsertPkU256!")); + return Data.Get(); + } + + static FReducer InsertPkU32(const FInsertPkU32Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertPkU32; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_pk_u32"); + return Out; + } + + FORCEINLINE bool IsInsertPkU32() const { return Tag == EReducerTag::InsertPkU32; } + FORCEINLINE FInsertPkU32Args GetAsInsertPkU32() const + { + ensureMsgf(IsInsertPkU32(), TEXT("Reducer does not hold InsertPkU32!")); + return Data.Get(); + } + + static FReducer InsertPkU32Two(const FInsertPkU32TwoArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertPkU32Two; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_pk_u32_two"); + return Out; + } + + FORCEINLINE bool IsInsertPkU32Two() const { return Tag == EReducerTag::InsertPkU32Two; } + FORCEINLINE FInsertPkU32TwoArgs GetAsInsertPkU32Two() const + { + ensureMsgf(IsInsertPkU32Two(), TEXT("Reducer does not hold InsertPkU32Two!")); + return Data.Get(); + } + + static FReducer InsertPkU64(const FInsertPkU64Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertPkU64; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_pk_u64"); + return Out; + } + + FORCEINLINE bool IsInsertPkU64() const { return Tag == EReducerTag::InsertPkU64; } + FORCEINLINE FInsertPkU64Args GetAsInsertPkU64() const + { + ensureMsgf(IsInsertPkU64(), TEXT("Reducer does not hold InsertPkU64!")); + return Data.Get(); + } + + static FReducer InsertPkU8(const FInsertPkU8Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertPkU8; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_pk_u8"); + return Out; + } + + FORCEINLINE bool IsInsertPkU8() const { return Tag == EReducerTag::InsertPkU8; } + FORCEINLINE FInsertPkU8Args GetAsInsertPkU8() const + { + ensureMsgf(IsInsertPkU8(), TEXT("Reducer does not hold InsertPkU8!")); + return Data.Get(); + } + + static FReducer InsertPrimitivesAsStrings(const FInsertPrimitivesAsStringsArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertPrimitivesAsStrings; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_primitives_as_strings"); + return Out; + } + + FORCEINLINE bool IsInsertPrimitivesAsStrings() const { return Tag == EReducerTag::InsertPrimitivesAsStrings; } + FORCEINLINE FInsertPrimitivesAsStringsArgs GetAsInsertPrimitivesAsStrings() const + { + ensureMsgf(IsInsertPrimitivesAsStrings(), TEXT("Reducer does not hold InsertPrimitivesAsStrings!")); + return Data.Get(); + } + + static FReducer InsertTableHoldsTable(const FInsertTableHoldsTableArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertTableHoldsTable; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_table_holds_table"); + return Out; + } + + FORCEINLINE bool IsInsertTableHoldsTable() const { return Tag == EReducerTag::InsertTableHoldsTable; } + FORCEINLINE FInsertTableHoldsTableArgs GetAsInsertTableHoldsTable() const + { + ensureMsgf(IsInsertTableHoldsTable(), TEXT("Reducer does not hold InsertTableHoldsTable!")); + return Data.Get(); + } + + static FReducer InsertUniqueBool(const FInsertUniqueBoolArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertUniqueBool; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_unique_bool"); + return Out; + } + + FORCEINLINE bool IsInsertUniqueBool() const { return Tag == EReducerTag::InsertUniqueBool; } + FORCEINLINE FInsertUniqueBoolArgs GetAsInsertUniqueBool() const + { + ensureMsgf(IsInsertUniqueBool(), TEXT("Reducer does not hold InsertUniqueBool!")); + return Data.Get(); + } + + static FReducer InsertUniqueConnectionId(const FInsertUniqueConnectionIdArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertUniqueConnectionId; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_unique_connection_id"); + return Out; + } + + FORCEINLINE bool IsInsertUniqueConnectionId() const { return Tag == EReducerTag::InsertUniqueConnectionId; } + FORCEINLINE FInsertUniqueConnectionIdArgs GetAsInsertUniqueConnectionId() const + { + ensureMsgf(IsInsertUniqueConnectionId(), TEXT("Reducer does not hold InsertUniqueConnectionId!")); + return Data.Get(); + } + + static FReducer InsertUniqueI128(const FInsertUniqueI128Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertUniqueI128; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_unique_i128"); + return Out; + } + + FORCEINLINE bool IsInsertUniqueI128() const { return Tag == EReducerTag::InsertUniqueI128; } + FORCEINLINE FInsertUniqueI128Args GetAsInsertUniqueI128() const + { + ensureMsgf(IsInsertUniqueI128(), TEXT("Reducer does not hold InsertUniqueI128!")); + return Data.Get(); + } + + static FReducer InsertUniqueI16(const FInsertUniqueI16Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertUniqueI16; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_unique_i16"); + return Out; + } + + FORCEINLINE bool IsInsertUniqueI16() const { return Tag == EReducerTag::InsertUniqueI16; } + FORCEINLINE FInsertUniqueI16Args GetAsInsertUniqueI16() const + { + ensureMsgf(IsInsertUniqueI16(), TEXT("Reducer does not hold InsertUniqueI16!")); + return Data.Get(); + } + + static FReducer InsertUniqueI256(const FInsertUniqueI256Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertUniqueI256; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_unique_i256"); + return Out; + } + + FORCEINLINE bool IsInsertUniqueI256() const { return Tag == EReducerTag::InsertUniqueI256; } + FORCEINLINE FInsertUniqueI256Args GetAsInsertUniqueI256() const + { + ensureMsgf(IsInsertUniqueI256(), TEXT("Reducer does not hold InsertUniqueI256!")); + return Data.Get(); + } + + static FReducer InsertUniqueI32(const FInsertUniqueI32Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertUniqueI32; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_unique_i32"); + return Out; + } + + FORCEINLINE bool IsInsertUniqueI32() const { return Tag == EReducerTag::InsertUniqueI32; } + FORCEINLINE FInsertUniqueI32Args GetAsInsertUniqueI32() const + { + ensureMsgf(IsInsertUniqueI32(), TEXT("Reducer does not hold InsertUniqueI32!")); + return Data.Get(); + } + + static FReducer InsertUniqueI64(const FInsertUniqueI64Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertUniqueI64; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_unique_i64"); + return Out; + } + + FORCEINLINE bool IsInsertUniqueI64() const { return Tag == EReducerTag::InsertUniqueI64; } + FORCEINLINE FInsertUniqueI64Args GetAsInsertUniqueI64() const + { + ensureMsgf(IsInsertUniqueI64(), TEXT("Reducer does not hold InsertUniqueI64!")); + return Data.Get(); + } + + static FReducer InsertUniqueI8(const FInsertUniqueI8Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertUniqueI8; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_unique_i8"); + return Out; + } + + FORCEINLINE bool IsInsertUniqueI8() const { return Tag == EReducerTag::InsertUniqueI8; } + FORCEINLINE FInsertUniqueI8Args GetAsInsertUniqueI8() const + { + ensureMsgf(IsInsertUniqueI8(), TEXT("Reducer does not hold InsertUniqueI8!")); + return Data.Get(); + } + + static FReducer InsertUniqueIdentity(const FInsertUniqueIdentityArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertUniqueIdentity; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_unique_identity"); + return Out; + } + + FORCEINLINE bool IsInsertUniqueIdentity() const { return Tag == EReducerTag::InsertUniqueIdentity; } + FORCEINLINE FInsertUniqueIdentityArgs GetAsInsertUniqueIdentity() const + { + ensureMsgf(IsInsertUniqueIdentity(), TEXT("Reducer does not hold InsertUniqueIdentity!")); + return Data.Get(); + } + + static FReducer InsertUniqueString(const FInsertUniqueStringArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertUniqueString; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_unique_string"); + return Out; + } + + FORCEINLINE bool IsInsertUniqueString() const { return Tag == EReducerTag::InsertUniqueString; } + FORCEINLINE FInsertUniqueStringArgs GetAsInsertUniqueString() const + { + ensureMsgf(IsInsertUniqueString(), TEXT("Reducer does not hold InsertUniqueString!")); + return Data.Get(); + } + + static FReducer InsertUniqueU128(const FInsertUniqueU128Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertUniqueU128; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_unique_u128"); + return Out; + } + + FORCEINLINE bool IsInsertUniqueU128() const { return Tag == EReducerTag::InsertUniqueU128; } + FORCEINLINE FInsertUniqueU128Args GetAsInsertUniqueU128() const + { + ensureMsgf(IsInsertUniqueU128(), TEXT("Reducer does not hold InsertUniqueU128!")); + return Data.Get(); + } + + static FReducer InsertUniqueU16(const FInsertUniqueU16Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertUniqueU16; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_unique_u16"); + return Out; + } + + FORCEINLINE bool IsInsertUniqueU16() const { return Tag == EReducerTag::InsertUniqueU16; } + FORCEINLINE FInsertUniqueU16Args GetAsInsertUniqueU16() const + { + ensureMsgf(IsInsertUniqueU16(), TEXT("Reducer does not hold InsertUniqueU16!")); + return Data.Get(); + } + + static FReducer InsertUniqueU256(const FInsertUniqueU256Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertUniqueU256; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_unique_u256"); + return Out; + } + + FORCEINLINE bool IsInsertUniqueU256() const { return Tag == EReducerTag::InsertUniqueU256; } + FORCEINLINE FInsertUniqueU256Args GetAsInsertUniqueU256() const + { + ensureMsgf(IsInsertUniqueU256(), TEXT("Reducer does not hold InsertUniqueU256!")); + return Data.Get(); + } + + static FReducer InsertUniqueU32(const FInsertUniqueU32Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertUniqueU32; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_unique_u32"); + return Out; + } + + FORCEINLINE bool IsInsertUniqueU32() const { return Tag == EReducerTag::InsertUniqueU32; } + FORCEINLINE FInsertUniqueU32Args GetAsInsertUniqueU32() const + { + ensureMsgf(IsInsertUniqueU32(), TEXT("Reducer does not hold InsertUniqueU32!")); + return Data.Get(); + } + + static FReducer InsertUniqueU32UpdatePkU32(const FInsertUniqueU32UpdatePkU32Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertUniqueU32UpdatePkU32; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_unique_u32_update_pk_u32"); + return Out; + } + + FORCEINLINE bool IsInsertUniqueU32UpdatePkU32() const { return Tag == EReducerTag::InsertUniqueU32UpdatePkU32; } + FORCEINLINE FInsertUniqueU32UpdatePkU32Args GetAsInsertUniqueU32UpdatePkU32() const + { + ensureMsgf(IsInsertUniqueU32UpdatePkU32(), TEXT("Reducer does not hold InsertUniqueU32UpdatePkU32!")); + return Data.Get(); + } + + static FReducer InsertUniqueU64(const FInsertUniqueU64Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertUniqueU64; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_unique_u64"); + return Out; + } + + FORCEINLINE bool IsInsertUniqueU64() const { return Tag == EReducerTag::InsertUniqueU64; } + FORCEINLINE FInsertUniqueU64Args GetAsInsertUniqueU64() const + { + ensureMsgf(IsInsertUniqueU64(), TEXT("Reducer does not hold InsertUniqueU64!")); + return Data.Get(); + } + + static FReducer InsertUniqueU8(const FInsertUniqueU8Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertUniqueU8; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_unique_u8"); + return Out; + } + + FORCEINLINE bool IsInsertUniqueU8() const { return Tag == EReducerTag::InsertUniqueU8; } + FORCEINLINE FInsertUniqueU8Args GetAsInsertUniqueU8() const + { + ensureMsgf(IsInsertUniqueU8(), TEXT("Reducer does not hold InsertUniqueU8!")); + return Data.Get(); + } + + static FReducer InsertUser(const FInsertUserArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertUser; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_user"); + return Out; + } + + FORCEINLINE bool IsInsertUser() const { return Tag == EReducerTag::InsertUser; } + FORCEINLINE FInsertUserArgs GetAsInsertUser() const + { + ensureMsgf(IsInsertUser(), TEXT("Reducer does not hold InsertUser!")); + return Data.Get(); + } + + static FReducer InsertVecBool(const FInsertVecBoolArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertVecBool; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_vec_bool"); + return Out; + } + + FORCEINLINE bool IsInsertVecBool() const { return Tag == EReducerTag::InsertVecBool; } + FORCEINLINE FInsertVecBoolArgs GetAsInsertVecBool() const + { + ensureMsgf(IsInsertVecBool(), TEXT("Reducer does not hold InsertVecBool!")); + return Data.Get(); + } + + static FReducer InsertVecByteStruct(const FInsertVecByteStructArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertVecByteStruct; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_vec_byte_struct"); + return Out; + } + + FORCEINLINE bool IsInsertVecByteStruct() const { return Tag == EReducerTag::InsertVecByteStruct; } + FORCEINLINE FInsertVecByteStructArgs GetAsInsertVecByteStruct() const + { + ensureMsgf(IsInsertVecByteStruct(), TEXT("Reducer does not hold InsertVecByteStruct!")); + return Data.Get(); + } + + static FReducer InsertVecConnectionId(const FInsertVecConnectionIdArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertVecConnectionId; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_vec_connection_id"); + return Out; + } + + FORCEINLINE bool IsInsertVecConnectionId() const { return Tag == EReducerTag::InsertVecConnectionId; } + FORCEINLINE FInsertVecConnectionIdArgs GetAsInsertVecConnectionId() const + { + ensureMsgf(IsInsertVecConnectionId(), TEXT("Reducer does not hold InsertVecConnectionId!")); + return Data.Get(); + } + + static FReducer InsertVecEnumWithPayload(const FInsertVecEnumWithPayloadArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertVecEnumWithPayload; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_vec_enum_with_payload"); + return Out; + } + + FORCEINLINE bool IsInsertVecEnumWithPayload() const { return Tag == EReducerTag::InsertVecEnumWithPayload; } + FORCEINLINE FInsertVecEnumWithPayloadArgs GetAsInsertVecEnumWithPayload() const + { + ensureMsgf(IsInsertVecEnumWithPayload(), TEXT("Reducer does not hold InsertVecEnumWithPayload!")); + return Data.Get(); + } + + static FReducer InsertVecEveryPrimitiveStruct(const FInsertVecEveryPrimitiveStructArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertVecEveryPrimitiveStruct; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_vec_every_primitive_struct"); + return Out; + } + + FORCEINLINE bool IsInsertVecEveryPrimitiveStruct() const { return Tag == EReducerTag::InsertVecEveryPrimitiveStruct; } + FORCEINLINE FInsertVecEveryPrimitiveStructArgs GetAsInsertVecEveryPrimitiveStruct() const + { + ensureMsgf(IsInsertVecEveryPrimitiveStruct(), TEXT("Reducer does not hold InsertVecEveryPrimitiveStruct!")); + return Data.Get(); + } + + static FReducer InsertVecEveryVecStruct(const FInsertVecEveryVecStructArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertVecEveryVecStruct; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_vec_every_vec_struct"); + return Out; + } + + FORCEINLINE bool IsInsertVecEveryVecStruct() const { return Tag == EReducerTag::InsertVecEveryVecStruct; } + FORCEINLINE FInsertVecEveryVecStructArgs GetAsInsertVecEveryVecStruct() const + { + ensureMsgf(IsInsertVecEveryVecStruct(), TEXT("Reducer does not hold InsertVecEveryVecStruct!")); + return Data.Get(); + } + + static FReducer InsertVecF32(const FInsertVecF32Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertVecF32; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_vec_f32"); + return Out; + } + + FORCEINLINE bool IsInsertVecF32() const { return Tag == EReducerTag::InsertVecF32; } + FORCEINLINE FInsertVecF32Args GetAsInsertVecF32() const + { + ensureMsgf(IsInsertVecF32(), TEXT("Reducer does not hold InsertVecF32!")); + return Data.Get(); + } + + static FReducer InsertVecF64(const FInsertVecF64Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertVecF64; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_vec_f64"); + return Out; + } + + FORCEINLINE bool IsInsertVecF64() const { return Tag == EReducerTag::InsertVecF64; } + FORCEINLINE FInsertVecF64Args GetAsInsertVecF64() const + { + ensureMsgf(IsInsertVecF64(), TEXT("Reducer does not hold InsertVecF64!")); + return Data.Get(); + } + + static FReducer InsertVecI128(const FInsertVecI128Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertVecI128; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_vec_i128"); + return Out; + } + + FORCEINLINE bool IsInsertVecI128() const { return Tag == EReducerTag::InsertVecI128; } + FORCEINLINE FInsertVecI128Args GetAsInsertVecI128() const + { + ensureMsgf(IsInsertVecI128(), TEXT("Reducer does not hold InsertVecI128!")); + return Data.Get(); + } + + static FReducer InsertVecI16(const FInsertVecI16Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertVecI16; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_vec_i16"); + return Out; + } + + FORCEINLINE bool IsInsertVecI16() const { return Tag == EReducerTag::InsertVecI16; } + FORCEINLINE FInsertVecI16Args GetAsInsertVecI16() const + { + ensureMsgf(IsInsertVecI16(), TEXT("Reducer does not hold InsertVecI16!")); + return Data.Get(); + } + + static FReducer InsertVecI256(const FInsertVecI256Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertVecI256; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_vec_i256"); + return Out; + } + + FORCEINLINE bool IsInsertVecI256() const { return Tag == EReducerTag::InsertVecI256; } + FORCEINLINE FInsertVecI256Args GetAsInsertVecI256() const + { + ensureMsgf(IsInsertVecI256(), TEXT("Reducer does not hold InsertVecI256!")); + return Data.Get(); + } + + static FReducer InsertVecI32(const FInsertVecI32Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertVecI32; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_vec_i32"); + return Out; + } + + FORCEINLINE bool IsInsertVecI32() const { return Tag == EReducerTag::InsertVecI32; } + FORCEINLINE FInsertVecI32Args GetAsInsertVecI32() const + { + ensureMsgf(IsInsertVecI32(), TEXT("Reducer does not hold InsertVecI32!")); + return Data.Get(); + } + + static FReducer InsertVecI64(const FInsertVecI64Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertVecI64; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_vec_i64"); + return Out; + } + + FORCEINLINE bool IsInsertVecI64() const { return Tag == EReducerTag::InsertVecI64; } + FORCEINLINE FInsertVecI64Args GetAsInsertVecI64() const + { + ensureMsgf(IsInsertVecI64(), TEXT("Reducer does not hold InsertVecI64!")); + return Data.Get(); + } + + static FReducer InsertVecI8(const FInsertVecI8Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertVecI8; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_vec_i8"); + return Out; + } + + FORCEINLINE bool IsInsertVecI8() const { return Tag == EReducerTag::InsertVecI8; } + FORCEINLINE FInsertVecI8Args GetAsInsertVecI8() const + { + ensureMsgf(IsInsertVecI8(), TEXT("Reducer does not hold InsertVecI8!")); + return Data.Get(); + } + + static FReducer InsertVecIdentity(const FInsertVecIdentityArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertVecIdentity; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_vec_identity"); + return Out; + } + + FORCEINLINE bool IsInsertVecIdentity() const { return Tag == EReducerTag::InsertVecIdentity; } + FORCEINLINE FInsertVecIdentityArgs GetAsInsertVecIdentity() const + { + ensureMsgf(IsInsertVecIdentity(), TEXT("Reducer does not hold InsertVecIdentity!")); + return Data.Get(); + } + + static FReducer InsertVecSimpleEnum(const FInsertVecSimpleEnumArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertVecSimpleEnum; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_vec_simple_enum"); + return Out; + } + + FORCEINLINE bool IsInsertVecSimpleEnum() const { return Tag == EReducerTag::InsertVecSimpleEnum; } + FORCEINLINE FInsertVecSimpleEnumArgs GetAsInsertVecSimpleEnum() const + { + ensureMsgf(IsInsertVecSimpleEnum(), TEXT("Reducer does not hold InsertVecSimpleEnum!")); + return Data.Get(); + } + + static FReducer InsertVecString(const FInsertVecStringArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertVecString; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_vec_string"); + return Out; + } + + FORCEINLINE bool IsInsertVecString() const { return Tag == EReducerTag::InsertVecString; } + FORCEINLINE FInsertVecStringArgs GetAsInsertVecString() const + { + ensureMsgf(IsInsertVecString(), TEXT("Reducer does not hold InsertVecString!")); + return Data.Get(); + } + + static FReducer InsertVecTimestamp(const FInsertVecTimestampArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertVecTimestamp; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_vec_timestamp"); + return Out; + } + + FORCEINLINE bool IsInsertVecTimestamp() const { return Tag == EReducerTag::InsertVecTimestamp; } + FORCEINLINE FInsertVecTimestampArgs GetAsInsertVecTimestamp() const + { + ensureMsgf(IsInsertVecTimestamp(), TEXT("Reducer does not hold InsertVecTimestamp!")); + return Data.Get(); + } + + static FReducer InsertVecU128(const FInsertVecU128Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertVecU128; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_vec_u128"); + return Out; + } + + FORCEINLINE bool IsInsertVecU128() const { return Tag == EReducerTag::InsertVecU128; } + FORCEINLINE FInsertVecU128Args GetAsInsertVecU128() const + { + ensureMsgf(IsInsertVecU128(), TEXT("Reducer does not hold InsertVecU128!")); + return Data.Get(); + } + + static FReducer InsertVecU16(const FInsertVecU16Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertVecU16; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_vec_u16"); + return Out; + } + + FORCEINLINE bool IsInsertVecU16() const { return Tag == EReducerTag::InsertVecU16; } + FORCEINLINE FInsertVecU16Args GetAsInsertVecU16() const + { + ensureMsgf(IsInsertVecU16(), TEXT("Reducer does not hold InsertVecU16!")); + return Data.Get(); + } + + static FReducer InsertVecU256(const FInsertVecU256Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertVecU256; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_vec_u256"); + return Out; + } + + FORCEINLINE bool IsInsertVecU256() const { return Tag == EReducerTag::InsertVecU256; } + FORCEINLINE FInsertVecU256Args GetAsInsertVecU256() const + { + ensureMsgf(IsInsertVecU256(), TEXT("Reducer does not hold InsertVecU256!")); + return Data.Get(); + } + + static FReducer InsertVecU32(const FInsertVecU32Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertVecU32; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_vec_u32"); + return Out; + } + + FORCEINLINE bool IsInsertVecU32() const { return Tag == EReducerTag::InsertVecU32; } + FORCEINLINE FInsertVecU32Args GetAsInsertVecU32() const + { + ensureMsgf(IsInsertVecU32(), TEXT("Reducer does not hold InsertVecU32!")); + return Data.Get(); + } + + static FReducer InsertVecU64(const FInsertVecU64Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertVecU64; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_vec_u64"); + return Out; + } + + FORCEINLINE bool IsInsertVecU64() const { return Tag == EReducerTag::InsertVecU64; } + FORCEINLINE FInsertVecU64Args GetAsInsertVecU64() const + { + ensureMsgf(IsInsertVecU64(), TEXT("Reducer does not hold InsertVecU64!")); + return Data.Get(); + } + + static FReducer InsertVecU8(const FInsertVecU8Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertVecU8; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_vec_u8"); + return Out; + } + + FORCEINLINE bool IsInsertVecU8() const { return Tag == EReducerTag::InsertVecU8; } + FORCEINLINE FInsertVecU8Args GetAsInsertVecU8() const + { + ensureMsgf(IsInsertVecU8(), TEXT("Reducer does not hold InsertVecU8!")); + return Data.Get(); + } + + static FReducer InsertVecUnitStruct(const FInsertVecUnitStructArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::InsertVecUnitStruct; + Out.Data.Set(Value); + Out.ReducerName = TEXT("insert_vec_unit_struct"); + return Out; + } + + FORCEINLINE bool IsInsertVecUnitStruct() const { return Tag == EReducerTag::InsertVecUnitStruct; } + FORCEINLINE FInsertVecUnitStructArgs GetAsInsertVecUnitStruct() const + { + ensureMsgf(IsInsertVecUnitStruct(), TEXT("Reducer does not hold InsertVecUnitStruct!")); + return Data.Get(); + } + + static FReducer NoOpSucceeds(const FNoOpSucceedsArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::NoOpSucceeds; + Out.Data.Set(Value); + Out.ReducerName = TEXT("no_op_succeeds"); + return Out; + } + + FORCEINLINE bool IsNoOpSucceeds() const { return Tag == EReducerTag::NoOpSucceeds; } + FORCEINLINE FNoOpSucceedsArgs GetAsNoOpSucceeds() const + { + ensureMsgf(IsNoOpSucceeds(), TEXT("Reducer does not hold NoOpSucceeds!")); + return Data.Get(); + } + + static FReducer SendScheduledMessage(const FSendScheduledMessageArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::SendScheduledMessage; + Out.Data.Set(Value); + Out.ReducerName = TEXT("send_scheduled_message"); + return Out; + } + + FORCEINLINE bool IsSendScheduledMessage() const { return Tag == EReducerTag::SendScheduledMessage; } + FORCEINLINE FSendScheduledMessageArgs GetAsSendScheduledMessage() const + { + ensureMsgf(IsSendScheduledMessage(), TEXT("Reducer does not hold SendScheduledMessage!")); + return Data.Get(); + } + + static FReducer UpdateIndexedSimpleEnum(const FUpdateIndexedSimpleEnumArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::UpdateIndexedSimpleEnum; + Out.Data.Set(Value); + Out.ReducerName = TEXT("update_indexed_simple_enum"); + return Out; + } + + FORCEINLINE bool IsUpdateIndexedSimpleEnum() const { return Tag == EReducerTag::UpdateIndexedSimpleEnum; } + FORCEINLINE FUpdateIndexedSimpleEnumArgs GetAsUpdateIndexedSimpleEnum() const + { + ensureMsgf(IsUpdateIndexedSimpleEnum(), TEXT("Reducer does not hold UpdateIndexedSimpleEnum!")); + return Data.Get(); + } + + static FReducer UpdatePkBool(const FUpdatePkBoolArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::UpdatePkBool; + Out.Data.Set(Value); + Out.ReducerName = TEXT("update_pk_bool"); + return Out; + } + + FORCEINLINE bool IsUpdatePkBool() const { return Tag == EReducerTag::UpdatePkBool; } + FORCEINLINE FUpdatePkBoolArgs GetAsUpdatePkBool() const + { + ensureMsgf(IsUpdatePkBool(), TEXT("Reducer does not hold UpdatePkBool!")); + return Data.Get(); + } + + static FReducer UpdatePkConnectionId(const FUpdatePkConnectionIdArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::UpdatePkConnectionId; + Out.Data.Set(Value); + Out.ReducerName = TEXT("update_pk_connection_id"); + return Out; + } + + FORCEINLINE bool IsUpdatePkConnectionId() const { return Tag == EReducerTag::UpdatePkConnectionId; } + FORCEINLINE FUpdatePkConnectionIdArgs GetAsUpdatePkConnectionId() const + { + ensureMsgf(IsUpdatePkConnectionId(), TEXT("Reducer does not hold UpdatePkConnectionId!")); + return Data.Get(); + } + + static FReducer UpdatePkI128(const FUpdatePkI128Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::UpdatePkI128; + Out.Data.Set(Value); + Out.ReducerName = TEXT("update_pk_i128"); + return Out; + } + + FORCEINLINE bool IsUpdatePkI128() const { return Tag == EReducerTag::UpdatePkI128; } + FORCEINLINE FUpdatePkI128Args GetAsUpdatePkI128() const + { + ensureMsgf(IsUpdatePkI128(), TEXT("Reducer does not hold UpdatePkI128!")); + return Data.Get(); + } + + static FReducer UpdatePkI16(const FUpdatePkI16Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::UpdatePkI16; + Out.Data.Set(Value); + Out.ReducerName = TEXT("update_pk_i16"); + return Out; + } + + FORCEINLINE bool IsUpdatePkI16() const { return Tag == EReducerTag::UpdatePkI16; } + FORCEINLINE FUpdatePkI16Args GetAsUpdatePkI16() const + { + ensureMsgf(IsUpdatePkI16(), TEXT("Reducer does not hold UpdatePkI16!")); + return Data.Get(); + } + + static FReducer UpdatePkI256(const FUpdatePkI256Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::UpdatePkI256; + Out.Data.Set(Value); + Out.ReducerName = TEXT("update_pk_i256"); + return Out; + } + + FORCEINLINE bool IsUpdatePkI256() const { return Tag == EReducerTag::UpdatePkI256; } + FORCEINLINE FUpdatePkI256Args GetAsUpdatePkI256() const + { + ensureMsgf(IsUpdatePkI256(), TEXT("Reducer does not hold UpdatePkI256!")); + return Data.Get(); + } + + static FReducer UpdatePkI32(const FUpdatePkI32Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::UpdatePkI32; + Out.Data.Set(Value); + Out.ReducerName = TEXT("update_pk_i32"); + return Out; + } + + FORCEINLINE bool IsUpdatePkI32() const { return Tag == EReducerTag::UpdatePkI32; } + FORCEINLINE FUpdatePkI32Args GetAsUpdatePkI32() const + { + ensureMsgf(IsUpdatePkI32(), TEXT("Reducer does not hold UpdatePkI32!")); + return Data.Get(); + } + + static FReducer UpdatePkI64(const FUpdatePkI64Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::UpdatePkI64; + Out.Data.Set(Value); + Out.ReducerName = TEXT("update_pk_i64"); + return Out; + } + + FORCEINLINE bool IsUpdatePkI64() const { return Tag == EReducerTag::UpdatePkI64; } + FORCEINLINE FUpdatePkI64Args GetAsUpdatePkI64() const + { + ensureMsgf(IsUpdatePkI64(), TEXT("Reducer does not hold UpdatePkI64!")); + return Data.Get(); + } + + static FReducer UpdatePkI8(const FUpdatePkI8Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::UpdatePkI8; + Out.Data.Set(Value); + Out.ReducerName = TEXT("update_pk_i8"); + return Out; + } + + FORCEINLINE bool IsUpdatePkI8() const { return Tag == EReducerTag::UpdatePkI8; } + FORCEINLINE FUpdatePkI8Args GetAsUpdatePkI8() const + { + ensureMsgf(IsUpdatePkI8(), TEXT("Reducer does not hold UpdatePkI8!")); + return Data.Get(); + } + + static FReducer UpdatePkIdentity(const FUpdatePkIdentityArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::UpdatePkIdentity; + Out.Data.Set(Value); + Out.ReducerName = TEXT("update_pk_identity"); + return Out; + } + + FORCEINLINE bool IsUpdatePkIdentity() const { return Tag == EReducerTag::UpdatePkIdentity; } + FORCEINLINE FUpdatePkIdentityArgs GetAsUpdatePkIdentity() const + { + ensureMsgf(IsUpdatePkIdentity(), TEXT("Reducer does not hold UpdatePkIdentity!")); + return Data.Get(); + } + + static FReducer UpdatePkSimpleEnum(const FUpdatePkSimpleEnumArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::UpdatePkSimpleEnum; + Out.Data.Set(Value); + Out.ReducerName = TEXT("update_pk_simple_enum"); + return Out; + } + + FORCEINLINE bool IsUpdatePkSimpleEnum() const { return Tag == EReducerTag::UpdatePkSimpleEnum; } + FORCEINLINE FUpdatePkSimpleEnumArgs GetAsUpdatePkSimpleEnum() const + { + ensureMsgf(IsUpdatePkSimpleEnum(), TEXT("Reducer does not hold UpdatePkSimpleEnum!")); + return Data.Get(); + } + + static FReducer UpdatePkString(const FUpdatePkStringArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::UpdatePkString; + Out.Data.Set(Value); + Out.ReducerName = TEXT("update_pk_string"); + return Out; + } + + FORCEINLINE bool IsUpdatePkString() const { return Tag == EReducerTag::UpdatePkString; } + FORCEINLINE FUpdatePkStringArgs GetAsUpdatePkString() const + { + ensureMsgf(IsUpdatePkString(), TEXT("Reducer does not hold UpdatePkString!")); + return Data.Get(); + } + + static FReducer UpdatePkU128(const FUpdatePkU128Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::UpdatePkU128; + Out.Data.Set(Value); + Out.ReducerName = TEXT("update_pk_u128"); + return Out; + } + + FORCEINLINE bool IsUpdatePkU128() const { return Tag == EReducerTag::UpdatePkU128; } + FORCEINLINE FUpdatePkU128Args GetAsUpdatePkU128() const + { + ensureMsgf(IsUpdatePkU128(), TEXT("Reducer does not hold UpdatePkU128!")); + return Data.Get(); + } + + static FReducer UpdatePkU16(const FUpdatePkU16Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::UpdatePkU16; + Out.Data.Set(Value); + Out.ReducerName = TEXT("update_pk_u16"); + return Out; + } + + FORCEINLINE bool IsUpdatePkU16() const { return Tag == EReducerTag::UpdatePkU16; } + FORCEINLINE FUpdatePkU16Args GetAsUpdatePkU16() const + { + ensureMsgf(IsUpdatePkU16(), TEXT("Reducer does not hold UpdatePkU16!")); + return Data.Get(); + } + + static FReducer UpdatePkU256(const FUpdatePkU256Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::UpdatePkU256; + Out.Data.Set(Value); + Out.ReducerName = TEXT("update_pk_u256"); + return Out; + } + + FORCEINLINE bool IsUpdatePkU256() const { return Tag == EReducerTag::UpdatePkU256; } + FORCEINLINE FUpdatePkU256Args GetAsUpdatePkU256() const + { + ensureMsgf(IsUpdatePkU256(), TEXT("Reducer does not hold UpdatePkU256!")); + return Data.Get(); + } + + static FReducer UpdatePkU32(const FUpdatePkU32Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::UpdatePkU32; + Out.Data.Set(Value); + Out.ReducerName = TEXT("update_pk_u32"); + return Out; + } + + FORCEINLINE bool IsUpdatePkU32() const { return Tag == EReducerTag::UpdatePkU32; } + FORCEINLINE FUpdatePkU32Args GetAsUpdatePkU32() const + { + ensureMsgf(IsUpdatePkU32(), TEXT("Reducer does not hold UpdatePkU32!")); + return Data.Get(); + } + + static FReducer UpdatePkU32Two(const FUpdatePkU32TwoArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::UpdatePkU32Two; + Out.Data.Set(Value); + Out.ReducerName = TEXT("update_pk_u32_two"); + return Out; + } + + FORCEINLINE bool IsUpdatePkU32Two() const { return Tag == EReducerTag::UpdatePkU32Two; } + FORCEINLINE FUpdatePkU32TwoArgs GetAsUpdatePkU32Two() const + { + ensureMsgf(IsUpdatePkU32Two(), TEXT("Reducer does not hold UpdatePkU32Two!")); + return Data.Get(); + } + + static FReducer UpdatePkU64(const FUpdatePkU64Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::UpdatePkU64; + Out.Data.Set(Value); + Out.ReducerName = TEXT("update_pk_u64"); + return Out; + } + + FORCEINLINE bool IsUpdatePkU64() const { return Tag == EReducerTag::UpdatePkU64; } + FORCEINLINE FUpdatePkU64Args GetAsUpdatePkU64() const + { + ensureMsgf(IsUpdatePkU64(), TEXT("Reducer does not hold UpdatePkU64!")); + return Data.Get(); + } + + static FReducer UpdatePkU8(const FUpdatePkU8Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::UpdatePkU8; + Out.Data.Set(Value); + Out.ReducerName = TEXT("update_pk_u8"); + return Out; + } + + FORCEINLINE bool IsUpdatePkU8() const { return Tag == EReducerTag::UpdatePkU8; } + FORCEINLINE FUpdatePkU8Args GetAsUpdatePkU8() const + { + ensureMsgf(IsUpdatePkU8(), TEXT("Reducer does not hold UpdatePkU8!")); + return Data.Get(); + } + + static FReducer UpdateUniqueBool(const FUpdateUniqueBoolArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::UpdateUniqueBool; + Out.Data.Set(Value); + Out.ReducerName = TEXT("update_unique_bool"); + return Out; + } + + FORCEINLINE bool IsUpdateUniqueBool() const { return Tag == EReducerTag::UpdateUniqueBool; } + FORCEINLINE FUpdateUniqueBoolArgs GetAsUpdateUniqueBool() const + { + ensureMsgf(IsUpdateUniqueBool(), TEXT("Reducer does not hold UpdateUniqueBool!")); + return Data.Get(); + } + + static FReducer UpdateUniqueConnectionId(const FUpdateUniqueConnectionIdArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::UpdateUniqueConnectionId; + Out.Data.Set(Value); + Out.ReducerName = TEXT("update_unique_connection_id"); + return Out; + } + + FORCEINLINE bool IsUpdateUniqueConnectionId() const { return Tag == EReducerTag::UpdateUniqueConnectionId; } + FORCEINLINE FUpdateUniqueConnectionIdArgs GetAsUpdateUniqueConnectionId() const + { + ensureMsgf(IsUpdateUniqueConnectionId(), TEXT("Reducer does not hold UpdateUniqueConnectionId!")); + return Data.Get(); + } + + static FReducer UpdateUniqueI128(const FUpdateUniqueI128Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::UpdateUniqueI128; + Out.Data.Set(Value); + Out.ReducerName = TEXT("update_unique_i128"); + return Out; + } + + FORCEINLINE bool IsUpdateUniqueI128() const { return Tag == EReducerTag::UpdateUniqueI128; } + FORCEINLINE FUpdateUniqueI128Args GetAsUpdateUniqueI128() const + { + ensureMsgf(IsUpdateUniqueI128(), TEXT("Reducer does not hold UpdateUniqueI128!")); + return Data.Get(); + } + + static FReducer UpdateUniqueI16(const FUpdateUniqueI16Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::UpdateUniqueI16; + Out.Data.Set(Value); + Out.ReducerName = TEXT("update_unique_i16"); + return Out; + } + + FORCEINLINE bool IsUpdateUniqueI16() const { return Tag == EReducerTag::UpdateUniqueI16; } + FORCEINLINE FUpdateUniqueI16Args GetAsUpdateUniqueI16() const + { + ensureMsgf(IsUpdateUniqueI16(), TEXT("Reducer does not hold UpdateUniqueI16!")); + return Data.Get(); + } + + static FReducer UpdateUniqueI256(const FUpdateUniqueI256Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::UpdateUniqueI256; + Out.Data.Set(Value); + Out.ReducerName = TEXT("update_unique_i256"); + return Out; + } + + FORCEINLINE bool IsUpdateUniqueI256() const { return Tag == EReducerTag::UpdateUniqueI256; } + FORCEINLINE FUpdateUniqueI256Args GetAsUpdateUniqueI256() const + { + ensureMsgf(IsUpdateUniqueI256(), TEXT("Reducer does not hold UpdateUniqueI256!")); + return Data.Get(); + } + + static FReducer UpdateUniqueI32(const FUpdateUniqueI32Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::UpdateUniqueI32; + Out.Data.Set(Value); + Out.ReducerName = TEXT("update_unique_i32"); + return Out; + } + + FORCEINLINE bool IsUpdateUniqueI32() const { return Tag == EReducerTag::UpdateUniqueI32; } + FORCEINLINE FUpdateUniqueI32Args GetAsUpdateUniqueI32() const + { + ensureMsgf(IsUpdateUniqueI32(), TEXT("Reducer does not hold UpdateUniqueI32!")); + return Data.Get(); + } + + static FReducer UpdateUniqueI64(const FUpdateUniqueI64Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::UpdateUniqueI64; + Out.Data.Set(Value); + Out.ReducerName = TEXT("update_unique_i64"); + return Out; + } + + FORCEINLINE bool IsUpdateUniqueI64() const { return Tag == EReducerTag::UpdateUniqueI64; } + FORCEINLINE FUpdateUniqueI64Args GetAsUpdateUniqueI64() const + { + ensureMsgf(IsUpdateUniqueI64(), TEXT("Reducer does not hold UpdateUniqueI64!")); + return Data.Get(); + } + + static FReducer UpdateUniqueI8(const FUpdateUniqueI8Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::UpdateUniqueI8; + Out.Data.Set(Value); + Out.ReducerName = TEXT("update_unique_i8"); + return Out; + } + + FORCEINLINE bool IsUpdateUniqueI8() const { return Tag == EReducerTag::UpdateUniqueI8; } + FORCEINLINE FUpdateUniqueI8Args GetAsUpdateUniqueI8() const + { + ensureMsgf(IsUpdateUniqueI8(), TEXT("Reducer does not hold UpdateUniqueI8!")); + return Data.Get(); + } + + static FReducer UpdateUniqueIdentity(const FUpdateUniqueIdentityArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::UpdateUniqueIdentity; + Out.Data.Set(Value); + Out.ReducerName = TEXT("update_unique_identity"); + return Out; + } + + FORCEINLINE bool IsUpdateUniqueIdentity() const { return Tag == EReducerTag::UpdateUniqueIdentity; } + FORCEINLINE FUpdateUniqueIdentityArgs GetAsUpdateUniqueIdentity() const + { + ensureMsgf(IsUpdateUniqueIdentity(), TEXT("Reducer does not hold UpdateUniqueIdentity!")); + return Data.Get(); + } + + static FReducer UpdateUniqueString(const FUpdateUniqueStringArgs& Value) + { + FReducer Out; + Out.Tag = EReducerTag::UpdateUniqueString; + Out.Data.Set(Value); + Out.ReducerName = TEXT("update_unique_string"); + return Out; + } + + FORCEINLINE bool IsUpdateUniqueString() const { return Tag == EReducerTag::UpdateUniqueString; } + FORCEINLINE FUpdateUniqueStringArgs GetAsUpdateUniqueString() const + { + ensureMsgf(IsUpdateUniqueString(), TEXT("Reducer does not hold UpdateUniqueString!")); + return Data.Get(); + } + + static FReducer UpdateUniqueU128(const FUpdateUniqueU128Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::UpdateUniqueU128; + Out.Data.Set(Value); + Out.ReducerName = TEXT("update_unique_u128"); + return Out; + } + + FORCEINLINE bool IsUpdateUniqueU128() const { return Tag == EReducerTag::UpdateUniqueU128; } + FORCEINLINE FUpdateUniqueU128Args GetAsUpdateUniqueU128() const + { + ensureMsgf(IsUpdateUniqueU128(), TEXT("Reducer does not hold UpdateUniqueU128!")); + return Data.Get(); + } + + static FReducer UpdateUniqueU16(const FUpdateUniqueU16Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::UpdateUniqueU16; + Out.Data.Set(Value); + Out.ReducerName = TEXT("update_unique_u16"); + return Out; + } + + FORCEINLINE bool IsUpdateUniqueU16() const { return Tag == EReducerTag::UpdateUniqueU16; } + FORCEINLINE FUpdateUniqueU16Args GetAsUpdateUniqueU16() const + { + ensureMsgf(IsUpdateUniqueU16(), TEXT("Reducer does not hold UpdateUniqueU16!")); + return Data.Get(); + } + + static FReducer UpdateUniqueU256(const FUpdateUniqueU256Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::UpdateUniqueU256; + Out.Data.Set(Value); + Out.ReducerName = TEXT("update_unique_u256"); + return Out; + } + + FORCEINLINE bool IsUpdateUniqueU256() const { return Tag == EReducerTag::UpdateUniqueU256; } + FORCEINLINE FUpdateUniqueU256Args GetAsUpdateUniqueU256() const + { + ensureMsgf(IsUpdateUniqueU256(), TEXT("Reducer does not hold UpdateUniqueU256!")); + return Data.Get(); + } + + static FReducer UpdateUniqueU32(const FUpdateUniqueU32Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::UpdateUniqueU32; + Out.Data.Set(Value); + Out.ReducerName = TEXT("update_unique_u32"); + return Out; + } + + FORCEINLINE bool IsUpdateUniqueU32() const { return Tag == EReducerTag::UpdateUniqueU32; } + FORCEINLINE FUpdateUniqueU32Args GetAsUpdateUniqueU32() const + { + ensureMsgf(IsUpdateUniqueU32(), TEXT("Reducer does not hold UpdateUniqueU32!")); + return Data.Get(); + } + + static FReducer UpdateUniqueU64(const FUpdateUniqueU64Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::UpdateUniqueU64; + Out.Data.Set(Value); + Out.ReducerName = TEXT("update_unique_u64"); + return Out; + } + + FORCEINLINE bool IsUpdateUniqueU64() const { return Tag == EReducerTag::UpdateUniqueU64; } + FORCEINLINE FUpdateUniqueU64Args GetAsUpdateUniqueU64() const + { + ensureMsgf(IsUpdateUniqueU64(), TEXT("Reducer does not hold UpdateUniqueU64!")); + return Data.Get(); + } + + static FReducer UpdateUniqueU8(const FUpdateUniqueU8Args& Value) + { + FReducer Out; + Out.Tag = EReducerTag::UpdateUniqueU8; + Out.Data.Set(Value); + Out.ReducerName = TEXT("update_unique_u8"); + return Out; + } + + FORCEINLINE bool IsUpdateUniqueU8() const { return Tag == EReducerTag::UpdateUniqueU8; } + FORCEINLINE FUpdateUniqueU8Args GetAsUpdateUniqueU8() const + { + ensureMsgf(IsUpdateUniqueU8(), TEXT("Reducer does not hold UpdateUniqueU8!")); + return Data.Get(); + } + + FORCEINLINE bool operator==(const FReducer& Other) const + { + if (Tag != Other.Tag || ReducerId != Other.ReducerId || RequestId != Other.RequestId || ReducerName != Other.ReducerName) return false; + switch (Tag) + { + case EReducerTag::DeleteFromBtreeU32: + return GetAsDeleteFromBtreeU32() == Other.GetAsDeleteFromBtreeU32(); + case EReducerTag::DeleteLargeTable: + return GetAsDeleteLargeTable() == Other.GetAsDeleteLargeTable(); + case EReducerTag::DeletePkBool: + return GetAsDeletePkBool() == Other.GetAsDeletePkBool(); + case EReducerTag::DeletePkConnectionId: + return GetAsDeletePkConnectionId() == Other.GetAsDeletePkConnectionId(); + case EReducerTag::DeletePkI128: + return GetAsDeletePkI128() == Other.GetAsDeletePkI128(); + case EReducerTag::DeletePkI16: + return GetAsDeletePkI16() == Other.GetAsDeletePkI16(); + case EReducerTag::DeletePkI256: + return GetAsDeletePkI256() == Other.GetAsDeletePkI256(); + case EReducerTag::DeletePkI32: + return GetAsDeletePkI32() == Other.GetAsDeletePkI32(); + case EReducerTag::DeletePkI64: + return GetAsDeletePkI64() == Other.GetAsDeletePkI64(); + case EReducerTag::DeletePkI8: + return GetAsDeletePkI8() == Other.GetAsDeletePkI8(); + case EReducerTag::DeletePkIdentity: + return GetAsDeletePkIdentity() == Other.GetAsDeletePkIdentity(); + case EReducerTag::DeletePkString: + return GetAsDeletePkString() == Other.GetAsDeletePkString(); + case EReducerTag::DeletePkU128: + return GetAsDeletePkU128() == Other.GetAsDeletePkU128(); + case EReducerTag::DeletePkU16: + return GetAsDeletePkU16() == Other.GetAsDeletePkU16(); + case EReducerTag::DeletePkU256: + return GetAsDeletePkU256() == Other.GetAsDeletePkU256(); + case EReducerTag::DeletePkU32: + return GetAsDeletePkU32() == Other.GetAsDeletePkU32(); + case EReducerTag::DeletePkU32InsertPkU32Two: + return GetAsDeletePkU32InsertPkU32Two() == Other.GetAsDeletePkU32InsertPkU32Two(); + case EReducerTag::DeletePkU32Two: + return GetAsDeletePkU32Two() == Other.GetAsDeletePkU32Two(); + case EReducerTag::DeletePkU64: + return GetAsDeletePkU64() == Other.GetAsDeletePkU64(); + case EReducerTag::DeletePkU8: + return GetAsDeletePkU8() == Other.GetAsDeletePkU8(); + case EReducerTag::DeleteUniqueBool: + return GetAsDeleteUniqueBool() == Other.GetAsDeleteUniqueBool(); + case EReducerTag::DeleteUniqueConnectionId: + return GetAsDeleteUniqueConnectionId() == Other.GetAsDeleteUniqueConnectionId(); + case EReducerTag::DeleteUniqueI128: + return GetAsDeleteUniqueI128() == Other.GetAsDeleteUniqueI128(); + case EReducerTag::DeleteUniqueI16: + return GetAsDeleteUniqueI16() == Other.GetAsDeleteUniqueI16(); + case EReducerTag::DeleteUniqueI256: + return GetAsDeleteUniqueI256() == Other.GetAsDeleteUniqueI256(); + case EReducerTag::DeleteUniqueI32: + return GetAsDeleteUniqueI32() == Other.GetAsDeleteUniqueI32(); + case EReducerTag::DeleteUniqueI64: + return GetAsDeleteUniqueI64() == Other.GetAsDeleteUniqueI64(); + case EReducerTag::DeleteUniqueI8: + return GetAsDeleteUniqueI8() == Other.GetAsDeleteUniqueI8(); + case EReducerTag::DeleteUniqueIdentity: + return GetAsDeleteUniqueIdentity() == Other.GetAsDeleteUniqueIdentity(); + case EReducerTag::DeleteUniqueString: + return GetAsDeleteUniqueString() == Other.GetAsDeleteUniqueString(); + case EReducerTag::DeleteUniqueU128: + return GetAsDeleteUniqueU128() == Other.GetAsDeleteUniqueU128(); + case EReducerTag::DeleteUniqueU16: + return GetAsDeleteUniqueU16() == Other.GetAsDeleteUniqueU16(); + case EReducerTag::DeleteUniqueU256: + return GetAsDeleteUniqueU256() == Other.GetAsDeleteUniqueU256(); + case EReducerTag::DeleteUniqueU32: + return GetAsDeleteUniqueU32() == Other.GetAsDeleteUniqueU32(); + case EReducerTag::DeleteUniqueU64: + return GetAsDeleteUniqueU64() == Other.GetAsDeleteUniqueU64(); + case EReducerTag::DeleteUniqueU8: + return GetAsDeleteUniqueU8() == Other.GetAsDeleteUniqueU8(); + case EReducerTag::InsertCallTimestamp: + return GetAsInsertCallTimestamp() == Other.GetAsInsertCallTimestamp(); + case EReducerTag::InsertCallerOneConnectionId: + return GetAsInsertCallerOneConnectionId() == Other.GetAsInsertCallerOneConnectionId(); + case EReducerTag::InsertCallerOneIdentity: + return GetAsInsertCallerOneIdentity() == Other.GetAsInsertCallerOneIdentity(); + case EReducerTag::InsertCallerPkConnectionId: + return GetAsInsertCallerPkConnectionId() == Other.GetAsInsertCallerPkConnectionId(); + case EReducerTag::InsertCallerPkIdentity: + return GetAsInsertCallerPkIdentity() == Other.GetAsInsertCallerPkIdentity(); + case EReducerTag::InsertCallerUniqueConnectionId: + return GetAsInsertCallerUniqueConnectionId() == Other.GetAsInsertCallerUniqueConnectionId(); + case EReducerTag::InsertCallerUniqueIdentity: + return GetAsInsertCallerUniqueIdentity() == Other.GetAsInsertCallerUniqueIdentity(); + case EReducerTag::InsertCallerVecConnectionId: + return GetAsInsertCallerVecConnectionId() == Other.GetAsInsertCallerVecConnectionId(); + case EReducerTag::InsertCallerVecIdentity: + return GetAsInsertCallerVecIdentity() == Other.GetAsInsertCallerVecIdentity(); + case EReducerTag::InsertIntoBtreeU32: + return GetAsInsertIntoBtreeU32() == Other.GetAsInsertIntoBtreeU32(); + case EReducerTag::InsertIntoIndexedSimpleEnum: + return GetAsInsertIntoIndexedSimpleEnum() == Other.GetAsInsertIntoIndexedSimpleEnum(); + case EReducerTag::InsertIntoPkBtreeU32: + return GetAsInsertIntoPkBtreeU32() == Other.GetAsInsertIntoPkBtreeU32(); + case EReducerTag::InsertLargeTable: + return GetAsInsertLargeTable() == Other.GetAsInsertLargeTable(); + case EReducerTag::InsertOneBool: + return GetAsInsertOneBool() == Other.GetAsInsertOneBool(); + case EReducerTag::InsertOneByteStruct: + return GetAsInsertOneByteStruct() == Other.GetAsInsertOneByteStruct(); + case EReducerTag::InsertOneConnectionId: + return GetAsInsertOneConnectionId() == Other.GetAsInsertOneConnectionId(); + case EReducerTag::InsertOneEnumWithPayload: + return GetAsInsertOneEnumWithPayload() == Other.GetAsInsertOneEnumWithPayload(); + case EReducerTag::InsertOneEveryPrimitiveStruct: + return GetAsInsertOneEveryPrimitiveStruct() == Other.GetAsInsertOneEveryPrimitiveStruct(); + case EReducerTag::InsertOneEveryVecStruct: + return GetAsInsertOneEveryVecStruct() == Other.GetAsInsertOneEveryVecStruct(); + case EReducerTag::InsertOneF32: + return GetAsInsertOneF32() == Other.GetAsInsertOneF32(); + case EReducerTag::InsertOneF64: + return GetAsInsertOneF64() == Other.GetAsInsertOneF64(); + case EReducerTag::InsertOneI128: + return GetAsInsertOneI128() == Other.GetAsInsertOneI128(); + case EReducerTag::InsertOneI16: + return GetAsInsertOneI16() == Other.GetAsInsertOneI16(); + case EReducerTag::InsertOneI256: + return GetAsInsertOneI256() == Other.GetAsInsertOneI256(); + case EReducerTag::InsertOneI32: + return GetAsInsertOneI32() == Other.GetAsInsertOneI32(); + case EReducerTag::InsertOneI64: + return GetAsInsertOneI64() == Other.GetAsInsertOneI64(); + case EReducerTag::InsertOneI8: + return GetAsInsertOneI8() == Other.GetAsInsertOneI8(); + case EReducerTag::InsertOneIdentity: + return GetAsInsertOneIdentity() == Other.GetAsInsertOneIdentity(); + case EReducerTag::InsertOneSimpleEnum: + return GetAsInsertOneSimpleEnum() == Other.GetAsInsertOneSimpleEnum(); + case EReducerTag::InsertOneString: + return GetAsInsertOneString() == Other.GetAsInsertOneString(); + case EReducerTag::InsertOneTimestamp: + return GetAsInsertOneTimestamp() == Other.GetAsInsertOneTimestamp(); + case EReducerTag::InsertOneU128: + return GetAsInsertOneU128() == Other.GetAsInsertOneU128(); + case EReducerTag::InsertOneU16: + return GetAsInsertOneU16() == Other.GetAsInsertOneU16(); + case EReducerTag::InsertOneU256: + return GetAsInsertOneU256() == Other.GetAsInsertOneU256(); + case EReducerTag::InsertOneU32: + return GetAsInsertOneU32() == Other.GetAsInsertOneU32(); + case EReducerTag::InsertOneU64: + return GetAsInsertOneU64() == Other.GetAsInsertOneU64(); + case EReducerTag::InsertOneU8: + return GetAsInsertOneU8() == Other.GetAsInsertOneU8(); + case EReducerTag::InsertOneUnitStruct: + return GetAsInsertOneUnitStruct() == Other.GetAsInsertOneUnitStruct(); + case EReducerTag::InsertOptionEveryPrimitiveStruct: + return GetAsInsertOptionEveryPrimitiveStruct() == Other.GetAsInsertOptionEveryPrimitiveStruct(); + case EReducerTag::InsertOptionI32: + return GetAsInsertOptionI32() == Other.GetAsInsertOptionI32(); + case EReducerTag::InsertOptionIdentity: + return GetAsInsertOptionIdentity() == Other.GetAsInsertOptionIdentity(); + case EReducerTag::InsertOptionSimpleEnum: + return GetAsInsertOptionSimpleEnum() == Other.GetAsInsertOptionSimpleEnum(); + case EReducerTag::InsertOptionString: + return GetAsInsertOptionString() == Other.GetAsInsertOptionString(); + case EReducerTag::InsertOptionVecOptionI32: + return GetAsInsertOptionVecOptionI32() == Other.GetAsInsertOptionVecOptionI32(); + case EReducerTag::InsertPkBool: + return GetAsInsertPkBool() == Other.GetAsInsertPkBool(); + case EReducerTag::InsertPkConnectionId: + return GetAsInsertPkConnectionId() == Other.GetAsInsertPkConnectionId(); + case EReducerTag::InsertPkI128: + return GetAsInsertPkI128() == Other.GetAsInsertPkI128(); + case EReducerTag::InsertPkI16: + return GetAsInsertPkI16() == Other.GetAsInsertPkI16(); + case EReducerTag::InsertPkI256: + return GetAsInsertPkI256() == Other.GetAsInsertPkI256(); + case EReducerTag::InsertPkI32: + return GetAsInsertPkI32() == Other.GetAsInsertPkI32(); + case EReducerTag::InsertPkI64: + return GetAsInsertPkI64() == Other.GetAsInsertPkI64(); + case EReducerTag::InsertPkI8: + return GetAsInsertPkI8() == Other.GetAsInsertPkI8(); + case EReducerTag::InsertPkIdentity: + return GetAsInsertPkIdentity() == Other.GetAsInsertPkIdentity(); + case EReducerTag::InsertPkSimpleEnum: + return GetAsInsertPkSimpleEnum() == Other.GetAsInsertPkSimpleEnum(); + case EReducerTag::InsertPkString: + return GetAsInsertPkString() == Other.GetAsInsertPkString(); + case EReducerTag::InsertPkU128: + return GetAsInsertPkU128() == Other.GetAsInsertPkU128(); + case EReducerTag::InsertPkU16: + return GetAsInsertPkU16() == Other.GetAsInsertPkU16(); + case EReducerTag::InsertPkU256: + return GetAsInsertPkU256() == Other.GetAsInsertPkU256(); + case EReducerTag::InsertPkU32: + return GetAsInsertPkU32() == Other.GetAsInsertPkU32(); + case EReducerTag::InsertPkU32Two: + return GetAsInsertPkU32Two() == Other.GetAsInsertPkU32Two(); + case EReducerTag::InsertPkU64: + return GetAsInsertPkU64() == Other.GetAsInsertPkU64(); + case EReducerTag::InsertPkU8: + return GetAsInsertPkU8() == Other.GetAsInsertPkU8(); + case EReducerTag::InsertPrimitivesAsStrings: + return GetAsInsertPrimitivesAsStrings() == Other.GetAsInsertPrimitivesAsStrings(); + case EReducerTag::InsertTableHoldsTable: + return GetAsInsertTableHoldsTable() == Other.GetAsInsertTableHoldsTable(); + case EReducerTag::InsertUniqueBool: + return GetAsInsertUniqueBool() == Other.GetAsInsertUniqueBool(); + case EReducerTag::InsertUniqueConnectionId: + return GetAsInsertUniqueConnectionId() == Other.GetAsInsertUniqueConnectionId(); + case EReducerTag::InsertUniqueI128: + return GetAsInsertUniqueI128() == Other.GetAsInsertUniqueI128(); + case EReducerTag::InsertUniqueI16: + return GetAsInsertUniqueI16() == Other.GetAsInsertUniqueI16(); + case EReducerTag::InsertUniqueI256: + return GetAsInsertUniqueI256() == Other.GetAsInsertUniqueI256(); + case EReducerTag::InsertUniqueI32: + return GetAsInsertUniqueI32() == Other.GetAsInsertUniqueI32(); + case EReducerTag::InsertUniqueI64: + return GetAsInsertUniqueI64() == Other.GetAsInsertUniqueI64(); + case EReducerTag::InsertUniqueI8: + return GetAsInsertUniqueI8() == Other.GetAsInsertUniqueI8(); + case EReducerTag::InsertUniqueIdentity: + return GetAsInsertUniqueIdentity() == Other.GetAsInsertUniqueIdentity(); + case EReducerTag::InsertUniqueString: + return GetAsInsertUniqueString() == Other.GetAsInsertUniqueString(); + case EReducerTag::InsertUniqueU128: + return GetAsInsertUniqueU128() == Other.GetAsInsertUniqueU128(); + case EReducerTag::InsertUniqueU16: + return GetAsInsertUniqueU16() == Other.GetAsInsertUniqueU16(); + case EReducerTag::InsertUniqueU256: + return GetAsInsertUniqueU256() == Other.GetAsInsertUniqueU256(); + case EReducerTag::InsertUniqueU32: + return GetAsInsertUniqueU32() == Other.GetAsInsertUniqueU32(); + case EReducerTag::InsertUniqueU32UpdatePkU32: + return GetAsInsertUniqueU32UpdatePkU32() == Other.GetAsInsertUniqueU32UpdatePkU32(); + case EReducerTag::InsertUniqueU64: + return GetAsInsertUniqueU64() == Other.GetAsInsertUniqueU64(); + case EReducerTag::InsertUniqueU8: + return GetAsInsertUniqueU8() == Other.GetAsInsertUniqueU8(); + case EReducerTag::InsertUser: + return GetAsInsertUser() == Other.GetAsInsertUser(); + case EReducerTag::InsertVecBool: + return GetAsInsertVecBool() == Other.GetAsInsertVecBool(); + case EReducerTag::InsertVecByteStruct: + return GetAsInsertVecByteStruct() == Other.GetAsInsertVecByteStruct(); + case EReducerTag::InsertVecConnectionId: + return GetAsInsertVecConnectionId() == Other.GetAsInsertVecConnectionId(); + case EReducerTag::InsertVecEnumWithPayload: + return GetAsInsertVecEnumWithPayload() == Other.GetAsInsertVecEnumWithPayload(); + case EReducerTag::InsertVecEveryPrimitiveStruct: + return GetAsInsertVecEveryPrimitiveStruct() == Other.GetAsInsertVecEveryPrimitiveStruct(); + case EReducerTag::InsertVecEveryVecStruct: + return GetAsInsertVecEveryVecStruct() == Other.GetAsInsertVecEveryVecStruct(); + case EReducerTag::InsertVecF32: + return GetAsInsertVecF32() == Other.GetAsInsertVecF32(); + case EReducerTag::InsertVecF64: + return GetAsInsertVecF64() == Other.GetAsInsertVecF64(); + case EReducerTag::InsertVecI128: + return GetAsInsertVecI128() == Other.GetAsInsertVecI128(); + case EReducerTag::InsertVecI16: + return GetAsInsertVecI16() == Other.GetAsInsertVecI16(); + case EReducerTag::InsertVecI256: + return GetAsInsertVecI256() == Other.GetAsInsertVecI256(); + case EReducerTag::InsertVecI32: + return GetAsInsertVecI32() == Other.GetAsInsertVecI32(); + case EReducerTag::InsertVecI64: + return GetAsInsertVecI64() == Other.GetAsInsertVecI64(); + case EReducerTag::InsertVecI8: + return GetAsInsertVecI8() == Other.GetAsInsertVecI8(); + case EReducerTag::InsertVecIdentity: + return GetAsInsertVecIdentity() == Other.GetAsInsertVecIdentity(); + case EReducerTag::InsertVecSimpleEnum: + return GetAsInsertVecSimpleEnum() == Other.GetAsInsertVecSimpleEnum(); + case EReducerTag::InsertVecString: + return GetAsInsertVecString() == Other.GetAsInsertVecString(); + case EReducerTag::InsertVecTimestamp: + return GetAsInsertVecTimestamp() == Other.GetAsInsertVecTimestamp(); + case EReducerTag::InsertVecU128: + return GetAsInsertVecU128() == Other.GetAsInsertVecU128(); + case EReducerTag::InsertVecU16: + return GetAsInsertVecU16() == Other.GetAsInsertVecU16(); + case EReducerTag::InsertVecU256: + return GetAsInsertVecU256() == Other.GetAsInsertVecU256(); + case EReducerTag::InsertVecU32: + return GetAsInsertVecU32() == Other.GetAsInsertVecU32(); + case EReducerTag::InsertVecU64: + return GetAsInsertVecU64() == Other.GetAsInsertVecU64(); + case EReducerTag::InsertVecU8: + return GetAsInsertVecU8() == Other.GetAsInsertVecU8(); + case EReducerTag::InsertVecUnitStruct: + return GetAsInsertVecUnitStruct() == Other.GetAsInsertVecUnitStruct(); + case EReducerTag::NoOpSucceeds: + return GetAsNoOpSucceeds() == Other.GetAsNoOpSucceeds(); + case EReducerTag::SendScheduledMessage: + return GetAsSendScheduledMessage() == Other.GetAsSendScheduledMessage(); + case EReducerTag::UpdateIndexedSimpleEnum: + return GetAsUpdateIndexedSimpleEnum() == Other.GetAsUpdateIndexedSimpleEnum(); + case EReducerTag::UpdatePkBool: + return GetAsUpdatePkBool() == Other.GetAsUpdatePkBool(); + case EReducerTag::UpdatePkConnectionId: + return GetAsUpdatePkConnectionId() == Other.GetAsUpdatePkConnectionId(); + case EReducerTag::UpdatePkI128: + return GetAsUpdatePkI128() == Other.GetAsUpdatePkI128(); + case EReducerTag::UpdatePkI16: + return GetAsUpdatePkI16() == Other.GetAsUpdatePkI16(); + case EReducerTag::UpdatePkI256: + return GetAsUpdatePkI256() == Other.GetAsUpdatePkI256(); + case EReducerTag::UpdatePkI32: + return GetAsUpdatePkI32() == Other.GetAsUpdatePkI32(); + case EReducerTag::UpdatePkI64: + return GetAsUpdatePkI64() == Other.GetAsUpdatePkI64(); + case EReducerTag::UpdatePkI8: + return GetAsUpdatePkI8() == Other.GetAsUpdatePkI8(); + case EReducerTag::UpdatePkIdentity: + return GetAsUpdatePkIdentity() == Other.GetAsUpdatePkIdentity(); + case EReducerTag::UpdatePkSimpleEnum: + return GetAsUpdatePkSimpleEnum() == Other.GetAsUpdatePkSimpleEnum(); + case EReducerTag::UpdatePkString: + return GetAsUpdatePkString() == Other.GetAsUpdatePkString(); + case EReducerTag::UpdatePkU128: + return GetAsUpdatePkU128() == Other.GetAsUpdatePkU128(); + case EReducerTag::UpdatePkU16: + return GetAsUpdatePkU16() == Other.GetAsUpdatePkU16(); + case EReducerTag::UpdatePkU256: + return GetAsUpdatePkU256() == Other.GetAsUpdatePkU256(); + case EReducerTag::UpdatePkU32: + return GetAsUpdatePkU32() == Other.GetAsUpdatePkU32(); + case EReducerTag::UpdatePkU32Two: + return GetAsUpdatePkU32Two() == Other.GetAsUpdatePkU32Two(); + case EReducerTag::UpdatePkU64: + return GetAsUpdatePkU64() == Other.GetAsUpdatePkU64(); + case EReducerTag::UpdatePkU8: + return GetAsUpdatePkU8() == Other.GetAsUpdatePkU8(); + case EReducerTag::UpdateUniqueBool: + return GetAsUpdateUniqueBool() == Other.GetAsUpdateUniqueBool(); + case EReducerTag::UpdateUniqueConnectionId: + return GetAsUpdateUniqueConnectionId() == Other.GetAsUpdateUniqueConnectionId(); + case EReducerTag::UpdateUniqueI128: + return GetAsUpdateUniqueI128() == Other.GetAsUpdateUniqueI128(); + case EReducerTag::UpdateUniqueI16: + return GetAsUpdateUniqueI16() == Other.GetAsUpdateUniqueI16(); + case EReducerTag::UpdateUniqueI256: + return GetAsUpdateUniqueI256() == Other.GetAsUpdateUniqueI256(); + case EReducerTag::UpdateUniqueI32: + return GetAsUpdateUniqueI32() == Other.GetAsUpdateUniqueI32(); + case EReducerTag::UpdateUniqueI64: + return GetAsUpdateUniqueI64() == Other.GetAsUpdateUniqueI64(); + case EReducerTag::UpdateUniqueI8: + return GetAsUpdateUniqueI8() == Other.GetAsUpdateUniqueI8(); + case EReducerTag::UpdateUniqueIdentity: + return GetAsUpdateUniqueIdentity() == Other.GetAsUpdateUniqueIdentity(); + case EReducerTag::UpdateUniqueString: + return GetAsUpdateUniqueString() == Other.GetAsUpdateUniqueString(); + case EReducerTag::UpdateUniqueU128: + return GetAsUpdateUniqueU128() == Other.GetAsUpdateUniqueU128(); + case EReducerTag::UpdateUniqueU16: + return GetAsUpdateUniqueU16() == Other.GetAsUpdateUniqueU16(); + case EReducerTag::UpdateUniqueU256: + return GetAsUpdateUniqueU256() == Other.GetAsUpdateUniqueU256(); + case EReducerTag::UpdateUniqueU32: + return GetAsUpdateUniqueU32() == Other.GetAsUpdateUniqueU32(); + case EReducerTag::UpdateUniqueU64: + return GetAsUpdateUniqueU64() == Other.GetAsUpdateUniqueU64(); + case EReducerTag::UpdateUniqueU8: + return GetAsUpdateUniqueU8() == Other.GetAsUpdateUniqueU8(); + default: return false; + } + } + FORCEINLINE bool operator!=(const FReducer& Other) const { return !(*this == Other); } +}; + +UCLASS() +class TESTCLIENT_API UReducerBpLib : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() + +private: + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer DeleteFromBtreeU32(const FDeleteFromBtreeU32Args& Value) { + return FReducer::DeleteFromBtreeU32(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsDeleteFromBtreeU32(const FReducer& Reducer) { return Reducer.IsDeleteFromBtreeU32(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FDeleteFromBtreeU32Args GetAsDeleteFromBtreeU32(const FReducer& Reducer) { + return Reducer.GetAsDeleteFromBtreeU32(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer DeleteLargeTable(const FDeleteLargeTableArgs& Value) { + return FReducer::DeleteLargeTable(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsDeleteLargeTable(const FReducer& Reducer) { return Reducer.IsDeleteLargeTable(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FDeleteLargeTableArgs GetAsDeleteLargeTable(const FReducer& Reducer) { + return Reducer.GetAsDeleteLargeTable(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer DeletePkBool(const FDeletePkBoolArgs& Value) { + return FReducer::DeletePkBool(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsDeletePkBool(const FReducer& Reducer) { return Reducer.IsDeletePkBool(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FDeletePkBoolArgs GetAsDeletePkBool(const FReducer& Reducer) { + return Reducer.GetAsDeletePkBool(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer DeletePkConnectionId(const FDeletePkConnectionIdArgs& Value) { + return FReducer::DeletePkConnectionId(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsDeletePkConnectionId(const FReducer& Reducer) { return Reducer.IsDeletePkConnectionId(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FDeletePkConnectionIdArgs GetAsDeletePkConnectionId(const FReducer& Reducer) { + return Reducer.GetAsDeletePkConnectionId(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer DeletePkI128(const FDeletePkI128Args& Value) { + return FReducer::DeletePkI128(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsDeletePkI128(const FReducer& Reducer) { return Reducer.IsDeletePkI128(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FDeletePkI128Args GetAsDeletePkI128(const FReducer& Reducer) { + return Reducer.GetAsDeletePkI128(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer DeletePkI16(const FDeletePkI16Args& Value) { + return FReducer::DeletePkI16(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsDeletePkI16(const FReducer& Reducer) { return Reducer.IsDeletePkI16(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FDeletePkI16Args GetAsDeletePkI16(const FReducer& Reducer) { + return Reducer.GetAsDeletePkI16(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer DeletePkI256(const FDeletePkI256Args& Value) { + return FReducer::DeletePkI256(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsDeletePkI256(const FReducer& Reducer) { return Reducer.IsDeletePkI256(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FDeletePkI256Args GetAsDeletePkI256(const FReducer& Reducer) { + return Reducer.GetAsDeletePkI256(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer DeletePkI32(const FDeletePkI32Args& Value) { + return FReducer::DeletePkI32(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsDeletePkI32(const FReducer& Reducer) { return Reducer.IsDeletePkI32(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FDeletePkI32Args GetAsDeletePkI32(const FReducer& Reducer) { + return Reducer.GetAsDeletePkI32(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer DeletePkI64(const FDeletePkI64Args& Value) { + return FReducer::DeletePkI64(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsDeletePkI64(const FReducer& Reducer) { return Reducer.IsDeletePkI64(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FDeletePkI64Args GetAsDeletePkI64(const FReducer& Reducer) { + return Reducer.GetAsDeletePkI64(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer DeletePkI8(const FDeletePkI8Args& Value) { + return FReducer::DeletePkI8(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsDeletePkI8(const FReducer& Reducer) { return Reducer.IsDeletePkI8(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FDeletePkI8Args GetAsDeletePkI8(const FReducer& Reducer) { + return Reducer.GetAsDeletePkI8(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer DeletePkIdentity(const FDeletePkIdentityArgs& Value) { + return FReducer::DeletePkIdentity(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsDeletePkIdentity(const FReducer& Reducer) { return Reducer.IsDeletePkIdentity(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FDeletePkIdentityArgs GetAsDeletePkIdentity(const FReducer& Reducer) { + return Reducer.GetAsDeletePkIdentity(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer DeletePkString(const FDeletePkStringArgs& Value) { + return FReducer::DeletePkString(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsDeletePkString(const FReducer& Reducer) { return Reducer.IsDeletePkString(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FDeletePkStringArgs GetAsDeletePkString(const FReducer& Reducer) { + return Reducer.GetAsDeletePkString(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer DeletePkU128(const FDeletePkU128Args& Value) { + return FReducer::DeletePkU128(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsDeletePkU128(const FReducer& Reducer) { return Reducer.IsDeletePkU128(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FDeletePkU128Args GetAsDeletePkU128(const FReducer& Reducer) { + return Reducer.GetAsDeletePkU128(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer DeletePkU16(const FDeletePkU16Args& Value) { + return FReducer::DeletePkU16(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsDeletePkU16(const FReducer& Reducer) { return Reducer.IsDeletePkU16(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FDeletePkU16Args GetAsDeletePkU16(const FReducer& Reducer) { + return Reducer.GetAsDeletePkU16(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer DeletePkU256(const FDeletePkU256Args& Value) { + return FReducer::DeletePkU256(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsDeletePkU256(const FReducer& Reducer) { return Reducer.IsDeletePkU256(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FDeletePkU256Args GetAsDeletePkU256(const FReducer& Reducer) { + return Reducer.GetAsDeletePkU256(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer DeletePkU32(const FDeletePkU32Args& Value) { + return FReducer::DeletePkU32(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsDeletePkU32(const FReducer& Reducer) { return Reducer.IsDeletePkU32(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FDeletePkU32Args GetAsDeletePkU32(const FReducer& Reducer) { + return Reducer.GetAsDeletePkU32(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer DeletePkU32InsertPkU32Two(const FDeletePkU32InsertPkU32TwoArgs& Value) { + return FReducer::DeletePkU32InsertPkU32Two(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsDeletePkU32InsertPkU32Two(const FReducer& Reducer) { return Reducer.IsDeletePkU32InsertPkU32Two(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FDeletePkU32InsertPkU32TwoArgs GetAsDeletePkU32InsertPkU32Two(const FReducer& Reducer) { + return Reducer.GetAsDeletePkU32InsertPkU32Two(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer DeletePkU32Two(const FDeletePkU32TwoArgs& Value) { + return FReducer::DeletePkU32Two(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsDeletePkU32Two(const FReducer& Reducer) { return Reducer.IsDeletePkU32Two(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FDeletePkU32TwoArgs GetAsDeletePkU32Two(const FReducer& Reducer) { + return Reducer.GetAsDeletePkU32Two(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer DeletePkU64(const FDeletePkU64Args& Value) { + return FReducer::DeletePkU64(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsDeletePkU64(const FReducer& Reducer) { return Reducer.IsDeletePkU64(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FDeletePkU64Args GetAsDeletePkU64(const FReducer& Reducer) { + return Reducer.GetAsDeletePkU64(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer DeletePkU8(const FDeletePkU8Args& Value) { + return FReducer::DeletePkU8(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsDeletePkU8(const FReducer& Reducer) { return Reducer.IsDeletePkU8(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FDeletePkU8Args GetAsDeletePkU8(const FReducer& Reducer) { + return Reducer.GetAsDeletePkU8(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer DeleteUniqueBool(const FDeleteUniqueBoolArgs& Value) { + return FReducer::DeleteUniqueBool(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsDeleteUniqueBool(const FReducer& Reducer) { return Reducer.IsDeleteUniqueBool(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FDeleteUniqueBoolArgs GetAsDeleteUniqueBool(const FReducer& Reducer) { + return Reducer.GetAsDeleteUniqueBool(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer DeleteUniqueConnectionId(const FDeleteUniqueConnectionIdArgs& Value) { + return FReducer::DeleteUniqueConnectionId(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsDeleteUniqueConnectionId(const FReducer& Reducer) { return Reducer.IsDeleteUniqueConnectionId(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FDeleteUniqueConnectionIdArgs GetAsDeleteUniqueConnectionId(const FReducer& Reducer) { + return Reducer.GetAsDeleteUniqueConnectionId(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer DeleteUniqueI128(const FDeleteUniqueI128Args& Value) { + return FReducer::DeleteUniqueI128(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsDeleteUniqueI128(const FReducer& Reducer) { return Reducer.IsDeleteUniqueI128(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FDeleteUniqueI128Args GetAsDeleteUniqueI128(const FReducer& Reducer) { + return Reducer.GetAsDeleteUniqueI128(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer DeleteUniqueI16(const FDeleteUniqueI16Args& Value) { + return FReducer::DeleteUniqueI16(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsDeleteUniqueI16(const FReducer& Reducer) { return Reducer.IsDeleteUniqueI16(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FDeleteUniqueI16Args GetAsDeleteUniqueI16(const FReducer& Reducer) { + return Reducer.GetAsDeleteUniqueI16(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer DeleteUniqueI256(const FDeleteUniqueI256Args& Value) { + return FReducer::DeleteUniqueI256(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsDeleteUniqueI256(const FReducer& Reducer) { return Reducer.IsDeleteUniqueI256(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FDeleteUniqueI256Args GetAsDeleteUniqueI256(const FReducer& Reducer) { + return Reducer.GetAsDeleteUniqueI256(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer DeleteUniqueI32(const FDeleteUniqueI32Args& Value) { + return FReducer::DeleteUniqueI32(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsDeleteUniqueI32(const FReducer& Reducer) { return Reducer.IsDeleteUniqueI32(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FDeleteUniqueI32Args GetAsDeleteUniqueI32(const FReducer& Reducer) { + return Reducer.GetAsDeleteUniqueI32(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer DeleteUniqueI64(const FDeleteUniqueI64Args& Value) { + return FReducer::DeleteUniqueI64(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsDeleteUniqueI64(const FReducer& Reducer) { return Reducer.IsDeleteUniqueI64(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FDeleteUniqueI64Args GetAsDeleteUniqueI64(const FReducer& Reducer) { + return Reducer.GetAsDeleteUniqueI64(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer DeleteUniqueI8(const FDeleteUniqueI8Args& Value) { + return FReducer::DeleteUniqueI8(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsDeleteUniqueI8(const FReducer& Reducer) { return Reducer.IsDeleteUniqueI8(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FDeleteUniqueI8Args GetAsDeleteUniqueI8(const FReducer& Reducer) { + return Reducer.GetAsDeleteUniqueI8(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer DeleteUniqueIdentity(const FDeleteUniqueIdentityArgs& Value) { + return FReducer::DeleteUniqueIdentity(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsDeleteUniqueIdentity(const FReducer& Reducer) { return Reducer.IsDeleteUniqueIdentity(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FDeleteUniqueIdentityArgs GetAsDeleteUniqueIdentity(const FReducer& Reducer) { + return Reducer.GetAsDeleteUniqueIdentity(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer DeleteUniqueString(const FDeleteUniqueStringArgs& Value) { + return FReducer::DeleteUniqueString(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsDeleteUniqueString(const FReducer& Reducer) { return Reducer.IsDeleteUniqueString(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FDeleteUniqueStringArgs GetAsDeleteUniqueString(const FReducer& Reducer) { + return Reducer.GetAsDeleteUniqueString(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer DeleteUniqueU128(const FDeleteUniqueU128Args& Value) { + return FReducer::DeleteUniqueU128(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsDeleteUniqueU128(const FReducer& Reducer) { return Reducer.IsDeleteUniqueU128(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FDeleteUniqueU128Args GetAsDeleteUniqueU128(const FReducer& Reducer) { + return Reducer.GetAsDeleteUniqueU128(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer DeleteUniqueU16(const FDeleteUniqueU16Args& Value) { + return FReducer::DeleteUniqueU16(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsDeleteUniqueU16(const FReducer& Reducer) { return Reducer.IsDeleteUniqueU16(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FDeleteUniqueU16Args GetAsDeleteUniqueU16(const FReducer& Reducer) { + return Reducer.GetAsDeleteUniqueU16(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer DeleteUniqueU256(const FDeleteUniqueU256Args& Value) { + return FReducer::DeleteUniqueU256(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsDeleteUniqueU256(const FReducer& Reducer) { return Reducer.IsDeleteUniqueU256(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FDeleteUniqueU256Args GetAsDeleteUniqueU256(const FReducer& Reducer) { + return Reducer.GetAsDeleteUniqueU256(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer DeleteUniqueU32(const FDeleteUniqueU32Args& Value) { + return FReducer::DeleteUniqueU32(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsDeleteUniqueU32(const FReducer& Reducer) { return Reducer.IsDeleteUniqueU32(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FDeleteUniqueU32Args GetAsDeleteUniqueU32(const FReducer& Reducer) { + return Reducer.GetAsDeleteUniqueU32(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer DeleteUniqueU64(const FDeleteUniqueU64Args& Value) { + return FReducer::DeleteUniqueU64(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsDeleteUniqueU64(const FReducer& Reducer) { return Reducer.IsDeleteUniqueU64(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FDeleteUniqueU64Args GetAsDeleteUniqueU64(const FReducer& Reducer) { + return Reducer.GetAsDeleteUniqueU64(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer DeleteUniqueU8(const FDeleteUniqueU8Args& Value) { + return FReducer::DeleteUniqueU8(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsDeleteUniqueU8(const FReducer& Reducer) { return Reducer.IsDeleteUniqueU8(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FDeleteUniqueU8Args GetAsDeleteUniqueU8(const FReducer& Reducer) { + return Reducer.GetAsDeleteUniqueU8(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertCallTimestamp(const FInsertCallTimestampArgs& Value) { + return FReducer::InsertCallTimestamp(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertCallTimestamp(const FReducer& Reducer) { return Reducer.IsInsertCallTimestamp(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertCallTimestampArgs GetAsInsertCallTimestamp(const FReducer& Reducer) { + return Reducer.GetAsInsertCallTimestamp(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertCallerOneConnectionId(const FInsertCallerOneConnectionIdArgs& Value) { + return FReducer::InsertCallerOneConnectionId(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertCallerOneConnectionId(const FReducer& Reducer) { return Reducer.IsInsertCallerOneConnectionId(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertCallerOneConnectionIdArgs GetAsInsertCallerOneConnectionId(const FReducer& Reducer) { + return Reducer.GetAsInsertCallerOneConnectionId(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertCallerOneIdentity(const FInsertCallerOneIdentityArgs& Value) { + return FReducer::InsertCallerOneIdentity(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertCallerOneIdentity(const FReducer& Reducer) { return Reducer.IsInsertCallerOneIdentity(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertCallerOneIdentityArgs GetAsInsertCallerOneIdentity(const FReducer& Reducer) { + return Reducer.GetAsInsertCallerOneIdentity(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertCallerPkConnectionId(const FInsertCallerPkConnectionIdArgs& Value) { + return FReducer::InsertCallerPkConnectionId(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertCallerPkConnectionId(const FReducer& Reducer) { return Reducer.IsInsertCallerPkConnectionId(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertCallerPkConnectionIdArgs GetAsInsertCallerPkConnectionId(const FReducer& Reducer) { + return Reducer.GetAsInsertCallerPkConnectionId(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertCallerPkIdentity(const FInsertCallerPkIdentityArgs& Value) { + return FReducer::InsertCallerPkIdentity(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertCallerPkIdentity(const FReducer& Reducer) { return Reducer.IsInsertCallerPkIdentity(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertCallerPkIdentityArgs GetAsInsertCallerPkIdentity(const FReducer& Reducer) { + return Reducer.GetAsInsertCallerPkIdentity(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertCallerUniqueConnectionId(const FInsertCallerUniqueConnectionIdArgs& Value) { + return FReducer::InsertCallerUniqueConnectionId(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertCallerUniqueConnectionId(const FReducer& Reducer) { return Reducer.IsInsertCallerUniqueConnectionId(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertCallerUniqueConnectionIdArgs GetAsInsertCallerUniqueConnectionId(const FReducer& Reducer) { + return Reducer.GetAsInsertCallerUniqueConnectionId(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertCallerUniqueIdentity(const FInsertCallerUniqueIdentityArgs& Value) { + return FReducer::InsertCallerUniqueIdentity(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertCallerUniqueIdentity(const FReducer& Reducer) { return Reducer.IsInsertCallerUniqueIdentity(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertCallerUniqueIdentityArgs GetAsInsertCallerUniqueIdentity(const FReducer& Reducer) { + return Reducer.GetAsInsertCallerUniqueIdentity(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertCallerVecConnectionId(const FInsertCallerVecConnectionIdArgs& Value) { + return FReducer::InsertCallerVecConnectionId(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertCallerVecConnectionId(const FReducer& Reducer) { return Reducer.IsInsertCallerVecConnectionId(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertCallerVecConnectionIdArgs GetAsInsertCallerVecConnectionId(const FReducer& Reducer) { + return Reducer.GetAsInsertCallerVecConnectionId(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertCallerVecIdentity(const FInsertCallerVecIdentityArgs& Value) { + return FReducer::InsertCallerVecIdentity(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertCallerVecIdentity(const FReducer& Reducer) { return Reducer.IsInsertCallerVecIdentity(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertCallerVecIdentityArgs GetAsInsertCallerVecIdentity(const FReducer& Reducer) { + return Reducer.GetAsInsertCallerVecIdentity(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertIntoBtreeU32(const FInsertIntoBtreeU32Args& Value) { + return FReducer::InsertIntoBtreeU32(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertIntoBtreeU32(const FReducer& Reducer) { return Reducer.IsInsertIntoBtreeU32(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertIntoBtreeU32Args GetAsInsertIntoBtreeU32(const FReducer& Reducer) { + return Reducer.GetAsInsertIntoBtreeU32(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertIntoIndexedSimpleEnum(const FInsertIntoIndexedSimpleEnumArgs& Value) { + return FReducer::InsertIntoIndexedSimpleEnum(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertIntoIndexedSimpleEnum(const FReducer& Reducer) { return Reducer.IsInsertIntoIndexedSimpleEnum(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertIntoIndexedSimpleEnumArgs GetAsInsertIntoIndexedSimpleEnum(const FReducer& Reducer) { + return Reducer.GetAsInsertIntoIndexedSimpleEnum(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertIntoPkBtreeU32(const FInsertIntoPkBtreeU32Args& Value) { + return FReducer::InsertIntoPkBtreeU32(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertIntoPkBtreeU32(const FReducer& Reducer) { return Reducer.IsInsertIntoPkBtreeU32(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertIntoPkBtreeU32Args GetAsInsertIntoPkBtreeU32(const FReducer& Reducer) { + return Reducer.GetAsInsertIntoPkBtreeU32(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertLargeTable(const FInsertLargeTableArgs& Value) { + return FReducer::InsertLargeTable(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertLargeTable(const FReducer& Reducer) { return Reducer.IsInsertLargeTable(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertLargeTableArgs GetAsInsertLargeTable(const FReducer& Reducer) { + return Reducer.GetAsInsertLargeTable(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertOneBool(const FInsertOneBoolArgs& Value) { + return FReducer::InsertOneBool(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertOneBool(const FReducer& Reducer) { return Reducer.IsInsertOneBool(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertOneBoolArgs GetAsInsertOneBool(const FReducer& Reducer) { + return Reducer.GetAsInsertOneBool(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertOneByteStruct(const FInsertOneByteStructArgs& Value) { + return FReducer::InsertOneByteStruct(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertOneByteStruct(const FReducer& Reducer) { return Reducer.IsInsertOneByteStruct(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertOneByteStructArgs GetAsInsertOneByteStruct(const FReducer& Reducer) { + return Reducer.GetAsInsertOneByteStruct(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertOneConnectionId(const FInsertOneConnectionIdArgs& Value) { + return FReducer::InsertOneConnectionId(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertOneConnectionId(const FReducer& Reducer) { return Reducer.IsInsertOneConnectionId(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertOneConnectionIdArgs GetAsInsertOneConnectionId(const FReducer& Reducer) { + return Reducer.GetAsInsertOneConnectionId(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertOneEnumWithPayload(const FInsertOneEnumWithPayloadArgs& Value) { + return FReducer::InsertOneEnumWithPayload(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertOneEnumWithPayload(const FReducer& Reducer) { return Reducer.IsInsertOneEnumWithPayload(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertOneEnumWithPayloadArgs GetAsInsertOneEnumWithPayload(const FReducer& Reducer) { + return Reducer.GetAsInsertOneEnumWithPayload(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertOneEveryPrimitiveStruct(const FInsertOneEveryPrimitiveStructArgs& Value) { + return FReducer::InsertOneEveryPrimitiveStruct(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertOneEveryPrimitiveStruct(const FReducer& Reducer) { return Reducer.IsInsertOneEveryPrimitiveStruct(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertOneEveryPrimitiveStructArgs GetAsInsertOneEveryPrimitiveStruct(const FReducer& Reducer) { + return Reducer.GetAsInsertOneEveryPrimitiveStruct(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertOneEveryVecStruct(const FInsertOneEveryVecStructArgs& Value) { + return FReducer::InsertOneEveryVecStruct(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertOneEveryVecStruct(const FReducer& Reducer) { return Reducer.IsInsertOneEveryVecStruct(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertOneEveryVecStructArgs GetAsInsertOneEveryVecStruct(const FReducer& Reducer) { + return Reducer.GetAsInsertOneEveryVecStruct(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertOneF32(const FInsertOneF32Args& Value) { + return FReducer::InsertOneF32(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertOneF32(const FReducer& Reducer) { return Reducer.IsInsertOneF32(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertOneF32Args GetAsInsertOneF32(const FReducer& Reducer) { + return Reducer.GetAsInsertOneF32(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertOneF64(const FInsertOneF64Args& Value) { + return FReducer::InsertOneF64(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertOneF64(const FReducer& Reducer) { return Reducer.IsInsertOneF64(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertOneF64Args GetAsInsertOneF64(const FReducer& Reducer) { + return Reducer.GetAsInsertOneF64(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertOneI128(const FInsertOneI128Args& Value) { + return FReducer::InsertOneI128(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertOneI128(const FReducer& Reducer) { return Reducer.IsInsertOneI128(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertOneI128Args GetAsInsertOneI128(const FReducer& Reducer) { + return Reducer.GetAsInsertOneI128(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertOneI16(const FInsertOneI16Args& Value) { + return FReducer::InsertOneI16(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertOneI16(const FReducer& Reducer) { return Reducer.IsInsertOneI16(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertOneI16Args GetAsInsertOneI16(const FReducer& Reducer) { + return Reducer.GetAsInsertOneI16(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertOneI256(const FInsertOneI256Args& Value) { + return FReducer::InsertOneI256(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertOneI256(const FReducer& Reducer) { return Reducer.IsInsertOneI256(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertOneI256Args GetAsInsertOneI256(const FReducer& Reducer) { + return Reducer.GetAsInsertOneI256(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertOneI32(const FInsertOneI32Args& Value) { + return FReducer::InsertOneI32(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertOneI32(const FReducer& Reducer) { return Reducer.IsInsertOneI32(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertOneI32Args GetAsInsertOneI32(const FReducer& Reducer) { + return Reducer.GetAsInsertOneI32(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertOneI64(const FInsertOneI64Args& Value) { + return FReducer::InsertOneI64(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertOneI64(const FReducer& Reducer) { return Reducer.IsInsertOneI64(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertOneI64Args GetAsInsertOneI64(const FReducer& Reducer) { + return Reducer.GetAsInsertOneI64(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertOneI8(const FInsertOneI8Args& Value) { + return FReducer::InsertOneI8(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertOneI8(const FReducer& Reducer) { return Reducer.IsInsertOneI8(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertOneI8Args GetAsInsertOneI8(const FReducer& Reducer) { + return Reducer.GetAsInsertOneI8(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertOneIdentity(const FInsertOneIdentityArgs& Value) { + return FReducer::InsertOneIdentity(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertOneIdentity(const FReducer& Reducer) { return Reducer.IsInsertOneIdentity(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertOneIdentityArgs GetAsInsertOneIdentity(const FReducer& Reducer) { + return Reducer.GetAsInsertOneIdentity(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertOneSimpleEnum(const FInsertOneSimpleEnumArgs& Value) { + return FReducer::InsertOneSimpleEnum(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertOneSimpleEnum(const FReducer& Reducer) { return Reducer.IsInsertOneSimpleEnum(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertOneSimpleEnumArgs GetAsInsertOneSimpleEnum(const FReducer& Reducer) { + return Reducer.GetAsInsertOneSimpleEnum(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertOneString(const FInsertOneStringArgs& Value) { + return FReducer::InsertOneString(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertOneString(const FReducer& Reducer) { return Reducer.IsInsertOneString(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertOneStringArgs GetAsInsertOneString(const FReducer& Reducer) { + return Reducer.GetAsInsertOneString(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertOneTimestamp(const FInsertOneTimestampArgs& Value) { + return FReducer::InsertOneTimestamp(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertOneTimestamp(const FReducer& Reducer) { return Reducer.IsInsertOneTimestamp(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertOneTimestampArgs GetAsInsertOneTimestamp(const FReducer& Reducer) { + return Reducer.GetAsInsertOneTimestamp(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertOneU128(const FInsertOneU128Args& Value) { + return FReducer::InsertOneU128(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertOneU128(const FReducer& Reducer) { return Reducer.IsInsertOneU128(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertOneU128Args GetAsInsertOneU128(const FReducer& Reducer) { + return Reducer.GetAsInsertOneU128(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertOneU16(const FInsertOneU16Args& Value) { + return FReducer::InsertOneU16(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertOneU16(const FReducer& Reducer) { return Reducer.IsInsertOneU16(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertOneU16Args GetAsInsertOneU16(const FReducer& Reducer) { + return Reducer.GetAsInsertOneU16(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertOneU256(const FInsertOneU256Args& Value) { + return FReducer::InsertOneU256(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertOneU256(const FReducer& Reducer) { return Reducer.IsInsertOneU256(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertOneU256Args GetAsInsertOneU256(const FReducer& Reducer) { + return Reducer.GetAsInsertOneU256(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertOneU32(const FInsertOneU32Args& Value) { + return FReducer::InsertOneU32(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertOneU32(const FReducer& Reducer) { return Reducer.IsInsertOneU32(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertOneU32Args GetAsInsertOneU32(const FReducer& Reducer) { + return Reducer.GetAsInsertOneU32(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertOneU64(const FInsertOneU64Args& Value) { + return FReducer::InsertOneU64(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertOneU64(const FReducer& Reducer) { return Reducer.IsInsertOneU64(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertOneU64Args GetAsInsertOneU64(const FReducer& Reducer) { + return Reducer.GetAsInsertOneU64(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertOneU8(const FInsertOneU8Args& Value) { + return FReducer::InsertOneU8(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertOneU8(const FReducer& Reducer) { return Reducer.IsInsertOneU8(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertOneU8Args GetAsInsertOneU8(const FReducer& Reducer) { + return Reducer.GetAsInsertOneU8(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertOneUnitStruct(const FInsertOneUnitStructArgs& Value) { + return FReducer::InsertOneUnitStruct(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertOneUnitStruct(const FReducer& Reducer) { return Reducer.IsInsertOneUnitStruct(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertOneUnitStructArgs GetAsInsertOneUnitStruct(const FReducer& Reducer) { + return Reducer.GetAsInsertOneUnitStruct(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertOptionEveryPrimitiveStruct(const FInsertOptionEveryPrimitiveStructArgs& Value) { + return FReducer::InsertOptionEveryPrimitiveStruct(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertOptionEveryPrimitiveStruct(const FReducer& Reducer) { return Reducer.IsInsertOptionEveryPrimitiveStruct(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertOptionEveryPrimitiveStructArgs GetAsInsertOptionEveryPrimitiveStruct(const FReducer& Reducer) { + return Reducer.GetAsInsertOptionEveryPrimitiveStruct(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertOptionI32(const FInsertOptionI32Args& Value) { + return FReducer::InsertOptionI32(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertOptionI32(const FReducer& Reducer) { return Reducer.IsInsertOptionI32(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertOptionI32Args GetAsInsertOptionI32(const FReducer& Reducer) { + return Reducer.GetAsInsertOptionI32(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertOptionIdentity(const FInsertOptionIdentityArgs& Value) { + return FReducer::InsertOptionIdentity(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertOptionIdentity(const FReducer& Reducer) { return Reducer.IsInsertOptionIdentity(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertOptionIdentityArgs GetAsInsertOptionIdentity(const FReducer& Reducer) { + return Reducer.GetAsInsertOptionIdentity(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertOptionSimpleEnum(const FInsertOptionSimpleEnumArgs& Value) { + return FReducer::InsertOptionSimpleEnum(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertOptionSimpleEnum(const FReducer& Reducer) { return Reducer.IsInsertOptionSimpleEnum(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertOptionSimpleEnumArgs GetAsInsertOptionSimpleEnum(const FReducer& Reducer) { + return Reducer.GetAsInsertOptionSimpleEnum(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertOptionString(const FInsertOptionStringArgs& Value) { + return FReducer::InsertOptionString(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertOptionString(const FReducer& Reducer) { return Reducer.IsInsertOptionString(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertOptionStringArgs GetAsInsertOptionString(const FReducer& Reducer) { + return Reducer.GetAsInsertOptionString(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertOptionVecOptionI32(const FInsertOptionVecOptionI32Args& Value) { + return FReducer::InsertOptionVecOptionI32(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertOptionVecOptionI32(const FReducer& Reducer) { return Reducer.IsInsertOptionVecOptionI32(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertOptionVecOptionI32Args GetAsInsertOptionVecOptionI32(const FReducer& Reducer) { + return Reducer.GetAsInsertOptionVecOptionI32(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertPkBool(const FInsertPkBoolArgs& Value) { + return FReducer::InsertPkBool(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertPkBool(const FReducer& Reducer) { return Reducer.IsInsertPkBool(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertPkBoolArgs GetAsInsertPkBool(const FReducer& Reducer) { + return Reducer.GetAsInsertPkBool(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertPkConnectionId(const FInsertPkConnectionIdArgs& Value) { + return FReducer::InsertPkConnectionId(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertPkConnectionId(const FReducer& Reducer) { return Reducer.IsInsertPkConnectionId(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertPkConnectionIdArgs GetAsInsertPkConnectionId(const FReducer& Reducer) { + return Reducer.GetAsInsertPkConnectionId(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertPkI128(const FInsertPkI128Args& Value) { + return FReducer::InsertPkI128(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertPkI128(const FReducer& Reducer) { return Reducer.IsInsertPkI128(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertPkI128Args GetAsInsertPkI128(const FReducer& Reducer) { + return Reducer.GetAsInsertPkI128(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertPkI16(const FInsertPkI16Args& Value) { + return FReducer::InsertPkI16(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertPkI16(const FReducer& Reducer) { return Reducer.IsInsertPkI16(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertPkI16Args GetAsInsertPkI16(const FReducer& Reducer) { + return Reducer.GetAsInsertPkI16(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertPkI256(const FInsertPkI256Args& Value) { + return FReducer::InsertPkI256(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertPkI256(const FReducer& Reducer) { return Reducer.IsInsertPkI256(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertPkI256Args GetAsInsertPkI256(const FReducer& Reducer) { + return Reducer.GetAsInsertPkI256(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertPkI32(const FInsertPkI32Args& Value) { + return FReducer::InsertPkI32(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertPkI32(const FReducer& Reducer) { return Reducer.IsInsertPkI32(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertPkI32Args GetAsInsertPkI32(const FReducer& Reducer) { + return Reducer.GetAsInsertPkI32(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertPkI64(const FInsertPkI64Args& Value) { + return FReducer::InsertPkI64(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertPkI64(const FReducer& Reducer) { return Reducer.IsInsertPkI64(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertPkI64Args GetAsInsertPkI64(const FReducer& Reducer) { + return Reducer.GetAsInsertPkI64(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertPkI8(const FInsertPkI8Args& Value) { + return FReducer::InsertPkI8(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertPkI8(const FReducer& Reducer) { return Reducer.IsInsertPkI8(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertPkI8Args GetAsInsertPkI8(const FReducer& Reducer) { + return Reducer.GetAsInsertPkI8(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertPkIdentity(const FInsertPkIdentityArgs& Value) { + return FReducer::InsertPkIdentity(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertPkIdentity(const FReducer& Reducer) { return Reducer.IsInsertPkIdentity(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertPkIdentityArgs GetAsInsertPkIdentity(const FReducer& Reducer) { + return Reducer.GetAsInsertPkIdentity(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertPkSimpleEnum(const FInsertPkSimpleEnumArgs& Value) { + return FReducer::InsertPkSimpleEnum(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertPkSimpleEnum(const FReducer& Reducer) { return Reducer.IsInsertPkSimpleEnum(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertPkSimpleEnumArgs GetAsInsertPkSimpleEnum(const FReducer& Reducer) { + return Reducer.GetAsInsertPkSimpleEnum(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertPkString(const FInsertPkStringArgs& Value) { + return FReducer::InsertPkString(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertPkString(const FReducer& Reducer) { return Reducer.IsInsertPkString(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertPkStringArgs GetAsInsertPkString(const FReducer& Reducer) { + return Reducer.GetAsInsertPkString(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertPkU128(const FInsertPkU128Args& Value) { + return FReducer::InsertPkU128(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertPkU128(const FReducer& Reducer) { return Reducer.IsInsertPkU128(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertPkU128Args GetAsInsertPkU128(const FReducer& Reducer) { + return Reducer.GetAsInsertPkU128(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertPkU16(const FInsertPkU16Args& Value) { + return FReducer::InsertPkU16(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertPkU16(const FReducer& Reducer) { return Reducer.IsInsertPkU16(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertPkU16Args GetAsInsertPkU16(const FReducer& Reducer) { + return Reducer.GetAsInsertPkU16(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertPkU256(const FInsertPkU256Args& Value) { + return FReducer::InsertPkU256(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertPkU256(const FReducer& Reducer) { return Reducer.IsInsertPkU256(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertPkU256Args GetAsInsertPkU256(const FReducer& Reducer) { + return Reducer.GetAsInsertPkU256(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertPkU32(const FInsertPkU32Args& Value) { + return FReducer::InsertPkU32(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertPkU32(const FReducer& Reducer) { return Reducer.IsInsertPkU32(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertPkU32Args GetAsInsertPkU32(const FReducer& Reducer) { + return Reducer.GetAsInsertPkU32(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertPkU32Two(const FInsertPkU32TwoArgs& Value) { + return FReducer::InsertPkU32Two(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertPkU32Two(const FReducer& Reducer) { return Reducer.IsInsertPkU32Two(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertPkU32TwoArgs GetAsInsertPkU32Two(const FReducer& Reducer) { + return Reducer.GetAsInsertPkU32Two(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertPkU64(const FInsertPkU64Args& Value) { + return FReducer::InsertPkU64(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertPkU64(const FReducer& Reducer) { return Reducer.IsInsertPkU64(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertPkU64Args GetAsInsertPkU64(const FReducer& Reducer) { + return Reducer.GetAsInsertPkU64(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertPkU8(const FInsertPkU8Args& Value) { + return FReducer::InsertPkU8(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertPkU8(const FReducer& Reducer) { return Reducer.IsInsertPkU8(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertPkU8Args GetAsInsertPkU8(const FReducer& Reducer) { + return Reducer.GetAsInsertPkU8(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertPrimitivesAsStrings(const FInsertPrimitivesAsStringsArgs& Value) { + return FReducer::InsertPrimitivesAsStrings(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertPrimitivesAsStrings(const FReducer& Reducer) { return Reducer.IsInsertPrimitivesAsStrings(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertPrimitivesAsStringsArgs GetAsInsertPrimitivesAsStrings(const FReducer& Reducer) { + return Reducer.GetAsInsertPrimitivesAsStrings(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertTableHoldsTable(const FInsertTableHoldsTableArgs& Value) { + return FReducer::InsertTableHoldsTable(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertTableHoldsTable(const FReducer& Reducer) { return Reducer.IsInsertTableHoldsTable(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertTableHoldsTableArgs GetAsInsertTableHoldsTable(const FReducer& Reducer) { + return Reducer.GetAsInsertTableHoldsTable(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertUniqueBool(const FInsertUniqueBoolArgs& Value) { + return FReducer::InsertUniqueBool(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertUniqueBool(const FReducer& Reducer) { return Reducer.IsInsertUniqueBool(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertUniqueBoolArgs GetAsInsertUniqueBool(const FReducer& Reducer) { + return Reducer.GetAsInsertUniqueBool(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertUniqueConnectionId(const FInsertUniqueConnectionIdArgs& Value) { + return FReducer::InsertUniqueConnectionId(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertUniqueConnectionId(const FReducer& Reducer) { return Reducer.IsInsertUniqueConnectionId(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertUniqueConnectionIdArgs GetAsInsertUniqueConnectionId(const FReducer& Reducer) { + return Reducer.GetAsInsertUniqueConnectionId(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertUniqueI128(const FInsertUniqueI128Args& Value) { + return FReducer::InsertUniqueI128(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertUniqueI128(const FReducer& Reducer) { return Reducer.IsInsertUniqueI128(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertUniqueI128Args GetAsInsertUniqueI128(const FReducer& Reducer) { + return Reducer.GetAsInsertUniqueI128(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertUniqueI16(const FInsertUniqueI16Args& Value) { + return FReducer::InsertUniqueI16(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertUniqueI16(const FReducer& Reducer) { return Reducer.IsInsertUniqueI16(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertUniqueI16Args GetAsInsertUniqueI16(const FReducer& Reducer) { + return Reducer.GetAsInsertUniqueI16(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertUniqueI256(const FInsertUniqueI256Args& Value) { + return FReducer::InsertUniqueI256(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertUniqueI256(const FReducer& Reducer) { return Reducer.IsInsertUniqueI256(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertUniqueI256Args GetAsInsertUniqueI256(const FReducer& Reducer) { + return Reducer.GetAsInsertUniqueI256(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertUniqueI32(const FInsertUniqueI32Args& Value) { + return FReducer::InsertUniqueI32(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertUniqueI32(const FReducer& Reducer) { return Reducer.IsInsertUniqueI32(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertUniqueI32Args GetAsInsertUniqueI32(const FReducer& Reducer) { + return Reducer.GetAsInsertUniqueI32(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertUniqueI64(const FInsertUniqueI64Args& Value) { + return FReducer::InsertUniqueI64(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertUniqueI64(const FReducer& Reducer) { return Reducer.IsInsertUniqueI64(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertUniqueI64Args GetAsInsertUniqueI64(const FReducer& Reducer) { + return Reducer.GetAsInsertUniqueI64(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertUniqueI8(const FInsertUniqueI8Args& Value) { + return FReducer::InsertUniqueI8(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertUniqueI8(const FReducer& Reducer) { return Reducer.IsInsertUniqueI8(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertUniqueI8Args GetAsInsertUniqueI8(const FReducer& Reducer) { + return Reducer.GetAsInsertUniqueI8(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertUniqueIdentity(const FInsertUniqueIdentityArgs& Value) { + return FReducer::InsertUniqueIdentity(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertUniqueIdentity(const FReducer& Reducer) { return Reducer.IsInsertUniqueIdentity(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertUniqueIdentityArgs GetAsInsertUniqueIdentity(const FReducer& Reducer) { + return Reducer.GetAsInsertUniqueIdentity(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertUniqueString(const FInsertUniqueStringArgs& Value) { + return FReducer::InsertUniqueString(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertUniqueString(const FReducer& Reducer) { return Reducer.IsInsertUniqueString(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertUniqueStringArgs GetAsInsertUniqueString(const FReducer& Reducer) { + return Reducer.GetAsInsertUniqueString(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertUniqueU128(const FInsertUniqueU128Args& Value) { + return FReducer::InsertUniqueU128(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertUniqueU128(const FReducer& Reducer) { return Reducer.IsInsertUniqueU128(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertUniqueU128Args GetAsInsertUniqueU128(const FReducer& Reducer) { + return Reducer.GetAsInsertUniqueU128(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertUniqueU16(const FInsertUniqueU16Args& Value) { + return FReducer::InsertUniqueU16(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertUniqueU16(const FReducer& Reducer) { return Reducer.IsInsertUniqueU16(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertUniqueU16Args GetAsInsertUniqueU16(const FReducer& Reducer) { + return Reducer.GetAsInsertUniqueU16(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertUniqueU256(const FInsertUniqueU256Args& Value) { + return FReducer::InsertUniqueU256(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertUniqueU256(const FReducer& Reducer) { return Reducer.IsInsertUniqueU256(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertUniqueU256Args GetAsInsertUniqueU256(const FReducer& Reducer) { + return Reducer.GetAsInsertUniqueU256(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertUniqueU32(const FInsertUniqueU32Args& Value) { + return FReducer::InsertUniqueU32(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertUniqueU32(const FReducer& Reducer) { return Reducer.IsInsertUniqueU32(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertUniqueU32Args GetAsInsertUniqueU32(const FReducer& Reducer) { + return Reducer.GetAsInsertUniqueU32(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertUniqueU32UpdatePkU32(const FInsertUniqueU32UpdatePkU32Args& Value) { + return FReducer::InsertUniqueU32UpdatePkU32(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertUniqueU32UpdatePkU32(const FReducer& Reducer) { return Reducer.IsInsertUniqueU32UpdatePkU32(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertUniqueU32UpdatePkU32Args GetAsInsertUniqueU32UpdatePkU32(const FReducer& Reducer) { + return Reducer.GetAsInsertUniqueU32UpdatePkU32(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertUniqueU64(const FInsertUniqueU64Args& Value) { + return FReducer::InsertUniqueU64(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertUniqueU64(const FReducer& Reducer) { return Reducer.IsInsertUniqueU64(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertUniqueU64Args GetAsInsertUniqueU64(const FReducer& Reducer) { + return Reducer.GetAsInsertUniqueU64(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertUniqueU8(const FInsertUniqueU8Args& Value) { + return FReducer::InsertUniqueU8(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertUniqueU8(const FReducer& Reducer) { return Reducer.IsInsertUniqueU8(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertUniqueU8Args GetAsInsertUniqueU8(const FReducer& Reducer) { + return Reducer.GetAsInsertUniqueU8(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertUser(const FInsertUserArgs& Value) { + return FReducer::InsertUser(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertUser(const FReducer& Reducer) { return Reducer.IsInsertUser(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertUserArgs GetAsInsertUser(const FReducer& Reducer) { + return Reducer.GetAsInsertUser(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertVecBool(const FInsertVecBoolArgs& Value) { + return FReducer::InsertVecBool(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertVecBool(const FReducer& Reducer) { return Reducer.IsInsertVecBool(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertVecBoolArgs GetAsInsertVecBool(const FReducer& Reducer) { + return Reducer.GetAsInsertVecBool(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertVecByteStruct(const FInsertVecByteStructArgs& Value) { + return FReducer::InsertVecByteStruct(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertVecByteStruct(const FReducer& Reducer) { return Reducer.IsInsertVecByteStruct(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertVecByteStructArgs GetAsInsertVecByteStruct(const FReducer& Reducer) { + return Reducer.GetAsInsertVecByteStruct(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertVecConnectionId(const FInsertVecConnectionIdArgs& Value) { + return FReducer::InsertVecConnectionId(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertVecConnectionId(const FReducer& Reducer) { return Reducer.IsInsertVecConnectionId(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertVecConnectionIdArgs GetAsInsertVecConnectionId(const FReducer& Reducer) { + return Reducer.GetAsInsertVecConnectionId(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertVecEnumWithPayload(const FInsertVecEnumWithPayloadArgs& Value) { + return FReducer::InsertVecEnumWithPayload(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertVecEnumWithPayload(const FReducer& Reducer) { return Reducer.IsInsertVecEnumWithPayload(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertVecEnumWithPayloadArgs GetAsInsertVecEnumWithPayload(const FReducer& Reducer) { + return Reducer.GetAsInsertVecEnumWithPayload(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertVecEveryPrimitiveStruct(const FInsertVecEveryPrimitiveStructArgs& Value) { + return FReducer::InsertVecEveryPrimitiveStruct(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertVecEveryPrimitiveStruct(const FReducer& Reducer) { return Reducer.IsInsertVecEveryPrimitiveStruct(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertVecEveryPrimitiveStructArgs GetAsInsertVecEveryPrimitiveStruct(const FReducer& Reducer) { + return Reducer.GetAsInsertVecEveryPrimitiveStruct(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertVecEveryVecStruct(const FInsertVecEveryVecStructArgs& Value) { + return FReducer::InsertVecEveryVecStruct(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertVecEveryVecStruct(const FReducer& Reducer) { return Reducer.IsInsertVecEveryVecStruct(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertVecEveryVecStructArgs GetAsInsertVecEveryVecStruct(const FReducer& Reducer) { + return Reducer.GetAsInsertVecEveryVecStruct(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertVecF32(const FInsertVecF32Args& Value) { + return FReducer::InsertVecF32(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertVecF32(const FReducer& Reducer) { return Reducer.IsInsertVecF32(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertVecF32Args GetAsInsertVecF32(const FReducer& Reducer) { + return Reducer.GetAsInsertVecF32(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertVecF64(const FInsertVecF64Args& Value) { + return FReducer::InsertVecF64(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertVecF64(const FReducer& Reducer) { return Reducer.IsInsertVecF64(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertVecF64Args GetAsInsertVecF64(const FReducer& Reducer) { + return Reducer.GetAsInsertVecF64(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertVecI128(const FInsertVecI128Args& Value) { + return FReducer::InsertVecI128(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertVecI128(const FReducer& Reducer) { return Reducer.IsInsertVecI128(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertVecI128Args GetAsInsertVecI128(const FReducer& Reducer) { + return Reducer.GetAsInsertVecI128(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertVecI16(const FInsertVecI16Args& Value) { + return FReducer::InsertVecI16(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertVecI16(const FReducer& Reducer) { return Reducer.IsInsertVecI16(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertVecI16Args GetAsInsertVecI16(const FReducer& Reducer) { + return Reducer.GetAsInsertVecI16(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertVecI256(const FInsertVecI256Args& Value) { + return FReducer::InsertVecI256(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertVecI256(const FReducer& Reducer) { return Reducer.IsInsertVecI256(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertVecI256Args GetAsInsertVecI256(const FReducer& Reducer) { + return Reducer.GetAsInsertVecI256(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertVecI32(const FInsertVecI32Args& Value) { + return FReducer::InsertVecI32(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertVecI32(const FReducer& Reducer) { return Reducer.IsInsertVecI32(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertVecI32Args GetAsInsertVecI32(const FReducer& Reducer) { + return Reducer.GetAsInsertVecI32(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertVecI64(const FInsertVecI64Args& Value) { + return FReducer::InsertVecI64(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertVecI64(const FReducer& Reducer) { return Reducer.IsInsertVecI64(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertVecI64Args GetAsInsertVecI64(const FReducer& Reducer) { + return Reducer.GetAsInsertVecI64(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertVecI8(const FInsertVecI8Args& Value) { + return FReducer::InsertVecI8(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertVecI8(const FReducer& Reducer) { return Reducer.IsInsertVecI8(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertVecI8Args GetAsInsertVecI8(const FReducer& Reducer) { + return Reducer.GetAsInsertVecI8(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertVecIdentity(const FInsertVecIdentityArgs& Value) { + return FReducer::InsertVecIdentity(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertVecIdentity(const FReducer& Reducer) { return Reducer.IsInsertVecIdentity(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertVecIdentityArgs GetAsInsertVecIdentity(const FReducer& Reducer) { + return Reducer.GetAsInsertVecIdentity(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertVecSimpleEnum(const FInsertVecSimpleEnumArgs& Value) { + return FReducer::InsertVecSimpleEnum(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertVecSimpleEnum(const FReducer& Reducer) { return Reducer.IsInsertVecSimpleEnum(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertVecSimpleEnumArgs GetAsInsertVecSimpleEnum(const FReducer& Reducer) { + return Reducer.GetAsInsertVecSimpleEnum(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertVecString(const FInsertVecStringArgs& Value) { + return FReducer::InsertVecString(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertVecString(const FReducer& Reducer) { return Reducer.IsInsertVecString(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertVecStringArgs GetAsInsertVecString(const FReducer& Reducer) { + return Reducer.GetAsInsertVecString(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertVecTimestamp(const FInsertVecTimestampArgs& Value) { + return FReducer::InsertVecTimestamp(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertVecTimestamp(const FReducer& Reducer) { return Reducer.IsInsertVecTimestamp(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertVecTimestampArgs GetAsInsertVecTimestamp(const FReducer& Reducer) { + return Reducer.GetAsInsertVecTimestamp(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertVecU128(const FInsertVecU128Args& Value) { + return FReducer::InsertVecU128(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertVecU128(const FReducer& Reducer) { return Reducer.IsInsertVecU128(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertVecU128Args GetAsInsertVecU128(const FReducer& Reducer) { + return Reducer.GetAsInsertVecU128(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertVecU16(const FInsertVecU16Args& Value) { + return FReducer::InsertVecU16(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertVecU16(const FReducer& Reducer) { return Reducer.IsInsertVecU16(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertVecU16Args GetAsInsertVecU16(const FReducer& Reducer) { + return Reducer.GetAsInsertVecU16(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertVecU256(const FInsertVecU256Args& Value) { + return FReducer::InsertVecU256(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertVecU256(const FReducer& Reducer) { return Reducer.IsInsertVecU256(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertVecU256Args GetAsInsertVecU256(const FReducer& Reducer) { + return Reducer.GetAsInsertVecU256(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertVecU32(const FInsertVecU32Args& Value) { + return FReducer::InsertVecU32(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertVecU32(const FReducer& Reducer) { return Reducer.IsInsertVecU32(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertVecU32Args GetAsInsertVecU32(const FReducer& Reducer) { + return Reducer.GetAsInsertVecU32(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertVecU64(const FInsertVecU64Args& Value) { + return FReducer::InsertVecU64(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertVecU64(const FReducer& Reducer) { return Reducer.IsInsertVecU64(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertVecU64Args GetAsInsertVecU64(const FReducer& Reducer) { + return Reducer.GetAsInsertVecU64(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertVecU8(const FInsertVecU8Args& Value) { + return FReducer::InsertVecU8(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertVecU8(const FReducer& Reducer) { return Reducer.IsInsertVecU8(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertVecU8Args GetAsInsertVecU8(const FReducer& Reducer) { + return Reducer.GetAsInsertVecU8(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer InsertVecUnitStruct(const FInsertVecUnitStructArgs& Value) { + return FReducer::InsertVecUnitStruct(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsInsertVecUnitStruct(const FReducer& Reducer) { return Reducer.IsInsertVecUnitStruct(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FInsertVecUnitStructArgs GetAsInsertVecUnitStruct(const FReducer& Reducer) { + return Reducer.GetAsInsertVecUnitStruct(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer NoOpSucceeds(const FNoOpSucceedsArgs& Value) { + return FReducer::NoOpSucceeds(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsNoOpSucceeds(const FReducer& Reducer) { return Reducer.IsNoOpSucceeds(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FNoOpSucceedsArgs GetAsNoOpSucceeds(const FReducer& Reducer) { + return Reducer.GetAsNoOpSucceeds(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer SendScheduledMessage(const FSendScheduledMessageArgs& Value) { + return FReducer::SendScheduledMessage(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsSendScheduledMessage(const FReducer& Reducer) { return Reducer.IsSendScheduledMessage(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FSendScheduledMessageArgs GetAsSendScheduledMessage(const FReducer& Reducer) { + return Reducer.GetAsSendScheduledMessage(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer UpdateIndexedSimpleEnum(const FUpdateIndexedSimpleEnumArgs& Value) { + return FReducer::UpdateIndexedSimpleEnum(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsUpdateIndexedSimpleEnum(const FReducer& Reducer) { return Reducer.IsUpdateIndexedSimpleEnum(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FUpdateIndexedSimpleEnumArgs GetAsUpdateIndexedSimpleEnum(const FReducer& Reducer) { + return Reducer.GetAsUpdateIndexedSimpleEnum(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer UpdatePkBool(const FUpdatePkBoolArgs& Value) { + return FReducer::UpdatePkBool(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsUpdatePkBool(const FReducer& Reducer) { return Reducer.IsUpdatePkBool(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FUpdatePkBoolArgs GetAsUpdatePkBool(const FReducer& Reducer) { + return Reducer.GetAsUpdatePkBool(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer UpdatePkConnectionId(const FUpdatePkConnectionIdArgs& Value) { + return FReducer::UpdatePkConnectionId(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsUpdatePkConnectionId(const FReducer& Reducer) { return Reducer.IsUpdatePkConnectionId(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FUpdatePkConnectionIdArgs GetAsUpdatePkConnectionId(const FReducer& Reducer) { + return Reducer.GetAsUpdatePkConnectionId(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer UpdatePkI128(const FUpdatePkI128Args& Value) { + return FReducer::UpdatePkI128(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsUpdatePkI128(const FReducer& Reducer) { return Reducer.IsUpdatePkI128(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FUpdatePkI128Args GetAsUpdatePkI128(const FReducer& Reducer) { + return Reducer.GetAsUpdatePkI128(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer UpdatePkI16(const FUpdatePkI16Args& Value) { + return FReducer::UpdatePkI16(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsUpdatePkI16(const FReducer& Reducer) { return Reducer.IsUpdatePkI16(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FUpdatePkI16Args GetAsUpdatePkI16(const FReducer& Reducer) { + return Reducer.GetAsUpdatePkI16(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer UpdatePkI256(const FUpdatePkI256Args& Value) { + return FReducer::UpdatePkI256(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsUpdatePkI256(const FReducer& Reducer) { return Reducer.IsUpdatePkI256(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FUpdatePkI256Args GetAsUpdatePkI256(const FReducer& Reducer) { + return Reducer.GetAsUpdatePkI256(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer UpdatePkI32(const FUpdatePkI32Args& Value) { + return FReducer::UpdatePkI32(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsUpdatePkI32(const FReducer& Reducer) { return Reducer.IsUpdatePkI32(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FUpdatePkI32Args GetAsUpdatePkI32(const FReducer& Reducer) { + return Reducer.GetAsUpdatePkI32(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer UpdatePkI64(const FUpdatePkI64Args& Value) { + return FReducer::UpdatePkI64(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsUpdatePkI64(const FReducer& Reducer) { return Reducer.IsUpdatePkI64(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FUpdatePkI64Args GetAsUpdatePkI64(const FReducer& Reducer) { + return Reducer.GetAsUpdatePkI64(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer UpdatePkI8(const FUpdatePkI8Args& Value) { + return FReducer::UpdatePkI8(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsUpdatePkI8(const FReducer& Reducer) { return Reducer.IsUpdatePkI8(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FUpdatePkI8Args GetAsUpdatePkI8(const FReducer& Reducer) { + return Reducer.GetAsUpdatePkI8(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer UpdatePkIdentity(const FUpdatePkIdentityArgs& Value) { + return FReducer::UpdatePkIdentity(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsUpdatePkIdentity(const FReducer& Reducer) { return Reducer.IsUpdatePkIdentity(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FUpdatePkIdentityArgs GetAsUpdatePkIdentity(const FReducer& Reducer) { + return Reducer.GetAsUpdatePkIdentity(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer UpdatePkSimpleEnum(const FUpdatePkSimpleEnumArgs& Value) { + return FReducer::UpdatePkSimpleEnum(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsUpdatePkSimpleEnum(const FReducer& Reducer) { return Reducer.IsUpdatePkSimpleEnum(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FUpdatePkSimpleEnumArgs GetAsUpdatePkSimpleEnum(const FReducer& Reducer) { + return Reducer.GetAsUpdatePkSimpleEnum(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer UpdatePkString(const FUpdatePkStringArgs& Value) { + return FReducer::UpdatePkString(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsUpdatePkString(const FReducer& Reducer) { return Reducer.IsUpdatePkString(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FUpdatePkStringArgs GetAsUpdatePkString(const FReducer& Reducer) { + return Reducer.GetAsUpdatePkString(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer UpdatePkU128(const FUpdatePkU128Args& Value) { + return FReducer::UpdatePkU128(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsUpdatePkU128(const FReducer& Reducer) { return Reducer.IsUpdatePkU128(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FUpdatePkU128Args GetAsUpdatePkU128(const FReducer& Reducer) { + return Reducer.GetAsUpdatePkU128(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer UpdatePkU16(const FUpdatePkU16Args& Value) { + return FReducer::UpdatePkU16(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsUpdatePkU16(const FReducer& Reducer) { return Reducer.IsUpdatePkU16(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FUpdatePkU16Args GetAsUpdatePkU16(const FReducer& Reducer) { + return Reducer.GetAsUpdatePkU16(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer UpdatePkU256(const FUpdatePkU256Args& Value) { + return FReducer::UpdatePkU256(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsUpdatePkU256(const FReducer& Reducer) { return Reducer.IsUpdatePkU256(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FUpdatePkU256Args GetAsUpdatePkU256(const FReducer& Reducer) { + return Reducer.GetAsUpdatePkU256(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer UpdatePkU32(const FUpdatePkU32Args& Value) { + return FReducer::UpdatePkU32(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsUpdatePkU32(const FReducer& Reducer) { return Reducer.IsUpdatePkU32(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FUpdatePkU32Args GetAsUpdatePkU32(const FReducer& Reducer) { + return Reducer.GetAsUpdatePkU32(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer UpdatePkU32Two(const FUpdatePkU32TwoArgs& Value) { + return FReducer::UpdatePkU32Two(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsUpdatePkU32Two(const FReducer& Reducer) { return Reducer.IsUpdatePkU32Two(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FUpdatePkU32TwoArgs GetAsUpdatePkU32Two(const FReducer& Reducer) { + return Reducer.GetAsUpdatePkU32Two(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer UpdatePkU64(const FUpdatePkU64Args& Value) { + return FReducer::UpdatePkU64(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsUpdatePkU64(const FReducer& Reducer) { return Reducer.IsUpdatePkU64(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FUpdatePkU64Args GetAsUpdatePkU64(const FReducer& Reducer) { + return Reducer.GetAsUpdatePkU64(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer UpdatePkU8(const FUpdatePkU8Args& Value) { + return FReducer::UpdatePkU8(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsUpdatePkU8(const FReducer& Reducer) { return Reducer.IsUpdatePkU8(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FUpdatePkU8Args GetAsUpdatePkU8(const FReducer& Reducer) { + return Reducer.GetAsUpdatePkU8(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer UpdateUniqueBool(const FUpdateUniqueBoolArgs& Value) { + return FReducer::UpdateUniqueBool(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsUpdateUniqueBool(const FReducer& Reducer) { return Reducer.IsUpdateUniqueBool(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FUpdateUniqueBoolArgs GetAsUpdateUniqueBool(const FReducer& Reducer) { + return Reducer.GetAsUpdateUniqueBool(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer UpdateUniqueConnectionId(const FUpdateUniqueConnectionIdArgs& Value) { + return FReducer::UpdateUniqueConnectionId(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsUpdateUniqueConnectionId(const FReducer& Reducer) { return Reducer.IsUpdateUniqueConnectionId(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FUpdateUniqueConnectionIdArgs GetAsUpdateUniqueConnectionId(const FReducer& Reducer) { + return Reducer.GetAsUpdateUniqueConnectionId(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer UpdateUniqueI128(const FUpdateUniqueI128Args& Value) { + return FReducer::UpdateUniqueI128(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsUpdateUniqueI128(const FReducer& Reducer) { return Reducer.IsUpdateUniqueI128(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FUpdateUniqueI128Args GetAsUpdateUniqueI128(const FReducer& Reducer) { + return Reducer.GetAsUpdateUniqueI128(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer UpdateUniqueI16(const FUpdateUniqueI16Args& Value) { + return FReducer::UpdateUniqueI16(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsUpdateUniqueI16(const FReducer& Reducer) { return Reducer.IsUpdateUniqueI16(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FUpdateUniqueI16Args GetAsUpdateUniqueI16(const FReducer& Reducer) { + return Reducer.GetAsUpdateUniqueI16(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer UpdateUniqueI256(const FUpdateUniqueI256Args& Value) { + return FReducer::UpdateUniqueI256(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsUpdateUniqueI256(const FReducer& Reducer) { return Reducer.IsUpdateUniqueI256(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FUpdateUniqueI256Args GetAsUpdateUniqueI256(const FReducer& Reducer) { + return Reducer.GetAsUpdateUniqueI256(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer UpdateUniqueI32(const FUpdateUniqueI32Args& Value) { + return FReducer::UpdateUniqueI32(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsUpdateUniqueI32(const FReducer& Reducer) { return Reducer.IsUpdateUniqueI32(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FUpdateUniqueI32Args GetAsUpdateUniqueI32(const FReducer& Reducer) { + return Reducer.GetAsUpdateUniqueI32(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer UpdateUniqueI64(const FUpdateUniqueI64Args& Value) { + return FReducer::UpdateUniqueI64(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsUpdateUniqueI64(const FReducer& Reducer) { return Reducer.IsUpdateUniqueI64(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FUpdateUniqueI64Args GetAsUpdateUniqueI64(const FReducer& Reducer) { + return Reducer.GetAsUpdateUniqueI64(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer UpdateUniqueI8(const FUpdateUniqueI8Args& Value) { + return FReducer::UpdateUniqueI8(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsUpdateUniqueI8(const FReducer& Reducer) { return Reducer.IsUpdateUniqueI8(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FUpdateUniqueI8Args GetAsUpdateUniqueI8(const FReducer& Reducer) { + return Reducer.GetAsUpdateUniqueI8(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer UpdateUniqueIdentity(const FUpdateUniqueIdentityArgs& Value) { + return FReducer::UpdateUniqueIdentity(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsUpdateUniqueIdentity(const FReducer& Reducer) { return Reducer.IsUpdateUniqueIdentity(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FUpdateUniqueIdentityArgs GetAsUpdateUniqueIdentity(const FReducer& Reducer) { + return Reducer.GetAsUpdateUniqueIdentity(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer UpdateUniqueString(const FUpdateUniqueStringArgs& Value) { + return FReducer::UpdateUniqueString(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsUpdateUniqueString(const FReducer& Reducer) { return Reducer.IsUpdateUniqueString(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FUpdateUniqueStringArgs GetAsUpdateUniqueString(const FReducer& Reducer) { + return Reducer.GetAsUpdateUniqueString(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer UpdateUniqueU128(const FUpdateUniqueU128Args& Value) { + return FReducer::UpdateUniqueU128(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsUpdateUniqueU128(const FReducer& Reducer) { return Reducer.IsUpdateUniqueU128(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FUpdateUniqueU128Args GetAsUpdateUniqueU128(const FReducer& Reducer) { + return Reducer.GetAsUpdateUniqueU128(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer UpdateUniqueU16(const FUpdateUniqueU16Args& Value) { + return FReducer::UpdateUniqueU16(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsUpdateUniqueU16(const FReducer& Reducer) { return Reducer.IsUpdateUniqueU16(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FUpdateUniqueU16Args GetAsUpdateUniqueU16(const FReducer& Reducer) { + return Reducer.GetAsUpdateUniqueU16(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer UpdateUniqueU256(const FUpdateUniqueU256Args& Value) { + return FReducer::UpdateUniqueU256(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsUpdateUniqueU256(const FReducer& Reducer) { return Reducer.IsUpdateUniqueU256(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FUpdateUniqueU256Args GetAsUpdateUniqueU256(const FReducer& Reducer) { + return Reducer.GetAsUpdateUniqueU256(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer UpdateUniqueU32(const FUpdateUniqueU32Args& Value) { + return FReducer::UpdateUniqueU32(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsUpdateUniqueU32(const FReducer& Reducer) { return Reducer.IsUpdateUniqueU32(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FUpdateUniqueU32Args GetAsUpdateUniqueU32(const FReducer& Reducer) { + return Reducer.GetAsUpdateUniqueU32(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer UpdateUniqueU64(const FUpdateUniqueU64Args& Value) { + return FReducer::UpdateUniqueU64(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsUpdateUniqueU64(const FReducer& Reducer) { return Reducer.IsUpdateUniqueU64(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FUpdateUniqueU64Args GetAsUpdateUniqueU64(const FReducer& Reducer) { + return Reducer.GetAsUpdateUniqueU64(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|Reducer") + static FReducer UpdateUniqueU8(const FUpdateUniqueU8Args& Value) { + return FReducer::UpdateUniqueU8(Value); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static bool IsUpdateUniqueU8(const FReducer& Reducer) { return Reducer.IsUpdateUniqueU8(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|Reducer") + static FUpdateUniqueU8Args GetAsUpdateUniqueU8(const FReducer& Reducer) { + return Reducer.GetAsUpdateUniqueU8(); + } +}; + +/** Metadata describing a reducer run. */ +USTRUCT(BlueprintType) +struct TESTCLIENT_API FTestClientReducerEvent +{ + GENERATED_BODY() + + /** Timestamp for when the reducer executed */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBTimestamp Timestamp; + + /** Result status of the reducer */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBStatus Status; + + /** Identity that initiated the call */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBIdentity CallerIdentity; + + /** Connection ID for the caller */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="SpacetimeDB") + FSpacetimeDBConnectionId CallerConnectionId; + + /** Energy consumed while executing */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="SpacetimeDB") + FEnergyQuantaType EnergyConsumed; + + /** Detailed call information */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="SpacetimeDB") + FReducer Reducer; + + FORCEINLINE bool operator==(const FTestClientReducerEvent& Other) const + { + return Status == Other.Status && Timestamp == Other.Timestamp && CallerIdentity == Other.CallerIdentity && + CallerConnectionId == Other.CallerConnectionId && EnergyConsumed == Other.EnergyConsumed && + Reducer == Other.Reducer; + } + + FORCEINLINE bool operator!=(const FTestClientReducerEvent& Other) const + { + return !(*this == Other); + } +}; + +/** Represents event with variant message data. */ +USTRUCT(BlueprintType) +struct TESTCLIENT_API FTestClientEvent +{ + GENERATED_BODY() + + /** Tagged union holding reducer call, unit events, or error string */ + TVariant MessageData; + + /** Type tag indicating what this event represents */ + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + ESpacetimeDBEventTag Tag = ESpacetimeDBEventTag::UnknownTransaction; + + /** === Static factory methods ===*/ + static FTestClientEvent Reducer(const FReducer& Value) + { + FTestClientEvent Obj; + Obj.Tag = ESpacetimeDBEventTag::Reducer; + Obj.MessageData.Set(Value); + return Obj; + } + + static FTestClientEvent SubscribeApplied(const FSpacetimeDBUnit& Value) + { + FTestClientEvent Obj; + Obj.Tag = ESpacetimeDBEventTag::SubscribeApplied; + Obj.MessageData.Set(Value); + return Obj; + } + + static FTestClientEvent UnsubscribeApplied(const FSpacetimeDBUnit& Value) + { + FTestClientEvent Obj; + Obj.Tag = ESpacetimeDBEventTag::UnsubscribeApplied; + Obj.MessageData.Set(Value); + return Obj; + } + + static FTestClientEvent Disconnected(const FSpacetimeDBUnit& Value) + { + FTestClientEvent Obj; + Obj.Tag = ESpacetimeDBEventTag::Disconnected; + Obj.MessageData.Set(Value); + return Obj; + } + + static FTestClientEvent SubscribeError(const FString& Value) + { + FTestClientEvent Obj; + Obj.Tag = ESpacetimeDBEventTag::SubscribeError; + Obj.MessageData.Set(Value); + return Obj; + } + + static FTestClientEvent UnknownTransaction(const FSpacetimeDBUnit& Value) + { + FTestClientEvent Obj; + Obj.Tag = ESpacetimeDBEventTag::UnknownTransaction; + Obj.MessageData.Set(Value); + return Obj; + } + + FORCEINLINE bool IsReducer() const { return Tag == ESpacetimeDBEventTag::Reducer; } + FORCEINLINE FReducer GetAsReducer() const + { + ensureMsgf(IsReducer(), TEXT("MessageData does not hold Reducer!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsSubscribeApplied() const { return Tag == ESpacetimeDBEventTag::SubscribeApplied; } + FORCEINLINE FSpacetimeDBUnit GetAsSubscribeApplied() const + { + ensureMsgf(IsSubscribeApplied(), TEXT("MessageData does not hold SubscribeApplied!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsUnsubscribeApplied() const { return Tag == ESpacetimeDBEventTag::UnsubscribeApplied; } + FORCEINLINE FSpacetimeDBUnit GetAsUnsubscribeApplied() const + { + ensureMsgf(IsUnsubscribeApplied(), TEXT("MessageData does not hold UnsubscribeApplied!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsDisconnected() const { return Tag == ESpacetimeDBEventTag::Disconnected; } + FORCEINLINE FSpacetimeDBUnit GetAsDisconnected() const + { + ensureMsgf(IsDisconnected(), TEXT("MessageData does not hold Disconnected!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsSubscribeError() const { return Tag == ESpacetimeDBEventTag::SubscribeError; } + FORCEINLINE FString GetAsSubscribeError() const + { + ensureMsgf(IsSubscribeError(), TEXT("MessageData does not hold SubscribeError!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsUnknownTransaction() const { return Tag == ESpacetimeDBEventTag::UnknownTransaction; } + FORCEINLINE FSpacetimeDBUnit GetAsUnknownTransaction() const + { + ensureMsgf(IsUnknownTransaction(), TEXT("MessageData does not hold UnknownTransaction!")); + return MessageData.Get(); + } + + FORCEINLINE bool operator==(const FTestClientEvent& Other) const + { + if (Tag != Other.Tag) return false; + switch (Tag) + { + case ESpacetimeDBEventTag::Reducer: return GetAsReducer() == Other.GetAsReducer(); + case ESpacetimeDBEventTag::SubscribeApplied: return GetAsSubscribeApplied() == Other.GetAsSubscribeApplied(); + case ESpacetimeDBEventTag::UnsubscribeApplied: return GetAsUnsubscribeApplied() == Other.GetAsUnsubscribeApplied(); + case ESpacetimeDBEventTag::Disconnected: return GetAsDisconnected() == Other.GetAsDisconnected(); + case ESpacetimeDBEventTag::SubscribeError: return GetAsSubscribeError() == Other.GetAsSubscribeError(); + case ESpacetimeDBEventTag::UnknownTransaction: return GetAsUnknownTransaction() == Other.GetAsUnknownTransaction(); + default: return false; + } + } + + FORCEINLINE bool operator!=(const FTestClientEvent& Other) const + { + return !(*this == Other); + } +}; + +UCLASS() +class TESTCLIENT_API UTestClientEventBpLib : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() + +private: + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|TestClientEvent") + static FTestClientEvent Reducer(const FReducer& InValue) + { + return FTestClientEvent::Reducer(InValue); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|TestClientEvent") + static FTestClientEvent SubscribeApplied(const FSpacetimeDBUnit& InValue) + { + return FTestClientEvent::SubscribeApplied(InValue); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|TestClientEvent") + static FTestClientEvent UnsubscribeApplied(const FSpacetimeDBUnit& InValue) + { + return FTestClientEvent::UnsubscribeApplied(InValue); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|TestClientEvent") + static FTestClientEvent Disconnected(const FSpacetimeDBUnit& InValue) + { + return FTestClientEvent::Disconnected(InValue); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|TestClientEvent") + static FTestClientEvent SubscribeError(const FString& InValue) + { + return FTestClientEvent::SubscribeError(InValue); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|TestClientEvent") + static FTestClientEvent UnknownTransaction(const FSpacetimeDBUnit& InValue) + { + return FTestClientEvent::UnknownTransaction(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|TestClientEvent") + static bool IsReducer(const FTestClientEvent& Event) { return Event.IsReducer(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|TestClientEvent") + static bool IsSubscribeApplied(const FTestClientEvent& Event) { return Event.IsSubscribeApplied(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|TestClientEvent") + static bool IsUnsubscribeApplied(const FTestClientEvent& Event) { return Event.IsUnsubscribeApplied(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|TestClientEvent") + static bool IsDisconnected(const FTestClientEvent& Event) { return Event.IsDisconnected(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|TestClientEvent") + static bool IsSubscribeError(const FTestClientEvent& Event) { return Event.IsSubscribeError(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|TestClientEvent") + static bool IsUnknownTransaction(const FTestClientEvent& Event) { return Event.IsUnknownTransaction(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|TestClientEvent") + static FReducer GetAsReducer(const FTestClientEvent& Event) + { + return Event.GetAsReducer(); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|TestClientEvent") + static FSpacetimeDBUnit GetAsSubscribeApplied(const FTestClientEvent& Event) + { + return Event.GetAsSubscribeApplied(); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|TestClientEvent") + static FSpacetimeDBUnit GetAsUnsubscribeApplied(const FTestClientEvent& Event) + { + return Event.GetAsUnsubscribeApplied(); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|TestClientEvent") + static FSpacetimeDBUnit GetAsDisconnected(const FTestClientEvent& Event) + { + return Event.GetAsDisconnected(); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|TestClientEvent") + static FString GetAsSubscribeError(const FTestClientEvent& Event) + { + return Event.GetAsSubscribeError(); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|TestClientEvent") + static FSpacetimeDBUnit GetAsUnknownTransaction(const FTestClientEvent& Event) + { + return Event.GetAsUnknownTransaction(); + } + +}; + + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FEventContext : public FContextBase +{ + GENERATED_BODY() + + FEventContext() = default; + FEventContext(UDbConnection* InConn, const FTestClientEvent& InEvent) : FContextBase(InConn), Event(InEvent) {} + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FTestClientEvent Event; +}; + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FReducerEventContext : public FContextBase +{ + GENERATED_BODY() + + FReducerEventContext() = default; + FReducerEventContext(UDbConnection* InConn, FTestClientReducerEvent InEvent) : FContextBase(InConn), Event(InEvent) {} + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FTestClientReducerEvent Event; +}; + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FErrorContext : public FContextBase +{ + GENERATED_BODY() + + FErrorContext() = default; + FErrorContext(UDbConnection* InConn, const FString& InError) : FContextBase(InConn), Error(InError) {} + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + FString Error; + +}; + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FSubscriptionEventContext : public FContextBase +{ + GENERATED_BODY() + + FSubscriptionEventContext() = default; + FSubscriptionEventContext(UDbConnection* InConn) : FContextBase(InConn) {} + +}; + +DECLARE_DYNAMIC_DELEGATE_OneParam( + FOnSubscriptionApplied, + FSubscriptionEventContext, Context); + +DECLARE_DYNAMIC_DELEGATE_OneParam( + FOnSubscriptionError, + FErrorContext, Context); + +UCLASS(BlueprintType) +class TESTCLIENT_API USetReducerFlags : public USetReducerFlagsBase +{ + GENERATED_BODY() + +public: + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void DeleteFromBtreeU32(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void DeleteLargeTable(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void DeletePkBool(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void DeletePkConnectionId(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void DeletePkI128(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void DeletePkI16(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void DeletePkI256(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void DeletePkI32(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void DeletePkI64(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void DeletePkI8(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void DeletePkIdentity(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void DeletePkString(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void DeletePkU128(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void DeletePkU16(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void DeletePkU256(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void DeletePkU32(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void DeletePkU32InsertPkU32Two(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void DeletePkU32Two(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void DeletePkU64(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void DeletePkU8(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void DeleteUniqueBool(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void DeleteUniqueConnectionId(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void DeleteUniqueI128(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void DeleteUniqueI16(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void DeleteUniqueI256(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void DeleteUniqueI32(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void DeleteUniqueI64(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void DeleteUniqueI8(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void DeleteUniqueIdentity(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void DeleteUniqueString(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void DeleteUniqueU128(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void DeleteUniqueU16(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void DeleteUniqueU256(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void DeleteUniqueU32(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void DeleteUniqueU64(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void DeleteUniqueU8(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertCallTimestamp(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertCallerOneConnectionId(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertCallerOneIdentity(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertCallerPkConnectionId(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertCallerPkIdentity(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertCallerUniqueConnectionId(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertCallerUniqueIdentity(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertCallerVecConnectionId(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertCallerVecIdentity(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertIntoBtreeU32(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertIntoIndexedSimpleEnum(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertIntoPkBtreeU32(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertLargeTable(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertOneBool(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertOneByteStruct(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertOneConnectionId(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertOneEnumWithPayload(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertOneEveryPrimitiveStruct(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertOneEveryVecStruct(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertOneF32(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertOneF64(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertOneI128(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertOneI16(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertOneI256(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertOneI32(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertOneI64(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertOneI8(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertOneIdentity(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertOneSimpleEnum(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertOneString(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertOneTimestamp(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertOneU128(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertOneU16(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertOneU256(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertOneU32(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertOneU64(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertOneU8(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertOneUnitStruct(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertOptionEveryPrimitiveStruct(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertOptionI32(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertOptionIdentity(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertOptionSimpleEnum(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertOptionString(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertOptionVecOptionI32(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertPkBool(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertPkConnectionId(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertPkI128(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertPkI16(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertPkI256(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertPkI32(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertPkI64(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertPkI8(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertPkIdentity(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertPkSimpleEnum(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertPkString(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertPkU128(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertPkU16(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertPkU256(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertPkU32(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertPkU32Two(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertPkU64(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertPkU8(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertPrimitivesAsStrings(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertTableHoldsTable(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertUniqueBool(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertUniqueConnectionId(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertUniqueI128(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertUniqueI16(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertUniqueI256(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertUniqueI32(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertUniqueI64(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertUniqueI8(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertUniqueIdentity(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertUniqueString(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertUniqueU128(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertUniqueU16(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertUniqueU256(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertUniqueU32(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertUniqueU32UpdatePkU32(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertUniqueU64(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertUniqueU8(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertUser(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertVecBool(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertVecByteStruct(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertVecConnectionId(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertVecEnumWithPayload(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertVecEveryPrimitiveStruct(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertVecEveryVecStruct(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertVecF32(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertVecF64(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertVecI128(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertVecI16(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertVecI256(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertVecI32(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertVecI64(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertVecI8(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertVecIdentity(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertVecSimpleEnum(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertVecString(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertVecTimestamp(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertVecU128(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertVecU16(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertVecU256(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertVecU32(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertVecU64(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertVecU8(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void InsertVecUnitStruct(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void NoOpSucceeds(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void SendScheduledMessage(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void UpdateIndexedSimpleEnum(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void UpdatePkBool(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void UpdatePkConnectionId(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void UpdatePkI128(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void UpdatePkI16(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void UpdatePkI256(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void UpdatePkI32(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void UpdatePkI64(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void UpdatePkI8(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void UpdatePkIdentity(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void UpdatePkSimpleEnum(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void UpdatePkString(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void UpdatePkU128(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void UpdatePkU16(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void UpdatePkU256(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void UpdatePkU32(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void UpdatePkU32Two(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void UpdatePkU64(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void UpdatePkU8(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void UpdateUniqueBool(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void UpdateUniqueConnectionId(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void UpdateUniqueI128(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void UpdateUniqueI16(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void UpdateUniqueI256(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void UpdateUniqueI32(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void UpdateUniqueI64(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void UpdateUniqueI8(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void UpdateUniqueIdentity(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void UpdateUniqueString(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void UpdateUniqueU128(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void UpdateUniqueU16(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void UpdateUniqueU256(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void UpdateUniqueU32(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void UpdateUniqueU64(ECallReducerFlags Flag); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + void UpdateUniqueU8(ECallReducerFlags Flag); + +}; + +// RemoteTables class +UCLASS(BlueprintType) +class TESTCLIENT_API URemoteTables : public UObject +{ + GENERATED_BODY() + +public: + void Initialize(); + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UOneF64Table* OneF64; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UVecU256Table* VecU256; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UOneU32Table* OneU32; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UVecI16Table* VecI16; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UOptionVecOptionI32Table* OptionVecOptionI32; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UVecEnumWithPayloadTable* VecEnumWithPayload; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UVecI128Table* VecI128; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UOneI256Table* OneI256; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UVecF64Table* VecF64; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UOneConnectionIdTable* OneConnectionId; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UUniqueU16Table* UniqueU16; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + ULargeTableTable* LargeTable; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UVecEveryPrimitiveStructTable* VecEveryPrimitiveStruct; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UVecI8Table* VecI8; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UVecI64Table* VecI64; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UVecTimestampTable* VecTimestamp; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UUniqueU64Table* UniqueU64; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UVecU32Table* VecU32; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UVecUnitStructTable* VecUnitStruct; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UOneU64Table* OneU64; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UOneEveryPrimitiveStructTable* OneEveryPrimitiveStruct; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UIndexedTableTable* IndexedTable; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UOptionSimpleEnumTable* OptionSimpleEnum; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UPkU16Table* PkU16; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UOneSimpleEnumTable* OneSimpleEnum; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UUniqueU32Table* UniqueU32; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UUniqueI64Table* UniqueI64; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UVecByteStructTable* VecByteStruct; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UVecU128Table* VecU128; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UVecI32Table* VecI32; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UOneBoolTable* OneBool; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UVecIdentityTable* VecIdentity; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UTableHoldsTableTable* TableHoldsTable; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UUniqueIdentityTable* UniqueIdentity; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UUniqueConnectionIdTable* UniqueConnectionId; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UIndexedSimpleEnumTable* IndexedSimpleEnum; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UOneU8Table* OneU8; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UPkU8Table* PkU8; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UPkI256Table* PkI256; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UPkI16Table* PkI16; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UPkStringTable* PkString; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UOneIdentityTable* OneIdentity; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UOneI64Table* OneI64; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UOptionEveryPrimitiveStructTable* OptionEveryPrimitiveStruct; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UVecBoolTable* VecBool; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UUniqueI16Table* UniqueI16; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UPkSimpleEnumTable* PkSimpleEnum; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UUniqueI32Table* UniqueI32; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UPkI32Table* PkI32; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UUniqueI256Table* UniqueI256; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UUniqueI8Table* UniqueI8; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UOneI16Table* OneI16; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UPkU128Table* PkU128; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UVecU8Table* VecU8; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UOneEnumWithPayloadTable* OneEnumWithPayload; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UPkU64Table* PkU64; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UUniqueU128Table* UniqueU128; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UOneStringTable* OneString; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UOneTimestampTable* OneTimestamp; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UPkBoolTable* PkBool; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UVecSimpleEnumTable* VecSimpleEnum; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UOneU256Table* OneU256; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UOneF32Table* OneF32; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UOneI128Table* OneI128; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UOneU128Table* OneU128; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UOneUnitStructTable* OneUnitStruct; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UVecU16Table* VecU16; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UOneByteStructTable* OneByteStruct; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UScheduledTableTable* ScheduledTable; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UPkConnectionIdTable* PkConnectionId; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UOneI32Table* OneI32; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UPkI128Table* PkI128; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UPkU32Table* PkU32; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UUniqueStringTable* UniqueString; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UPkIdentityTable* PkIdentity; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UUniqueI128Table* UniqueI128; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UOptionI32Table* OptionI32; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UPkI64Table* PkI64; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UPkU32TwoTable* PkU32Two; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UVecU64Table* VecU64; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UVecF32Table* VecF32; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UOneU16Table* OneU16; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UBTreeU32Table* BtreeU32; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UPkI8Table* PkI8; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UPkU256Table* PkU256; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UIndexedTable2Table* IndexedTable2; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UOneEveryVecStructTable* OneEveryVecStruct; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UOptionIdentityTable* OptionIdentity; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UOptionStringTable* OptionString; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UUniqueU256Table* UniqueU256; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UVecConnectionIdTable* VecConnectionId; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UVecEveryVecStructTable* VecEveryVecStruct; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UVecI256Table* VecI256; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UUsersTable* Users; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UVecStringTable* VecString; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UOneI8Table* OneI8; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UUniqueBoolTable* UniqueBool; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + UUniqueU8Table* UniqueU8; + +}; + +// RemoteReducers class +UCLASS(BlueprintType) +class TESTCLIENT_API URemoteReducers : public UObject +{ + GENERATED_BODY() + +public: + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FDeleteFromBtreeU32Handler, + const FReducerEventContext&, Context, + const TArray&, Rows + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FDeleteFromBtreeU32Handler OnDeleteFromBtreeU32; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void DeleteFromBtreeU32(const TArray& Rows); + + bool InvokeDeleteFromBtreeU32(const FReducerEventContext& Context, const UDeleteFromBtreeU32Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FDeleteLargeTableHandler, + const FReducerEventContext&, Context, + const FDeleteLargeTableArgs&, Args + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FDeleteLargeTableHandler OnDeleteLargeTable; + + // NOTE: Not exposed to Blueprint because uint16, uint32, uint64, int8, int16 types are not Blueprint-compatible + void DeleteLargeTable(const uint8 A, const uint16 B, const uint32 C, const uint64 D, const FSpacetimeDBUInt128& E, const FSpacetimeDBUInt256& F, const int8 G, const int16 H, const int32 I, const int64 J, const FSpacetimeDBInt128& K, const FSpacetimeDBInt256& L, const bool M, const float N, const double O, const FString& P, const ESimpleEnumType& Q, const FEnumWithPayloadType& R, const FUnitStructType& S, const FByteStructType& T, const FEveryPrimitiveStructType& U, const FEveryVecStructType& V); + + bool InvokeDeleteLargeTable(const FReducerEventContext& Context, const UDeleteLargeTableReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FDeletePkBoolHandler, + const FReducerEventContext&, Context, + bool, B + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FDeletePkBoolHandler OnDeletePkBool; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void DeletePkBool(const bool B); + + bool InvokeDeletePkBool(const FReducerEventContext& Context, const UDeletePkBoolReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FDeletePkConnectionIdHandler, + const FReducerEventContext&, Context, + const FSpacetimeDBConnectionId&, A + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FDeletePkConnectionIdHandler OnDeletePkConnectionId; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void DeletePkConnectionId(const FSpacetimeDBConnectionId& A); + + bool InvokeDeletePkConnectionId(const FReducerEventContext& Context, const UDeletePkConnectionIdReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FDeletePkI128Handler, + const FReducerEventContext&, Context, + const FSpacetimeDBInt128&, N + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FDeletePkI128Handler OnDeletePkI128; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void DeletePkI128(const FSpacetimeDBInt128& N); + + bool InvokeDeletePkI128(const FReducerEventContext& Context, const UDeletePkI128Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FDeletePkI16Handler, + const FReducerEventContext&, Context, + int16, N + ); + // NOTE: Not exposed to Blueprint because int16 types are not Blueprint-compatible + FDeletePkI16Handler OnDeletePkI16; + + // NOTE: Not exposed to Blueprint because int16 types are not Blueprint-compatible + void DeletePkI16(const int16 N); + + bool InvokeDeletePkI16(const FReducerEventContext& Context, const UDeletePkI16Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FDeletePkI256Handler, + const FReducerEventContext&, Context, + const FSpacetimeDBInt256&, N + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FDeletePkI256Handler OnDeletePkI256; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void DeletePkI256(const FSpacetimeDBInt256& N); + + bool InvokeDeletePkI256(const FReducerEventContext& Context, const UDeletePkI256Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FDeletePkI32Handler, + const FReducerEventContext&, Context, + int32, N + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FDeletePkI32Handler OnDeletePkI32; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void DeletePkI32(const int32 N); + + bool InvokeDeletePkI32(const FReducerEventContext& Context, const UDeletePkI32Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FDeletePkI64Handler, + const FReducerEventContext&, Context, + int64, N + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FDeletePkI64Handler OnDeletePkI64; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void DeletePkI64(const int64 N); + + bool InvokeDeletePkI64(const FReducerEventContext& Context, const UDeletePkI64Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FDeletePkI8Handler, + const FReducerEventContext&, Context, + int8, N + ); + // NOTE: Not exposed to Blueprint because int8 types are not Blueprint-compatible + FDeletePkI8Handler OnDeletePkI8; + + // NOTE: Not exposed to Blueprint because int8 types are not Blueprint-compatible + void DeletePkI8(const int8 N); + + bool InvokeDeletePkI8(const FReducerEventContext& Context, const UDeletePkI8Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FDeletePkIdentityHandler, + const FReducerEventContext&, Context, + const FSpacetimeDBIdentity&, I + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FDeletePkIdentityHandler OnDeletePkIdentity; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void DeletePkIdentity(const FSpacetimeDBIdentity& I); + + bool InvokeDeletePkIdentity(const FReducerEventContext& Context, const UDeletePkIdentityReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FDeletePkStringHandler, + const FReducerEventContext&, Context, + const FString&, S + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FDeletePkStringHandler OnDeletePkString; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void DeletePkString(const FString& S); + + bool InvokeDeletePkString(const FReducerEventContext& Context, const UDeletePkStringReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FDeletePkU128Handler, + const FReducerEventContext&, Context, + const FSpacetimeDBUInt128&, N + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FDeletePkU128Handler OnDeletePkU128; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void DeletePkU128(const FSpacetimeDBUInt128& N); + + bool InvokeDeletePkU128(const FReducerEventContext& Context, const UDeletePkU128Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FDeletePkU16Handler, + const FReducerEventContext&, Context, + uint16, N + ); + // NOTE: Not exposed to Blueprint because uint16 types are not Blueprint-compatible + FDeletePkU16Handler OnDeletePkU16; + + // NOTE: Not exposed to Blueprint because uint16 types are not Blueprint-compatible + void DeletePkU16(const uint16 N); + + bool InvokeDeletePkU16(const FReducerEventContext& Context, const UDeletePkU16Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FDeletePkU256Handler, + const FReducerEventContext&, Context, + const FSpacetimeDBUInt256&, N + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FDeletePkU256Handler OnDeletePkU256; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void DeletePkU256(const FSpacetimeDBUInt256& N); + + bool InvokeDeletePkU256(const FReducerEventContext& Context, const UDeletePkU256Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FDeletePkU32Handler, + const FReducerEventContext&, Context, + uint32, N + ); + // NOTE: Not exposed to Blueprint because uint32 types are not Blueprint-compatible + FDeletePkU32Handler OnDeletePkU32; + + // NOTE: Not exposed to Blueprint because uint32 types are not Blueprint-compatible + void DeletePkU32(const uint32 N); + + bool InvokeDeletePkU32(const FReducerEventContext& Context, const UDeletePkU32Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FDeletePkU32InsertPkU32TwoHandler, + const FReducerEventContext&, Context, + uint32, N, + int32, Data + ); + // NOTE: Not exposed to Blueprint because uint32 types are not Blueprint-compatible + FDeletePkU32InsertPkU32TwoHandler OnDeletePkU32InsertPkU32Two; + + // NOTE: Not exposed to Blueprint because uint32 types are not Blueprint-compatible + void DeletePkU32InsertPkU32Two(const uint32 N, const int32 Data); + + bool InvokeDeletePkU32InsertPkU32Two(const FReducerEventContext& Context, const UDeletePkU32InsertPkU32TwoReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FDeletePkU32TwoHandler, + const FReducerEventContext&, Context, + uint32, N + ); + // NOTE: Not exposed to Blueprint because uint32 types are not Blueprint-compatible + FDeletePkU32TwoHandler OnDeletePkU32Two; + + // NOTE: Not exposed to Blueprint because uint32 types are not Blueprint-compatible + void DeletePkU32Two(const uint32 N); + + bool InvokeDeletePkU32Two(const FReducerEventContext& Context, const UDeletePkU32TwoReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FDeletePkU64Handler, + const FReducerEventContext&, Context, + uint64, N + ); + // NOTE: Not exposed to Blueprint because uint64 types are not Blueprint-compatible + FDeletePkU64Handler OnDeletePkU64; + + // NOTE: Not exposed to Blueprint because uint64 types are not Blueprint-compatible + void DeletePkU64(const uint64 N); + + bool InvokeDeletePkU64(const FReducerEventContext& Context, const UDeletePkU64Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FDeletePkU8Handler, + const FReducerEventContext&, Context, + uint8, N + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FDeletePkU8Handler OnDeletePkU8; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void DeletePkU8(const uint8 N); + + bool InvokeDeletePkU8(const FReducerEventContext& Context, const UDeletePkU8Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FDeleteUniqueBoolHandler, + const FReducerEventContext&, Context, + bool, B + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FDeleteUniqueBoolHandler OnDeleteUniqueBool; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void DeleteUniqueBool(const bool B); + + bool InvokeDeleteUniqueBool(const FReducerEventContext& Context, const UDeleteUniqueBoolReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FDeleteUniqueConnectionIdHandler, + const FReducerEventContext&, Context, + const FSpacetimeDBConnectionId&, A + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FDeleteUniqueConnectionIdHandler OnDeleteUniqueConnectionId; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void DeleteUniqueConnectionId(const FSpacetimeDBConnectionId& A); + + bool InvokeDeleteUniqueConnectionId(const FReducerEventContext& Context, const UDeleteUniqueConnectionIdReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FDeleteUniqueI128Handler, + const FReducerEventContext&, Context, + const FSpacetimeDBInt128&, N + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FDeleteUniqueI128Handler OnDeleteUniqueI128; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void DeleteUniqueI128(const FSpacetimeDBInt128& N); + + bool InvokeDeleteUniqueI128(const FReducerEventContext& Context, const UDeleteUniqueI128Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FDeleteUniqueI16Handler, + const FReducerEventContext&, Context, + int16, N + ); + // NOTE: Not exposed to Blueprint because int16 types are not Blueprint-compatible + FDeleteUniqueI16Handler OnDeleteUniqueI16; + + // NOTE: Not exposed to Blueprint because int16 types are not Blueprint-compatible + void DeleteUniqueI16(const int16 N); + + bool InvokeDeleteUniqueI16(const FReducerEventContext& Context, const UDeleteUniqueI16Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FDeleteUniqueI256Handler, + const FReducerEventContext&, Context, + const FSpacetimeDBInt256&, N + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FDeleteUniqueI256Handler OnDeleteUniqueI256; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void DeleteUniqueI256(const FSpacetimeDBInt256& N); + + bool InvokeDeleteUniqueI256(const FReducerEventContext& Context, const UDeleteUniqueI256Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FDeleteUniqueI32Handler, + const FReducerEventContext&, Context, + int32, N + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FDeleteUniqueI32Handler OnDeleteUniqueI32; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void DeleteUniqueI32(const int32 N); + + bool InvokeDeleteUniqueI32(const FReducerEventContext& Context, const UDeleteUniqueI32Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FDeleteUniqueI64Handler, + const FReducerEventContext&, Context, + int64, N + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FDeleteUniqueI64Handler OnDeleteUniqueI64; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void DeleteUniqueI64(const int64 N); + + bool InvokeDeleteUniqueI64(const FReducerEventContext& Context, const UDeleteUniqueI64Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FDeleteUniqueI8Handler, + const FReducerEventContext&, Context, + int8, N + ); + // NOTE: Not exposed to Blueprint because int8 types are not Blueprint-compatible + FDeleteUniqueI8Handler OnDeleteUniqueI8; + + // NOTE: Not exposed to Blueprint because int8 types are not Blueprint-compatible + void DeleteUniqueI8(const int8 N); + + bool InvokeDeleteUniqueI8(const FReducerEventContext& Context, const UDeleteUniqueI8Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FDeleteUniqueIdentityHandler, + const FReducerEventContext&, Context, + const FSpacetimeDBIdentity&, I + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FDeleteUniqueIdentityHandler OnDeleteUniqueIdentity; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void DeleteUniqueIdentity(const FSpacetimeDBIdentity& I); + + bool InvokeDeleteUniqueIdentity(const FReducerEventContext& Context, const UDeleteUniqueIdentityReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FDeleteUniqueStringHandler, + const FReducerEventContext&, Context, + const FString&, S + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FDeleteUniqueStringHandler OnDeleteUniqueString; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void DeleteUniqueString(const FString& S); + + bool InvokeDeleteUniqueString(const FReducerEventContext& Context, const UDeleteUniqueStringReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FDeleteUniqueU128Handler, + const FReducerEventContext&, Context, + const FSpacetimeDBUInt128&, N + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FDeleteUniqueU128Handler OnDeleteUniqueU128; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void DeleteUniqueU128(const FSpacetimeDBUInt128& N); + + bool InvokeDeleteUniqueU128(const FReducerEventContext& Context, const UDeleteUniqueU128Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FDeleteUniqueU16Handler, + const FReducerEventContext&, Context, + uint16, N + ); + // NOTE: Not exposed to Blueprint because uint16 types are not Blueprint-compatible + FDeleteUniqueU16Handler OnDeleteUniqueU16; + + // NOTE: Not exposed to Blueprint because uint16 types are not Blueprint-compatible + void DeleteUniqueU16(const uint16 N); + + bool InvokeDeleteUniqueU16(const FReducerEventContext& Context, const UDeleteUniqueU16Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FDeleteUniqueU256Handler, + const FReducerEventContext&, Context, + const FSpacetimeDBUInt256&, N + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FDeleteUniqueU256Handler OnDeleteUniqueU256; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void DeleteUniqueU256(const FSpacetimeDBUInt256& N); + + bool InvokeDeleteUniqueU256(const FReducerEventContext& Context, const UDeleteUniqueU256Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FDeleteUniqueU32Handler, + const FReducerEventContext&, Context, + uint32, N + ); + // NOTE: Not exposed to Blueprint because uint32 types are not Blueprint-compatible + FDeleteUniqueU32Handler OnDeleteUniqueU32; + + // NOTE: Not exposed to Blueprint because uint32 types are not Blueprint-compatible + void DeleteUniqueU32(const uint32 N); + + bool InvokeDeleteUniqueU32(const FReducerEventContext& Context, const UDeleteUniqueU32Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FDeleteUniqueU64Handler, + const FReducerEventContext&, Context, + uint64, N + ); + // NOTE: Not exposed to Blueprint because uint64 types are not Blueprint-compatible + FDeleteUniqueU64Handler OnDeleteUniqueU64; + + // NOTE: Not exposed to Blueprint because uint64 types are not Blueprint-compatible + void DeleteUniqueU64(const uint64 N); + + bool InvokeDeleteUniqueU64(const FReducerEventContext& Context, const UDeleteUniqueU64Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FDeleteUniqueU8Handler, + const FReducerEventContext&, Context, + uint8, N + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FDeleteUniqueU8Handler OnDeleteUniqueU8; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void DeleteUniqueU8(const uint8 N); + + bool InvokeDeleteUniqueU8(const FReducerEventContext& Context, const UDeleteUniqueU8Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam( + FInsertCallTimestampHandler, + const FReducerEventContext&, Context + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertCallTimestampHandler OnInsertCallTimestamp; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertCallTimestamp(); + + bool InvokeInsertCallTimestamp(const FReducerEventContext& Context, const UInsertCallTimestampReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam( + FInsertCallerOneConnectionIdHandler, + const FReducerEventContext&, Context + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertCallerOneConnectionIdHandler OnInsertCallerOneConnectionId; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertCallerOneConnectionId(); + + bool InvokeInsertCallerOneConnectionId(const FReducerEventContext& Context, const UInsertCallerOneConnectionIdReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam( + FInsertCallerOneIdentityHandler, + const FReducerEventContext&, Context + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertCallerOneIdentityHandler OnInsertCallerOneIdentity; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertCallerOneIdentity(); + + bool InvokeInsertCallerOneIdentity(const FReducerEventContext& Context, const UInsertCallerOneIdentityReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertCallerPkConnectionIdHandler, + const FReducerEventContext&, Context, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertCallerPkConnectionIdHandler OnInsertCallerPkConnectionId; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertCallerPkConnectionId(const int32 Data); + + bool InvokeInsertCallerPkConnectionId(const FReducerEventContext& Context, const UInsertCallerPkConnectionIdReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertCallerPkIdentityHandler, + const FReducerEventContext&, Context, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertCallerPkIdentityHandler OnInsertCallerPkIdentity; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertCallerPkIdentity(const int32 Data); + + bool InvokeInsertCallerPkIdentity(const FReducerEventContext& Context, const UInsertCallerPkIdentityReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertCallerUniqueConnectionIdHandler, + const FReducerEventContext&, Context, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertCallerUniqueConnectionIdHandler OnInsertCallerUniqueConnectionId; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertCallerUniqueConnectionId(const int32 Data); + + bool InvokeInsertCallerUniqueConnectionId(const FReducerEventContext& Context, const UInsertCallerUniqueConnectionIdReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertCallerUniqueIdentityHandler, + const FReducerEventContext&, Context, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertCallerUniqueIdentityHandler OnInsertCallerUniqueIdentity; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertCallerUniqueIdentity(const int32 Data); + + bool InvokeInsertCallerUniqueIdentity(const FReducerEventContext& Context, const UInsertCallerUniqueIdentityReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam( + FInsertCallerVecConnectionIdHandler, + const FReducerEventContext&, Context + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertCallerVecConnectionIdHandler OnInsertCallerVecConnectionId; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertCallerVecConnectionId(); + + bool InvokeInsertCallerVecConnectionId(const FReducerEventContext& Context, const UInsertCallerVecConnectionIdReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam( + FInsertCallerVecIdentityHandler, + const FReducerEventContext&, Context + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertCallerVecIdentityHandler OnInsertCallerVecIdentity; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertCallerVecIdentity(); + + bool InvokeInsertCallerVecIdentity(const FReducerEventContext& Context, const UInsertCallerVecIdentityReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertIntoBtreeU32Handler, + const FReducerEventContext&, Context, + const TArray&, Rows + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertIntoBtreeU32Handler OnInsertIntoBtreeU32; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertIntoBtreeU32(const TArray& Rows); + + bool InvokeInsertIntoBtreeU32(const FReducerEventContext& Context, const UInsertIntoBtreeU32Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertIntoIndexedSimpleEnumHandler, + const FReducerEventContext&, Context, + const ESimpleEnumType&, N + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertIntoIndexedSimpleEnumHandler OnInsertIntoIndexedSimpleEnum; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertIntoIndexedSimpleEnum(const ESimpleEnumType& N); + + bool InvokeInsertIntoIndexedSimpleEnum(const FReducerEventContext& Context, const UInsertIntoIndexedSimpleEnumReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FInsertIntoPkBtreeU32Handler, + const FReducerEventContext&, Context, + const TArray&, PkU32, + const TArray&, BtU32 + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertIntoPkBtreeU32Handler OnInsertIntoPkBtreeU32; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertIntoPkBtreeU32(const TArray& PkU32, const TArray& BtU32); + + bool InvokeInsertIntoPkBtreeU32(const FReducerEventContext& Context, const UInsertIntoPkBtreeU32Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertLargeTableHandler, + const FReducerEventContext&, Context, + const FInsertLargeTableArgs&, Args + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertLargeTableHandler OnInsertLargeTable; + + // NOTE: Not exposed to Blueprint because uint16, uint32, uint64, int8, int16 types are not Blueprint-compatible + void InsertLargeTable(const uint8 A, const uint16 B, const uint32 C, const uint64 D, const FSpacetimeDBUInt128& E, const FSpacetimeDBUInt256& F, const int8 G, const int16 H, const int32 I, const int64 J, const FSpacetimeDBInt128& K, const FSpacetimeDBInt256& L, const bool M, const float N, const double O, const FString& P, const ESimpleEnumType& Q, const FEnumWithPayloadType& R, const FUnitStructType& S, const FByteStructType& T, const FEveryPrimitiveStructType& U, const FEveryVecStructType& V); + + bool InvokeInsertLargeTable(const FReducerEventContext& Context, const UInsertLargeTableReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertOneBoolHandler, + const FReducerEventContext&, Context, + bool, B + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertOneBoolHandler OnInsertOneBool; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertOneBool(const bool B); + + bool InvokeInsertOneBool(const FReducerEventContext& Context, const UInsertOneBoolReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertOneByteStructHandler, + const FReducerEventContext&, Context, + const FByteStructType&, S + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertOneByteStructHandler OnInsertOneByteStruct; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertOneByteStruct(const FByteStructType& S); + + bool InvokeInsertOneByteStruct(const FReducerEventContext& Context, const UInsertOneByteStructReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertOneConnectionIdHandler, + const FReducerEventContext&, Context, + const FSpacetimeDBConnectionId&, A + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertOneConnectionIdHandler OnInsertOneConnectionId; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertOneConnectionId(const FSpacetimeDBConnectionId& A); + + bool InvokeInsertOneConnectionId(const FReducerEventContext& Context, const UInsertOneConnectionIdReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertOneEnumWithPayloadHandler, + const FReducerEventContext&, Context, + const FEnumWithPayloadType&, E + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertOneEnumWithPayloadHandler OnInsertOneEnumWithPayload; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertOneEnumWithPayload(const FEnumWithPayloadType& E); + + bool InvokeInsertOneEnumWithPayload(const FReducerEventContext& Context, const UInsertOneEnumWithPayloadReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertOneEveryPrimitiveStructHandler, + const FReducerEventContext&, Context, + const FEveryPrimitiveStructType&, S + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertOneEveryPrimitiveStructHandler OnInsertOneEveryPrimitiveStruct; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertOneEveryPrimitiveStruct(const FEveryPrimitiveStructType& S); + + bool InvokeInsertOneEveryPrimitiveStruct(const FReducerEventContext& Context, const UInsertOneEveryPrimitiveStructReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertOneEveryVecStructHandler, + const FReducerEventContext&, Context, + const FEveryVecStructType&, S + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertOneEveryVecStructHandler OnInsertOneEveryVecStruct; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertOneEveryVecStruct(const FEveryVecStructType& S); + + bool InvokeInsertOneEveryVecStruct(const FReducerEventContext& Context, const UInsertOneEveryVecStructReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertOneF32Handler, + const FReducerEventContext&, Context, + float, F + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertOneF32Handler OnInsertOneF32; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertOneF32(const float F); + + bool InvokeInsertOneF32(const FReducerEventContext& Context, const UInsertOneF32Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertOneF64Handler, + const FReducerEventContext&, Context, + double, F + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertOneF64Handler OnInsertOneF64; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertOneF64(const double F); + + bool InvokeInsertOneF64(const FReducerEventContext& Context, const UInsertOneF64Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertOneI128Handler, + const FReducerEventContext&, Context, + const FSpacetimeDBInt128&, N + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertOneI128Handler OnInsertOneI128; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertOneI128(const FSpacetimeDBInt128& N); + + bool InvokeInsertOneI128(const FReducerEventContext& Context, const UInsertOneI128Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertOneI16Handler, + const FReducerEventContext&, Context, + int16, N + ); + // NOTE: Not exposed to Blueprint because int16 types are not Blueprint-compatible + FInsertOneI16Handler OnInsertOneI16; + + // NOTE: Not exposed to Blueprint because int16 types are not Blueprint-compatible + void InsertOneI16(const int16 N); + + bool InvokeInsertOneI16(const FReducerEventContext& Context, const UInsertOneI16Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertOneI256Handler, + const FReducerEventContext&, Context, + const FSpacetimeDBInt256&, N + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertOneI256Handler OnInsertOneI256; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertOneI256(const FSpacetimeDBInt256& N); + + bool InvokeInsertOneI256(const FReducerEventContext& Context, const UInsertOneI256Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertOneI32Handler, + const FReducerEventContext&, Context, + int32, N + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertOneI32Handler OnInsertOneI32; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertOneI32(const int32 N); + + bool InvokeInsertOneI32(const FReducerEventContext& Context, const UInsertOneI32Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertOneI64Handler, + const FReducerEventContext&, Context, + int64, N + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertOneI64Handler OnInsertOneI64; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertOneI64(const int64 N); + + bool InvokeInsertOneI64(const FReducerEventContext& Context, const UInsertOneI64Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertOneI8Handler, + const FReducerEventContext&, Context, + int8, N + ); + // NOTE: Not exposed to Blueprint because int8 types are not Blueprint-compatible + FInsertOneI8Handler OnInsertOneI8; + + // NOTE: Not exposed to Blueprint because int8 types are not Blueprint-compatible + void InsertOneI8(const int8 N); + + bool InvokeInsertOneI8(const FReducerEventContext& Context, const UInsertOneI8Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertOneIdentityHandler, + const FReducerEventContext&, Context, + const FSpacetimeDBIdentity&, I + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertOneIdentityHandler OnInsertOneIdentity; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertOneIdentity(const FSpacetimeDBIdentity& I); + + bool InvokeInsertOneIdentity(const FReducerEventContext& Context, const UInsertOneIdentityReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertOneSimpleEnumHandler, + const FReducerEventContext&, Context, + const ESimpleEnumType&, E + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertOneSimpleEnumHandler OnInsertOneSimpleEnum; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertOneSimpleEnum(const ESimpleEnumType& E); + + bool InvokeInsertOneSimpleEnum(const FReducerEventContext& Context, const UInsertOneSimpleEnumReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertOneStringHandler, + const FReducerEventContext&, Context, + const FString&, S + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertOneStringHandler OnInsertOneString; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertOneString(const FString& S); + + bool InvokeInsertOneString(const FReducerEventContext& Context, const UInsertOneStringReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertOneTimestampHandler, + const FReducerEventContext&, Context, + const FSpacetimeDBTimestamp&, T + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertOneTimestampHandler OnInsertOneTimestamp; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertOneTimestamp(const FSpacetimeDBTimestamp& T); + + bool InvokeInsertOneTimestamp(const FReducerEventContext& Context, const UInsertOneTimestampReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertOneU128Handler, + const FReducerEventContext&, Context, + const FSpacetimeDBUInt128&, N + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertOneU128Handler OnInsertOneU128; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertOneU128(const FSpacetimeDBUInt128& N); + + bool InvokeInsertOneU128(const FReducerEventContext& Context, const UInsertOneU128Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertOneU16Handler, + const FReducerEventContext&, Context, + uint16, N + ); + // NOTE: Not exposed to Blueprint because uint16 types are not Blueprint-compatible + FInsertOneU16Handler OnInsertOneU16; + + // NOTE: Not exposed to Blueprint because uint16 types are not Blueprint-compatible + void InsertOneU16(const uint16 N); + + bool InvokeInsertOneU16(const FReducerEventContext& Context, const UInsertOneU16Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertOneU256Handler, + const FReducerEventContext&, Context, + const FSpacetimeDBUInt256&, N + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertOneU256Handler OnInsertOneU256; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertOneU256(const FSpacetimeDBUInt256& N); + + bool InvokeInsertOneU256(const FReducerEventContext& Context, const UInsertOneU256Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertOneU32Handler, + const FReducerEventContext&, Context, + uint32, N + ); + // NOTE: Not exposed to Blueprint because uint32 types are not Blueprint-compatible + FInsertOneU32Handler OnInsertOneU32; + + // NOTE: Not exposed to Blueprint because uint32 types are not Blueprint-compatible + void InsertOneU32(const uint32 N); + + bool InvokeInsertOneU32(const FReducerEventContext& Context, const UInsertOneU32Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertOneU64Handler, + const FReducerEventContext&, Context, + uint64, N + ); + // NOTE: Not exposed to Blueprint because uint64 types are not Blueprint-compatible + FInsertOneU64Handler OnInsertOneU64; + + // NOTE: Not exposed to Blueprint because uint64 types are not Blueprint-compatible + void InsertOneU64(const uint64 N); + + bool InvokeInsertOneU64(const FReducerEventContext& Context, const UInsertOneU64Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertOneU8Handler, + const FReducerEventContext&, Context, + uint8, N + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertOneU8Handler OnInsertOneU8; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertOneU8(const uint8 N); + + bool InvokeInsertOneU8(const FReducerEventContext& Context, const UInsertOneU8Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertOneUnitStructHandler, + const FReducerEventContext&, Context, + const FUnitStructType&, S + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertOneUnitStructHandler OnInsertOneUnitStruct; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertOneUnitStruct(const FUnitStructType& S); + + bool InvokeInsertOneUnitStruct(const FReducerEventContext& Context, const UInsertOneUnitStructReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertOptionEveryPrimitiveStructHandler, + const FReducerEventContext&, Context, + const FTestClientOptionalEveryPrimitiveStruct&, S + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertOptionEveryPrimitiveStructHandler OnInsertOptionEveryPrimitiveStruct; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertOptionEveryPrimitiveStruct(const FTestClientOptionalEveryPrimitiveStruct& S); + + bool InvokeInsertOptionEveryPrimitiveStruct(const FReducerEventContext& Context, const UInsertOptionEveryPrimitiveStructReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertOptionI32Handler, + const FReducerEventContext&, Context, + FTestClientOptionalInt32, N + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertOptionI32Handler OnInsertOptionI32; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertOptionI32(const FTestClientOptionalInt32 N); + + bool InvokeInsertOptionI32(const FReducerEventContext& Context, const UInsertOptionI32Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertOptionIdentityHandler, + const FReducerEventContext&, Context, + const FTestClientOptionalIdentity&, I + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertOptionIdentityHandler OnInsertOptionIdentity; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertOptionIdentity(const FTestClientOptionalIdentity& I); + + bool InvokeInsertOptionIdentity(const FReducerEventContext& Context, const UInsertOptionIdentityReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertOptionSimpleEnumHandler, + const FReducerEventContext&, Context, + const FTestClientOptionalSimpleEnum&, E + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertOptionSimpleEnumHandler OnInsertOptionSimpleEnum; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertOptionSimpleEnum(const FTestClientOptionalSimpleEnum& E); + + bool InvokeInsertOptionSimpleEnum(const FReducerEventContext& Context, const UInsertOptionSimpleEnumReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertOptionStringHandler, + const FReducerEventContext&, Context, + const FTestClientOptionalString&, S + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertOptionStringHandler OnInsertOptionString; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertOptionString(const FTestClientOptionalString& S); + + bool InvokeInsertOptionString(const FReducerEventContext& Context, const UInsertOptionStringReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertOptionVecOptionI32Handler, + const FReducerEventContext&, Context, + const FTestClientOptionalVecInt32&, V + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertOptionVecOptionI32Handler OnInsertOptionVecOptionI32; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertOptionVecOptionI32(const FTestClientOptionalVecInt32& V); + + bool InvokeInsertOptionVecOptionI32(const FReducerEventContext& Context, const UInsertOptionVecOptionI32Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FInsertPkBoolHandler, + const FReducerEventContext&, Context, + bool, B, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertPkBoolHandler OnInsertPkBool; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertPkBool(const bool B, const int32 Data); + + bool InvokeInsertPkBool(const FReducerEventContext& Context, const UInsertPkBoolReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FInsertPkConnectionIdHandler, + const FReducerEventContext&, Context, + const FSpacetimeDBConnectionId&, A, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertPkConnectionIdHandler OnInsertPkConnectionId; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertPkConnectionId(const FSpacetimeDBConnectionId& A, const int32 Data); + + bool InvokeInsertPkConnectionId(const FReducerEventContext& Context, const UInsertPkConnectionIdReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FInsertPkI128Handler, + const FReducerEventContext&, Context, + const FSpacetimeDBInt128&, N, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertPkI128Handler OnInsertPkI128; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertPkI128(const FSpacetimeDBInt128& N, const int32 Data); + + bool InvokeInsertPkI128(const FReducerEventContext& Context, const UInsertPkI128Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FInsertPkI16Handler, + const FReducerEventContext&, Context, + int16, N, + int32, Data + ); + // NOTE: Not exposed to Blueprint because int16 types are not Blueprint-compatible + FInsertPkI16Handler OnInsertPkI16; + + // NOTE: Not exposed to Blueprint because int16 types are not Blueprint-compatible + void InsertPkI16(const int16 N, const int32 Data); + + bool InvokeInsertPkI16(const FReducerEventContext& Context, const UInsertPkI16Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FInsertPkI256Handler, + const FReducerEventContext&, Context, + const FSpacetimeDBInt256&, N, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertPkI256Handler OnInsertPkI256; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertPkI256(const FSpacetimeDBInt256& N, const int32 Data); + + bool InvokeInsertPkI256(const FReducerEventContext& Context, const UInsertPkI256Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FInsertPkI32Handler, + const FReducerEventContext&, Context, + int32, N, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertPkI32Handler OnInsertPkI32; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertPkI32(const int32 N, const int32 Data); + + bool InvokeInsertPkI32(const FReducerEventContext& Context, const UInsertPkI32Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FInsertPkI64Handler, + const FReducerEventContext&, Context, + int64, N, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertPkI64Handler OnInsertPkI64; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertPkI64(const int64 N, const int32 Data); + + bool InvokeInsertPkI64(const FReducerEventContext& Context, const UInsertPkI64Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FInsertPkI8Handler, + const FReducerEventContext&, Context, + int8, N, + int32, Data + ); + // NOTE: Not exposed to Blueprint because int8 types are not Blueprint-compatible + FInsertPkI8Handler OnInsertPkI8; + + // NOTE: Not exposed to Blueprint because int8 types are not Blueprint-compatible + void InsertPkI8(const int8 N, const int32 Data); + + bool InvokeInsertPkI8(const FReducerEventContext& Context, const UInsertPkI8Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FInsertPkIdentityHandler, + const FReducerEventContext&, Context, + const FSpacetimeDBIdentity&, I, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertPkIdentityHandler OnInsertPkIdentity; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertPkIdentity(const FSpacetimeDBIdentity& I, const int32 Data); + + bool InvokeInsertPkIdentity(const FReducerEventContext& Context, const UInsertPkIdentityReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FInsertPkSimpleEnumHandler, + const FReducerEventContext&, Context, + const ESimpleEnumType&, A, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertPkSimpleEnumHandler OnInsertPkSimpleEnum; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertPkSimpleEnum(const ESimpleEnumType& A, const int32 Data); + + bool InvokeInsertPkSimpleEnum(const FReducerEventContext& Context, const UInsertPkSimpleEnumReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FInsertPkStringHandler, + const FReducerEventContext&, Context, + const FString&, S, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertPkStringHandler OnInsertPkString; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertPkString(const FString& S, const int32 Data); + + bool InvokeInsertPkString(const FReducerEventContext& Context, const UInsertPkStringReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FInsertPkU128Handler, + const FReducerEventContext&, Context, + const FSpacetimeDBUInt128&, N, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertPkU128Handler OnInsertPkU128; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertPkU128(const FSpacetimeDBUInt128& N, const int32 Data); + + bool InvokeInsertPkU128(const FReducerEventContext& Context, const UInsertPkU128Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FInsertPkU16Handler, + const FReducerEventContext&, Context, + uint16, N, + int32, Data + ); + // NOTE: Not exposed to Blueprint because uint16 types are not Blueprint-compatible + FInsertPkU16Handler OnInsertPkU16; + + // NOTE: Not exposed to Blueprint because uint16 types are not Blueprint-compatible + void InsertPkU16(const uint16 N, const int32 Data); + + bool InvokeInsertPkU16(const FReducerEventContext& Context, const UInsertPkU16Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FInsertPkU256Handler, + const FReducerEventContext&, Context, + const FSpacetimeDBUInt256&, N, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertPkU256Handler OnInsertPkU256; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertPkU256(const FSpacetimeDBUInt256& N, const int32 Data); + + bool InvokeInsertPkU256(const FReducerEventContext& Context, const UInsertPkU256Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FInsertPkU32Handler, + const FReducerEventContext&, Context, + uint32, N, + int32, Data + ); + // NOTE: Not exposed to Blueprint because uint32 types are not Blueprint-compatible + FInsertPkU32Handler OnInsertPkU32; + + // NOTE: Not exposed to Blueprint because uint32 types are not Blueprint-compatible + void InsertPkU32(const uint32 N, const int32 Data); + + bool InvokeInsertPkU32(const FReducerEventContext& Context, const UInsertPkU32Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FInsertPkU32TwoHandler, + const FReducerEventContext&, Context, + uint32, N, + int32, Data + ); + // NOTE: Not exposed to Blueprint because uint32 types are not Blueprint-compatible + FInsertPkU32TwoHandler OnInsertPkU32Two; + + // NOTE: Not exposed to Blueprint because uint32 types are not Blueprint-compatible + void InsertPkU32Two(const uint32 N, const int32 Data); + + bool InvokeInsertPkU32Two(const FReducerEventContext& Context, const UInsertPkU32TwoReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FInsertPkU64Handler, + const FReducerEventContext&, Context, + uint64, N, + int32, Data + ); + // NOTE: Not exposed to Blueprint because uint64 types are not Blueprint-compatible + FInsertPkU64Handler OnInsertPkU64; + + // NOTE: Not exposed to Blueprint because uint64 types are not Blueprint-compatible + void InsertPkU64(const uint64 N, const int32 Data); + + bool InvokeInsertPkU64(const FReducerEventContext& Context, const UInsertPkU64Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FInsertPkU8Handler, + const FReducerEventContext&, Context, + uint8, N, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertPkU8Handler OnInsertPkU8; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertPkU8(const uint8 N, const int32 Data); + + bool InvokeInsertPkU8(const FReducerEventContext& Context, const UInsertPkU8Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertPrimitivesAsStringsHandler, + const FReducerEventContext&, Context, + const FEveryPrimitiveStructType&, S + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertPrimitivesAsStringsHandler OnInsertPrimitivesAsStrings; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertPrimitivesAsStrings(const FEveryPrimitiveStructType& S); + + bool InvokeInsertPrimitivesAsStrings(const FReducerEventContext& Context, const UInsertPrimitivesAsStringsReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FInsertTableHoldsTableHandler, + const FReducerEventContext&, Context, + const FOneU8Type&, A, + const FVecU8Type&, B + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertTableHoldsTableHandler OnInsertTableHoldsTable; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertTableHoldsTable(const FOneU8Type& A, const FVecU8Type& B); + + bool InvokeInsertTableHoldsTable(const FReducerEventContext& Context, const UInsertTableHoldsTableReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FInsertUniqueBoolHandler, + const FReducerEventContext&, Context, + bool, B, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertUniqueBoolHandler OnInsertUniqueBool; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertUniqueBool(const bool B, const int32 Data); + + bool InvokeInsertUniqueBool(const FReducerEventContext& Context, const UInsertUniqueBoolReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FInsertUniqueConnectionIdHandler, + const FReducerEventContext&, Context, + const FSpacetimeDBConnectionId&, A, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertUniqueConnectionIdHandler OnInsertUniqueConnectionId; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertUniqueConnectionId(const FSpacetimeDBConnectionId& A, const int32 Data); + + bool InvokeInsertUniqueConnectionId(const FReducerEventContext& Context, const UInsertUniqueConnectionIdReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FInsertUniqueI128Handler, + const FReducerEventContext&, Context, + const FSpacetimeDBInt128&, N, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertUniqueI128Handler OnInsertUniqueI128; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertUniqueI128(const FSpacetimeDBInt128& N, const int32 Data); + + bool InvokeInsertUniqueI128(const FReducerEventContext& Context, const UInsertUniqueI128Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FInsertUniqueI16Handler, + const FReducerEventContext&, Context, + int16, N, + int32, Data + ); + // NOTE: Not exposed to Blueprint because int16 types are not Blueprint-compatible + FInsertUniqueI16Handler OnInsertUniqueI16; + + // NOTE: Not exposed to Blueprint because int16 types are not Blueprint-compatible + void InsertUniqueI16(const int16 N, const int32 Data); + + bool InvokeInsertUniqueI16(const FReducerEventContext& Context, const UInsertUniqueI16Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FInsertUniqueI256Handler, + const FReducerEventContext&, Context, + const FSpacetimeDBInt256&, N, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertUniqueI256Handler OnInsertUniqueI256; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertUniqueI256(const FSpacetimeDBInt256& N, const int32 Data); + + bool InvokeInsertUniqueI256(const FReducerEventContext& Context, const UInsertUniqueI256Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FInsertUniqueI32Handler, + const FReducerEventContext&, Context, + int32, N, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertUniqueI32Handler OnInsertUniqueI32; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertUniqueI32(const int32 N, const int32 Data); + + bool InvokeInsertUniqueI32(const FReducerEventContext& Context, const UInsertUniqueI32Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FInsertUniqueI64Handler, + const FReducerEventContext&, Context, + int64, N, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertUniqueI64Handler OnInsertUniqueI64; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertUniqueI64(const int64 N, const int32 Data); + + bool InvokeInsertUniqueI64(const FReducerEventContext& Context, const UInsertUniqueI64Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FInsertUniqueI8Handler, + const FReducerEventContext&, Context, + int8, N, + int32, Data + ); + // NOTE: Not exposed to Blueprint because int8 types are not Blueprint-compatible + FInsertUniqueI8Handler OnInsertUniqueI8; + + // NOTE: Not exposed to Blueprint because int8 types are not Blueprint-compatible + void InsertUniqueI8(const int8 N, const int32 Data); + + bool InvokeInsertUniqueI8(const FReducerEventContext& Context, const UInsertUniqueI8Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FInsertUniqueIdentityHandler, + const FReducerEventContext&, Context, + const FSpacetimeDBIdentity&, I, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertUniqueIdentityHandler OnInsertUniqueIdentity; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertUniqueIdentity(const FSpacetimeDBIdentity& I, const int32 Data); + + bool InvokeInsertUniqueIdentity(const FReducerEventContext& Context, const UInsertUniqueIdentityReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FInsertUniqueStringHandler, + const FReducerEventContext&, Context, + const FString&, S, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertUniqueStringHandler OnInsertUniqueString; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertUniqueString(const FString& S, const int32 Data); + + bool InvokeInsertUniqueString(const FReducerEventContext& Context, const UInsertUniqueStringReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FInsertUniqueU128Handler, + const FReducerEventContext&, Context, + const FSpacetimeDBUInt128&, N, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertUniqueU128Handler OnInsertUniqueU128; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertUniqueU128(const FSpacetimeDBUInt128& N, const int32 Data); + + bool InvokeInsertUniqueU128(const FReducerEventContext& Context, const UInsertUniqueU128Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FInsertUniqueU16Handler, + const FReducerEventContext&, Context, + uint16, N, + int32, Data + ); + // NOTE: Not exposed to Blueprint because uint16 types are not Blueprint-compatible + FInsertUniqueU16Handler OnInsertUniqueU16; + + // NOTE: Not exposed to Blueprint because uint16 types are not Blueprint-compatible + void InsertUniqueU16(const uint16 N, const int32 Data); + + bool InvokeInsertUniqueU16(const FReducerEventContext& Context, const UInsertUniqueU16Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FInsertUniqueU256Handler, + const FReducerEventContext&, Context, + const FSpacetimeDBUInt256&, N, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertUniqueU256Handler OnInsertUniqueU256; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertUniqueU256(const FSpacetimeDBUInt256& N, const int32 Data); + + bool InvokeInsertUniqueU256(const FReducerEventContext& Context, const UInsertUniqueU256Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FInsertUniqueU32Handler, + const FReducerEventContext&, Context, + uint32, N, + int32, Data + ); + // NOTE: Not exposed to Blueprint because uint32 types are not Blueprint-compatible + FInsertUniqueU32Handler OnInsertUniqueU32; + + // NOTE: Not exposed to Blueprint because uint32 types are not Blueprint-compatible + void InsertUniqueU32(const uint32 N, const int32 Data); + + bool InvokeInsertUniqueU32(const FReducerEventContext& Context, const UInsertUniqueU32Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_FourParams( + FInsertUniqueU32UpdatePkU32Handler, + const FReducerEventContext&, Context, + uint32, N, + int32, DUnique, + int32, DPk + ); + // NOTE: Not exposed to Blueprint because uint32 types are not Blueprint-compatible + FInsertUniqueU32UpdatePkU32Handler OnInsertUniqueU32UpdatePkU32; + + // NOTE: Not exposed to Blueprint because uint32 types are not Blueprint-compatible + void InsertUniqueU32UpdatePkU32(const uint32 N, const int32 DUnique, const int32 DPk); + + bool InvokeInsertUniqueU32UpdatePkU32(const FReducerEventContext& Context, const UInsertUniqueU32UpdatePkU32Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FInsertUniqueU64Handler, + const FReducerEventContext&, Context, + uint64, N, + int32, Data + ); + // NOTE: Not exposed to Blueprint because uint64 types are not Blueprint-compatible + FInsertUniqueU64Handler OnInsertUniqueU64; + + // NOTE: Not exposed to Blueprint because uint64 types are not Blueprint-compatible + void InsertUniqueU64(const uint64 N, const int32 Data); + + bool InvokeInsertUniqueU64(const FReducerEventContext& Context, const UInsertUniqueU64Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FInsertUniqueU8Handler, + const FReducerEventContext&, Context, + uint8, N, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertUniqueU8Handler OnInsertUniqueU8; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertUniqueU8(const uint8 N, const int32 Data); + + bool InvokeInsertUniqueU8(const FReducerEventContext& Context, const UInsertUniqueU8Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FInsertUserHandler, + const FReducerEventContext&, Context, + const FString&, Name, + const FSpacetimeDBIdentity&, Identity + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertUserHandler OnInsertUser; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertUser(const FString& Name, const FSpacetimeDBIdentity& Identity); + + bool InvokeInsertUser(const FReducerEventContext& Context, const UInsertUserReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertVecBoolHandler, + const FReducerEventContext&, Context, + const TArray&, B + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertVecBoolHandler OnInsertVecBool; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertVecBool(const TArray& B); + + bool InvokeInsertVecBool(const FReducerEventContext& Context, const UInsertVecBoolReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertVecByteStructHandler, + const FReducerEventContext&, Context, + const TArray&, S + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertVecByteStructHandler OnInsertVecByteStruct; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertVecByteStruct(const TArray& S); + + bool InvokeInsertVecByteStruct(const FReducerEventContext& Context, const UInsertVecByteStructReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertVecConnectionIdHandler, + const FReducerEventContext&, Context, + const TArray&, A + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertVecConnectionIdHandler OnInsertVecConnectionId; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertVecConnectionId(const TArray& A); + + bool InvokeInsertVecConnectionId(const FReducerEventContext& Context, const UInsertVecConnectionIdReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertVecEnumWithPayloadHandler, + const FReducerEventContext&, Context, + const TArray&, E + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertVecEnumWithPayloadHandler OnInsertVecEnumWithPayload; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertVecEnumWithPayload(const TArray& E); + + bool InvokeInsertVecEnumWithPayload(const FReducerEventContext& Context, const UInsertVecEnumWithPayloadReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertVecEveryPrimitiveStructHandler, + const FReducerEventContext&, Context, + const TArray&, S + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertVecEveryPrimitiveStructHandler OnInsertVecEveryPrimitiveStruct; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertVecEveryPrimitiveStruct(const TArray& S); + + bool InvokeInsertVecEveryPrimitiveStruct(const FReducerEventContext& Context, const UInsertVecEveryPrimitiveStructReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertVecEveryVecStructHandler, + const FReducerEventContext&, Context, + const TArray&, S + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertVecEveryVecStructHandler OnInsertVecEveryVecStruct; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertVecEveryVecStruct(const TArray& S); + + bool InvokeInsertVecEveryVecStruct(const FReducerEventContext& Context, const UInsertVecEveryVecStructReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertVecF32Handler, + const FReducerEventContext&, Context, + const TArray&, F + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertVecF32Handler OnInsertVecF32; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertVecF32(const TArray& F); + + bool InvokeInsertVecF32(const FReducerEventContext& Context, const UInsertVecF32Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertVecF64Handler, + const FReducerEventContext&, Context, + const TArray&, F + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertVecF64Handler OnInsertVecF64; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertVecF64(const TArray& F); + + bool InvokeInsertVecF64(const FReducerEventContext& Context, const UInsertVecF64Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertVecI128Handler, + const FReducerEventContext&, Context, + const TArray&, N + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertVecI128Handler OnInsertVecI128; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertVecI128(const TArray& N); + + bool InvokeInsertVecI128(const FReducerEventContext& Context, const UInsertVecI128Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertVecI16Handler, + const FReducerEventContext&, Context, + const TArray&, N + ); + // NOTE: Not exposed to Blueprint because TArray types are not Blueprint-compatible + FInsertVecI16Handler OnInsertVecI16; + + // NOTE: Not exposed to Blueprint because TArray types are not Blueprint-compatible + void InsertVecI16(const TArray& N); + + bool InvokeInsertVecI16(const FReducerEventContext& Context, const UInsertVecI16Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertVecI256Handler, + const FReducerEventContext&, Context, + const TArray&, N + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertVecI256Handler OnInsertVecI256; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertVecI256(const TArray& N); + + bool InvokeInsertVecI256(const FReducerEventContext& Context, const UInsertVecI256Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertVecI32Handler, + const FReducerEventContext&, Context, + const TArray&, N + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertVecI32Handler OnInsertVecI32; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertVecI32(const TArray& N); + + bool InvokeInsertVecI32(const FReducerEventContext& Context, const UInsertVecI32Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertVecI64Handler, + const FReducerEventContext&, Context, + const TArray&, N + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertVecI64Handler OnInsertVecI64; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertVecI64(const TArray& N); + + bool InvokeInsertVecI64(const FReducerEventContext& Context, const UInsertVecI64Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertVecI8Handler, + const FReducerEventContext&, Context, + const TArray&, N + ); + // NOTE: Not exposed to Blueprint because TArray types are not Blueprint-compatible + FInsertVecI8Handler OnInsertVecI8; + + // NOTE: Not exposed to Blueprint because TArray types are not Blueprint-compatible + void InsertVecI8(const TArray& N); + + bool InvokeInsertVecI8(const FReducerEventContext& Context, const UInsertVecI8Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertVecIdentityHandler, + const FReducerEventContext&, Context, + const TArray&, I + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertVecIdentityHandler OnInsertVecIdentity; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertVecIdentity(const TArray& I); + + bool InvokeInsertVecIdentity(const FReducerEventContext& Context, const UInsertVecIdentityReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertVecSimpleEnumHandler, + const FReducerEventContext&, Context, + const TArray&, E + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertVecSimpleEnumHandler OnInsertVecSimpleEnum; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertVecSimpleEnum(const TArray& E); + + bool InvokeInsertVecSimpleEnum(const FReducerEventContext& Context, const UInsertVecSimpleEnumReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertVecStringHandler, + const FReducerEventContext&, Context, + const TArray&, S + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertVecStringHandler OnInsertVecString; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertVecString(const TArray& S); + + bool InvokeInsertVecString(const FReducerEventContext& Context, const UInsertVecStringReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertVecTimestampHandler, + const FReducerEventContext&, Context, + const TArray&, T + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertVecTimestampHandler OnInsertVecTimestamp; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertVecTimestamp(const TArray& T); + + bool InvokeInsertVecTimestamp(const FReducerEventContext& Context, const UInsertVecTimestampReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertVecU128Handler, + const FReducerEventContext&, Context, + const TArray&, N + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertVecU128Handler OnInsertVecU128; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertVecU128(const TArray& N); + + bool InvokeInsertVecU128(const FReducerEventContext& Context, const UInsertVecU128Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertVecU16Handler, + const FReducerEventContext&, Context, + const TArray&, N + ); + // NOTE: Not exposed to Blueprint because TArray types are not Blueprint-compatible + FInsertVecU16Handler OnInsertVecU16; + + // NOTE: Not exposed to Blueprint because TArray types are not Blueprint-compatible + void InsertVecU16(const TArray& N); + + bool InvokeInsertVecU16(const FReducerEventContext& Context, const UInsertVecU16Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertVecU256Handler, + const FReducerEventContext&, Context, + const TArray&, N + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertVecU256Handler OnInsertVecU256; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertVecU256(const TArray& N); + + bool InvokeInsertVecU256(const FReducerEventContext& Context, const UInsertVecU256Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertVecU32Handler, + const FReducerEventContext&, Context, + const TArray&, N + ); + // NOTE: Not exposed to Blueprint because TArray types are not Blueprint-compatible + FInsertVecU32Handler OnInsertVecU32; + + // NOTE: Not exposed to Blueprint because TArray types are not Blueprint-compatible + void InsertVecU32(const TArray& N); + + bool InvokeInsertVecU32(const FReducerEventContext& Context, const UInsertVecU32Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertVecU64Handler, + const FReducerEventContext&, Context, + const TArray&, N + ); + // NOTE: Not exposed to Blueprint because TArray types are not Blueprint-compatible + FInsertVecU64Handler OnInsertVecU64; + + // NOTE: Not exposed to Blueprint because TArray types are not Blueprint-compatible + void InsertVecU64(const TArray& N); + + bool InvokeInsertVecU64(const FReducerEventContext& Context, const UInsertVecU64Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertVecU8Handler, + const FReducerEventContext&, Context, + const TArray&, N + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertVecU8Handler OnInsertVecU8; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertVecU8(const TArray& N); + + bool InvokeInsertVecU8(const FReducerEventContext& Context, const UInsertVecU8Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FInsertVecUnitStructHandler, + const FReducerEventContext&, Context, + const TArray&, S + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FInsertVecUnitStructHandler OnInsertVecUnitStruct; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void InsertVecUnitStruct(const TArray& S); + + bool InvokeInsertVecUnitStruct(const FReducerEventContext& Context, const UInsertVecUnitStructReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam( + FNoOpSucceedsHandler, + const FReducerEventContext&, Context + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FNoOpSucceedsHandler OnNoOpSucceeds; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void NoOpSucceeds(); + + bool InvokeNoOpSucceeds(const FReducerEventContext& Context, const UNoOpSucceedsReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FSendScheduledMessageHandler, + const FReducerEventContext&, Context, + const FScheduledTableType&, Arg + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FSendScheduledMessageHandler OnSendScheduledMessage; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void SendScheduledMessage(const FScheduledTableType& Arg); + + bool InvokeSendScheduledMessage(const FReducerEventContext& Context, const USendScheduledMessageReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FUpdateIndexedSimpleEnumHandler, + const FReducerEventContext&, Context, + const ESimpleEnumType&, A, + const ESimpleEnumType&, B + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FUpdateIndexedSimpleEnumHandler OnUpdateIndexedSimpleEnum; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void UpdateIndexedSimpleEnum(const ESimpleEnumType& A, const ESimpleEnumType& B); + + bool InvokeUpdateIndexedSimpleEnum(const FReducerEventContext& Context, const UUpdateIndexedSimpleEnumReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FUpdatePkBoolHandler, + const FReducerEventContext&, Context, + bool, B, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FUpdatePkBoolHandler OnUpdatePkBool; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void UpdatePkBool(const bool B, const int32 Data); + + bool InvokeUpdatePkBool(const FReducerEventContext& Context, const UUpdatePkBoolReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FUpdatePkConnectionIdHandler, + const FReducerEventContext&, Context, + const FSpacetimeDBConnectionId&, A, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FUpdatePkConnectionIdHandler OnUpdatePkConnectionId; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void UpdatePkConnectionId(const FSpacetimeDBConnectionId& A, const int32 Data); + + bool InvokeUpdatePkConnectionId(const FReducerEventContext& Context, const UUpdatePkConnectionIdReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FUpdatePkI128Handler, + const FReducerEventContext&, Context, + const FSpacetimeDBInt128&, N, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FUpdatePkI128Handler OnUpdatePkI128; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void UpdatePkI128(const FSpacetimeDBInt128& N, const int32 Data); + + bool InvokeUpdatePkI128(const FReducerEventContext& Context, const UUpdatePkI128Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FUpdatePkI16Handler, + const FReducerEventContext&, Context, + int16, N, + int32, Data + ); + // NOTE: Not exposed to Blueprint because int16 types are not Blueprint-compatible + FUpdatePkI16Handler OnUpdatePkI16; + + // NOTE: Not exposed to Blueprint because int16 types are not Blueprint-compatible + void UpdatePkI16(const int16 N, const int32 Data); + + bool InvokeUpdatePkI16(const FReducerEventContext& Context, const UUpdatePkI16Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FUpdatePkI256Handler, + const FReducerEventContext&, Context, + const FSpacetimeDBInt256&, N, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FUpdatePkI256Handler OnUpdatePkI256; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void UpdatePkI256(const FSpacetimeDBInt256& N, const int32 Data); + + bool InvokeUpdatePkI256(const FReducerEventContext& Context, const UUpdatePkI256Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FUpdatePkI32Handler, + const FReducerEventContext&, Context, + int32, N, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FUpdatePkI32Handler OnUpdatePkI32; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void UpdatePkI32(const int32 N, const int32 Data); + + bool InvokeUpdatePkI32(const FReducerEventContext& Context, const UUpdatePkI32Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FUpdatePkI64Handler, + const FReducerEventContext&, Context, + int64, N, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FUpdatePkI64Handler OnUpdatePkI64; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void UpdatePkI64(const int64 N, const int32 Data); + + bool InvokeUpdatePkI64(const FReducerEventContext& Context, const UUpdatePkI64Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FUpdatePkI8Handler, + const FReducerEventContext&, Context, + int8, N, + int32, Data + ); + // NOTE: Not exposed to Blueprint because int8 types are not Blueprint-compatible + FUpdatePkI8Handler OnUpdatePkI8; + + // NOTE: Not exposed to Blueprint because int8 types are not Blueprint-compatible + void UpdatePkI8(const int8 N, const int32 Data); + + bool InvokeUpdatePkI8(const FReducerEventContext& Context, const UUpdatePkI8Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FUpdatePkIdentityHandler, + const FReducerEventContext&, Context, + const FSpacetimeDBIdentity&, I, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FUpdatePkIdentityHandler OnUpdatePkIdentity; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void UpdatePkIdentity(const FSpacetimeDBIdentity& I, const int32 Data); + + bool InvokeUpdatePkIdentity(const FReducerEventContext& Context, const UUpdatePkIdentityReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FUpdatePkSimpleEnumHandler, + const FReducerEventContext&, Context, + const ESimpleEnumType&, A, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FUpdatePkSimpleEnumHandler OnUpdatePkSimpleEnum; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void UpdatePkSimpleEnum(const ESimpleEnumType& A, const int32 Data); + + bool InvokeUpdatePkSimpleEnum(const FReducerEventContext& Context, const UUpdatePkSimpleEnumReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FUpdatePkStringHandler, + const FReducerEventContext&, Context, + const FString&, S, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FUpdatePkStringHandler OnUpdatePkString; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void UpdatePkString(const FString& S, const int32 Data); + + bool InvokeUpdatePkString(const FReducerEventContext& Context, const UUpdatePkStringReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FUpdatePkU128Handler, + const FReducerEventContext&, Context, + const FSpacetimeDBUInt128&, N, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FUpdatePkU128Handler OnUpdatePkU128; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void UpdatePkU128(const FSpacetimeDBUInt128& N, const int32 Data); + + bool InvokeUpdatePkU128(const FReducerEventContext& Context, const UUpdatePkU128Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FUpdatePkU16Handler, + const FReducerEventContext&, Context, + uint16, N, + int32, Data + ); + // NOTE: Not exposed to Blueprint because uint16 types are not Blueprint-compatible + FUpdatePkU16Handler OnUpdatePkU16; + + // NOTE: Not exposed to Blueprint because uint16 types are not Blueprint-compatible + void UpdatePkU16(const uint16 N, const int32 Data); + + bool InvokeUpdatePkU16(const FReducerEventContext& Context, const UUpdatePkU16Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FUpdatePkU256Handler, + const FReducerEventContext&, Context, + const FSpacetimeDBUInt256&, N, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FUpdatePkU256Handler OnUpdatePkU256; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void UpdatePkU256(const FSpacetimeDBUInt256& N, const int32 Data); + + bool InvokeUpdatePkU256(const FReducerEventContext& Context, const UUpdatePkU256Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FUpdatePkU32Handler, + const FReducerEventContext&, Context, + uint32, N, + int32, Data + ); + // NOTE: Not exposed to Blueprint because uint32 types are not Blueprint-compatible + FUpdatePkU32Handler OnUpdatePkU32; + + // NOTE: Not exposed to Blueprint because uint32 types are not Blueprint-compatible + void UpdatePkU32(const uint32 N, const int32 Data); + + bool InvokeUpdatePkU32(const FReducerEventContext& Context, const UUpdatePkU32Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FUpdatePkU32TwoHandler, + const FReducerEventContext&, Context, + uint32, N, + int32, Data + ); + // NOTE: Not exposed to Blueprint because uint32 types are not Blueprint-compatible + FUpdatePkU32TwoHandler OnUpdatePkU32Two; + + // NOTE: Not exposed to Blueprint because uint32 types are not Blueprint-compatible + void UpdatePkU32Two(const uint32 N, const int32 Data); + + bool InvokeUpdatePkU32Two(const FReducerEventContext& Context, const UUpdatePkU32TwoReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FUpdatePkU64Handler, + const FReducerEventContext&, Context, + uint64, N, + int32, Data + ); + // NOTE: Not exposed to Blueprint because uint64 types are not Blueprint-compatible + FUpdatePkU64Handler OnUpdatePkU64; + + // NOTE: Not exposed to Blueprint because uint64 types are not Blueprint-compatible + void UpdatePkU64(const uint64 N, const int32 Data); + + bool InvokeUpdatePkU64(const FReducerEventContext& Context, const UUpdatePkU64Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FUpdatePkU8Handler, + const FReducerEventContext&, Context, + uint8, N, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FUpdatePkU8Handler OnUpdatePkU8; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void UpdatePkU8(const uint8 N, const int32 Data); + + bool InvokeUpdatePkU8(const FReducerEventContext& Context, const UUpdatePkU8Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FUpdateUniqueBoolHandler, + const FReducerEventContext&, Context, + bool, B, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FUpdateUniqueBoolHandler OnUpdateUniqueBool; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void UpdateUniqueBool(const bool B, const int32 Data); + + bool InvokeUpdateUniqueBool(const FReducerEventContext& Context, const UUpdateUniqueBoolReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FUpdateUniqueConnectionIdHandler, + const FReducerEventContext&, Context, + const FSpacetimeDBConnectionId&, A, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FUpdateUniqueConnectionIdHandler OnUpdateUniqueConnectionId; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void UpdateUniqueConnectionId(const FSpacetimeDBConnectionId& A, const int32 Data); + + bool InvokeUpdateUniqueConnectionId(const FReducerEventContext& Context, const UUpdateUniqueConnectionIdReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FUpdateUniqueI128Handler, + const FReducerEventContext&, Context, + const FSpacetimeDBInt128&, N, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FUpdateUniqueI128Handler OnUpdateUniqueI128; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void UpdateUniqueI128(const FSpacetimeDBInt128& N, const int32 Data); + + bool InvokeUpdateUniqueI128(const FReducerEventContext& Context, const UUpdateUniqueI128Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FUpdateUniqueI16Handler, + const FReducerEventContext&, Context, + int16, N, + int32, Data + ); + // NOTE: Not exposed to Blueprint because int16 types are not Blueprint-compatible + FUpdateUniqueI16Handler OnUpdateUniqueI16; + + // NOTE: Not exposed to Blueprint because int16 types are not Blueprint-compatible + void UpdateUniqueI16(const int16 N, const int32 Data); + + bool InvokeUpdateUniqueI16(const FReducerEventContext& Context, const UUpdateUniqueI16Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FUpdateUniqueI256Handler, + const FReducerEventContext&, Context, + const FSpacetimeDBInt256&, N, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FUpdateUniqueI256Handler OnUpdateUniqueI256; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void UpdateUniqueI256(const FSpacetimeDBInt256& N, const int32 Data); + + bool InvokeUpdateUniqueI256(const FReducerEventContext& Context, const UUpdateUniqueI256Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FUpdateUniqueI32Handler, + const FReducerEventContext&, Context, + int32, N, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FUpdateUniqueI32Handler OnUpdateUniqueI32; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void UpdateUniqueI32(const int32 N, const int32 Data); + + bool InvokeUpdateUniqueI32(const FReducerEventContext& Context, const UUpdateUniqueI32Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FUpdateUniqueI64Handler, + const FReducerEventContext&, Context, + int64, N, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FUpdateUniqueI64Handler OnUpdateUniqueI64; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void UpdateUniqueI64(const int64 N, const int32 Data); + + bool InvokeUpdateUniqueI64(const FReducerEventContext& Context, const UUpdateUniqueI64Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FUpdateUniqueI8Handler, + const FReducerEventContext&, Context, + int8, N, + int32, Data + ); + // NOTE: Not exposed to Blueprint because int8 types are not Blueprint-compatible + FUpdateUniqueI8Handler OnUpdateUniqueI8; + + // NOTE: Not exposed to Blueprint because int8 types are not Blueprint-compatible + void UpdateUniqueI8(const int8 N, const int32 Data); + + bool InvokeUpdateUniqueI8(const FReducerEventContext& Context, const UUpdateUniqueI8Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FUpdateUniqueIdentityHandler, + const FReducerEventContext&, Context, + const FSpacetimeDBIdentity&, I, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FUpdateUniqueIdentityHandler OnUpdateUniqueIdentity; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void UpdateUniqueIdentity(const FSpacetimeDBIdentity& I, const int32 Data); + + bool InvokeUpdateUniqueIdentity(const FReducerEventContext& Context, const UUpdateUniqueIdentityReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FUpdateUniqueStringHandler, + const FReducerEventContext&, Context, + const FString&, S, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FUpdateUniqueStringHandler OnUpdateUniqueString; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void UpdateUniqueString(const FString& S, const int32 Data); + + bool InvokeUpdateUniqueString(const FReducerEventContext& Context, const UUpdateUniqueStringReducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FUpdateUniqueU128Handler, + const FReducerEventContext&, Context, + const FSpacetimeDBUInt128&, N, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FUpdateUniqueU128Handler OnUpdateUniqueU128; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void UpdateUniqueU128(const FSpacetimeDBUInt128& N, const int32 Data); + + bool InvokeUpdateUniqueU128(const FReducerEventContext& Context, const UUpdateUniqueU128Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FUpdateUniqueU16Handler, + const FReducerEventContext&, Context, + uint16, N, + int32, Data + ); + // NOTE: Not exposed to Blueprint because uint16 types are not Blueprint-compatible + FUpdateUniqueU16Handler OnUpdateUniqueU16; + + // NOTE: Not exposed to Blueprint because uint16 types are not Blueprint-compatible + void UpdateUniqueU16(const uint16 N, const int32 Data); + + bool InvokeUpdateUniqueU16(const FReducerEventContext& Context, const UUpdateUniqueU16Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FUpdateUniqueU256Handler, + const FReducerEventContext&, Context, + const FSpacetimeDBUInt256&, N, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FUpdateUniqueU256Handler OnUpdateUniqueU256; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void UpdateUniqueU256(const FSpacetimeDBUInt256& N, const int32 Data); + + bool InvokeUpdateUniqueU256(const FReducerEventContext& Context, const UUpdateUniqueU256Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FUpdateUniqueU32Handler, + const FReducerEventContext&, Context, + uint32, N, + int32, Data + ); + // NOTE: Not exposed to Blueprint because uint32 types are not Blueprint-compatible + FUpdateUniqueU32Handler OnUpdateUniqueU32; + + // NOTE: Not exposed to Blueprint because uint32 types are not Blueprint-compatible + void UpdateUniqueU32(const uint32 N, const int32 Data); + + bool InvokeUpdateUniqueU32(const FReducerEventContext& Context, const UUpdateUniqueU32Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FUpdateUniqueU64Handler, + const FReducerEventContext&, Context, + uint64, N, + int32, Data + ); + // NOTE: Not exposed to Blueprint because uint64 types are not Blueprint-compatible + FUpdateUniqueU64Handler OnUpdateUniqueU64; + + // NOTE: Not exposed to Blueprint because uint64 types are not Blueprint-compatible + void UpdateUniqueU64(const uint64 N, const int32 Data); + + bool InvokeUpdateUniqueU64(const FReducerEventContext& Context, const UUpdateUniqueU64Reducer* Args); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FUpdateUniqueU8Handler, + const FReducerEventContext&, Context, + uint8, N, + int32, Data + ); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FUpdateUniqueU8Handler OnUpdateUniqueU8; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + void UpdateUniqueU8(const uint8 N, const int32 Data); + + bool InvokeUpdateUniqueU8(const FReducerEventContext& Context, const UUpdateUniqueU8Reducer* Args); + + // Internal error handling + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FInternalOnUnhandledReducerError, const FReducerEventContext&, Context, const FString&, Error); + FInternalOnUnhandledReducerError InternalOnUnhandledReducerError; + +private: + + friend UDbConnection; + + UPROPERTY() + class UDbConnection* Conn; + + UPROPERTY() + USetReducerFlags* SetCallReducerFlags; +}; + +// SubscriptionBuilder class +UCLASS(BlueprintType) +class TESTCLIENT_API USubscriptionBuilder : public USubscriptionBuilderBase +{ + GENERATED_BODY() + +public: + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + USubscriptionBuilder* OnApplied(FOnSubscriptionApplied Callback); + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + USubscriptionBuilder* OnError(FOnSubscriptionError Callback); + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + USubscriptionHandle* Subscribe(const TArray& SQL); + + /** Convenience for subscribing to all rows from all tables */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + USubscriptionHandle* SubscribeToAllTables(); + + + friend class UDbConnection; + friend class UDbConnectionBase; + +protected: + UPROPERTY() + class UDbConnection* Conn; + + // Delegates stored so Subscribe() can bind forwarding callbacks + FOnSubscriptionApplied OnAppliedDelegateInternal; + FOnSubscriptionError OnErrorDelegateInternal; +}; + +// SubscriptionHandle class +UCLASS(BlueprintType) +class TESTCLIENT_API USubscriptionHandle : public USubscriptionHandleBase +{ + GENERATED_BODY() + +public: + + USubscriptionHandle() {}; + + explicit USubscriptionHandle(UDbConnection* InConn); + + friend class USubscriptionBuilder; + +private: + UPROPERTY() + class UDbConnection* Conn; + + // Delegates that expose subscription events with connection aware contexts + FOnSubscriptionApplied OnAppliedDelegate; + FOnSubscriptionError OnErrorDelegate; + + UFUNCTION() + void ForwardOnApplied(const FSubscriptionEventContextBase& BaseCtx); + + UFUNCTION() + void ForwardOnError(const FErrorContextBase& BaseCtx); +}; + +/* + @Note: Child class of UDbConnectionBuilderBase. +*/ +UCLASS(BlueprintType) +class TESTCLIENT_API UDbConnectionBuilder : public UDbConnectionBuilderBase +{ + GENERATED_BODY() +public: + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + UDbConnectionBuilder* WithUri(const FString& InUri); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + UDbConnectionBuilder* WithModuleName(const FString& InName); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + UDbConnectionBuilder* WithToken(const FString& InToken); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + UDbConnectionBuilder* WithCompression(const ESpacetimeDBCompression& InCompression); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + UDbConnectionBuilder* OnConnect(FOnConnectDelegate Callback); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + UDbConnectionBuilder* OnConnectError(FOnConnectErrorDelegate Callback); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + UDbConnectionBuilder* OnDisconnect(FOnDisconnectDelegate Callback); + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + UDbConnection* Build(); + +private: + + // Stored delegates which will be forwarded when the connection events occur. + FOnConnectDelegate OnConnectDelegateInternal; + FOnDisconnectDelegate OnDisconnectDelegateInternal; +}; + +// Main DbConnection class +UCLASS(BlueprintType) +class TESTCLIENT_API UDbConnection : public UDbConnectionBase +{ + GENERATED_BODY() + +public: + explicit UDbConnection(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get()); + + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + URemoteTables* Db; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + URemoteReducers* Reducers; + + UPROPERTY(BlueprintReadOnly, Category="SpacetimeDB") + USetReducerFlags* SetReducerFlags; + + // Delegates that allow users to bind with the concrete connection type. + FOnConnectDelegate OnConnectDelegate; + FOnDisconnectDelegate OnDisconnectDelegate; + + UFUNCTION(BlueprintCallable, Category="SpacetimeDB") + USubscriptionBuilder* SubscriptionBuilder(); + + /** Static entry point for constructing a connection. */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB", DisplayName = "SpacetimeDB Builder") + static UDbConnectionBuilder* Builder(); + + // Error handling + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnUnhandledReducerError, const FReducerEventContext&, Context, const FString&, Error); + UPROPERTY(BlueprintAssignable, Category="SpacetimeDB") + FOnUnhandledReducerError OnUnhandledReducerError; + + +protected: + + // Hook up error handling to reducers + virtual void PostInitProperties() override; + + UFUNCTION() + void ForwardOnConnect(UDbConnectionBase* BaseConnection, FSpacetimeDBIdentity InIdentity, const FString& InToken); + UFUNCTION() + void ForwardOnDisconnect(UDbConnectionBase* BaseConnection, const FString& Error); + + UFUNCTION() + void OnUnhandledReducerErrorHandler(const FReducerEventContext& Context, const FString& Error); + + // Override the DbConnectionBase methods to handle updates and events + virtual void DbUpdate(const FDatabaseUpdateType& Update, const FSpacetimeDBEvent& Event) override; + + // Override the reducer event handler to dispatch events to the appropriate reducers + virtual void ReducerEvent(const FReducerEvent& Event) override; + + // Override the reducer event failed handler + virtual void ReducerEventFailed(const FReducerEvent& Event, const FString ErrorMessage) override; +}; + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/BTreeU32Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/BTreeU32Table.g.h new file mode 100644 index 00000000000..a2381251578 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/BTreeU32Table.g.h @@ -0,0 +1,101 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/BTreeU32Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "BTreeU32Table.g.generated.h" + +UCLASS(Blueprintable) +class UBTreeU32NIndex : public UObject +{ + GENERATED_BODY() + +public: + TArray Filter(const uint32& N) const + { + TArray OutResults; + + LocalCache->FindByMultiKeyBTreeIndex>( + OutResults, + TEXT("n"), + MakeTuple(N) + ); + + return OutResults; + } + + void SetCache(TSharedPtr> InCache) + { + LocalCache = InCache; + } + +private: + // NOTE: Not exposed to Blueprint because some parameter types are not Blueprint-compatible + void FilterN(TArray& OutResults, const uint32& N) + { + OutResults = Filter(N); + } + + TSharedPtr> LocalCache; +}; + +UCLASS(BlueprintType) +class TESTCLIENT_API UBTreeU32Table : public URemoteTable +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly) + UBTreeU32NIndex* N; + + void PostInitialize(); + + /** Update function for btree_u32 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnBTreeU32Insert, + const FEventContext&, Context, + const FBTreeU32Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnBTreeU32Update, + const FEventContext&, Context, + const FBTreeU32Type&, OldRow, + const FBTreeU32Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnBTreeU32Delete, + const FEventContext&, Context, + const FBTreeU32Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnBTreeU32Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnBTreeU32Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnBTreeU32Delete OnDelete; + +private: + const FString TableName = TEXT("btree_u32"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/IndexedSimpleEnumTable.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/IndexedSimpleEnumTable.g.h new file mode 100644 index 00000000000..698fed5a56a --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/IndexedSimpleEnumTable.g.h @@ -0,0 +1,101 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/IndexedSimpleEnumType.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "IndexedSimpleEnumTable.g.generated.h" + +UCLASS(Blueprintable) +class UIndexedSimpleEnumNIndex : public UObject +{ + GENERATED_BODY() + +public: + TArray Filter(const ESimpleEnumType& N) const + { + TArray OutResults; + + LocalCache->FindByMultiKeyBTreeIndex>( + OutResults, + TEXT("n"), + MakeTuple(N) + ); + + return OutResults; + } + + void SetCache(TSharedPtr> InCache) + { + LocalCache = InCache; + } + +private: + UFUNCTION(BlueprintCallable) + void FilterN(TArray& OutResults, const ESimpleEnumType& N) + { + OutResults = Filter(N); + } + + TSharedPtr> LocalCache; +}; + +UCLASS(BlueprintType) +class TESTCLIENT_API UIndexedSimpleEnumTable : public URemoteTable +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly) + UIndexedSimpleEnumNIndex* N; + + void PostInitialize(); + + /** Update function for indexed_simple_enum table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnIndexedSimpleEnumInsert, + const FEventContext&, Context, + const FIndexedSimpleEnumType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnIndexedSimpleEnumUpdate, + const FEventContext&, Context, + const FIndexedSimpleEnumType&, OldRow, + const FIndexedSimpleEnumType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnIndexedSimpleEnumDelete, + const FEventContext&, Context, + const FIndexedSimpleEnumType&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnIndexedSimpleEnumInsert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnIndexedSimpleEnumUpdate OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnIndexedSimpleEnumDelete OnDelete; + +private: + const FString TableName = TEXT("indexed_simple_enum"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/IndexedTable2Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/IndexedTable2Table.g.h new file mode 100644 index 00000000000..c943ba5e3bd --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/IndexedTable2Table.g.h @@ -0,0 +1,101 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/IndexedTable2Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "IndexedTable2Table.g.generated.h" + +UCLASS(Blueprintable) +class UIndexedTable2PlayerIdSnazzIndexIndex : public UObject +{ + GENERATED_BODY() + +public: + TArray Filter(const uint32& PlayerId, const float& PlayerSnazz) const + { + TArray OutResults; + + LocalCache->FindByMultiKeyBTreeIndex>( + OutResults, + TEXT("player_id_snazz_index"), + MakeTuple(PlayerId, PlayerSnazz) + ); + + return OutResults; + } + + void SetCache(TSharedPtr> InCache) + { + LocalCache = InCache; + } + +private: + // NOTE: Not exposed to Blueprint because some parameter types are not Blueprint-compatible + void FilterPlayerIdPlayerSnazz(TArray& OutResults, const uint32& PlayerId, const float& PlayerSnazz) + { + OutResults = Filter(PlayerId, PlayerSnazz); + } + + TSharedPtr> LocalCache; +}; + +UCLASS(BlueprintType) +class TESTCLIENT_API UIndexedTable2Table : public URemoteTable +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly) + UIndexedTable2PlayerIdSnazzIndexIndex* PlayerIdSnazzIndex; + + void PostInitialize(); + + /** Update function for indexed_table_2 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnIndexedTable2Insert, + const FEventContext&, Context, + const FIndexedTable2Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnIndexedTable2Update, + const FEventContext&, Context, + const FIndexedTable2Type&, OldRow, + const FIndexedTable2Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnIndexedTable2Delete, + const FEventContext&, Context, + const FIndexedTable2Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnIndexedTable2Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnIndexedTable2Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnIndexedTable2Delete OnDelete; + +private: + const FString TableName = TEXT("indexed_table_2"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/IndexedTableTable.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/IndexedTableTable.g.h new file mode 100644 index 00000000000..0280e19a2c1 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/IndexedTableTable.g.h @@ -0,0 +1,101 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/IndexedTableType.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "IndexedTableTable.g.generated.h" + +UCLASS(Blueprintable) +class UIndexedTablePlayerIdIndex : public UObject +{ + GENERATED_BODY() + +public: + TArray Filter(const uint32& PlayerId) const + { + TArray OutResults; + + LocalCache->FindByMultiKeyBTreeIndex>( + OutResults, + TEXT("player_id"), + MakeTuple(PlayerId) + ); + + return OutResults; + } + + void SetCache(TSharedPtr> InCache) + { + LocalCache = InCache; + } + +private: + // NOTE: Not exposed to Blueprint because some parameter types are not Blueprint-compatible + void FilterPlayerId(TArray& OutResults, const uint32& PlayerId) + { + OutResults = Filter(PlayerId); + } + + TSharedPtr> LocalCache; +}; + +UCLASS(BlueprintType) +class TESTCLIENT_API UIndexedTableTable : public URemoteTable +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly) + UIndexedTablePlayerIdIndex* PlayerId; + + void PostInitialize(); + + /** Update function for indexed_table table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnIndexedTableInsert, + const FEventContext&, Context, + const FIndexedTableType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnIndexedTableUpdate, + const FEventContext&, Context, + const FIndexedTableType&, OldRow, + const FIndexedTableType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnIndexedTableDelete, + const FEventContext&, Context, + const FIndexedTableType&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnIndexedTableInsert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnIndexedTableUpdate OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnIndexedTableDelete OnDelete; + +private: + const FString TableName = TEXT("indexed_table"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/LargeTableTable.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/LargeTableTable.g.h new file mode 100644 index 00000000000..4ab3b3b6bf4 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/LargeTableTable.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/LargeTableType.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "LargeTableTable.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API ULargeTableTable : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for large_table table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnLargeTableInsert, + const FEventContext&, Context, + const FLargeTableType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnLargeTableUpdate, + const FEventContext&, Context, + const FLargeTableType&, OldRow, + const FLargeTableType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnLargeTableDelete, + const FEventContext&, Context, + const FLargeTableType&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnLargeTableInsert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnLargeTableUpdate OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnLargeTableDelete OnDelete; + +private: + const FString TableName = TEXT("large_table"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneBoolTable.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneBoolTable.g.h new file mode 100644 index 00000000000..024f5232853 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneBoolTable.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/OneBoolType.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "OneBoolTable.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UOneBoolTable : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for one_bool table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneBoolInsert, + const FEventContext&, Context, + const FOneBoolType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnOneBoolUpdate, + const FEventContext&, Context, + const FOneBoolType&, OldRow, + const FOneBoolType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneBoolDelete, + const FEventContext&, Context, + const FOneBoolType&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneBoolInsert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneBoolUpdate OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneBoolDelete OnDelete; + +private: + const FString TableName = TEXT("one_bool"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneByteStructTable.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneByteStructTable.g.h new file mode 100644 index 00000000000..ee039f2423c --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneByteStructTable.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/OneByteStructType.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "OneByteStructTable.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UOneByteStructTable : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for one_byte_struct table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneByteStructInsert, + const FEventContext&, Context, + const FOneByteStructType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnOneByteStructUpdate, + const FEventContext&, Context, + const FOneByteStructType&, OldRow, + const FOneByteStructType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneByteStructDelete, + const FEventContext&, Context, + const FOneByteStructType&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneByteStructInsert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneByteStructUpdate OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneByteStructDelete OnDelete; + +private: + const FString TableName = TEXT("one_byte_struct"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneConnectionIdTable.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneConnectionIdTable.g.h new file mode 100644 index 00000000000..24270eb9cbc --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneConnectionIdTable.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/OneConnectionIdType.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "OneConnectionIdTable.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UOneConnectionIdTable : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for one_connection_id table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneConnectionIdInsert, + const FEventContext&, Context, + const FOneConnectionIdType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnOneConnectionIdUpdate, + const FEventContext&, Context, + const FOneConnectionIdType&, OldRow, + const FOneConnectionIdType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneConnectionIdDelete, + const FEventContext&, Context, + const FOneConnectionIdType&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneConnectionIdInsert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneConnectionIdUpdate OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneConnectionIdDelete OnDelete; + +private: + const FString TableName = TEXT("one_connection_id"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneEnumWithPayloadTable.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneEnumWithPayloadTable.g.h new file mode 100644 index 00000000000..c77be0a4460 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneEnumWithPayloadTable.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/OneEnumWithPayloadType.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "OneEnumWithPayloadTable.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UOneEnumWithPayloadTable : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for one_enum_with_payload table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneEnumWithPayloadInsert, + const FEventContext&, Context, + const FOneEnumWithPayloadType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnOneEnumWithPayloadUpdate, + const FEventContext&, Context, + const FOneEnumWithPayloadType&, OldRow, + const FOneEnumWithPayloadType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneEnumWithPayloadDelete, + const FEventContext&, Context, + const FOneEnumWithPayloadType&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneEnumWithPayloadInsert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneEnumWithPayloadUpdate OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneEnumWithPayloadDelete OnDelete; + +private: + const FString TableName = TEXT("one_enum_with_payload"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneEveryPrimitiveStructTable.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneEveryPrimitiveStructTable.g.h new file mode 100644 index 00000000000..4e2027c8677 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneEveryPrimitiveStructTable.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/OneEveryPrimitiveStructType.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "OneEveryPrimitiveStructTable.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UOneEveryPrimitiveStructTable : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for one_every_primitive_struct table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneEveryPrimitiveStructInsert, + const FEventContext&, Context, + const FOneEveryPrimitiveStructType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnOneEveryPrimitiveStructUpdate, + const FEventContext&, Context, + const FOneEveryPrimitiveStructType&, OldRow, + const FOneEveryPrimitiveStructType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneEveryPrimitiveStructDelete, + const FEventContext&, Context, + const FOneEveryPrimitiveStructType&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneEveryPrimitiveStructInsert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneEveryPrimitiveStructUpdate OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneEveryPrimitiveStructDelete OnDelete; + +private: + const FString TableName = TEXT("one_every_primitive_struct"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneEveryVecStructTable.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneEveryVecStructTable.g.h new file mode 100644 index 00000000000..b54b49f4c79 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneEveryVecStructTable.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/OneEveryVecStructType.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "OneEveryVecStructTable.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UOneEveryVecStructTable : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for one_every_vec_struct table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneEveryVecStructInsert, + const FEventContext&, Context, + const FOneEveryVecStructType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnOneEveryVecStructUpdate, + const FEventContext&, Context, + const FOneEveryVecStructType&, OldRow, + const FOneEveryVecStructType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneEveryVecStructDelete, + const FEventContext&, Context, + const FOneEveryVecStructType&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneEveryVecStructInsert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneEveryVecStructUpdate OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneEveryVecStructDelete OnDelete; + +private: + const FString TableName = TEXT("one_every_vec_struct"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneF32Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneF32Table.g.h new file mode 100644 index 00000000000..789c5dafdc6 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneF32Table.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/OneF32Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "OneF32Table.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UOneF32Table : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for one_f32 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneF32Insert, + const FEventContext&, Context, + const FOneF32Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnOneF32Update, + const FEventContext&, Context, + const FOneF32Type&, OldRow, + const FOneF32Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneF32Delete, + const FEventContext&, Context, + const FOneF32Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneF32Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneF32Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneF32Delete OnDelete; + +private: + const FString TableName = TEXT("one_f32"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneF64Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneF64Table.g.h new file mode 100644 index 00000000000..3dfb09c8b20 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneF64Table.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/OneF64Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "OneF64Table.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UOneF64Table : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for one_f64 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneF64Insert, + const FEventContext&, Context, + const FOneF64Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnOneF64Update, + const FEventContext&, Context, + const FOneF64Type&, OldRow, + const FOneF64Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneF64Delete, + const FEventContext&, Context, + const FOneF64Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneF64Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneF64Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneF64Delete OnDelete; + +private: + const FString TableName = TEXT("one_f64"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneI128Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneI128Table.g.h new file mode 100644 index 00000000000..dc370d4929f --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneI128Table.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/OneI128Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "OneI128Table.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UOneI128Table : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for one_i128 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneI128Insert, + const FEventContext&, Context, + const FOneI128Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnOneI128Update, + const FEventContext&, Context, + const FOneI128Type&, OldRow, + const FOneI128Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneI128Delete, + const FEventContext&, Context, + const FOneI128Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneI128Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneI128Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneI128Delete OnDelete; + +private: + const FString TableName = TEXT("one_i128"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneI16Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneI16Table.g.h new file mode 100644 index 00000000000..0f26c456dbf --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneI16Table.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/OneI16Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "OneI16Table.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UOneI16Table : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for one_i16 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneI16Insert, + const FEventContext&, Context, + const FOneI16Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnOneI16Update, + const FEventContext&, Context, + const FOneI16Type&, OldRow, + const FOneI16Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneI16Delete, + const FEventContext&, Context, + const FOneI16Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneI16Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneI16Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneI16Delete OnDelete; + +private: + const FString TableName = TEXT("one_i16"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneI256Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneI256Table.g.h new file mode 100644 index 00000000000..aee4aedfb92 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneI256Table.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/OneI256Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "OneI256Table.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UOneI256Table : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for one_i256 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneI256Insert, + const FEventContext&, Context, + const FOneI256Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnOneI256Update, + const FEventContext&, Context, + const FOneI256Type&, OldRow, + const FOneI256Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneI256Delete, + const FEventContext&, Context, + const FOneI256Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneI256Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneI256Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneI256Delete OnDelete; + +private: + const FString TableName = TEXT("one_i256"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneI32Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneI32Table.g.h new file mode 100644 index 00000000000..ed497686cd7 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneI32Table.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/OneI32Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "OneI32Table.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UOneI32Table : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for one_i32 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneI32Insert, + const FEventContext&, Context, + const FOneI32Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnOneI32Update, + const FEventContext&, Context, + const FOneI32Type&, OldRow, + const FOneI32Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneI32Delete, + const FEventContext&, Context, + const FOneI32Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneI32Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneI32Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneI32Delete OnDelete; + +private: + const FString TableName = TEXT("one_i32"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneI64Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneI64Table.g.h new file mode 100644 index 00000000000..dfb550e5662 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneI64Table.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/OneI64Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "OneI64Table.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UOneI64Table : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for one_i64 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneI64Insert, + const FEventContext&, Context, + const FOneI64Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnOneI64Update, + const FEventContext&, Context, + const FOneI64Type&, OldRow, + const FOneI64Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneI64Delete, + const FEventContext&, Context, + const FOneI64Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneI64Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneI64Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneI64Delete OnDelete; + +private: + const FString TableName = TEXT("one_i64"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneI8Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneI8Table.g.h new file mode 100644 index 00000000000..f41b8bed6d5 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneI8Table.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/OneI8Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "OneI8Table.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UOneI8Table : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for one_i8 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneI8Insert, + const FEventContext&, Context, + const FOneI8Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnOneI8Update, + const FEventContext&, Context, + const FOneI8Type&, OldRow, + const FOneI8Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneI8Delete, + const FEventContext&, Context, + const FOneI8Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneI8Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneI8Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneI8Delete OnDelete; + +private: + const FString TableName = TEXT("one_i8"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneIdentityTable.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneIdentityTable.g.h new file mode 100644 index 00000000000..6b21130e90c --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneIdentityTable.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/OneIdentityType.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "OneIdentityTable.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UOneIdentityTable : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for one_identity table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneIdentityInsert, + const FEventContext&, Context, + const FOneIdentityType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnOneIdentityUpdate, + const FEventContext&, Context, + const FOneIdentityType&, OldRow, + const FOneIdentityType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneIdentityDelete, + const FEventContext&, Context, + const FOneIdentityType&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneIdentityInsert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneIdentityUpdate OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneIdentityDelete OnDelete; + +private: + const FString TableName = TEXT("one_identity"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneSimpleEnumTable.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneSimpleEnumTable.g.h new file mode 100644 index 00000000000..f17b7811315 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneSimpleEnumTable.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/OneSimpleEnumType.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "OneSimpleEnumTable.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UOneSimpleEnumTable : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for one_simple_enum table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneSimpleEnumInsert, + const FEventContext&, Context, + const FOneSimpleEnumType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnOneSimpleEnumUpdate, + const FEventContext&, Context, + const FOneSimpleEnumType&, OldRow, + const FOneSimpleEnumType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneSimpleEnumDelete, + const FEventContext&, Context, + const FOneSimpleEnumType&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneSimpleEnumInsert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneSimpleEnumUpdate OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneSimpleEnumDelete OnDelete; + +private: + const FString TableName = TEXT("one_simple_enum"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneStringTable.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneStringTable.g.h new file mode 100644 index 00000000000..e6301016a72 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneStringTable.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/OneStringType.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "OneStringTable.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UOneStringTable : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for one_string table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneStringInsert, + const FEventContext&, Context, + const FOneStringType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnOneStringUpdate, + const FEventContext&, Context, + const FOneStringType&, OldRow, + const FOneStringType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneStringDelete, + const FEventContext&, Context, + const FOneStringType&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneStringInsert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneStringUpdate OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneStringDelete OnDelete; + +private: + const FString TableName = TEXT("one_string"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneTimestampTable.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneTimestampTable.g.h new file mode 100644 index 00000000000..9f859bde935 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneTimestampTable.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/OneTimestampType.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "OneTimestampTable.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UOneTimestampTable : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for one_timestamp table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneTimestampInsert, + const FEventContext&, Context, + const FOneTimestampType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnOneTimestampUpdate, + const FEventContext&, Context, + const FOneTimestampType&, OldRow, + const FOneTimestampType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneTimestampDelete, + const FEventContext&, Context, + const FOneTimestampType&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneTimestampInsert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneTimestampUpdate OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneTimestampDelete OnDelete; + +private: + const FString TableName = TEXT("one_timestamp"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneU128Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneU128Table.g.h new file mode 100644 index 00000000000..0ccaa72f21f --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneU128Table.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/OneU128Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "OneU128Table.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UOneU128Table : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for one_u128 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneU128Insert, + const FEventContext&, Context, + const FOneU128Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnOneU128Update, + const FEventContext&, Context, + const FOneU128Type&, OldRow, + const FOneU128Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneU128Delete, + const FEventContext&, Context, + const FOneU128Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneU128Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneU128Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneU128Delete OnDelete; + +private: + const FString TableName = TEXT("one_u128"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneU16Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneU16Table.g.h new file mode 100644 index 00000000000..4501b0e7d59 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneU16Table.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/OneU16Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "OneU16Table.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UOneU16Table : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for one_u16 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneU16Insert, + const FEventContext&, Context, + const FOneU16Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnOneU16Update, + const FEventContext&, Context, + const FOneU16Type&, OldRow, + const FOneU16Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneU16Delete, + const FEventContext&, Context, + const FOneU16Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneU16Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneU16Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneU16Delete OnDelete; + +private: + const FString TableName = TEXT("one_u16"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneU256Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneU256Table.g.h new file mode 100644 index 00000000000..ad10a3b4727 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneU256Table.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/OneU256Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "OneU256Table.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UOneU256Table : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for one_u256 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneU256Insert, + const FEventContext&, Context, + const FOneU256Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnOneU256Update, + const FEventContext&, Context, + const FOneU256Type&, OldRow, + const FOneU256Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneU256Delete, + const FEventContext&, Context, + const FOneU256Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneU256Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneU256Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneU256Delete OnDelete; + +private: + const FString TableName = TEXT("one_u256"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneU32Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneU32Table.g.h new file mode 100644 index 00000000000..cbdecbcd491 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneU32Table.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/OneU32Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "OneU32Table.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UOneU32Table : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for one_u32 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneU32Insert, + const FEventContext&, Context, + const FOneU32Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnOneU32Update, + const FEventContext&, Context, + const FOneU32Type&, OldRow, + const FOneU32Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneU32Delete, + const FEventContext&, Context, + const FOneU32Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneU32Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneU32Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneU32Delete OnDelete; + +private: + const FString TableName = TEXT("one_u32"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneU64Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneU64Table.g.h new file mode 100644 index 00000000000..14ce8017a71 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneU64Table.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/OneU64Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "OneU64Table.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UOneU64Table : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for one_u64 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneU64Insert, + const FEventContext&, Context, + const FOneU64Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnOneU64Update, + const FEventContext&, Context, + const FOneU64Type&, OldRow, + const FOneU64Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneU64Delete, + const FEventContext&, Context, + const FOneU64Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneU64Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneU64Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneU64Delete OnDelete; + +private: + const FString TableName = TEXT("one_u64"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneU8Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneU8Table.g.h new file mode 100644 index 00000000000..128f8eb24cb --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneU8Table.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/OneU8Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "OneU8Table.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UOneU8Table : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for one_u8 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneU8Insert, + const FEventContext&, Context, + const FOneU8Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnOneU8Update, + const FEventContext&, Context, + const FOneU8Type&, OldRow, + const FOneU8Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneU8Delete, + const FEventContext&, Context, + const FOneU8Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneU8Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneU8Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneU8Delete OnDelete; + +private: + const FString TableName = TEXT("one_u8"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneUnitStructTable.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneUnitStructTable.g.h new file mode 100644 index 00000000000..063e6547633 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OneUnitStructTable.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/OneUnitStructType.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "OneUnitStructTable.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UOneUnitStructTable : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for one_unit_struct table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneUnitStructInsert, + const FEventContext&, Context, + const FOneUnitStructType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnOneUnitStructUpdate, + const FEventContext&, Context, + const FOneUnitStructType&, OldRow, + const FOneUnitStructType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOneUnitStructDelete, + const FEventContext&, Context, + const FOneUnitStructType&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneUnitStructInsert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneUnitStructUpdate OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOneUnitStructDelete OnDelete; + +private: + const FString TableName = TEXT("one_unit_struct"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OptionEveryPrimitiveStructTable.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OptionEveryPrimitiveStructTable.g.h new file mode 100644 index 00000000000..8d45eea5a44 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OptionEveryPrimitiveStructTable.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/OptionEveryPrimitiveStructType.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "OptionEveryPrimitiveStructTable.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UOptionEveryPrimitiveStructTable : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for option_every_primitive_struct table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOptionEveryPrimitiveStructInsert, + const FEventContext&, Context, + const FOptionEveryPrimitiveStructType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnOptionEveryPrimitiveStructUpdate, + const FEventContext&, Context, + const FOptionEveryPrimitiveStructType&, OldRow, + const FOptionEveryPrimitiveStructType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOptionEveryPrimitiveStructDelete, + const FEventContext&, Context, + const FOptionEveryPrimitiveStructType&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOptionEveryPrimitiveStructInsert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOptionEveryPrimitiveStructUpdate OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOptionEveryPrimitiveStructDelete OnDelete; + +private: + const FString TableName = TEXT("option_every_primitive_struct"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OptionI32Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OptionI32Table.g.h new file mode 100644 index 00000000000..d404a836656 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OptionI32Table.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/OptionI32Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "OptionI32Table.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UOptionI32Table : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for option_i32 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOptionI32Insert, + const FEventContext&, Context, + const FOptionI32Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnOptionI32Update, + const FEventContext&, Context, + const FOptionI32Type&, OldRow, + const FOptionI32Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOptionI32Delete, + const FEventContext&, Context, + const FOptionI32Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOptionI32Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOptionI32Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOptionI32Delete OnDelete; + +private: + const FString TableName = TEXT("option_i32"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OptionIdentityTable.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OptionIdentityTable.g.h new file mode 100644 index 00000000000..5c34e93c3e9 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OptionIdentityTable.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/OptionIdentityType.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "OptionIdentityTable.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UOptionIdentityTable : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for option_identity table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOptionIdentityInsert, + const FEventContext&, Context, + const FOptionIdentityType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnOptionIdentityUpdate, + const FEventContext&, Context, + const FOptionIdentityType&, OldRow, + const FOptionIdentityType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOptionIdentityDelete, + const FEventContext&, Context, + const FOptionIdentityType&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOptionIdentityInsert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOptionIdentityUpdate OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOptionIdentityDelete OnDelete; + +private: + const FString TableName = TEXT("option_identity"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OptionSimpleEnumTable.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OptionSimpleEnumTable.g.h new file mode 100644 index 00000000000..570a544e7c6 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OptionSimpleEnumTable.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/OptionSimpleEnumType.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "OptionSimpleEnumTable.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UOptionSimpleEnumTable : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for option_simple_enum table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOptionSimpleEnumInsert, + const FEventContext&, Context, + const FOptionSimpleEnumType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnOptionSimpleEnumUpdate, + const FEventContext&, Context, + const FOptionSimpleEnumType&, OldRow, + const FOptionSimpleEnumType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOptionSimpleEnumDelete, + const FEventContext&, Context, + const FOptionSimpleEnumType&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOptionSimpleEnumInsert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOptionSimpleEnumUpdate OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOptionSimpleEnumDelete OnDelete; + +private: + const FString TableName = TEXT("option_simple_enum"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OptionStringTable.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OptionStringTable.g.h new file mode 100644 index 00000000000..a8b38d07c48 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OptionStringTable.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/OptionStringType.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "OptionStringTable.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UOptionStringTable : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for option_string table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOptionStringInsert, + const FEventContext&, Context, + const FOptionStringType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnOptionStringUpdate, + const FEventContext&, Context, + const FOptionStringType&, OldRow, + const FOptionStringType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOptionStringDelete, + const FEventContext&, Context, + const FOptionStringType&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOptionStringInsert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOptionStringUpdate OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOptionStringDelete OnDelete; + +private: + const FString TableName = TEXT("option_string"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OptionVecOptionI32Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OptionVecOptionI32Table.g.h new file mode 100644 index 00000000000..be51577a72d --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/OptionVecOptionI32Table.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/OptionVecOptionI32Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "OptionVecOptionI32Table.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UOptionVecOptionI32Table : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for option_vec_option_i32 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOptionVecOptionI32Insert, + const FEventContext&, Context, + const FOptionVecOptionI32Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnOptionVecOptionI32Update, + const FEventContext&, Context, + const FOptionVecOptionI32Type&, OldRow, + const FOptionVecOptionI32Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnOptionVecOptionI32Delete, + const FEventContext&, Context, + const FOptionVecOptionI32Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOptionVecOptionI32Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOptionVecOptionI32Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnOptionVecOptionI32Delete OnDelete; + +private: + const FString TableName = TEXT("option_vec_option_i32"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkBoolTable.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkBoolTable.g.h new file mode 100644 index 00000000000..bb24a2c9c22 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkBoolTable.g.h @@ -0,0 +1,104 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/PkBoolType.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "PkBoolTable.g.generated.h" + +UCLASS(Blueprintable) +class TESTCLIENT_API UPkBoolBUniqueIndex : public UObject +{ + GENERATED_BODY() + +private: + // Declare an instance of your templated helper. + // It's private because the UObject wrapper will expose its functionality. + FUniqueIndexHelper> BIndexHelper; + +public: + UPkBoolBUniqueIndex() + // Initialize the helper with the specific unique index name + : BIndexHelper("b") { + } + + /** + * Finds a PkBool by their unique b. + * @param Key The b to search for. + * @return The found FPkBoolType, or a default-constructed FPkBoolType if not found. + */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|PkBoolIndex") + FPkBoolType Find(bool Key) + { + // Simply delegate the call to the internal helper + return BIndexHelper.FindUniqueIndex(Key); + } + + // A public setter to provide the cache to the helper after construction + // This is a common pattern when the cache might be created or provided by another system. + void SetCache(TSharedPtr> InPkBoolCache) + { + BIndexHelper.Cache = InPkBoolCache; + } +}; +/***/ + +UCLASS(BlueprintType) +class TESTCLIENT_API UPkBoolTable : public URemoteTable +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly) + UPkBoolBUniqueIndex* B; + + void PostInitialize(); + + /** Update function for pk_bool table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnPkBoolInsert, + const FEventContext&, Context, + const FPkBoolType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnPkBoolUpdate, + const FEventContext&, Context, + const FPkBoolType&, OldRow, + const FPkBoolType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnPkBoolDelete, + const FEventContext&, Context, + const FPkBoolType&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkBoolInsert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkBoolUpdate OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkBoolDelete OnDelete; + +private: + const FString TableName = TEXT("pk_bool"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkConnectionIdTable.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkConnectionIdTable.g.h new file mode 100644 index 00000000000..c174980504c --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkConnectionIdTable.g.h @@ -0,0 +1,104 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/PkConnectionIdType.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "PkConnectionIdTable.g.generated.h" + +UCLASS(Blueprintable) +class TESTCLIENT_API UPkConnectionIdAUniqueIndex : public UObject +{ + GENERATED_BODY() + +private: + // Declare an instance of your templated helper. + // It's private because the UObject wrapper will expose its functionality. + FUniqueIndexHelper> AIndexHelper; + +public: + UPkConnectionIdAUniqueIndex() + // Initialize the helper with the specific unique index name + : AIndexHelper("a") { + } + + /** + * Finds a PkConnectionId by their unique a. + * @param Key The a to search for. + * @return The found FPkConnectionIdType, or a default-constructed FPkConnectionIdType if not found. + */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|PkConnectionIdIndex") + FPkConnectionIdType Find(FSpacetimeDBConnectionId Key) + { + // Simply delegate the call to the internal helper + return AIndexHelper.FindUniqueIndex(Key); + } + + // A public setter to provide the cache to the helper after construction + // This is a common pattern when the cache might be created or provided by another system. + void SetCache(TSharedPtr> InPkConnectionIdCache) + { + AIndexHelper.Cache = InPkConnectionIdCache; + } +}; +/***/ + +UCLASS(BlueprintType) +class TESTCLIENT_API UPkConnectionIdTable : public URemoteTable +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly) + UPkConnectionIdAUniqueIndex* A; + + void PostInitialize(); + + /** Update function for pk_connection_id table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnPkConnectionIdInsert, + const FEventContext&, Context, + const FPkConnectionIdType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnPkConnectionIdUpdate, + const FEventContext&, Context, + const FPkConnectionIdType&, OldRow, + const FPkConnectionIdType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnPkConnectionIdDelete, + const FEventContext&, Context, + const FPkConnectionIdType&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkConnectionIdInsert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkConnectionIdUpdate OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkConnectionIdDelete OnDelete; + +private: + const FString TableName = TEXT("pk_connection_id"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkI128Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkI128Table.g.h new file mode 100644 index 00000000000..0e1135a0b79 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkI128Table.g.h @@ -0,0 +1,104 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/PkI128Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "PkI128Table.g.generated.h" + +UCLASS(Blueprintable) +class TESTCLIENT_API UPkI128NUniqueIndex : public UObject +{ + GENERATED_BODY() + +private: + // Declare an instance of your templated helper. + // It's private because the UObject wrapper will expose its functionality. + FUniqueIndexHelper> NIndexHelper; + +public: + UPkI128NUniqueIndex() + // Initialize the helper with the specific unique index name + : NIndexHelper("n") { + } + + /** + * Finds a PkI128 by their unique n. + * @param Key The n to search for. + * @return The found FPkI128Type, or a default-constructed FPkI128Type if not found. + */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|PkI128Index") + FPkI128Type Find(FSpacetimeDBInt128 Key) + { + // Simply delegate the call to the internal helper + return NIndexHelper.FindUniqueIndex(Key); + } + + // A public setter to provide the cache to the helper after construction + // This is a common pattern when the cache might be created or provided by another system. + void SetCache(TSharedPtr> InPkI128Cache) + { + NIndexHelper.Cache = InPkI128Cache; + } +}; +/***/ + +UCLASS(BlueprintType) +class TESTCLIENT_API UPkI128Table : public URemoteTable +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly) + UPkI128NUniqueIndex* N; + + void PostInitialize(); + + /** Update function for pk_i128 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnPkI128Insert, + const FEventContext&, Context, + const FPkI128Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnPkI128Update, + const FEventContext&, Context, + const FPkI128Type&, OldRow, + const FPkI128Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnPkI128Delete, + const FEventContext&, Context, + const FPkI128Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkI128Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkI128Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkI128Delete OnDelete; + +private: + const FString TableName = TEXT("pk_i128"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkI16Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkI16Table.g.h new file mode 100644 index 00000000000..11c67eb11e2 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkI16Table.g.h @@ -0,0 +1,104 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/PkI16Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "PkI16Table.g.generated.h" + +UCLASS(Blueprintable) +class TESTCLIENT_API UPkI16NUniqueIndex : public UObject +{ + GENERATED_BODY() + +private: + // Declare an instance of your templated helper. + // It's private because the UObject wrapper will expose its functionality. + FUniqueIndexHelper> NIndexHelper; + +public: + UPkI16NUniqueIndex() + // Initialize the helper with the specific unique index name + : NIndexHelper("n") { + } + + /** + * Finds a PkI16 by their unique n. + * @param Key The n to search for. + * @return The found FPkI16Type, or a default-constructed FPkI16Type if not found. + */ + // NOTE: Not exposed to Blueprint because int16 types are not Blueprint-compatible + FPkI16Type Find(int16 Key) + { + // Simply delegate the call to the internal helper + return NIndexHelper.FindUniqueIndex(Key); + } + + // A public setter to provide the cache to the helper after construction + // This is a common pattern when the cache might be created or provided by another system. + void SetCache(TSharedPtr> InPkI16Cache) + { + NIndexHelper.Cache = InPkI16Cache; + } +}; +/***/ + +UCLASS(BlueprintType) +class TESTCLIENT_API UPkI16Table : public URemoteTable +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly) + UPkI16NUniqueIndex* N; + + void PostInitialize(); + + /** Update function for pk_i16 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnPkI16Insert, + const FEventContext&, Context, + const FPkI16Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnPkI16Update, + const FEventContext&, Context, + const FPkI16Type&, OldRow, + const FPkI16Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnPkI16Delete, + const FEventContext&, Context, + const FPkI16Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkI16Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkI16Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkI16Delete OnDelete; + +private: + const FString TableName = TEXT("pk_i16"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkI256Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkI256Table.g.h new file mode 100644 index 00000000000..54ac7cd2f4d --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkI256Table.g.h @@ -0,0 +1,104 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/PkI256Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "PkI256Table.g.generated.h" + +UCLASS(Blueprintable) +class TESTCLIENT_API UPkI256NUniqueIndex : public UObject +{ + GENERATED_BODY() + +private: + // Declare an instance of your templated helper. + // It's private because the UObject wrapper will expose its functionality. + FUniqueIndexHelper> NIndexHelper; + +public: + UPkI256NUniqueIndex() + // Initialize the helper with the specific unique index name + : NIndexHelper("n") { + } + + /** + * Finds a PkI256 by their unique n. + * @param Key The n to search for. + * @return The found FPkI256Type, or a default-constructed FPkI256Type if not found. + */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|PkI256Index") + FPkI256Type Find(FSpacetimeDBInt256 Key) + { + // Simply delegate the call to the internal helper + return NIndexHelper.FindUniqueIndex(Key); + } + + // A public setter to provide the cache to the helper after construction + // This is a common pattern when the cache might be created or provided by another system. + void SetCache(TSharedPtr> InPkI256Cache) + { + NIndexHelper.Cache = InPkI256Cache; + } +}; +/***/ + +UCLASS(BlueprintType) +class TESTCLIENT_API UPkI256Table : public URemoteTable +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly) + UPkI256NUniqueIndex* N; + + void PostInitialize(); + + /** Update function for pk_i256 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnPkI256Insert, + const FEventContext&, Context, + const FPkI256Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnPkI256Update, + const FEventContext&, Context, + const FPkI256Type&, OldRow, + const FPkI256Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnPkI256Delete, + const FEventContext&, Context, + const FPkI256Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkI256Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkI256Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkI256Delete OnDelete; + +private: + const FString TableName = TEXT("pk_i256"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkI32Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkI32Table.g.h new file mode 100644 index 00000000000..6bfc39baee2 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkI32Table.g.h @@ -0,0 +1,104 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/PkI32Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "PkI32Table.g.generated.h" + +UCLASS(Blueprintable) +class TESTCLIENT_API UPkI32NUniqueIndex : public UObject +{ + GENERATED_BODY() + +private: + // Declare an instance of your templated helper. + // It's private because the UObject wrapper will expose its functionality. + FUniqueIndexHelper> NIndexHelper; + +public: + UPkI32NUniqueIndex() + // Initialize the helper with the specific unique index name + : NIndexHelper("n") { + } + + /** + * Finds a PkI32 by their unique n. + * @param Key The n to search for. + * @return The found FPkI32Type, or a default-constructed FPkI32Type if not found. + */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|PkI32Index") + FPkI32Type Find(int32 Key) + { + // Simply delegate the call to the internal helper + return NIndexHelper.FindUniqueIndex(Key); + } + + // A public setter to provide the cache to the helper after construction + // This is a common pattern when the cache might be created or provided by another system. + void SetCache(TSharedPtr> InPkI32Cache) + { + NIndexHelper.Cache = InPkI32Cache; + } +}; +/***/ + +UCLASS(BlueprintType) +class TESTCLIENT_API UPkI32Table : public URemoteTable +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly) + UPkI32NUniqueIndex* N; + + void PostInitialize(); + + /** Update function for pk_i32 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnPkI32Insert, + const FEventContext&, Context, + const FPkI32Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnPkI32Update, + const FEventContext&, Context, + const FPkI32Type&, OldRow, + const FPkI32Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnPkI32Delete, + const FEventContext&, Context, + const FPkI32Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkI32Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkI32Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkI32Delete OnDelete; + +private: + const FString TableName = TEXT("pk_i32"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkI64Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkI64Table.g.h new file mode 100644 index 00000000000..c7fb8ceff7e --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkI64Table.g.h @@ -0,0 +1,104 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/PkI64Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "PkI64Table.g.generated.h" + +UCLASS(Blueprintable) +class TESTCLIENT_API UPkI64NUniqueIndex : public UObject +{ + GENERATED_BODY() + +private: + // Declare an instance of your templated helper. + // It's private because the UObject wrapper will expose its functionality. + FUniqueIndexHelper> NIndexHelper; + +public: + UPkI64NUniqueIndex() + // Initialize the helper with the specific unique index name + : NIndexHelper("n") { + } + + /** + * Finds a PkI64 by their unique n. + * @param Key The n to search for. + * @return The found FPkI64Type, or a default-constructed FPkI64Type if not found. + */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|PkI64Index") + FPkI64Type Find(int64 Key) + { + // Simply delegate the call to the internal helper + return NIndexHelper.FindUniqueIndex(Key); + } + + // A public setter to provide the cache to the helper after construction + // This is a common pattern when the cache might be created or provided by another system. + void SetCache(TSharedPtr> InPkI64Cache) + { + NIndexHelper.Cache = InPkI64Cache; + } +}; +/***/ + +UCLASS(BlueprintType) +class TESTCLIENT_API UPkI64Table : public URemoteTable +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly) + UPkI64NUniqueIndex* N; + + void PostInitialize(); + + /** Update function for pk_i64 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnPkI64Insert, + const FEventContext&, Context, + const FPkI64Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnPkI64Update, + const FEventContext&, Context, + const FPkI64Type&, OldRow, + const FPkI64Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnPkI64Delete, + const FEventContext&, Context, + const FPkI64Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkI64Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkI64Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkI64Delete OnDelete; + +private: + const FString TableName = TEXT("pk_i64"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkI8Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkI8Table.g.h new file mode 100644 index 00000000000..f33af5b4e60 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkI8Table.g.h @@ -0,0 +1,104 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/PkI8Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "PkI8Table.g.generated.h" + +UCLASS(Blueprintable) +class TESTCLIENT_API UPkI8NUniqueIndex : public UObject +{ + GENERATED_BODY() + +private: + // Declare an instance of your templated helper. + // It's private because the UObject wrapper will expose its functionality. + FUniqueIndexHelper> NIndexHelper; + +public: + UPkI8NUniqueIndex() + // Initialize the helper with the specific unique index name + : NIndexHelper("n") { + } + + /** + * Finds a PkI8 by their unique n. + * @param Key The n to search for. + * @return The found FPkI8Type, or a default-constructed FPkI8Type if not found. + */ + // NOTE: Not exposed to Blueprint because int8 types are not Blueprint-compatible + FPkI8Type Find(int8 Key) + { + // Simply delegate the call to the internal helper + return NIndexHelper.FindUniqueIndex(Key); + } + + // A public setter to provide the cache to the helper after construction + // This is a common pattern when the cache might be created or provided by another system. + void SetCache(TSharedPtr> InPkI8Cache) + { + NIndexHelper.Cache = InPkI8Cache; + } +}; +/***/ + +UCLASS(BlueprintType) +class TESTCLIENT_API UPkI8Table : public URemoteTable +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly) + UPkI8NUniqueIndex* N; + + void PostInitialize(); + + /** Update function for pk_i8 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnPkI8Insert, + const FEventContext&, Context, + const FPkI8Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnPkI8Update, + const FEventContext&, Context, + const FPkI8Type&, OldRow, + const FPkI8Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnPkI8Delete, + const FEventContext&, Context, + const FPkI8Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkI8Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkI8Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkI8Delete OnDelete; + +private: + const FString TableName = TEXT("pk_i8"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkIdentityTable.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkIdentityTable.g.h new file mode 100644 index 00000000000..17b9b970cd2 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkIdentityTable.g.h @@ -0,0 +1,104 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/PkIdentityType.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "PkIdentityTable.g.generated.h" + +UCLASS(Blueprintable) +class TESTCLIENT_API UPkIdentityIUniqueIndex : public UObject +{ + GENERATED_BODY() + +private: + // Declare an instance of your templated helper. + // It's private because the UObject wrapper will expose its functionality. + FUniqueIndexHelper> IIndexHelper; + +public: + UPkIdentityIUniqueIndex() + // Initialize the helper with the specific unique index name + : IIndexHelper("i") { + } + + /** + * Finds a PkIdentity by their unique i. + * @param Key The i to search for. + * @return The found FPkIdentityType, or a default-constructed FPkIdentityType if not found. + */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|PkIdentityIndex") + FPkIdentityType Find(FSpacetimeDBIdentity Key) + { + // Simply delegate the call to the internal helper + return IIndexHelper.FindUniqueIndex(Key); + } + + // A public setter to provide the cache to the helper after construction + // This is a common pattern when the cache might be created or provided by another system. + void SetCache(TSharedPtr> InPkIdentityCache) + { + IIndexHelper.Cache = InPkIdentityCache; + } +}; +/***/ + +UCLASS(BlueprintType) +class TESTCLIENT_API UPkIdentityTable : public URemoteTable +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly) + UPkIdentityIUniqueIndex* I; + + void PostInitialize(); + + /** Update function for pk_identity table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnPkIdentityInsert, + const FEventContext&, Context, + const FPkIdentityType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnPkIdentityUpdate, + const FEventContext&, Context, + const FPkIdentityType&, OldRow, + const FPkIdentityType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnPkIdentityDelete, + const FEventContext&, Context, + const FPkIdentityType&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkIdentityInsert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkIdentityUpdate OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkIdentityDelete OnDelete; + +private: + const FString TableName = TEXT("pk_identity"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkSimpleEnumTable.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkSimpleEnumTable.g.h new file mode 100644 index 00000000000..92c3004e667 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkSimpleEnumTable.g.h @@ -0,0 +1,104 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/PkSimpleEnumType.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "PkSimpleEnumTable.g.generated.h" + +UCLASS(Blueprintable) +class TESTCLIENT_API UPkSimpleEnumAUniqueIndex : public UObject +{ + GENERATED_BODY() + +private: + // Declare an instance of your templated helper. + // It's private because the UObject wrapper will expose its functionality. + FUniqueIndexHelper> AIndexHelper; + +public: + UPkSimpleEnumAUniqueIndex() + // Initialize the helper with the specific unique index name + : AIndexHelper("a") { + } + + /** + * Finds a PkSimpleEnum by their unique a. + * @param Key The a to search for. + * @return The found FPkSimpleEnumType, or a default-constructed FPkSimpleEnumType if not found. + */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|PkSimpleEnumIndex") + FPkSimpleEnumType Find(ESimpleEnumType Key) + { + // Simply delegate the call to the internal helper + return AIndexHelper.FindUniqueIndex(Key); + } + + // A public setter to provide the cache to the helper after construction + // This is a common pattern when the cache might be created or provided by another system. + void SetCache(TSharedPtr> InPkSimpleEnumCache) + { + AIndexHelper.Cache = InPkSimpleEnumCache; + } +}; +/***/ + +UCLASS(BlueprintType) +class TESTCLIENT_API UPkSimpleEnumTable : public URemoteTable +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly) + UPkSimpleEnumAUniqueIndex* A; + + void PostInitialize(); + + /** Update function for pk_simple_enum table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnPkSimpleEnumInsert, + const FEventContext&, Context, + const FPkSimpleEnumType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnPkSimpleEnumUpdate, + const FEventContext&, Context, + const FPkSimpleEnumType&, OldRow, + const FPkSimpleEnumType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnPkSimpleEnumDelete, + const FEventContext&, Context, + const FPkSimpleEnumType&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkSimpleEnumInsert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkSimpleEnumUpdate OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkSimpleEnumDelete OnDelete; + +private: + const FString TableName = TEXT("pk_simple_enum"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkStringTable.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkStringTable.g.h new file mode 100644 index 00000000000..4eceb3319e9 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkStringTable.g.h @@ -0,0 +1,104 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/PkStringType.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "PkStringTable.g.generated.h" + +UCLASS(Blueprintable) +class TESTCLIENT_API UPkStringSUniqueIndex : public UObject +{ + GENERATED_BODY() + +private: + // Declare an instance of your templated helper. + // It's private because the UObject wrapper will expose its functionality. + FUniqueIndexHelper> SIndexHelper; + +public: + UPkStringSUniqueIndex() + // Initialize the helper with the specific unique index name + : SIndexHelper("s") { + } + + /** + * Finds a PkString by their unique s. + * @param Key The s to search for. + * @return The found FPkStringType, or a default-constructed FPkStringType if not found. + */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|PkStringIndex") + FPkStringType Find(FString Key) + { + // Simply delegate the call to the internal helper + return SIndexHelper.FindUniqueIndex(Key); + } + + // A public setter to provide the cache to the helper after construction + // This is a common pattern when the cache might be created or provided by another system. + void SetCache(TSharedPtr> InPkStringCache) + { + SIndexHelper.Cache = InPkStringCache; + } +}; +/***/ + +UCLASS(BlueprintType) +class TESTCLIENT_API UPkStringTable : public URemoteTable +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly) + UPkStringSUniqueIndex* S; + + void PostInitialize(); + + /** Update function for pk_string table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnPkStringInsert, + const FEventContext&, Context, + const FPkStringType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnPkStringUpdate, + const FEventContext&, Context, + const FPkStringType&, OldRow, + const FPkStringType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnPkStringDelete, + const FEventContext&, Context, + const FPkStringType&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkStringInsert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkStringUpdate OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkStringDelete OnDelete; + +private: + const FString TableName = TEXT("pk_string"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkU128Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkU128Table.g.h new file mode 100644 index 00000000000..898f2e0f36b --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkU128Table.g.h @@ -0,0 +1,104 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/PkU128Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "PkU128Table.g.generated.h" + +UCLASS(Blueprintable) +class TESTCLIENT_API UPkU128NUniqueIndex : public UObject +{ + GENERATED_BODY() + +private: + // Declare an instance of your templated helper. + // It's private because the UObject wrapper will expose its functionality. + FUniqueIndexHelper> NIndexHelper; + +public: + UPkU128NUniqueIndex() + // Initialize the helper with the specific unique index name + : NIndexHelper("n") { + } + + /** + * Finds a PkU128 by their unique n. + * @param Key The n to search for. + * @return The found FPkU128Type, or a default-constructed FPkU128Type if not found. + */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|PkU128Index") + FPkU128Type Find(FSpacetimeDBUInt128 Key) + { + // Simply delegate the call to the internal helper + return NIndexHelper.FindUniqueIndex(Key); + } + + // A public setter to provide the cache to the helper after construction + // This is a common pattern when the cache might be created or provided by another system. + void SetCache(TSharedPtr> InPkU128Cache) + { + NIndexHelper.Cache = InPkU128Cache; + } +}; +/***/ + +UCLASS(BlueprintType) +class TESTCLIENT_API UPkU128Table : public URemoteTable +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly) + UPkU128NUniqueIndex* N; + + void PostInitialize(); + + /** Update function for pk_u128 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnPkU128Insert, + const FEventContext&, Context, + const FPkU128Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnPkU128Update, + const FEventContext&, Context, + const FPkU128Type&, OldRow, + const FPkU128Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnPkU128Delete, + const FEventContext&, Context, + const FPkU128Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkU128Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkU128Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkU128Delete OnDelete; + +private: + const FString TableName = TEXT("pk_u128"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkU16Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkU16Table.g.h new file mode 100644 index 00000000000..bf84e9c983a --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkU16Table.g.h @@ -0,0 +1,104 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/PkU16Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "PkU16Table.g.generated.h" + +UCLASS(Blueprintable) +class TESTCLIENT_API UPkU16NUniqueIndex : public UObject +{ + GENERATED_BODY() + +private: + // Declare an instance of your templated helper. + // It's private because the UObject wrapper will expose its functionality. + FUniqueIndexHelper> NIndexHelper; + +public: + UPkU16NUniqueIndex() + // Initialize the helper with the specific unique index name + : NIndexHelper("n") { + } + + /** + * Finds a PkU16 by their unique n. + * @param Key The n to search for. + * @return The found FPkU16Type, or a default-constructed FPkU16Type if not found. + */ + // NOTE: Not exposed to Blueprint because uint16 types are not Blueprint-compatible + FPkU16Type Find(uint16 Key) + { + // Simply delegate the call to the internal helper + return NIndexHelper.FindUniqueIndex(Key); + } + + // A public setter to provide the cache to the helper after construction + // This is a common pattern when the cache might be created or provided by another system. + void SetCache(TSharedPtr> InPkU16Cache) + { + NIndexHelper.Cache = InPkU16Cache; + } +}; +/***/ + +UCLASS(BlueprintType) +class TESTCLIENT_API UPkU16Table : public URemoteTable +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly) + UPkU16NUniqueIndex* N; + + void PostInitialize(); + + /** Update function for pk_u16 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnPkU16Insert, + const FEventContext&, Context, + const FPkU16Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnPkU16Update, + const FEventContext&, Context, + const FPkU16Type&, OldRow, + const FPkU16Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnPkU16Delete, + const FEventContext&, Context, + const FPkU16Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkU16Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkU16Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkU16Delete OnDelete; + +private: + const FString TableName = TEXT("pk_u16"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkU256Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkU256Table.g.h new file mode 100644 index 00000000000..08c20ff62c8 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkU256Table.g.h @@ -0,0 +1,104 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/PkU256Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "PkU256Table.g.generated.h" + +UCLASS(Blueprintable) +class TESTCLIENT_API UPkU256NUniqueIndex : public UObject +{ + GENERATED_BODY() + +private: + // Declare an instance of your templated helper. + // It's private because the UObject wrapper will expose its functionality. + FUniqueIndexHelper> NIndexHelper; + +public: + UPkU256NUniqueIndex() + // Initialize the helper with the specific unique index name + : NIndexHelper("n") { + } + + /** + * Finds a PkU256 by their unique n. + * @param Key The n to search for. + * @return The found FPkU256Type, or a default-constructed FPkU256Type if not found. + */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|PkU256Index") + FPkU256Type Find(FSpacetimeDBUInt256 Key) + { + // Simply delegate the call to the internal helper + return NIndexHelper.FindUniqueIndex(Key); + } + + // A public setter to provide the cache to the helper after construction + // This is a common pattern when the cache might be created or provided by another system. + void SetCache(TSharedPtr> InPkU256Cache) + { + NIndexHelper.Cache = InPkU256Cache; + } +}; +/***/ + +UCLASS(BlueprintType) +class TESTCLIENT_API UPkU256Table : public URemoteTable +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly) + UPkU256NUniqueIndex* N; + + void PostInitialize(); + + /** Update function for pk_u256 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnPkU256Insert, + const FEventContext&, Context, + const FPkU256Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnPkU256Update, + const FEventContext&, Context, + const FPkU256Type&, OldRow, + const FPkU256Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnPkU256Delete, + const FEventContext&, Context, + const FPkU256Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkU256Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkU256Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkU256Delete OnDelete; + +private: + const FString TableName = TEXT("pk_u256"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkU32Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkU32Table.g.h new file mode 100644 index 00000000000..a789c124636 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkU32Table.g.h @@ -0,0 +1,104 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/PkU32Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "PkU32Table.g.generated.h" + +UCLASS(Blueprintable) +class TESTCLIENT_API UPkU32NUniqueIndex : public UObject +{ + GENERATED_BODY() + +private: + // Declare an instance of your templated helper. + // It's private because the UObject wrapper will expose its functionality. + FUniqueIndexHelper> NIndexHelper; + +public: + UPkU32NUniqueIndex() + // Initialize the helper with the specific unique index name + : NIndexHelper("n") { + } + + /** + * Finds a PkU32 by their unique n. + * @param Key The n to search for. + * @return The found FPkU32Type, or a default-constructed FPkU32Type if not found. + */ + // NOTE: Not exposed to Blueprint because uint32 types are not Blueprint-compatible + FPkU32Type Find(uint32 Key) + { + // Simply delegate the call to the internal helper + return NIndexHelper.FindUniqueIndex(Key); + } + + // A public setter to provide the cache to the helper after construction + // This is a common pattern when the cache might be created or provided by another system. + void SetCache(TSharedPtr> InPkU32Cache) + { + NIndexHelper.Cache = InPkU32Cache; + } +}; +/***/ + +UCLASS(BlueprintType) +class TESTCLIENT_API UPkU32Table : public URemoteTable +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly) + UPkU32NUniqueIndex* N; + + void PostInitialize(); + + /** Update function for pk_u32 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnPkU32Insert, + const FEventContext&, Context, + const FPkU32Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnPkU32Update, + const FEventContext&, Context, + const FPkU32Type&, OldRow, + const FPkU32Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnPkU32Delete, + const FEventContext&, Context, + const FPkU32Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkU32Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkU32Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkU32Delete OnDelete; + +private: + const FString TableName = TEXT("pk_u32"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkU32TwoTable.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkU32TwoTable.g.h new file mode 100644 index 00000000000..c339273c53f --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkU32TwoTable.g.h @@ -0,0 +1,104 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/PkU32TwoType.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "PkU32TwoTable.g.generated.h" + +UCLASS(Blueprintable) +class TESTCLIENT_API UPkU32TwoNUniqueIndex : public UObject +{ + GENERATED_BODY() + +private: + // Declare an instance of your templated helper. + // It's private because the UObject wrapper will expose its functionality. + FUniqueIndexHelper> NIndexHelper; + +public: + UPkU32TwoNUniqueIndex() + // Initialize the helper with the specific unique index name + : NIndexHelper("n") { + } + + /** + * Finds a PkU32Two by their unique n. + * @param Key The n to search for. + * @return The found FPkU32TwoType, or a default-constructed FPkU32TwoType if not found. + */ + // NOTE: Not exposed to Blueprint because uint32 types are not Blueprint-compatible + FPkU32TwoType Find(uint32 Key) + { + // Simply delegate the call to the internal helper + return NIndexHelper.FindUniqueIndex(Key); + } + + // A public setter to provide the cache to the helper after construction + // This is a common pattern when the cache might be created or provided by another system. + void SetCache(TSharedPtr> InPkU32TwoCache) + { + NIndexHelper.Cache = InPkU32TwoCache; + } +}; +/***/ + +UCLASS(BlueprintType) +class TESTCLIENT_API UPkU32TwoTable : public URemoteTable +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly) + UPkU32TwoNUniqueIndex* N; + + void PostInitialize(); + + /** Update function for pk_u32_two table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnPkU32TwoInsert, + const FEventContext&, Context, + const FPkU32TwoType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnPkU32TwoUpdate, + const FEventContext&, Context, + const FPkU32TwoType&, OldRow, + const FPkU32TwoType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnPkU32TwoDelete, + const FEventContext&, Context, + const FPkU32TwoType&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkU32TwoInsert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkU32TwoUpdate OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkU32TwoDelete OnDelete; + +private: + const FString TableName = TEXT("pk_u32_two"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkU64Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkU64Table.g.h new file mode 100644 index 00000000000..03b049c5649 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkU64Table.g.h @@ -0,0 +1,104 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/PkU64Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "PkU64Table.g.generated.h" + +UCLASS(Blueprintable) +class TESTCLIENT_API UPkU64NUniqueIndex : public UObject +{ + GENERATED_BODY() + +private: + // Declare an instance of your templated helper. + // It's private because the UObject wrapper will expose its functionality. + FUniqueIndexHelper> NIndexHelper; + +public: + UPkU64NUniqueIndex() + // Initialize the helper with the specific unique index name + : NIndexHelper("n") { + } + + /** + * Finds a PkU64 by their unique n. + * @param Key The n to search for. + * @return The found FPkU64Type, or a default-constructed FPkU64Type if not found. + */ + // NOTE: Not exposed to Blueprint because uint64 types are not Blueprint-compatible + FPkU64Type Find(uint64 Key) + { + // Simply delegate the call to the internal helper + return NIndexHelper.FindUniqueIndex(Key); + } + + // A public setter to provide the cache to the helper after construction + // This is a common pattern when the cache might be created or provided by another system. + void SetCache(TSharedPtr> InPkU64Cache) + { + NIndexHelper.Cache = InPkU64Cache; + } +}; +/***/ + +UCLASS(BlueprintType) +class TESTCLIENT_API UPkU64Table : public URemoteTable +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly) + UPkU64NUniqueIndex* N; + + void PostInitialize(); + + /** Update function for pk_u64 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnPkU64Insert, + const FEventContext&, Context, + const FPkU64Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnPkU64Update, + const FEventContext&, Context, + const FPkU64Type&, OldRow, + const FPkU64Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnPkU64Delete, + const FEventContext&, Context, + const FPkU64Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkU64Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkU64Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkU64Delete OnDelete; + +private: + const FString TableName = TEXT("pk_u64"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkU8Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkU8Table.g.h new file mode 100644 index 00000000000..be15b181216 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/PkU8Table.g.h @@ -0,0 +1,104 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/PkU8Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "PkU8Table.g.generated.h" + +UCLASS(Blueprintable) +class TESTCLIENT_API UPkU8NUniqueIndex : public UObject +{ + GENERATED_BODY() + +private: + // Declare an instance of your templated helper. + // It's private because the UObject wrapper will expose its functionality. + FUniqueIndexHelper> NIndexHelper; + +public: + UPkU8NUniqueIndex() + // Initialize the helper with the specific unique index name + : NIndexHelper("n") { + } + + /** + * Finds a PkU8 by their unique n. + * @param Key The n to search for. + * @return The found FPkU8Type, or a default-constructed FPkU8Type if not found. + */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|PkU8Index") + FPkU8Type Find(uint8 Key) + { + // Simply delegate the call to the internal helper + return NIndexHelper.FindUniqueIndex(Key); + } + + // A public setter to provide the cache to the helper after construction + // This is a common pattern when the cache might be created or provided by another system. + void SetCache(TSharedPtr> InPkU8Cache) + { + NIndexHelper.Cache = InPkU8Cache; + } +}; +/***/ + +UCLASS(BlueprintType) +class TESTCLIENT_API UPkU8Table : public URemoteTable +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly) + UPkU8NUniqueIndex* N; + + void PostInitialize(); + + /** Update function for pk_u8 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnPkU8Insert, + const FEventContext&, Context, + const FPkU8Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnPkU8Update, + const FEventContext&, Context, + const FPkU8Type&, OldRow, + const FPkU8Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnPkU8Delete, + const FEventContext&, Context, + const FPkU8Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkU8Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkU8Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnPkU8Delete OnDelete; + +private: + const FString TableName = TEXT("pk_u8"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/ScheduledTableTable.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/ScheduledTableTable.g.h new file mode 100644 index 00000000000..9c01923f358 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/ScheduledTableTable.g.h @@ -0,0 +1,104 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/ScheduledTableType.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "ScheduledTableTable.g.generated.h" + +UCLASS(Blueprintable) +class TESTCLIENT_API UScheduledTableScheduledIdUniqueIndex : public UObject +{ + GENERATED_BODY() + +private: + // Declare an instance of your templated helper. + // It's private because the UObject wrapper will expose its functionality. + FUniqueIndexHelper> ScheduledIdIndexHelper; + +public: + UScheduledTableScheduledIdUniqueIndex() + // Initialize the helper with the specific unique index name + : ScheduledIdIndexHelper("scheduled_id") { + } + + /** + * Finds a ScheduledTable by their unique scheduledid. + * @param Key The scheduledid to search for. + * @return The found FScheduledTableType, or a default-constructed FScheduledTableType if not found. + */ + // NOTE: Not exposed to Blueprint because uint64 types are not Blueprint-compatible + FScheduledTableType Find(uint64 Key) + { + // Simply delegate the call to the internal helper + return ScheduledIdIndexHelper.FindUniqueIndex(Key); + } + + // A public setter to provide the cache to the helper after construction + // This is a common pattern when the cache might be created or provided by another system. + void SetCache(TSharedPtr> InScheduledTableCache) + { + ScheduledIdIndexHelper.Cache = InScheduledTableCache; + } +}; +/***/ + +UCLASS(BlueprintType) +class TESTCLIENT_API UScheduledTableTable : public URemoteTable +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly) + UScheduledTableScheduledIdUniqueIndex* ScheduledId; + + void PostInitialize(); + + /** Update function for scheduled_table table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnScheduledTableInsert, + const FEventContext&, Context, + const FScheduledTableType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnScheduledTableUpdate, + const FEventContext&, Context, + const FScheduledTableType&, OldRow, + const FScheduledTableType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnScheduledTableDelete, + const FEventContext&, Context, + const FScheduledTableType&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnScheduledTableInsert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnScheduledTableUpdate OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnScheduledTableDelete OnDelete; + +private: + const FString TableName = TEXT("scheduled_table"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/TableHoldsTableTable.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/TableHoldsTableTable.g.h new file mode 100644 index 00000000000..2ef7fda606d --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/TableHoldsTableTable.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/TableHoldsTableType.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "TableHoldsTableTable.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UTableHoldsTableTable : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for table_holds_table table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnTableHoldsTableInsert, + const FEventContext&, Context, + const FTableHoldsTableType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnTableHoldsTableUpdate, + const FEventContext&, Context, + const FTableHoldsTableType&, OldRow, + const FTableHoldsTableType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnTableHoldsTableDelete, + const FEventContext&, Context, + const FTableHoldsTableType&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnTableHoldsTableInsert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnTableHoldsTableUpdate OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnTableHoldsTableDelete OnDelete; + +private: + const FString TableName = TEXT("table_holds_table"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UniqueBoolTable.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UniqueBoolTable.g.h new file mode 100644 index 00000000000..66ba3f95266 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UniqueBoolTable.g.h @@ -0,0 +1,104 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/UniqueBoolType.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "UniqueBoolTable.g.generated.h" + +UCLASS(Blueprintable) +class TESTCLIENT_API UUniqueBoolBUniqueIndex : public UObject +{ + GENERATED_BODY() + +private: + // Declare an instance of your templated helper. + // It's private because the UObject wrapper will expose its functionality. + FUniqueIndexHelper> BIndexHelper; + +public: + UUniqueBoolBUniqueIndex() + // Initialize the helper with the specific unique index name + : BIndexHelper("b") { + } + + /** + * Finds a UniqueBool by their unique b. + * @param Key The b to search for. + * @return The found FUniqueBoolType, or a default-constructed FUniqueBoolType if not found. + */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|UniqueBoolIndex") + FUniqueBoolType Find(bool Key) + { + // Simply delegate the call to the internal helper + return BIndexHelper.FindUniqueIndex(Key); + } + + // A public setter to provide the cache to the helper after construction + // This is a common pattern when the cache might be created or provided by another system. + void SetCache(TSharedPtr> InUniqueBoolCache) + { + BIndexHelper.Cache = InUniqueBoolCache; + } +}; +/***/ + +UCLASS(BlueprintType) +class TESTCLIENT_API UUniqueBoolTable : public URemoteTable +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly) + UUniqueBoolBUniqueIndex* B; + + void PostInitialize(); + + /** Update function for unique_bool table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnUniqueBoolInsert, + const FEventContext&, Context, + const FUniqueBoolType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnUniqueBoolUpdate, + const FEventContext&, Context, + const FUniqueBoolType&, OldRow, + const FUniqueBoolType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnUniqueBoolDelete, + const FEventContext&, Context, + const FUniqueBoolType&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUniqueBoolInsert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUniqueBoolUpdate OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUniqueBoolDelete OnDelete; + +private: + const FString TableName = TEXT("unique_bool"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UniqueConnectionIdTable.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UniqueConnectionIdTable.g.h new file mode 100644 index 00000000000..f698100df20 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UniqueConnectionIdTable.g.h @@ -0,0 +1,104 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/UniqueConnectionIdType.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "UniqueConnectionIdTable.g.generated.h" + +UCLASS(Blueprintable) +class TESTCLIENT_API UUniqueConnectionIdAUniqueIndex : public UObject +{ + GENERATED_BODY() + +private: + // Declare an instance of your templated helper. + // It's private because the UObject wrapper will expose its functionality. + FUniqueIndexHelper> AIndexHelper; + +public: + UUniqueConnectionIdAUniqueIndex() + // Initialize the helper with the specific unique index name + : AIndexHelper("a") { + } + + /** + * Finds a UniqueConnectionId by their unique a. + * @param Key The a to search for. + * @return The found FUniqueConnectionIdType, or a default-constructed FUniqueConnectionIdType if not found. + */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|UniqueConnectionIdIndex") + FUniqueConnectionIdType Find(FSpacetimeDBConnectionId Key) + { + // Simply delegate the call to the internal helper + return AIndexHelper.FindUniqueIndex(Key); + } + + // A public setter to provide the cache to the helper after construction + // This is a common pattern when the cache might be created or provided by another system. + void SetCache(TSharedPtr> InUniqueConnectionIdCache) + { + AIndexHelper.Cache = InUniqueConnectionIdCache; + } +}; +/***/ + +UCLASS(BlueprintType) +class TESTCLIENT_API UUniqueConnectionIdTable : public URemoteTable +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly) + UUniqueConnectionIdAUniqueIndex* A; + + void PostInitialize(); + + /** Update function for unique_connection_id table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnUniqueConnectionIdInsert, + const FEventContext&, Context, + const FUniqueConnectionIdType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnUniqueConnectionIdUpdate, + const FEventContext&, Context, + const FUniqueConnectionIdType&, OldRow, + const FUniqueConnectionIdType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnUniqueConnectionIdDelete, + const FEventContext&, Context, + const FUniqueConnectionIdType&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUniqueConnectionIdInsert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUniqueConnectionIdUpdate OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUniqueConnectionIdDelete OnDelete; + +private: + const FString TableName = TEXT("unique_connection_id"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UniqueI128Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UniqueI128Table.g.h new file mode 100644 index 00000000000..478c18396c4 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UniqueI128Table.g.h @@ -0,0 +1,104 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/UniqueI128Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "UniqueI128Table.g.generated.h" + +UCLASS(Blueprintable) +class TESTCLIENT_API UUniqueI128NUniqueIndex : public UObject +{ + GENERATED_BODY() + +private: + // Declare an instance of your templated helper. + // It's private because the UObject wrapper will expose its functionality. + FUniqueIndexHelper> NIndexHelper; + +public: + UUniqueI128NUniqueIndex() + // Initialize the helper with the specific unique index name + : NIndexHelper("n") { + } + + /** + * Finds a UniqueI128 by their unique n. + * @param Key The n to search for. + * @return The found FUniqueI128Type, or a default-constructed FUniqueI128Type if not found. + */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|UniqueI128Index") + FUniqueI128Type Find(FSpacetimeDBInt128 Key) + { + // Simply delegate the call to the internal helper + return NIndexHelper.FindUniqueIndex(Key); + } + + // A public setter to provide the cache to the helper after construction + // This is a common pattern when the cache might be created or provided by another system. + void SetCache(TSharedPtr> InUniqueI128Cache) + { + NIndexHelper.Cache = InUniqueI128Cache; + } +}; +/***/ + +UCLASS(BlueprintType) +class TESTCLIENT_API UUniqueI128Table : public URemoteTable +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly) + UUniqueI128NUniqueIndex* N; + + void PostInitialize(); + + /** Update function for unique_i128 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnUniqueI128Insert, + const FEventContext&, Context, + const FUniqueI128Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnUniqueI128Update, + const FEventContext&, Context, + const FUniqueI128Type&, OldRow, + const FUniqueI128Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnUniqueI128Delete, + const FEventContext&, Context, + const FUniqueI128Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUniqueI128Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUniqueI128Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUniqueI128Delete OnDelete; + +private: + const FString TableName = TEXT("unique_i128"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UniqueI16Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UniqueI16Table.g.h new file mode 100644 index 00000000000..19eed2f3e1f --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UniqueI16Table.g.h @@ -0,0 +1,104 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/UniqueI16Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "UniqueI16Table.g.generated.h" + +UCLASS(Blueprintable) +class TESTCLIENT_API UUniqueI16NUniqueIndex : public UObject +{ + GENERATED_BODY() + +private: + // Declare an instance of your templated helper. + // It's private because the UObject wrapper will expose its functionality. + FUniqueIndexHelper> NIndexHelper; + +public: + UUniqueI16NUniqueIndex() + // Initialize the helper with the specific unique index name + : NIndexHelper("n") { + } + + /** + * Finds a UniqueI16 by their unique n. + * @param Key The n to search for. + * @return The found FUniqueI16Type, or a default-constructed FUniqueI16Type if not found. + */ + // NOTE: Not exposed to Blueprint because int16 types are not Blueprint-compatible + FUniqueI16Type Find(int16 Key) + { + // Simply delegate the call to the internal helper + return NIndexHelper.FindUniqueIndex(Key); + } + + // A public setter to provide the cache to the helper after construction + // This is a common pattern when the cache might be created or provided by another system. + void SetCache(TSharedPtr> InUniqueI16Cache) + { + NIndexHelper.Cache = InUniqueI16Cache; + } +}; +/***/ + +UCLASS(BlueprintType) +class TESTCLIENT_API UUniqueI16Table : public URemoteTable +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly) + UUniqueI16NUniqueIndex* N; + + void PostInitialize(); + + /** Update function for unique_i16 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnUniqueI16Insert, + const FEventContext&, Context, + const FUniqueI16Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnUniqueI16Update, + const FEventContext&, Context, + const FUniqueI16Type&, OldRow, + const FUniqueI16Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnUniqueI16Delete, + const FEventContext&, Context, + const FUniqueI16Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUniqueI16Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUniqueI16Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUniqueI16Delete OnDelete; + +private: + const FString TableName = TEXT("unique_i16"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UniqueI256Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UniqueI256Table.g.h new file mode 100644 index 00000000000..cd361f925f7 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UniqueI256Table.g.h @@ -0,0 +1,104 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/UniqueI256Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "UniqueI256Table.g.generated.h" + +UCLASS(Blueprintable) +class TESTCLIENT_API UUniqueI256NUniqueIndex : public UObject +{ + GENERATED_BODY() + +private: + // Declare an instance of your templated helper. + // It's private because the UObject wrapper will expose its functionality. + FUniqueIndexHelper> NIndexHelper; + +public: + UUniqueI256NUniqueIndex() + // Initialize the helper with the specific unique index name + : NIndexHelper("n") { + } + + /** + * Finds a UniqueI256 by their unique n. + * @param Key The n to search for. + * @return The found FUniqueI256Type, or a default-constructed FUniqueI256Type if not found. + */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|UniqueI256Index") + FUniqueI256Type Find(FSpacetimeDBInt256 Key) + { + // Simply delegate the call to the internal helper + return NIndexHelper.FindUniqueIndex(Key); + } + + // A public setter to provide the cache to the helper after construction + // This is a common pattern when the cache might be created or provided by another system. + void SetCache(TSharedPtr> InUniqueI256Cache) + { + NIndexHelper.Cache = InUniqueI256Cache; + } +}; +/***/ + +UCLASS(BlueprintType) +class TESTCLIENT_API UUniqueI256Table : public URemoteTable +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly) + UUniqueI256NUniqueIndex* N; + + void PostInitialize(); + + /** Update function for unique_i256 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnUniqueI256Insert, + const FEventContext&, Context, + const FUniqueI256Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnUniqueI256Update, + const FEventContext&, Context, + const FUniqueI256Type&, OldRow, + const FUniqueI256Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnUniqueI256Delete, + const FEventContext&, Context, + const FUniqueI256Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUniqueI256Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUniqueI256Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUniqueI256Delete OnDelete; + +private: + const FString TableName = TEXT("unique_i256"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UniqueI32Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UniqueI32Table.g.h new file mode 100644 index 00000000000..aada4f1ff3e --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UniqueI32Table.g.h @@ -0,0 +1,104 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/UniqueI32Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "UniqueI32Table.g.generated.h" + +UCLASS(Blueprintable) +class TESTCLIENT_API UUniqueI32NUniqueIndex : public UObject +{ + GENERATED_BODY() + +private: + // Declare an instance of your templated helper. + // It's private because the UObject wrapper will expose its functionality. + FUniqueIndexHelper> NIndexHelper; + +public: + UUniqueI32NUniqueIndex() + // Initialize the helper with the specific unique index name + : NIndexHelper("n") { + } + + /** + * Finds a UniqueI32 by their unique n. + * @param Key The n to search for. + * @return The found FUniqueI32Type, or a default-constructed FUniqueI32Type if not found. + */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|UniqueI32Index") + FUniqueI32Type Find(int32 Key) + { + // Simply delegate the call to the internal helper + return NIndexHelper.FindUniqueIndex(Key); + } + + // A public setter to provide the cache to the helper after construction + // This is a common pattern when the cache might be created or provided by another system. + void SetCache(TSharedPtr> InUniqueI32Cache) + { + NIndexHelper.Cache = InUniqueI32Cache; + } +}; +/***/ + +UCLASS(BlueprintType) +class TESTCLIENT_API UUniqueI32Table : public URemoteTable +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly) + UUniqueI32NUniqueIndex* N; + + void PostInitialize(); + + /** Update function for unique_i32 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnUniqueI32Insert, + const FEventContext&, Context, + const FUniqueI32Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnUniqueI32Update, + const FEventContext&, Context, + const FUniqueI32Type&, OldRow, + const FUniqueI32Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnUniqueI32Delete, + const FEventContext&, Context, + const FUniqueI32Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUniqueI32Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUniqueI32Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUniqueI32Delete OnDelete; + +private: + const FString TableName = TEXT("unique_i32"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UniqueI64Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UniqueI64Table.g.h new file mode 100644 index 00000000000..764acab9cc8 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UniqueI64Table.g.h @@ -0,0 +1,104 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/UniqueI64Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "UniqueI64Table.g.generated.h" + +UCLASS(Blueprintable) +class TESTCLIENT_API UUniqueI64NUniqueIndex : public UObject +{ + GENERATED_BODY() + +private: + // Declare an instance of your templated helper. + // It's private because the UObject wrapper will expose its functionality. + FUniqueIndexHelper> NIndexHelper; + +public: + UUniqueI64NUniqueIndex() + // Initialize the helper with the specific unique index name + : NIndexHelper("n") { + } + + /** + * Finds a UniqueI64 by their unique n. + * @param Key The n to search for. + * @return The found FUniqueI64Type, or a default-constructed FUniqueI64Type if not found. + */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|UniqueI64Index") + FUniqueI64Type Find(int64 Key) + { + // Simply delegate the call to the internal helper + return NIndexHelper.FindUniqueIndex(Key); + } + + // A public setter to provide the cache to the helper after construction + // This is a common pattern when the cache might be created or provided by another system. + void SetCache(TSharedPtr> InUniqueI64Cache) + { + NIndexHelper.Cache = InUniqueI64Cache; + } +}; +/***/ + +UCLASS(BlueprintType) +class TESTCLIENT_API UUniqueI64Table : public URemoteTable +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly) + UUniqueI64NUniqueIndex* N; + + void PostInitialize(); + + /** Update function for unique_i64 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnUniqueI64Insert, + const FEventContext&, Context, + const FUniqueI64Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnUniqueI64Update, + const FEventContext&, Context, + const FUniqueI64Type&, OldRow, + const FUniqueI64Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnUniqueI64Delete, + const FEventContext&, Context, + const FUniqueI64Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUniqueI64Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUniqueI64Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUniqueI64Delete OnDelete; + +private: + const FString TableName = TEXT("unique_i64"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UniqueI8Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UniqueI8Table.g.h new file mode 100644 index 00000000000..aa7727c19d5 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UniqueI8Table.g.h @@ -0,0 +1,104 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/UniqueI8Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "UniqueI8Table.g.generated.h" + +UCLASS(Blueprintable) +class TESTCLIENT_API UUniqueI8NUniqueIndex : public UObject +{ + GENERATED_BODY() + +private: + // Declare an instance of your templated helper. + // It's private because the UObject wrapper will expose its functionality. + FUniqueIndexHelper> NIndexHelper; + +public: + UUniqueI8NUniqueIndex() + // Initialize the helper with the specific unique index name + : NIndexHelper("n") { + } + + /** + * Finds a UniqueI8 by their unique n. + * @param Key The n to search for. + * @return The found FUniqueI8Type, or a default-constructed FUniqueI8Type if not found. + */ + // NOTE: Not exposed to Blueprint because int8 types are not Blueprint-compatible + FUniqueI8Type Find(int8 Key) + { + // Simply delegate the call to the internal helper + return NIndexHelper.FindUniqueIndex(Key); + } + + // A public setter to provide the cache to the helper after construction + // This is a common pattern when the cache might be created or provided by another system. + void SetCache(TSharedPtr> InUniqueI8Cache) + { + NIndexHelper.Cache = InUniqueI8Cache; + } +}; +/***/ + +UCLASS(BlueprintType) +class TESTCLIENT_API UUniqueI8Table : public URemoteTable +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly) + UUniqueI8NUniqueIndex* N; + + void PostInitialize(); + + /** Update function for unique_i8 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnUniqueI8Insert, + const FEventContext&, Context, + const FUniqueI8Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnUniqueI8Update, + const FEventContext&, Context, + const FUniqueI8Type&, OldRow, + const FUniqueI8Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnUniqueI8Delete, + const FEventContext&, Context, + const FUniqueI8Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUniqueI8Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUniqueI8Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUniqueI8Delete OnDelete; + +private: + const FString TableName = TEXT("unique_i8"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UniqueIdentityTable.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UniqueIdentityTable.g.h new file mode 100644 index 00000000000..3306c02c945 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UniqueIdentityTable.g.h @@ -0,0 +1,104 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/UniqueIdentityType.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "UniqueIdentityTable.g.generated.h" + +UCLASS(Blueprintable) +class TESTCLIENT_API UUniqueIdentityIUniqueIndex : public UObject +{ + GENERATED_BODY() + +private: + // Declare an instance of your templated helper. + // It's private because the UObject wrapper will expose its functionality. + FUniqueIndexHelper> IIndexHelper; + +public: + UUniqueIdentityIUniqueIndex() + // Initialize the helper with the specific unique index name + : IIndexHelper("i") { + } + + /** + * Finds a UniqueIdentity by their unique i. + * @param Key The i to search for. + * @return The found FUniqueIdentityType, or a default-constructed FUniqueIdentityType if not found. + */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|UniqueIdentityIndex") + FUniqueIdentityType Find(FSpacetimeDBIdentity Key) + { + // Simply delegate the call to the internal helper + return IIndexHelper.FindUniqueIndex(Key); + } + + // A public setter to provide the cache to the helper after construction + // This is a common pattern when the cache might be created or provided by another system. + void SetCache(TSharedPtr> InUniqueIdentityCache) + { + IIndexHelper.Cache = InUniqueIdentityCache; + } +}; +/***/ + +UCLASS(BlueprintType) +class TESTCLIENT_API UUniqueIdentityTable : public URemoteTable +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly) + UUniqueIdentityIUniqueIndex* I; + + void PostInitialize(); + + /** Update function for unique_identity table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnUniqueIdentityInsert, + const FEventContext&, Context, + const FUniqueIdentityType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnUniqueIdentityUpdate, + const FEventContext&, Context, + const FUniqueIdentityType&, OldRow, + const FUniqueIdentityType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnUniqueIdentityDelete, + const FEventContext&, Context, + const FUniqueIdentityType&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUniqueIdentityInsert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUniqueIdentityUpdate OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUniqueIdentityDelete OnDelete; + +private: + const FString TableName = TEXT("unique_identity"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UniqueStringTable.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UniqueStringTable.g.h new file mode 100644 index 00000000000..470c0fb753d --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UniqueStringTable.g.h @@ -0,0 +1,104 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/UniqueStringType.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "UniqueStringTable.g.generated.h" + +UCLASS(Blueprintable) +class TESTCLIENT_API UUniqueStringSUniqueIndex : public UObject +{ + GENERATED_BODY() + +private: + // Declare an instance of your templated helper. + // It's private because the UObject wrapper will expose its functionality. + FUniqueIndexHelper> SIndexHelper; + +public: + UUniqueStringSUniqueIndex() + // Initialize the helper with the specific unique index name + : SIndexHelper("s") { + } + + /** + * Finds a UniqueString by their unique s. + * @param Key The s to search for. + * @return The found FUniqueStringType, or a default-constructed FUniqueStringType if not found. + */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|UniqueStringIndex") + FUniqueStringType Find(FString Key) + { + // Simply delegate the call to the internal helper + return SIndexHelper.FindUniqueIndex(Key); + } + + // A public setter to provide the cache to the helper after construction + // This is a common pattern when the cache might be created or provided by another system. + void SetCache(TSharedPtr> InUniqueStringCache) + { + SIndexHelper.Cache = InUniqueStringCache; + } +}; +/***/ + +UCLASS(BlueprintType) +class TESTCLIENT_API UUniqueStringTable : public URemoteTable +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly) + UUniqueStringSUniqueIndex* S; + + void PostInitialize(); + + /** Update function for unique_string table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnUniqueStringInsert, + const FEventContext&, Context, + const FUniqueStringType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnUniqueStringUpdate, + const FEventContext&, Context, + const FUniqueStringType&, OldRow, + const FUniqueStringType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnUniqueStringDelete, + const FEventContext&, Context, + const FUniqueStringType&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUniqueStringInsert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUniqueStringUpdate OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUniqueStringDelete OnDelete; + +private: + const FString TableName = TEXT("unique_string"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UniqueU128Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UniqueU128Table.g.h new file mode 100644 index 00000000000..2677d84d330 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UniqueU128Table.g.h @@ -0,0 +1,104 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/UniqueU128Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "UniqueU128Table.g.generated.h" + +UCLASS(Blueprintable) +class TESTCLIENT_API UUniqueU128NUniqueIndex : public UObject +{ + GENERATED_BODY() + +private: + // Declare an instance of your templated helper. + // It's private because the UObject wrapper will expose its functionality. + FUniqueIndexHelper> NIndexHelper; + +public: + UUniqueU128NUniqueIndex() + // Initialize the helper with the specific unique index name + : NIndexHelper("n") { + } + + /** + * Finds a UniqueU128 by their unique n. + * @param Key The n to search for. + * @return The found FUniqueU128Type, or a default-constructed FUniqueU128Type if not found. + */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|UniqueU128Index") + FUniqueU128Type Find(FSpacetimeDBUInt128 Key) + { + // Simply delegate the call to the internal helper + return NIndexHelper.FindUniqueIndex(Key); + } + + // A public setter to provide the cache to the helper after construction + // This is a common pattern when the cache might be created or provided by another system. + void SetCache(TSharedPtr> InUniqueU128Cache) + { + NIndexHelper.Cache = InUniqueU128Cache; + } +}; +/***/ + +UCLASS(BlueprintType) +class TESTCLIENT_API UUniqueU128Table : public URemoteTable +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly) + UUniqueU128NUniqueIndex* N; + + void PostInitialize(); + + /** Update function for unique_u128 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnUniqueU128Insert, + const FEventContext&, Context, + const FUniqueU128Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnUniqueU128Update, + const FEventContext&, Context, + const FUniqueU128Type&, OldRow, + const FUniqueU128Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnUniqueU128Delete, + const FEventContext&, Context, + const FUniqueU128Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUniqueU128Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUniqueU128Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUniqueU128Delete OnDelete; + +private: + const FString TableName = TEXT("unique_u128"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UniqueU16Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UniqueU16Table.g.h new file mode 100644 index 00000000000..aea33985c3d --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UniqueU16Table.g.h @@ -0,0 +1,104 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/UniqueU16Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "UniqueU16Table.g.generated.h" + +UCLASS(Blueprintable) +class TESTCLIENT_API UUniqueU16NUniqueIndex : public UObject +{ + GENERATED_BODY() + +private: + // Declare an instance of your templated helper. + // It's private because the UObject wrapper will expose its functionality. + FUniqueIndexHelper> NIndexHelper; + +public: + UUniqueU16NUniqueIndex() + // Initialize the helper with the specific unique index name + : NIndexHelper("n") { + } + + /** + * Finds a UniqueU16 by their unique n. + * @param Key The n to search for. + * @return The found FUniqueU16Type, or a default-constructed FUniqueU16Type if not found. + */ + // NOTE: Not exposed to Blueprint because uint16 types are not Blueprint-compatible + FUniqueU16Type Find(uint16 Key) + { + // Simply delegate the call to the internal helper + return NIndexHelper.FindUniqueIndex(Key); + } + + // A public setter to provide the cache to the helper after construction + // This is a common pattern when the cache might be created or provided by another system. + void SetCache(TSharedPtr> InUniqueU16Cache) + { + NIndexHelper.Cache = InUniqueU16Cache; + } +}; +/***/ + +UCLASS(BlueprintType) +class TESTCLIENT_API UUniqueU16Table : public URemoteTable +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly) + UUniqueU16NUniqueIndex* N; + + void PostInitialize(); + + /** Update function for unique_u16 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnUniqueU16Insert, + const FEventContext&, Context, + const FUniqueU16Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnUniqueU16Update, + const FEventContext&, Context, + const FUniqueU16Type&, OldRow, + const FUniqueU16Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnUniqueU16Delete, + const FEventContext&, Context, + const FUniqueU16Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUniqueU16Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUniqueU16Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUniqueU16Delete OnDelete; + +private: + const FString TableName = TEXT("unique_u16"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UniqueU256Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UniqueU256Table.g.h new file mode 100644 index 00000000000..21ddf618b21 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UniqueU256Table.g.h @@ -0,0 +1,104 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/UniqueU256Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "UniqueU256Table.g.generated.h" + +UCLASS(Blueprintable) +class TESTCLIENT_API UUniqueU256NUniqueIndex : public UObject +{ + GENERATED_BODY() + +private: + // Declare an instance of your templated helper. + // It's private because the UObject wrapper will expose its functionality. + FUniqueIndexHelper> NIndexHelper; + +public: + UUniqueU256NUniqueIndex() + // Initialize the helper with the specific unique index name + : NIndexHelper("n") { + } + + /** + * Finds a UniqueU256 by their unique n. + * @param Key The n to search for. + * @return The found FUniqueU256Type, or a default-constructed FUniqueU256Type if not found. + */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|UniqueU256Index") + FUniqueU256Type Find(FSpacetimeDBUInt256 Key) + { + // Simply delegate the call to the internal helper + return NIndexHelper.FindUniqueIndex(Key); + } + + // A public setter to provide the cache to the helper after construction + // This is a common pattern when the cache might be created or provided by another system. + void SetCache(TSharedPtr> InUniqueU256Cache) + { + NIndexHelper.Cache = InUniqueU256Cache; + } +}; +/***/ + +UCLASS(BlueprintType) +class TESTCLIENT_API UUniqueU256Table : public URemoteTable +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly) + UUniqueU256NUniqueIndex* N; + + void PostInitialize(); + + /** Update function for unique_u256 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnUniqueU256Insert, + const FEventContext&, Context, + const FUniqueU256Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnUniqueU256Update, + const FEventContext&, Context, + const FUniqueU256Type&, OldRow, + const FUniqueU256Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnUniqueU256Delete, + const FEventContext&, Context, + const FUniqueU256Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUniqueU256Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUniqueU256Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUniqueU256Delete OnDelete; + +private: + const FString TableName = TEXT("unique_u256"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UniqueU32Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UniqueU32Table.g.h new file mode 100644 index 00000000000..c79c59b8e88 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UniqueU32Table.g.h @@ -0,0 +1,104 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/UniqueU32Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "UniqueU32Table.g.generated.h" + +UCLASS(Blueprintable) +class TESTCLIENT_API UUniqueU32NUniqueIndex : public UObject +{ + GENERATED_BODY() + +private: + // Declare an instance of your templated helper. + // It's private because the UObject wrapper will expose its functionality. + FUniqueIndexHelper> NIndexHelper; + +public: + UUniqueU32NUniqueIndex() + // Initialize the helper with the specific unique index name + : NIndexHelper("n") { + } + + /** + * Finds a UniqueU32 by their unique n. + * @param Key The n to search for. + * @return The found FUniqueU32Type, or a default-constructed FUniqueU32Type if not found. + */ + // NOTE: Not exposed to Blueprint because uint32 types are not Blueprint-compatible + FUniqueU32Type Find(uint32 Key) + { + // Simply delegate the call to the internal helper + return NIndexHelper.FindUniqueIndex(Key); + } + + // A public setter to provide the cache to the helper after construction + // This is a common pattern when the cache might be created or provided by another system. + void SetCache(TSharedPtr> InUniqueU32Cache) + { + NIndexHelper.Cache = InUniqueU32Cache; + } +}; +/***/ + +UCLASS(BlueprintType) +class TESTCLIENT_API UUniqueU32Table : public URemoteTable +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly) + UUniqueU32NUniqueIndex* N; + + void PostInitialize(); + + /** Update function for unique_u32 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnUniqueU32Insert, + const FEventContext&, Context, + const FUniqueU32Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnUniqueU32Update, + const FEventContext&, Context, + const FUniqueU32Type&, OldRow, + const FUniqueU32Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnUniqueU32Delete, + const FEventContext&, Context, + const FUniqueU32Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUniqueU32Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUniqueU32Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUniqueU32Delete OnDelete; + +private: + const FString TableName = TEXT("unique_u32"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UniqueU64Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UniqueU64Table.g.h new file mode 100644 index 00000000000..3d022c15183 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UniqueU64Table.g.h @@ -0,0 +1,104 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/UniqueU64Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "UniqueU64Table.g.generated.h" + +UCLASS(Blueprintable) +class TESTCLIENT_API UUniqueU64NUniqueIndex : public UObject +{ + GENERATED_BODY() + +private: + // Declare an instance of your templated helper. + // It's private because the UObject wrapper will expose its functionality. + FUniqueIndexHelper> NIndexHelper; + +public: + UUniqueU64NUniqueIndex() + // Initialize the helper with the specific unique index name + : NIndexHelper("n") { + } + + /** + * Finds a UniqueU64 by their unique n. + * @param Key The n to search for. + * @return The found FUniqueU64Type, or a default-constructed FUniqueU64Type if not found. + */ + // NOTE: Not exposed to Blueprint because uint64 types are not Blueprint-compatible + FUniqueU64Type Find(uint64 Key) + { + // Simply delegate the call to the internal helper + return NIndexHelper.FindUniqueIndex(Key); + } + + // A public setter to provide the cache to the helper after construction + // This is a common pattern when the cache might be created or provided by another system. + void SetCache(TSharedPtr> InUniqueU64Cache) + { + NIndexHelper.Cache = InUniqueU64Cache; + } +}; +/***/ + +UCLASS(BlueprintType) +class TESTCLIENT_API UUniqueU64Table : public URemoteTable +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly) + UUniqueU64NUniqueIndex* N; + + void PostInitialize(); + + /** Update function for unique_u64 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnUniqueU64Insert, + const FEventContext&, Context, + const FUniqueU64Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnUniqueU64Update, + const FEventContext&, Context, + const FUniqueU64Type&, OldRow, + const FUniqueU64Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnUniqueU64Delete, + const FEventContext&, Context, + const FUniqueU64Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUniqueU64Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUniqueU64Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUniqueU64Delete OnDelete; + +private: + const FString TableName = TEXT("unique_u64"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UniqueU8Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UniqueU8Table.g.h new file mode 100644 index 00000000000..e07ea119744 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UniqueU8Table.g.h @@ -0,0 +1,104 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/UniqueU8Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "UniqueU8Table.g.generated.h" + +UCLASS(Blueprintable) +class TESTCLIENT_API UUniqueU8NUniqueIndex : public UObject +{ + GENERATED_BODY() + +private: + // Declare an instance of your templated helper. + // It's private because the UObject wrapper will expose its functionality. + FUniqueIndexHelper> NIndexHelper; + +public: + UUniqueU8NUniqueIndex() + // Initialize the helper with the specific unique index name + : NIndexHelper("n") { + } + + /** + * Finds a UniqueU8 by their unique n. + * @param Key The n to search for. + * @return The found FUniqueU8Type, or a default-constructed FUniqueU8Type if not found. + */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|UniqueU8Index") + FUniqueU8Type Find(uint8 Key) + { + // Simply delegate the call to the internal helper + return NIndexHelper.FindUniqueIndex(Key); + } + + // A public setter to provide the cache to the helper after construction + // This is a common pattern when the cache might be created or provided by another system. + void SetCache(TSharedPtr> InUniqueU8Cache) + { + NIndexHelper.Cache = InUniqueU8Cache; + } +}; +/***/ + +UCLASS(BlueprintType) +class TESTCLIENT_API UUniqueU8Table : public URemoteTable +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly) + UUniqueU8NUniqueIndex* N; + + void PostInitialize(); + + /** Update function for unique_u8 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnUniqueU8Insert, + const FEventContext&, Context, + const FUniqueU8Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnUniqueU8Update, + const FEventContext&, Context, + const FUniqueU8Type&, OldRow, + const FUniqueU8Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnUniqueU8Delete, + const FEventContext&, Context, + const FUniqueU8Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUniqueU8Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUniqueU8Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUniqueU8Delete OnDelete; + +private: + const FString TableName = TEXT("unique_u8"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UsersTable.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UsersTable.g.h new file mode 100644 index 00000000000..74b22a0cf3a --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/UsersTable.g.h @@ -0,0 +1,104 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/UsersType.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "UsersTable.g.generated.h" + +UCLASS(Blueprintable) +class TESTCLIENT_API UUsersIdentityUniqueIndex : public UObject +{ + GENERATED_BODY() + +private: + // Declare an instance of your templated helper. + // It's private because the UObject wrapper will expose its functionality. + FUniqueIndexHelper> IdentityIndexHelper; + +public: + UUsersIdentityUniqueIndex() + // Initialize the helper with the specific unique index name + : IdentityIndexHelper("identity") { + } + + /** + * Finds a Users by their unique identity. + * @param Key The identity to search for. + * @return The found FUsersType, or a default-constructed FUsersType if not found. + */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|UsersIndex") + FUsersType Find(FSpacetimeDBIdentity Key) + { + // Simply delegate the call to the internal helper + return IdentityIndexHelper.FindUniqueIndex(Key); + } + + // A public setter to provide the cache to the helper after construction + // This is a common pattern when the cache might be created or provided by another system. + void SetCache(TSharedPtr> InUsersCache) + { + IdentityIndexHelper.Cache = InUsersCache; + } +}; +/***/ + +UCLASS(BlueprintType) +class TESTCLIENT_API UUsersTable : public URemoteTable +{ + GENERATED_BODY() + +public: + UPROPERTY(BlueprintReadOnly) + UUsersIdentityUniqueIndex* Identity; + + void PostInitialize(); + + /** Update function for users table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnUsersInsert, + const FEventContext&, Context, + const FUsersType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnUsersUpdate, + const FEventContext&, Context, + const FUsersType&, OldRow, + const FUsersType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnUsersDelete, + const FEventContext&, Context, + const FUsersType&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUsersInsert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUsersUpdate OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnUsersDelete OnDelete; + +private: + const FString TableName = TEXT("users"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecBoolTable.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecBoolTable.g.h new file mode 100644 index 00000000000..d78eb881470 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecBoolTable.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/VecBoolType.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "VecBoolTable.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UVecBoolTable : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for vec_bool table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecBoolInsert, + const FEventContext&, Context, + const FVecBoolType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnVecBoolUpdate, + const FEventContext&, Context, + const FVecBoolType&, OldRow, + const FVecBoolType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecBoolDelete, + const FEventContext&, Context, + const FVecBoolType&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecBoolInsert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecBoolUpdate OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecBoolDelete OnDelete; + +private: + const FString TableName = TEXT("vec_bool"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecByteStructTable.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecByteStructTable.g.h new file mode 100644 index 00000000000..c2766db4441 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecByteStructTable.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/VecByteStructType.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "VecByteStructTable.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UVecByteStructTable : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for vec_byte_struct table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecByteStructInsert, + const FEventContext&, Context, + const FVecByteStructType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnVecByteStructUpdate, + const FEventContext&, Context, + const FVecByteStructType&, OldRow, + const FVecByteStructType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecByteStructDelete, + const FEventContext&, Context, + const FVecByteStructType&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecByteStructInsert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecByteStructUpdate OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecByteStructDelete OnDelete; + +private: + const FString TableName = TEXT("vec_byte_struct"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecConnectionIdTable.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecConnectionIdTable.g.h new file mode 100644 index 00000000000..91758908b1e --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecConnectionIdTable.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/VecConnectionIdType.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "VecConnectionIdTable.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UVecConnectionIdTable : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for vec_connection_id table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecConnectionIdInsert, + const FEventContext&, Context, + const FVecConnectionIdType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnVecConnectionIdUpdate, + const FEventContext&, Context, + const FVecConnectionIdType&, OldRow, + const FVecConnectionIdType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecConnectionIdDelete, + const FEventContext&, Context, + const FVecConnectionIdType&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecConnectionIdInsert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecConnectionIdUpdate OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecConnectionIdDelete OnDelete; + +private: + const FString TableName = TEXT("vec_connection_id"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecEnumWithPayloadTable.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecEnumWithPayloadTable.g.h new file mode 100644 index 00000000000..6312a77df4a --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecEnumWithPayloadTable.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/VecEnumWithPayloadType.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "VecEnumWithPayloadTable.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UVecEnumWithPayloadTable : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for vec_enum_with_payload table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecEnumWithPayloadInsert, + const FEventContext&, Context, + const FVecEnumWithPayloadType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnVecEnumWithPayloadUpdate, + const FEventContext&, Context, + const FVecEnumWithPayloadType&, OldRow, + const FVecEnumWithPayloadType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecEnumWithPayloadDelete, + const FEventContext&, Context, + const FVecEnumWithPayloadType&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecEnumWithPayloadInsert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecEnumWithPayloadUpdate OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecEnumWithPayloadDelete OnDelete; + +private: + const FString TableName = TEXT("vec_enum_with_payload"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecEveryPrimitiveStructTable.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecEveryPrimitiveStructTable.g.h new file mode 100644 index 00000000000..77126b47d98 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecEveryPrimitiveStructTable.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/VecEveryPrimitiveStructType.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "VecEveryPrimitiveStructTable.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UVecEveryPrimitiveStructTable : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for vec_every_primitive_struct table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecEveryPrimitiveStructInsert, + const FEventContext&, Context, + const FVecEveryPrimitiveStructType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnVecEveryPrimitiveStructUpdate, + const FEventContext&, Context, + const FVecEveryPrimitiveStructType&, OldRow, + const FVecEveryPrimitiveStructType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecEveryPrimitiveStructDelete, + const FEventContext&, Context, + const FVecEveryPrimitiveStructType&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecEveryPrimitiveStructInsert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecEveryPrimitiveStructUpdate OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecEveryPrimitiveStructDelete OnDelete; + +private: + const FString TableName = TEXT("vec_every_primitive_struct"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecEveryVecStructTable.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecEveryVecStructTable.g.h new file mode 100644 index 00000000000..42268a159fb --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecEveryVecStructTable.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/VecEveryVecStructType.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "VecEveryVecStructTable.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UVecEveryVecStructTable : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for vec_every_vec_struct table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecEveryVecStructInsert, + const FEventContext&, Context, + const FVecEveryVecStructType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnVecEveryVecStructUpdate, + const FEventContext&, Context, + const FVecEveryVecStructType&, OldRow, + const FVecEveryVecStructType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecEveryVecStructDelete, + const FEventContext&, Context, + const FVecEveryVecStructType&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecEveryVecStructInsert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecEveryVecStructUpdate OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecEveryVecStructDelete OnDelete; + +private: + const FString TableName = TEXT("vec_every_vec_struct"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecF32Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecF32Table.g.h new file mode 100644 index 00000000000..fa09dc1ffa5 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecF32Table.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/VecF32Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "VecF32Table.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UVecF32Table : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for vec_f32 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecF32Insert, + const FEventContext&, Context, + const FVecF32Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnVecF32Update, + const FEventContext&, Context, + const FVecF32Type&, OldRow, + const FVecF32Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecF32Delete, + const FEventContext&, Context, + const FVecF32Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecF32Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecF32Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecF32Delete OnDelete; + +private: + const FString TableName = TEXT("vec_f32"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecF64Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecF64Table.g.h new file mode 100644 index 00000000000..8eb0e28d7fd --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecF64Table.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/VecF64Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "VecF64Table.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UVecF64Table : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for vec_f64 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecF64Insert, + const FEventContext&, Context, + const FVecF64Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnVecF64Update, + const FEventContext&, Context, + const FVecF64Type&, OldRow, + const FVecF64Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecF64Delete, + const FEventContext&, Context, + const FVecF64Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecF64Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecF64Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecF64Delete OnDelete; + +private: + const FString TableName = TEXT("vec_f64"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecI128Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecI128Table.g.h new file mode 100644 index 00000000000..95485adaee0 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecI128Table.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/VecI128Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "VecI128Table.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UVecI128Table : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for vec_i128 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecI128Insert, + const FEventContext&, Context, + const FVecI128Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnVecI128Update, + const FEventContext&, Context, + const FVecI128Type&, OldRow, + const FVecI128Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecI128Delete, + const FEventContext&, Context, + const FVecI128Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecI128Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecI128Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecI128Delete OnDelete; + +private: + const FString TableName = TEXT("vec_i128"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecI16Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecI16Table.g.h new file mode 100644 index 00000000000..a793d1d42c1 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecI16Table.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/VecI16Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "VecI16Table.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UVecI16Table : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for vec_i16 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecI16Insert, + const FEventContext&, Context, + const FVecI16Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnVecI16Update, + const FEventContext&, Context, + const FVecI16Type&, OldRow, + const FVecI16Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecI16Delete, + const FEventContext&, Context, + const FVecI16Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecI16Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecI16Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecI16Delete OnDelete; + +private: + const FString TableName = TEXT("vec_i16"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecI256Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecI256Table.g.h new file mode 100644 index 00000000000..d61ef4e5ad5 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecI256Table.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/VecI256Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "VecI256Table.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UVecI256Table : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for vec_i256 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecI256Insert, + const FEventContext&, Context, + const FVecI256Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnVecI256Update, + const FEventContext&, Context, + const FVecI256Type&, OldRow, + const FVecI256Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecI256Delete, + const FEventContext&, Context, + const FVecI256Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecI256Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecI256Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecI256Delete OnDelete; + +private: + const FString TableName = TEXT("vec_i256"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecI32Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecI32Table.g.h new file mode 100644 index 00000000000..7953feef881 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecI32Table.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/VecI32Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "VecI32Table.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UVecI32Table : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for vec_i32 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecI32Insert, + const FEventContext&, Context, + const FVecI32Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnVecI32Update, + const FEventContext&, Context, + const FVecI32Type&, OldRow, + const FVecI32Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecI32Delete, + const FEventContext&, Context, + const FVecI32Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecI32Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecI32Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecI32Delete OnDelete; + +private: + const FString TableName = TEXT("vec_i32"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecI64Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecI64Table.g.h new file mode 100644 index 00000000000..4493a09f494 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecI64Table.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/VecI64Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "VecI64Table.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UVecI64Table : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for vec_i64 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecI64Insert, + const FEventContext&, Context, + const FVecI64Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnVecI64Update, + const FEventContext&, Context, + const FVecI64Type&, OldRow, + const FVecI64Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecI64Delete, + const FEventContext&, Context, + const FVecI64Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecI64Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecI64Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecI64Delete OnDelete; + +private: + const FString TableName = TEXT("vec_i64"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecI8Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecI8Table.g.h new file mode 100644 index 00000000000..ea0d271ffe6 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecI8Table.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/VecI8Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "VecI8Table.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UVecI8Table : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for vec_i8 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecI8Insert, + const FEventContext&, Context, + const FVecI8Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnVecI8Update, + const FEventContext&, Context, + const FVecI8Type&, OldRow, + const FVecI8Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecI8Delete, + const FEventContext&, Context, + const FVecI8Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecI8Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecI8Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecI8Delete OnDelete; + +private: + const FString TableName = TEXT("vec_i8"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecIdentityTable.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecIdentityTable.g.h new file mode 100644 index 00000000000..9c22c8bbc62 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecIdentityTable.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/VecIdentityType.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "VecIdentityTable.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UVecIdentityTable : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for vec_identity table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecIdentityInsert, + const FEventContext&, Context, + const FVecIdentityType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnVecIdentityUpdate, + const FEventContext&, Context, + const FVecIdentityType&, OldRow, + const FVecIdentityType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecIdentityDelete, + const FEventContext&, Context, + const FVecIdentityType&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecIdentityInsert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecIdentityUpdate OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecIdentityDelete OnDelete; + +private: + const FString TableName = TEXT("vec_identity"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecSimpleEnumTable.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecSimpleEnumTable.g.h new file mode 100644 index 00000000000..5a8af6803d5 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecSimpleEnumTable.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/VecSimpleEnumType.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "VecSimpleEnumTable.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UVecSimpleEnumTable : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for vec_simple_enum table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecSimpleEnumInsert, + const FEventContext&, Context, + const FVecSimpleEnumType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnVecSimpleEnumUpdate, + const FEventContext&, Context, + const FVecSimpleEnumType&, OldRow, + const FVecSimpleEnumType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecSimpleEnumDelete, + const FEventContext&, Context, + const FVecSimpleEnumType&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecSimpleEnumInsert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecSimpleEnumUpdate OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecSimpleEnumDelete OnDelete; + +private: + const FString TableName = TEXT("vec_simple_enum"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecStringTable.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecStringTable.g.h new file mode 100644 index 00000000000..74def68e4a3 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecStringTable.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/VecStringType.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "VecStringTable.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UVecStringTable : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for vec_string table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecStringInsert, + const FEventContext&, Context, + const FVecStringType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnVecStringUpdate, + const FEventContext&, Context, + const FVecStringType&, OldRow, + const FVecStringType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecStringDelete, + const FEventContext&, Context, + const FVecStringType&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecStringInsert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecStringUpdate OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecStringDelete OnDelete; + +private: + const FString TableName = TEXT("vec_string"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecTimestampTable.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecTimestampTable.g.h new file mode 100644 index 00000000000..d5a6a64f2c5 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecTimestampTable.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/VecTimestampType.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "VecTimestampTable.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UVecTimestampTable : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for vec_timestamp table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecTimestampInsert, + const FEventContext&, Context, + const FVecTimestampType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnVecTimestampUpdate, + const FEventContext&, Context, + const FVecTimestampType&, OldRow, + const FVecTimestampType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecTimestampDelete, + const FEventContext&, Context, + const FVecTimestampType&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecTimestampInsert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecTimestampUpdate OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecTimestampDelete OnDelete; + +private: + const FString TableName = TEXT("vec_timestamp"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecU128Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecU128Table.g.h new file mode 100644 index 00000000000..6ffec05f26e --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecU128Table.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/VecU128Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "VecU128Table.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UVecU128Table : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for vec_u128 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecU128Insert, + const FEventContext&, Context, + const FVecU128Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnVecU128Update, + const FEventContext&, Context, + const FVecU128Type&, OldRow, + const FVecU128Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecU128Delete, + const FEventContext&, Context, + const FVecU128Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecU128Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecU128Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecU128Delete OnDelete; + +private: + const FString TableName = TEXT("vec_u128"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecU16Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecU16Table.g.h new file mode 100644 index 00000000000..c30d06a29b8 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecU16Table.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/VecU16Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "VecU16Table.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UVecU16Table : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for vec_u16 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecU16Insert, + const FEventContext&, Context, + const FVecU16Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnVecU16Update, + const FEventContext&, Context, + const FVecU16Type&, OldRow, + const FVecU16Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecU16Delete, + const FEventContext&, Context, + const FVecU16Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecU16Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecU16Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecU16Delete OnDelete; + +private: + const FString TableName = TEXT("vec_u16"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecU256Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecU256Table.g.h new file mode 100644 index 00000000000..03939aceba1 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecU256Table.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/VecU256Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "VecU256Table.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UVecU256Table : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for vec_u256 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecU256Insert, + const FEventContext&, Context, + const FVecU256Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnVecU256Update, + const FEventContext&, Context, + const FVecU256Type&, OldRow, + const FVecU256Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecU256Delete, + const FEventContext&, Context, + const FVecU256Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecU256Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecU256Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecU256Delete OnDelete; + +private: + const FString TableName = TEXT("vec_u256"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecU32Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecU32Table.g.h new file mode 100644 index 00000000000..eac904322e1 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecU32Table.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/VecU32Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "VecU32Table.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UVecU32Table : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for vec_u32 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecU32Insert, + const FEventContext&, Context, + const FVecU32Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnVecU32Update, + const FEventContext&, Context, + const FVecU32Type&, OldRow, + const FVecU32Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecU32Delete, + const FEventContext&, Context, + const FVecU32Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecU32Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecU32Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecU32Delete OnDelete; + +private: + const FString TableName = TEXT("vec_u32"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecU64Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecU64Table.g.h new file mode 100644 index 00000000000..c52cae6bb4d --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecU64Table.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/VecU64Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "VecU64Table.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UVecU64Table : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for vec_u64 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecU64Insert, + const FEventContext&, Context, + const FVecU64Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnVecU64Update, + const FEventContext&, Context, + const FVecU64Type&, OldRow, + const FVecU64Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecU64Delete, + const FEventContext&, Context, + const FVecU64Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecU64Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecU64Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecU64Delete OnDelete; + +private: + const FString TableName = TEXT("vec_u64"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecU8Table.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecU8Table.g.h new file mode 100644 index 00000000000..d3602f7adce --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecU8Table.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/VecU8Type.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "VecU8Table.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UVecU8Table : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for vec_u8 table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecU8Insert, + const FEventContext&, Context, + const FVecU8Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnVecU8Update, + const FEventContext&, Context, + const FVecU8Type&, OldRow, + const FVecU8Type&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecU8Delete, + const FEventContext&, Context, + const FVecU8Type&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecU8Insert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecU8Update OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecU8Delete OnDelete; + +private: + const FString TableName = TEXT("vec_u8"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecUnitStructTable.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecUnitStructTable.g.h new file mode 100644 index 00000000000..6fcd9c48194 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Tables/VecUnitStructTable.g.h @@ -0,0 +1,64 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/VecUnitStructType.g.h" +#include "Tables/RemoteTable.h" +#include "DBCache/WithBsatn.h" +#include "DBCache/TableHandle.h" +#include "DBCache/TableCache.h" +#include "VecUnitStructTable.g.generated.h" + +UCLASS(BlueprintType) +class TESTCLIENT_API UVecUnitStructTable : public URemoteTable +{ + GENERATED_BODY() + +public: + void PostInitialize(); + + /** Update function for vec_unit_struct table*/ + FTableAppliedDiff Update(TArray> InsertsRef, TArray> DeletesRef); + + /** Number of subscribed rows currently in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + int32 Count() const; + + /** Return all subscribed rows in the cache */ + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB") + TArray Iter() const; + + // Table Events + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecUnitStructInsert, + const FEventContext&, Context, + const FVecUnitStructType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( + FOnVecUnitStructUpdate, + const FEventContext&, Context, + const FVecUnitStructType&, OldRow, + const FVecUnitStructType&, NewRow); + + DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams( + FOnVecUnitStructDelete, + const FEventContext&, Context, + const FVecUnitStructType&, DeletedRow); + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecUnitStructInsert OnInsert; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecUnitStructUpdate OnUpdate; + + UPROPERTY(BlueprintAssignable, Category = "SpacetimeDB Events") + FOnVecUnitStructDelete OnDelete; + +private: + const FString TableName = TEXT("vec_unit_struct"); + + TSharedPtr> Data; +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/BTreeU32Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/BTreeU32Type.g.h new file mode 100644 index 00000000000..c5495ae5d04 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/BTreeU32Type.g.h @@ -0,0 +1,49 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "BTreeU32Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FBTreeU32Type +{ + GENERATED_BODY() + + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 N; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + int32 Data; + + FORCEINLINE bool operator==(const FBTreeU32Type& Other) const + { + return N == Other.N && Data == Other.Data; + } + + FORCEINLINE bool operator!=(const FBTreeU32Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FBTreeU32Type. + * Combines the hashes of all fields that are compared in operator==. + * @param BTreeU32Type The FBTreeU32Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FBTreeU32Type& BTreeU32Type) +{ + uint32 Hash = GetTypeHash(BTreeU32Type.N); + Hash = HashCombine(Hash, GetTypeHash(BTreeU32Type.Data)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FBTreeU32Type); + + UE_SPACETIMEDB_STRUCT(FBTreeU32Type, N, Data); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/ByteStructType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/ByteStructType.g.h new file mode 100644 index 00000000000..0c046e39435 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/ByteStructType.g.h @@ -0,0 +1,45 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ByteStructType.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FByteStructType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + uint8 B; + + FORCEINLINE bool operator==(const FByteStructType& Other) const + { + return B == Other.B; + } + + FORCEINLINE bool operator!=(const FByteStructType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FByteStructType. + * Combines the hashes of all fields that are compared in operator==. + * @param ByteStructType The FByteStructType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FByteStructType& ByteStructType) +{ + uint32 Hash = GetTypeHash(ByteStructType.B); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FByteStructType); + + UE_SPACETIMEDB_STRUCT(FByteStructType, B); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/EnumWithPayloadType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/EnumWithPayloadType.g.h new file mode 100644 index 00000000000..8a17f06b636 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/EnumWithPayloadType.g.h @@ -0,0 +1,908 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ModuleBindings/Types/SimpleEnumType.g.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "EnumWithPayloadType.g.generated.h" + +UENUM(BlueprintType) +enum class EEnumWithPayloadTag : uint8 +{ + U8, + U16, + U32, + U64, + U128, + U256, + I8, + I16, + I32, + I64, + I128, + I256, + Bool, + F32, + F64, + Str, + Identity, + ConnectionId, + Timestamp, + Bytes, + Ints, + Strings, + SimpleEnums +}; + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FEnumWithPayloadType +{ + GENERATED_BODY() + +public: + FEnumWithPayloadType() = default; + + TVariant, uint64, TArray, TArray, int8, FSpacetimeDBIdentity, uint8, FSpacetimeDBUInt256, int32, FSpacetimeDBUInt128, float, FSpacetimeDBTimestamp, uint16, double, FSpacetimeDBInt256, bool, uint32, int64, FSpacetimeDBInt128, FString, int16, FSpacetimeDBConnectionId, TArray> MessageData; + + UPROPERTY(BlueprintReadOnly) + EEnumWithPayloadTag Tag; + + static FEnumWithPayloadType U8(const uint8& Value) + { + FEnumWithPayloadType Obj; + Obj.Tag = EEnumWithPayloadTag::U8; + Obj.MessageData.Set(Value); + return Obj; + } + + static FEnumWithPayloadType U16(const uint16& Value) + { + FEnumWithPayloadType Obj; + Obj.Tag = EEnumWithPayloadTag::U16; + Obj.MessageData.Set(Value); + return Obj; + } + + static FEnumWithPayloadType U32(const uint32& Value) + { + FEnumWithPayloadType Obj; + Obj.Tag = EEnumWithPayloadTag::U32; + Obj.MessageData.Set(Value); + return Obj; + } + + static FEnumWithPayloadType U64(const uint64& Value) + { + FEnumWithPayloadType Obj; + Obj.Tag = EEnumWithPayloadTag::U64; + Obj.MessageData.Set(Value); + return Obj; + } + + static FEnumWithPayloadType U128(const FSpacetimeDBUInt128& Value) + { + FEnumWithPayloadType Obj; + Obj.Tag = EEnumWithPayloadTag::U128; + Obj.MessageData.Set(Value); + return Obj; + } + + static FEnumWithPayloadType U256(const FSpacetimeDBUInt256& Value) + { + FEnumWithPayloadType Obj; + Obj.Tag = EEnumWithPayloadTag::U256; + Obj.MessageData.Set(Value); + return Obj; + } + + static FEnumWithPayloadType I8(const int8& Value) + { + FEnumWithPayloadType Obj; + Obj.Tag = EEnumWithPayloadTag::I8; + Obj.MessageData.Set(Value); + return Obj; + } + + static FEnumWithPayloadType I16(const int16& Value) + { + FEnumWithPayloadType Obj; + Obj.Tag = EEnumWithPayloadTag::I16; + Obj.MessageData.Set(Value); + return Obj; + } + + static FEnumWithPayloadType I32(const int32& Value) + { + FEnumWithPayloadType Obj; + Obj.Tag = EEnumWithPayloadTag::I32; + Obj.MessageData.Set(Value); + return Obj; + } + + static FEnumWithPayloadType I64(const int64& Value) + { + FEnumWithPayloadType Obj; + Obj.Tag = EEnumWithPayloadTag::I64; + Obj.MessageData.Set(Value); + return Obj; + } + + static FEnumWithPayloadType I128(const FSpacetimeDBInt128& Value) + { + FEnumWithPayloadType Obj; + Obj.Tag = EEnumWithPayloadTag::I128; + Obj.MessageData.Set(Value); + return Obj; + } + + static FEnumWithPayloadType I256(const FSpacetimeDBInt256& Value) + { + FEnumWithPayloadType Obj; + Obj.Tag = EEnumWithPayloadTag::I256; + Obj.MessageData.Set(Value); + return Obj; + } + + static FEnumWithPayloadType Bool(const bool& Value) + { + FEnumWithPayloadType Obj; + Obj.Tag = EEnumWithPayloadTag::Bool; + Obj.MessageData.Set(Value); + return Obj; + } + + static FEnumWithPayloadType F32(const float& Value) + { + FEnumWithPayloadType Obj; + Obj.Tag = EEnumWithPayloadTag::F32; + Obj.MessageData.Set(Value); + return Obj; + } + + static FEnumWithPayloadType F64(const double& Value) + { + FEnumWithPayloadType Obj; + Obj.Tag = EEnumWithPayloadTag::F64; + Obj.MessageData.Set(Value); + return Obj; + } + + static FEnumWithPayloadType Str(const FString& Value) + { + FEnumWithPayloadType Obj; + Obj.Tag = EEnumWithPayloadTag::Str; + Obj.MessageData.Set(Value); + return Obj; + } + + static FEnumWithPayloadType Identity(const FSpacetimeDBIdentity& Value) + { + FEnumWithPayloadType Obj; + Obj.Tag = EEnumWithPayloadTag::Identity; + Obj.MessageData.Set(Value); + return Obj; + } + + static FEnumWithPayloadType ConnectionId(const FSpacetimeDBConnectionId& Value) + { + FEnumWithPayloadType Obj; + Obj.Tag = EEnumWithPayloadTag::ConnectionId; + Obj.MessageData.Set(Value); + return Obj; + } + + static FEnumWithPayloadType Timestamp(const FSpacetimeDBTimestamp& Value) + { + FEnumWithPayloadType Obj; + Obj.Tag = EEnumWithPayloadTag::Timestamp; + Obj.MessageData.Set(Value); + return Obj; + } + + static FEnumWithPayloadType Bytes(const TArray& Value) + { + FEnumWithPayloadType Obj; + Obj.Tag = EEnumWithPayloadTag::Bytes; + Obj.MessageData.Set>(Value); + return Obj; + } + + static FEnumWithPayloadType Ints(const TArray& Value) + { + FEnumWithPayloadType Obj; + Obj.Tag = EEnumWithPayloadTag::Ints; + Obj.MessageData.Set>(Value); + return Obj; + } + + static FEnumWithPayloadType Strings(const TArray& Value) + { + FEnumWithPayloadType Obj; + Obj.Tag = EEnumWithPayloadTag::Strings; + Obj.MessageData.Set>(Value); + return Obj; + } + + static FEnumWithPayloadType SimpleEnums(const TArray& Value) + { + FEnumWithPayloadType Obj; + Obj.Tag = EEnumWithPayloadTag::SimpleEnums; + Obj.MessageData.Set>(Value); + return Obj; + } + + FORCEINLINE bool IsU8() const { return Tag == EEnumWithPayloadTag::U8; } + + FORCEINLINE uint8 GetAsU8() const + { + ensureMsgf(IsU8(), TEXT("MessageData does not hold U8!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsU16() const { return Tag == EEnumWithPayloadTag::U16; } + + FORCEINLINE uint16 GetAsU16() const + { + ensureMsgf(IsU16(), TEXT("MessageData does not hold U16!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsU32() const { return Tag == EEnumWithPayloadTag::U32; } + + FORCEINLINE uint32 GetAsU32() const + { + ensureMsgf(IsU32(), TEXT("MessageData does not hold U32!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsU64() const { return Tag == EEnumWithPayloadTag::U64; } + + FORCEINLINE uint64 GetAsU64() const + { + ensureMsgf(IsU64(), TEXT("MessageData does not hold U64!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsU128() const { return Tag == EEnumWithPayloadTag::U128; } + + FORCEINLINE FSpacetimeDBUInt128 GetAsU128() const + { + ensureMsgf(IsU128(), TEXT("MessageData does not hold U128!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsU256() const { return Tag == EEnumWithPayloadTag::U256; } + + FORCEINLINE FSpacetimeDBUInt256 GetAsU256() const + { + ensureMsgf(IsU256(), TEXT("MessageData does not hold U256!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsI8() const { return Tag == EEnumWithPayloadTag::I8; } + + FORCEINLINE int8 GetAsI8() const + { + ensureMsgf(IsI8(), TEXT("MessageData does not hold I8!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsI16() const { return Tag == EEnumWithPayloadTag::I16; } + + FORCEINLINE int16 GetAsI16() const + { + ensureMsgf(IsI16(), TEXT("MessageData does not hold I16!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsI32() const { return Tag == EEnumWithPayloadTag::I32; } + + FORCEINLINE int32 GetAsI32() const + { + ensureMsgf(IsI32(), TEXT("MessageData does not hold I32!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsI64() const { return Tag == EEnumWithPayloadTag::I64; } + + FORCEINLINE int64 GetAsI64() const + { + ensureMsgf(IsI64(), TEXT("MessageData does not hold I64!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsI128() const { return Tag == EEnumWithPayloadTag::I128; } + + FORCEINLINE FSpacetimeDBInt128 GetAsI128() const + { + ensureMsgf(IsI128(), TEXT("MessageData does not hold I128!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsI256() const { return Tag == EEnumWithPayloadTag::I256; } + + FORCEINLINE FSpacetimeDBInt256 GetAsI256() const + { + ensureMsgf(IsI256(), TEXT("MessageData does not hold I256!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsBool() const { return Tag == EEnumWithPayloadTag::Bool; } + + FORCEINLINE bool GetAsBool() const + { + ensureMsgf(IsBool(), TEXT("MessageData does not hold Bool!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsF32() const { return Tag == EEnumWithPayloadTag::F32; } + + FORCEINLINE float GetAsF32() const + { + ensureMsgf(IsF32(), TEXT("MessageData does not hold F32!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsF64() const { return Tag == EEnumWithPayloadTag::F64; } + + FORCEINLINE double GetAsF64() const + { + ensureMsgf(IsF64(), TEXT("MessageData does not hold F64!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsStr() const { return Tag == EEnumWithPayloadTag::Str; } + + FORCEINLINE FString GetAsStr() const + { + ensureMsgf(IsStr(), TEXT("MessageData does not hold Str!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsIdentity() const { return Tag == EEnumWithPayloadTag::Identity; } + + FORCEINLINE FSpacetimeDBIdentity GetAsIdentity() const + { + ensureMsgf(IsIdentity(), TEXT("MessageData does not hold Identity!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsConnectionId() const { return Tag == EEnumWithPayloadTag::ConnectionId; } + + FORCEINLINE FSpacetimeDBConnectionId GetAsConnectionId() const + { + ensureMsgf(IsConnectionId(), TEXT("MessageData does not hold ConnectionId!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsTimestamp() const { return Tag == EEnumWithPayloadTag::Timestamp; } + + FORCEINLINE FSpacetimeDBTimestamp GetAsTimestamp() const + { + ensureMsgf(IsTimestamp(), TEXT("MessageData does not hold Timestamp!")); + return MessageData.Get(); + } + + FORCEINLINE bool IsBytes() const { return Tag == EEnumWithPayloadTag::Bytes; } + + FORCEINLINE TArray GetAsBytes() const + { + ensureMsgf(IsBytes(), TEXT("MessageData does not hold Bytes!")); + return MessageData.Get>(); + } + + FORCEINLINE bool IsInts() const { return Tag == EEnumWithPayloadTag::Ints; } + + FORCEINLINE TArray GetAsInts() const + { + ensureMsgf(IsInts(), TEXT("MessageData does not hold Ints!")); + return MessageData.Get>(); + } + + FORCEINLINE bool IsStrings() const { return Tag == EEnumWithPayloadTag::Strings; } + + FORCEINLINE TArray GetAsStrings() const + { + ensureMsgf(IsStrings(), TEXT("MessageData does not hold Strings!")); + return MessageData.Get>(); + } + + FORCEINLINE bool IsSimpleEnums() const { return Tag == EEnumWithPayloadTag::SimpleEnums; } + + FORCEINLINE TArray GetAsSimpleEnums() const + { + ensureMsgf(IsSimpleEnums(), TEXT("MessageData does not hold SimpleEnums!")); + return MessageData.Get>(); + } + + // Inline equality operators + FORCEINLINE bool operator==(const FEnumWithPayloadType& Other) const + { + if (Tag != Other.Tag) return false; + + switch (Tag) + { + case EEnumWithPayloadTag::U8: + return GetAsU8() == Other.GetAsU8(); + case EEnumWithPayloadTag::U16: + return GetAsU16() == Other.GetAsU16(); + case EEnumWithPayloadTag::U32: + return GetAsU32() == Other.GetAsU32(); + case EEnumWithPayloadTag::U64: + return GetAsU64() == Other.GetAsU64(); + case EEnumWithPayloadTag::U128: + return GetAsU128() == Other.GetAsU128(); + case EEnumWithPayloadTag::U256: + return GetAsU256() == Other.GetAsU256(); + case EEnumWithPayloadTag::I8: + return GetAsI8() == Other.GetAsI8(); + case EEnumWithPayloadTag::I16: + return GetAsI16() == Other.GetAsI16(); + case EEnumWithPayloadTag::I32: + return GetAsI32() == Other.GetAsI32(); + case EEnumWithPayloadTag::I64: + return GetAsI64() == Other.GetAsI64(); + case EEnumWithPayloadTag::I128: + return GetAsI128() == Other.GetAsI128(); + case EEnumWithPayloadTag::I256: + return GetAsI256() == Other.GetAsI256(); + case EEnumWithPayloadTag::Bool: + return GetAsBool() == Other.GetAsBool(); + case EEnumWithPayloadTag::F32: + return GetAsF32() == Other.GetAsF32(); + case EEnumWithPayloadTag::F64: + return GetAsF64() == Other.GetAsF64(); + case EEnumWithPayloadTag::Str: + return GetAsStr() == Other.GetAsStr(); + case EEnumWithPayloadTag::Identity: + return GetAsIdentity() == Other.GetAsIdentity(); + case EEnumWithPayloadTag::ConnectionId: + return GetAsConnectionId() == Other.GetAsConnectionId(); + case EEnumWithPayloadTag::Timestamp: + return GetAsTimestamp() == Other.GetAsTimestamp(); + case EEnumWithPayloadTag::Bytes: + return GetAsBytes() == Other.GetAsBytes(); + case EEnumWithPayloadTag::Ints: + return GetAsInts() == Other.GetAsInts(); + case EEnumWithPayloadTag::Strings: + return GetAsStrings() == Other.GetAsStrings(); + case EEnumWithPayloadTag::SimpleEnums: + return GetAsSimpleEnums() == Other.GetAsSimpleEnums(); + default: + return false; + } + } + + FORCEINLINE bool operator!=(const FEnumWithPayloadType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FEnumWithPayloadType. + * Combines the hashes of all fields that are compared in operator==. + * @param EnumWithPayloadType The FEnumWithPayloadType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FEnumWithPayloadType& EnumWithPayload) +{ + const uint32 TagHash = GetTypeHash(static_cast(EnumWithPayload.Tag)); + switch (EnumWithPayload.Tag) + { + case EEnumWithPayloadTag::U8: return HashCombine(TagHash, GetTypeHash(EnumWithPayload.GetAsU8())); + case EEnumWithPayloadTag::U16: return HashCombine(TagHash, GetTypeHash(EnumWithPayload.GetAsU16())); + case EEnumWithPayloadTag::U32: return HashCombine(TagHash, GetTypeHash(EnumWithPayload.GetAsU32())); + case EEnumWithPayloadTag::U64: return HashCombine(TagHash, GetTypeHash(EnumWithPayload.GetAsU64())); + case EEnumWithPayloadTag::U128: return HashCombine(TagHash, GetTypeHash(EnumWithPayload.GetAsU128())); + case EEnumWithPayloadTag::U256: return HashCombine(TagHash, GetTypeHash(EnumWithPayload.GetAsU256())); + case EEnumWithPayloadTag::I8: return HashCombine(TagHash, GetTypeHash(EnumWithPayload.GetAsI8())); + case EEnumWithPayloadTag::I16: return HashCombine(TagHash, GetTypeHash(EnumWithPayload.GetAsI16())); + case EEnumWithPayloadTag::I32: return HashCombine(TagHash, GetTypeHash(EnumWithPayload.GetAsI32())); + case EEnumWithPayloadTag::I64: return HashCombine(TagHash, GetTypeHash(EnumWithPayload.GetAsI64())); + case EEnumWithPayloadTag::I128: return HashCombine(TagHash, GetTypeHash(EnumWithPayload.GetAsI128())); + case EEnumWithPayloadTag::I256: return HashCombine(TagHash, GetTypeHash(EnumWithPayload.GetAsI256())); + case EEnumWithPayloadTag::Bool: return HashCombine(TagHash, GetTypeHash(EnumWithPayload.GetAsBool())); + case EEnumWithPayloadTag::F32: return HashCombine(TagHash, GetTypeHash(EnumWithPayload.GetAsF32())); + case EEnumWithPayloadTag::F64: return HashCombine(TagHash, GetTypeHash(EnumWithPayload.GetAsF64())); + case EEnumWithPayloadTag::Str: return HashCombine(TagHash, GetTypeHash(EnumWithPayload.GetAsStr())); + case EEnumWithPayloadTag::Identity: return HashCombine(TagHash, ::GetTypeHash(EnumWithPayload.GetAsIdentity())); + case EEnumWithPayloadTag::ConnectionId: return HashCombine(TagHash, ::GetTypeHash(EnumWithPayload.GetAsConnectionId())); + case EEnumWithPayloadTag::Timestamp: return HashCombine(TagHash, ::GetTypeHash(EnumWithPayload.GetAsTimestamp())); + case EEnumWithPayloadTag::Bytes: return HashCombine(TagHash, ::GetTypeHash(EnumWithPayload.GetAsBytes())); + case EEnumWithPayloadTag::Ints: return HashCombine(TagHash, ::GetTypeHash(EnumWithPayload.GetAsInts())); + case EEnumWithPayloadTag::Strings: return HashCombine(TagHash, ::GetTypeHash(EnumWithPayload.GetAsStrings())); + case EEnumWithPayloadTag::SimpleEnums: return HashCombine(TagHash, ::GetTypeHash(EnumWithPayload.GetAsSimpleEnums())); + default: return TagHash; + } +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FEnumWithPayloadType); + + UE_SPACETIMEDB_TAGGED_ENUM( + FEnumWithPayloadType, + EEnumWithPayloadTag, + MessageData, + U8, uint8, + U16, uint16, + U32, uint32, + U64, uint64, + U128, FSpacetimeDBUInt128, + U256, FSpacetimeDBUInt256, + I8, int8, + I16, int16, + I32, int32, + I64, int64, + I128, FSpacetimeDBInt128, + I256, FSpacetimeDBInt256, + Bool, bool, + F32, float, + F64, double, + Str, FString, + Identity, FSpacetimeDBIdentity, + ConnectionId, FSpacetimeDBConnectionId, + Timestamp, FSpacetimeDBTimestamp, + Bytes, TArray, + Ints, TArray, + Strings, TArray, + SimpleEnums, TArray + ); +} + +UCLASS() +class TESTCLIENT_API UEnumWithPayloadBpLib : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() + +private: + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|EnumWithPayload") + static FEnumWithPayloadType U8(const uint8& InValue) + { + return FEnumWithPayloadType::U8(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|EnumWithPayload") + static bool IsU8(const FEnumWithPayloadType& InValue) { return InValue.IsU8(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|EnumWithPayload") + static uint8 GetAsU8(const FEnumWithPayloadType& InValue) + { + return InValue.GetAsU8(); + } + + // NOTE: Not exposed to Blueprint because uint16 types are not Blueprint-compatible + static FEnumWithPayloadType U16(const uint16& InValue) + { + return FEnumWithPayloadType::U16(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|EnumWithPayload") + static bool IsU16(const FEnumWithPayloadType& InValue) { return InValue.IsU16(); } + + // NOTE: Not exposed to Blueprint because uint16 types are not Blueprint-compatible + static uint16 GetAsU16(const FEnumWithPayloadType& InValue) + { + return InValue.GetAsU16(); + } + + // NOTE: Not exposed to Blueprint because uint32 types are not Blueprint-compatible + static FEnumWithPayloadType U32(const uint32& InValue) + { + return FEnumWithPayloadType::U32(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|EnumWithPayload") + static bool IsU32(const FEnumWithPayloadType& InValue) { return InValue.IsU32(); } + + // NOTE: Not exposed to Blueprint because uint32 types are not Blueprint-compatible + static uint32 GetAsU32(const FEnumWithPayloadType& InValue) + { + return InValue.GetAsU32(); + } + + // NOTE: Not exposed to Blueprint because uint64 types are not Blueprint-compatible + static FEnumWithPayloadType U64(const uint64& InValue) + { + return FEnumWithPayloadType::U64(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|EnumWithPayload") + static bool IsU64(const FEnumWithPayloadType& InValue) { return InValue.IsU64(); } + + // NOTE: Not exposed to Blueprint because uint64 types are not Blueprint-compatible + static uint64 GetAsU64(const FEnumWithPayloadType& InValue) + { + return InValue.GetAsU64(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|EnumWithPayload") + static FEnumWithPayloadType U128(const FSpacetimeDBUInt128& InValue) + { + return FEnumWithPayloadType::U128(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|EnumWithPayload") + static bool IsU128(const FEnumWithPayloadType& InValue) { return InValue.IsU128(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|EnumWithPayload") + static FSpacetimeDBUInt128 GetAsU128(const FEnumWithPayloadType& InValue) + { + return InValue.GetAsU128(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|EnumWithPayload") + static FEnumWithPayloadType U256(const FSpacetimeDBUInt256& InValue) + { + return FEnumWithPayloadType::U256(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|EnumWithPayload") + static bool IsU256(const FEnumWithPayloadType& InValue) { return InValue.IsU256(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|EnumWithPayload") + static FSpacetimeDBUInt256 GetAsU256(const FEnumWithPayloadType& InValue) + { + return InValue.GetAsU256(); + } + + // NOTE: Not exposed to Blueprint because int8 types are not Blueprint-compatible + static FEnumWithPayloadType I8(const int8& InValue) + { + return FEnumWithPayloadType::I8(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|EnumWithPayload") + static bool IsI8(const FEnumWithPayloadType& InValue) { return InValue.IsI8(); } + + // NOTE: Not exposed to Blueprint because int8 types are not Blueprint-compatible + static int8 GetAsI8(const FEnumWithPayloadType& InValue) + { + return InValue.GetAsI8(); + } + + // NOTE: Not exposed to Blueprint because int16 types are not Blueprint-compatible + static FEnumWithPayloadType I16(const int16& InValue) + { + return FEnumWithPayloadType::I16(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|EnumWithPayload") + static bool IsI16(const FEnumWithPayloadType& InValue) { return InValue.IsI16(); } + + // NOTE: Not exposed to Blueprint because int16 types are not Blueprint-compatible + static int16 GetAsI16(const FEnumWithPayloadType& InValue) + { + return InValue.GetAsI16(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|EnumWithPayload") + static FEnumWithPayloadType I32(const int32& InValue) + { + return FEnumWithPayloadType::I32(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|EnumWithPayload") + static bool IsI32(const FEnumWithPayloadType& InValue) { return InValue.IsI32(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|EnumWithPayload") + static int32 GetAsI32(const FEnumWithPayloadType& InValue) + { + return InValue.GetAsI32(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|EnumWithPayload") + static FEnumWithPayloadType I64(const int64& InValue) + { + return FEnumWithPayloadType::I64(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|EnumWithPayload") + static bool IsI64(const FEnumWithPayloadType& InValue) { return InValue.IsI64(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|EnumWithPayload") + static int64 GetAsI64(const FEnumWithPayloadType& InValue) + { + return InValue.GetAsI64(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|EnumWithPayload") + static FEnumWithPayloadType I128(const FSpacetimeDBInt128& InValue) + { + return FEnumWithPayloadType::I128(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|EnumWithPayload") + static bool IsI128(const FEnumWithPayloadType& InValue) { return InValue.IsI128(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|EnumWithPayload") + static FSpacetimeDBInt128 GetAsI128(const FEnumWithPayloadType& InValue) + { + return InValue.GetAsI128(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|EnumWithPayload") + static FEnumWithPayloadType I256(const FSpacetimeDBInt256& InValue) + { + return FEnumWithPayloadType::I256(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|EnumWithPayload") + static bool IsI256(const FEnumWithPayloadType& InValue) { return InValue.IsI256(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|EnumWithPayload") + static FSpacetimeDBInt256 GetAsI256(const FEnumWithPayloadType& InValue) + { + return InValue.GetAsI256(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|EnumWithPayload") + static FEnumWithPayloadType Bool(const bool& InValue) + { + return FEnumWithPayloadType::Bool(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|EnumWithPayload") + static bool IsBool(const FEnumWithPayloadType& InValue) { return InValue.IsBool(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|EnumWithPayload") + static bool GetAsBool(const FEnumWithPayloadType& InValue) + { + return InValue.GetAsBool(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|EnumWithPayload") + static FEnumWithPayloadType F32(const float& InValue) + { + return FEnumWithPayloadType::F32(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|EnumWithPayload") + static bool IsF32(const FEnumWithPayloadType& InValue) { return InValue.IsF32(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|EnumWithPayload") + static float GetAsF32(const FEnumWithPayloadType& InValue) + { + return InValue.GetAsF32(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|EnumWithPayload") + static FEnumWithPayloadType F64(const double& InValue) + { + return FEnumWithPayloadType::F64(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|EnumWithPayload") + static bool IsF64(const FEnumWithPayloadType& InValue) { return InValue.IsF64(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|EnumWithPayload") + static double GetAsF64(const FEnumWithPayloadType& InValue) + { + return InValue.GetAsF64(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|EnumWithPayload") + static FEnumWithPayloadType Str(const FString& InValue) + { + return FEnumWithPayloadType::Str(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|EnumWithPayload") + static bool IsStr(const FEnumWithPayloadType& InValue) { return InValue.IsStr(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|EnumWithPayload") + static FString GetAsStr(const FEnumWithPayloadType& InValue) + { + return InValue.GetAsStr(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|EnumWithPayload") + static FEnumWithPayloadType Identity(const FSpacetimeDBIdentity& InValue) + { + return FEnumWithPayloadType::Identity(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|EnumWithPayload") + static bool IsIdentity(const FEnumWithPayloadType& InValue) { return InValue.IsIdentity(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|EnumWithPayload") + static FSpacetimeDBIdentity GetAsIdentity(const FEnumWithPayloadType& InValue) + { + return InValue.GetAsIdentity(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|EnumWithPayload") + static FEnumWithPayloadType ConnectionId(const FSpacetimeDBConnectionId& InValue) + { + return FEnumWithPayloadType::ConnectionId(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|EnumWithPayload") + static bool IsConnectionId(const FEnumWithPayloadType& InValue) { return InValue.IsConnectionId(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|EnumWithPayload") + static FSpacetimeDBConnectionId GetAsConnectionId(const FEnumWithPayloadType& InValue) + { + return InValue.GetAsConnectionId(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|EnumWithPayload") + static FEnumWithPayloadType Timestamp(const FSpacetimeDBTimestamp& InValue) + { + return FEnumWithPayloadType::Timestamp(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|EnumWithPayload") + static bool IsTimestamp(const FEnumWithPayloadType& InValue) { return InValue.IsTimestamp(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|EnumWithPayload") + static FSpacetimeDBTimestamp GetAsTimestamp(const FEnumWithPayloadType& InValue) + { + return InValue.GetAsTimestamp(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|EnumWithPayload") + static FEnumWithPayloadType Bytes(const TArray& InValue) + { + return FEnumWithPayloadType::Bytes(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|EnumWithPayload") + static bool IsBytes(const FEnumWithPayloadType& InValue) { return InValue.IsBytes(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|EnumWithPayload") + static TArray GetAsBytes(const FEnumWithPayloadType& InValue) + { + return InValue.GetAsBytes(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|EnumWithPayload") + static FEnumWithPayloadType Ints(const TArray& InValue) + { + return FEnumWithPayloadType::Ints(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|EnumWithPayload") + static bool IsInts(const FEnumWithPayloadType& InValue) { return InValue.IsInts(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|EnumWithPayload") + static TArray GetAsInts(const FEnumWithPayloadType& InValue) + { + return InValue.GetAsInts(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|EnumWithPayload") + static FEnumWithPayloadType Strings(const TArray& InValue) + { + return FEnumWithPayloadType::Strings(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|EnumWithPayload") + static bool IsStrings(const FEnumWithPayloadType& InValue) { return InValue.IsStrings(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|EnumWithPayload") + static TArray GetAsStrings(const FEnumWithPayloadType& InValue) + { + return InValue.GetAsStrings(); + } + + UFUNCTION(BlueprintCallable, Category = "SpacetimeDB|EnumWithPayload") + static FEnumWithPayloadType SimpleEnums(const TArray& InValue) + { + return FEnumWithPayloadType::SimpleEnums(InValue); + } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|EnumWithPayload") + static bool IsSimpleEnums(const FEnumWithPayloadType& InValue) { return InValue.IsSimpleEnums(); } + + UFUNCTION(BlueprintPure, Category = "SpacetimeDB|EnumWithPayload") + static TArray GetAsSimpleEnums(const FEnumWithPayloadType& InValue) + { + return InValue.GetAsSimpleEnums(); + } + +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/EveryPrimitiveStructType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/EveryPrimitiveStructType.g.h new file mode 100644 index 00000000000..ceeb781c6bc --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/EveryPrimitiveStructType.g.h @@ -0,0 +1,122 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "EveryPrimitiveStructType.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FEveryPrimitiveStructType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + uint8 A; + + // NOTE: uint16 field not exposed to Blueprint due to non-blueprintable elements + uint16 B; + + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 C; + + // NOTE: uint64 field not exposed to Blueprint due to non-blueprintable elements + uint64 D; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBUInt128 E; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBUInt256 F; + + // NOTE: int8 field not exposed to Blueprint due to non-blueprintable elements + int8 G; + + // NOTE: int16 field not exposed to Blueprint due to non-blueprintable elements + int16 H; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + int32 I; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + int64 J; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBInt128 K; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBInt256 L; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + bool M; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + float N; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + double O; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FString P; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBIdentity Q; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBConnectionId R; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBTimestamp S; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBTimeDuration T; + + FORCEINLINE bool operator==(const FEveryPrimitiveStructType& Other) const + { + return A == Other.A && B == Other.B && C == Other.C && D == Other.D && E == Other.E && F == Other.F && G == Other.G && H == Other.H && I == Other.I && J == Other.J && K == Other.K && L == Other.L && M == Other.M && N == Other.N && O == Other.O && P == Other.P && Q == Other.Q && R == Other.R && S == Other.S && T == Other.T; + } + + FORCEINLINE bool operator!=(const FEveryPrimitiveStructType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FEveryPrimitiveStructType. + * Combines the hashes of all fields that are compared in operator==. + * @param EveryPrimitiveStructType The FEveryPrimitiveStructType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FEveryPrimitiveStructType& EveryPrimitiveStructType) +{ + uint32 Hash = GetTypeHash(EveryPrimitiveStructType.A); + Hash = HashCombine(Hash, GetTypeHash(EveryPrimitiveStructType.B)); + Hash = HashCombine(Hash, GetTypeHash(EveryPrimitiveStructType.C)); + Hash = HashCombine(Hash, GetTypeHash(EveryPrimitiveStructType.D)); + Hash = HashCombine(Hash, GetTypeHash(EveryPrimitiveStructType.E)); + Hash = HashCombine(Hash, GetTypeHash(EveryPrimitiveStructType.F)); + Hash = HashCombine(Hash, GetTypeHash(EveryPrimitiveStructType.G)); + Hash = HashCombine(Hash, GetTypeHash(EveryPrimitiveStructType.H)); + Hash = HashCombine(Hash, GetTypeHash(EveryPrimitiveStructType.I)); + Hash = HashCombine(Hash, GetTypeHash(EveryPrimitiveStructType.J)); + Hash = HashCombine(Hash, GetTypeHash(EveryPrimitiveStructType.K)); + Hash = HashCombine(Hash, GetTypeHash(EveryPrimitiveStructType.L)); + Hash = HashCombine(Hash, GetTypeHash(EveryPrimitiveStructType.M)); + Hash = HashCombine(Hash, GetTypeHash(EveryPrimitiveStructType.N)); + Hash = HashCombine(Hash, GetTypeHash(EveryPrimitiveStructType.O)); + Hash = HashCombine(Hash, GetTypeHash(EveryPrimitiveStructType.P)); + Hash = HashCombine(Hash, GetTypeHash(EveryPrimitiveStructType.Q)); + Hash = HashCombine(Hash, GetTypeHash(EveryPrimitiveStructType.R)); + Hash = HashCombine(Hash, GetTypeHash(EveryPrimitiveStructType.S)); + Hash = HashCombine(Hash, GetTypeHash(EveryPrimitiveStructType.T)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FEveryPrimitiveStructType); + + UE_SPACETIMEDB_STRUCT(FEveryPrimitiveStructType, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/EveryVecStructType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/EveryVecStructType.g.h new file mode 100644 index 00000000000..21bd955a229 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/EveryVecStructType.g.h @@ -0,0 +1,122 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "EveryVecStructType.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FEveryVecStructType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + TArray A; + + // NOTE: TArray field not exposed to Blueprint due to non-blueprintable elements + TArray B; + + // NOTE: TArray field not exposed to Blueprint due to non-blueprintable elements + TArray C; + + // NOTE: TArray field not exposed to Blueprint due to non-blueprintable elements + TArray D; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + TArray E; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + TArray F; + + // NOTE: TArray field not exposed to Blueprint due to non-blueprintable elements + TArray G; + + // NOTE: TArray field not exposed to Blueprint due to non-blueprintable elements + TArray H; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + TArray I; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + TArray J; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + TArray K; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + TArray L; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + TArray M; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + TArray N; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + TArray O; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + TArray P; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + TArray Q; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + TArray R; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + TArray S; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + TArray T; + + FORCEINLINE bool operator==(const FEveryVecStructType& Other) const + { + return A == Other.A && B == Other.B && C == Other.C && D == Other.D && E == Other.E && F == Other.F && G == Other.G && H == Other.H && I == Other.I && J == Other.J && K == Other.K && L == Other.L && M == Other.M && N == Other.N && O == Other.O && P == Other.P && Q == Other.Q && R == Other.R && S == Other.S && T == Other.T; + } + + FORCEINLINE bool operator!=(const FEveryVecStructType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FEveryVecStructType. + * Combines the hashes of all fields that are compared in operator==. + * @param EveryVecStructType The FEveryVecStructType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FEveryVecStructType& EveryVecStructType) +{ + uint32 Hash = GetTypeHash(EveryVecStructType.A); + Hash = HashCombine(Hash, GetTypeHash(EveryVecStructType.B)); + Hash = HashCombine(Hash, GetTypeHash(EveryVecStructType.C)); + Hash = HashCombine(Hash, GetTypeHash(EveryVecStructType.D)); + Hash = HashCombine(Hash, GetTypeHash(EveryVecStructType.E)); + Hash = HashCombine(Hash, GetTypeHash(EveryVecStructType.F)); + Hash = HashCombine(Hash, GetTypeHash(EveryVecStructType.G)); + Hash = HashCombine(Hash, GetTypeHash(EveryVecStructType.H)); + Hash = HashCombine(Hash, GetTypeHash(EveryVecStructType.I)); + Hash = HashCombine(Hash, GetTypeHash(EveryVecStructType.J)); + Hash = HashCombine(Hash, GetTypeHash(EveryVecStructType.K)); + Hash = HashCombine(Hash, GetTypeHash(EveryVecStructType.L)); + Hash = HashCombine(Hash, GetTypeHash(EveryVecStructType.M)); + Hash = HashCombine(Hash, GetTypeHash(EveryVecStructType.N)); + Hash = HashCombine(Hash, GetTypeHash(EveryVecStructType.O)); + Hash = HashCombine(Hash, GetTypeHash(EveryVecStructType.P)); + Hash = HashCombine(Hash, GetTypeHash(EveryVecStructType.Q)); + Hash = HashCombine(Hash, GetTypeHash(EveryVecStructType.R)); + Hash = HashCombine(Hash, GetTypeHash(EveryVecStructType.S)); + Hash = HashCombine(Hash, GetTypeHash(EveryVecStructType.T)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FEveryVecStructType); + + UE_SPACETIMEDB_STRUCT(FEveryVecStructType, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/IndexedSimpleEnumType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/IndexedSimpleEnumType.g.h new file mode 100644 index 00000000000..d37a8371a2c --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/IndexedSimpleEnumType.g.h @@ -0,0 +1,46 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Types/SimpleEnumType.g.h" +#include "IndexedSimpleEnumType.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FIndexedSimpleEnumType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + ESimpleEnumType N; + + FORCEINLINE bool operator==(const FIndexedSimpleEnumType& Other) const + { + return N == Other.N; + } + + FORCEINLINE bool operator!=(const FIndexedSimpleEnumType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FIndexedSimpleEnumType. + * Combines the hashes of all fields that are compared in operator==. + * @param IndexedSimpleEnumType The FIndexedSimpleEnumType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FIndexedSimpleEnumType& IndexedSimpleEnumType) +{ + uint32 Hash = GetTypeHash(IndexedSimpleEnumType.N); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FIndexedSimpleEnumType); + + UE_SPACETIMEDB_STRUCT(FIndexedSimpleEnumType, N); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/IndexedTable2Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/IndexedTable2Type.g.h new file mode 100644 index 00000000000..f44d4d7e36f --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/IndexedTable2Type.g.h @@ -0,0 +1,49 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "IndexedTable2Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FIndexedTable2Type +{ + GENERATED_BODY() + + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 PlayerId; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + float PlayerSnazz; + + FORCEINLINE bool operator==(const FIndexedTable2Type& Other) const + { + return PlayerId == Other.PlayerId && PlayerSnazz == Other.PlayerSnazz; + } + + FORCEINLINE bool operator!=(const FIndexedTable2Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FIndexedTable2Type. + * Combines the hashes of all fields that are compared in operator==. + * @param IndexedTable2Type The FIndexedTable2Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FIndexedTable2Type& IndexedTable2Type) +{ + uint32 Hash = GetTypeHash(IndexedTable2Type.PlayerId); + Hash = HashCombine(Hash, GetTypeHash(IndexedTable2Type.PlayerSnazz)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FIndexedTable2Type); + + UE_SPACETIMEDB_STRUCT(FIndexedTable2Type, PlayerId, PlayerSnazz); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/IndexedTableType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/IndexedTableType.g.h new file mode 100644 index 00000000000..f0f9cbcfd99 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/IndexedTableType.g.h @@ -0,0 +1,45 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "IndexedTableType.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FIndexedTableType +{ + GENERATED_BODY() + + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 PlayerId; + + FORCEINLINE bool operator==(const FIndexedTableType& Other) const + { + return PlayerId == Other.PlayerId; + } + + FORCEINLINE bool operator!=(const FIndexedTableType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FIndexedTableType. + * Combines the hashes of all fields that are compared in operator==. + * @param IndexedTableType The FIndexedTableType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FIndexedTableType& IndexedTableType) +{ + uint32 Hash = GetTypeHash(IndexedTableType.PlayerId); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FIndexedTableType); + + UE_SPACETIMEDB_STRUCT(FIndexedTableType, PlayerId); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/LargeTableType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/LargeTableType.g.h new file mode 100644 index 00000000000..3b3c738bd11 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/LargeTableType.g.h @@ -0,0 +1,136 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Types/ByteStructType.g.h" +#include "ModuleBindings/Types/EnumWithPayloadType.g.h" +#include "ModuleBindings/Types/EveryPrimitiveStructType.g.h" +#include "ModuleBindings/Types/EveryVecStructType.g.h" +#include "ModuleBindings/Types/SimpleEnumType.g.h" +#include "ModuleBindings/Types/UnitStructType.g.h" +#include "Types/Builtins.h" +#include "LargeTableType.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FLargeTableType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + uint8 A; + + // NOTE: uint16 field not exposed to Blueprint due to non-blueprintable elements + uint16 B; + + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 C; + + // NOTE: uint64 field not exposed to Blueprint due to non-blueprintable elements + uint64 D; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBUInt128 E; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBUInt256 F; + + // NOTE: int8 field not exposed to Blueprint due to non-blueprintable elements + int8 G; + + // NOTE: int16 field not exposed to Blueprint due to non-blueprintable elements + int16 H; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + int32 I; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + int64 J; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBInt128 K; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBInt256 L; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + bool M; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + float N; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + double O; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FString P; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + ESimpleEnumType Q; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FEnumWithPayloadType R; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FUnitStructType S; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FByteStructType T; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FEveryPrimitiveStructType U; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FEveryVecStructType V; + + FORCEINLINE bool operator==(const FLargeTableType& Other) const + { + return A == Other.A && B == Other.B && C == Other.C && D == Other.D && E == Other.E && F == Other.F && G == Other.G && H == Other.H && I == Other.I && J == Other.J && K == Other.K && L == Other.L && M == Other.M && N == Other.N && O == Other.O && P == Other.P && Q == Other.Q && R == Other.R && S == Other.S && T == Other.T && U == Other.U && V == Other.V; + } + + FORCEINLINE bool operator!=(const FLargeTableType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FLargeTableType. + * Combines the hashes of all fields that are compared in operator==. + * @param LargeTableType The FLargeTableType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FLargeTableType& LargeTableType) +{ + uint32 Hash = GetTypeHash(LargeTableType.A); + Hash = HashCombine(Hash, GetTypeHash(LargeTableType.B)); + Hash = HashCombine(Hash, GetTypeHash(LargeTableType.C)); + Hash = HashCombine(Hash, GetTypeHash(LargeTableType.D)); + Hash = HashCombine(Hash, GetTypeHash(LargeTableType.E)); + Hash = HashCombine(Hash, GetTypeHash(LargeTableType.F)); + Hash = HashCombine(Hash, GetTypeHash(LargeTableType.G)); + Hash = HashCombine(Hash, GetTypeHash(LargeTableType.H)); + Hash = HashCombine(Hash, GetTypeHash(LargeTableType.I)); + Hash = HashCombine(Hash, GetTypeHash(LargeTableType.J)); + Hash = HashCombine(Hash, GetTypeHash(LargeTableType.K)); + Hash = HashCombine(Hash, GetTypeHash(LargeTableType.L)); + Hash = HashCombine(Hash, GetTypeHash(LargeTableType.M)); + Hash = HashCombine(Hash, GetTypeHash(LargeTableType.N)); + Hash = HashCombine(Hash, GetTypeHash(LargeTableType.O)); + Hash = HashCombine(Hash, GetTypeHash(LargeTableType.P)); + Hash = HashCombine(Hash, GetTypeHash(LargeTableType.Q)); + Hash = HashCombine(Hash, GetTypeHash(LargeTableType.R)); + Hash = HashCombine(Hash, GetTypeHash(LargeTableType.S)); + Hash = HashCombine(Hash, GetTypeHash(LargeTableType.T)); + Hash = HashCombine(Hash, GetTypeHash(LargeTableType.U)); + Hash = HashCombine(Hash, GetTypeHash(LargeTableType.V)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FLargeTableType); + + UE_SPACETIMEDB_STRUCT(FLargeTableType, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneBoolType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneBoolType.g.h new file mode 100644 index 00000000000..997b2ee7412 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneBoolType.g.h @@ -0,0 +1,45 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "OneBoolType.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FOneBoolType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + bool B; + + FORCEINLINE bool operator==(const FOneBoolType& Other) const + { + return B == Other.B; + } + + FORCEINLINE bool operator!=(const FOneBoolType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FOneBoolType. + * Combines the hashes of all fields that are compared in operator==. + * @param OneBoolType The FOneBoolType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FOneBoolType& OneBoolType) +{ + uint32 Hash = GetTypeHash(OneBoolType.B); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FOneBoolType); + + UE_SPACETIMEDB_STRUCT(FOneBoolType, B); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneByteStructType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneByteStructType.g.h new file mode 100644 index 00000000000..ae6b1821d79 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneByteStructType.g.h @@ -0,0 +1,46 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Types/ByteStructType.g.h" +#include "OneByteStructType.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FOneByteStructType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FByteStructType S; + + FORCEINLINE bool operator==(const FOneByteStructType& Other) const + { + return S == Other.S; + } + + FORCEINLINE bool operator!=(const FOneByteStructType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FOneByteStructType. + * Combines the hashes of all fields that are compared in operator==. + * @param OneByteStructType The FOneByteStructType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FOneByteStructType& OneByteStructType) +{ + uint32 Hash = GetTypeHash(OneByteStructType.S); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FOneByteStructType); + + UE_SPACETIMEDB_STRUCT(FOneByteStructType, S); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneConnectionIdType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneConnectionIdType.g.h new file mode 100644 index 00000000000..985d5c7e294 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneConnectionIdType.g.h @@ -0,0 +1,46 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "OneConnectionIdType.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FOneConnectionIdType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBConnectionId A; + + FORCEINLINE bool operator==(const FOneConnectionIdType& Other) const + { + return A == Other.A; + } + + FORCEINLINE bool operator!=(const FOneConnectionIdType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FOneConnectionIdType. + * Combines the hashes of all fields that are compared in operator==. + * @param OneConnectionIdType The FOneConnectionIdType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FOneConnectionIdType& OneConnectionIdType) +{ + uint32 Hash = GetTypeHash(OneConnectionIdType.A); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FOneConnectionIdType); + + UE_SPACETIMEDB_STRUCT(FOneConnectionIdType, A); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneEnumWithPayloadType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneEnumWithPayloadType.g.h new file mode 100644 index 00000000000..8881cde05a5 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneEnumWithPayloadType.g.h @@ -0,0 +1,46 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Types/EnumWithPayloadType.g.h" +#include "OneEnumWithPayloadType.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FOneEnumWithPayloadType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FEnumWithPayloadType E; + + FORCEINLINE bool operator==(const FOneEnumWithPayloadType& Other) const + { + return E == Other.E; + } + + FORCEINLINE bool operator!=(const FOneEnumWithPayloadType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FOneEnumWithPayloadType. + * Combines the hashes of all fields that are compared in operator==. + * @param OneEnumWithPayloadType The FOneEnumWithPayloadType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FOneEnumWithPayloadType& OneEnumWithPayloadType) +{ + uint32 Hash = GetTypeHash(OneEnumWithPayloadType.E); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FOneEnumWithPayloadType); + + UE_SPACETIMEDB_STRUCT(FOneEnumWithPayloadType, E); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneEveryPrimitiveStructType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneEveryPrimitiveStructType.g.h new file mode 100644 index 00000000000..a718429836d --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneEveryPrimitiveStructType.g.h @@ -0,0 +1,46 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Types/EveryPrimitiveStructType.g.h" +#include "OneEveryPrimitiveStructType.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FOneEveryPrimitiveStructType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FEveryPrimitiveStructType S; + + FORCEINLINE bool operator==(const FOneEveryPrimitiveStructType& Other) const + { + return S == Other.S; + } + + FORCEINLINE bool operator!=(const FOneEveryPrimitiveStructType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FOneEveryPrimitiveStructType. + * Combines the hashes of all fields that are compared in operator==. + * @param OneEveryPrimitiveStructType The FOneEveryPrimitiveStructType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FOneEveryPrimitiveStructType& OneEveryPrimitiveStructType) +{ + uint32 Hash = GetTypeHash(OneEveryPrimitiveStructType.S); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FOneEveryPrimitiveStructType); + + UE_SPACETIMEDB_STRUCT(FOneEveryPrimitiveStructType, S); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneEveryVecStructType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneEveryVecStructType.g.h new file mode 100644 index 00000000000..1e69544c0b6 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneEveryVecStructType.g.h @@ -0,0 +1,46 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Types/EveryVecStructType.g.h" +#include "OneEveryVecStructType.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FOneEveryVecStructType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FEveryVecStructType S; + + FORCEINLINE bool operator==(const FOneEveryVecStructType& Other) const + { + return S == Other.S; + } + + FORCEINLINE bool operator!=(const FOneEveryVecStructType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FOneEveryVecStructType. + * Combines the hashes of all fields that are compared in operator==. + * @param OneEveryVecStructType The FOneEveryVecStructType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FOneEveryVecStructType& OneEveryVecStructType) +{ + uint32 Hash = GetTypeHash(OneEveryVecStructType.S); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FOneEveryVecStructType); + + UE_SPACETIMEDB_STRUCT(FOneEveryVecStructType, S); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneF32Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneF32Type.g.h new file mode 100644 index 00000000000..0d35debb7ae --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneF32Type.g.h @@ -0,0 +1,45 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "OneF32Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FOneF32Type +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + float F; + + FORCEINLINE bool operator==(const FOneF32Type& Other) const + { + return F == Other.F; + } + + FORCEINLINE bool operator!=(const FOneF32Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FOneF32Type. + * Combines the hashes of all fields that are compared in operator==. + * @param OneF32Type The FOneF32Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FOneF32Type& OneF32Type) +{ + uint32 Hash = GetTypeHash(OneF32Type.F); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FOneF32Type); + + UE_SPACETIMEDB_STRUCT(FOneF32Type, F); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneF64Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneF64Type.g.h new file mode 100644 index 00000000000..edcb8cc8935 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneF64Type.g.h @@ -0,0 +1,45 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "OneF64Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FOneF64Type +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + double F; + + FORCEINLINE bool operator==(const FOneF64Type& Other) const + { + return F == Other.F; + } + + FORCEINLINE bool operator!=(const FOneF64Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FOneF64Type. + * Combines the hashes of all fields that are compared in operator==. + * @param OneF64Type The FOneF64Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FOneF64Type& OneF64Type) +{ + uint32 Hash = GetTypeHash(OneF64Type.F); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FOneF64Type); + + UE_SPACETIMEDB_STRUCT(FOneF64Type, F); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneI128Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneI128Type.g.h new file mode 100644 index 00000000000..d9a5c461ecc --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneI128Type.g.h @@ -0,0 +1,46 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "OneI128Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FOneI128Type +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBInt128 N; + + FORCEINLINE bool operator==(const FOneI128Type& Other) const + { + return N == Other.N; + } + + FORCEINLINE bool operator!=(const FOneI128Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FOneI128Type. + * Combines the hashes of all fields that are compared in operator==. + * @param OneI128Type The FOneI128Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FOneI128Type& OneI128Type) +{ + uint32 Hash = GetTypeHash(OneI128Type.N); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FOneI128Type); + + UE_SPACETIMEDB_STRUCT(FOneI128Type, N); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneI16Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneI16Type.g.h new file mode 100644 index 00000000000..390b7eef361 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneI16Type.g.h @@ -0,0 +1,45 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "OneI16Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FOneI16Type +{ + GENERATED_BODY() + + // NOTE: int16 field not exposed to Blueprint due to non-blueprintable elements + int16 N; + + FORCEINLINE bool operator==(const FOneI16Type& Other) const + { + return N == Other.N; + } + + FORCEINLINE bool operator!=(const FOneI16Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FOneI16Type. + * Combines the hashes of all fields that are compared in operator==. + * @param OneI16Type The FOneI16Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FOneI16Type& OneI16Type) +{ + uint32 Hash = GetTypeHash(OneI16Type.N); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FOneI16Type); + + UE_SPACETIMEDB_STRUCT(FOneI16Type, N); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneI256Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneI256Type.g.h new file mode 100644 index 00000000000..41a905f8f0d --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneI256Type.g.h @@ -0,0 +1,46 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "OneI256Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FOneI256Type +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBInt256 N; + + FORCEINLINE bool operator==(const FOneI256Type& Other) const + { + return N == Other.N; + } + + FORCEINLINE bool operator!=(const FOneI256Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FOneI256Type. + * Combines the hashes of all fields that are compared in operator==. + * @param OneI256Type The FOneI256Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FOneI256Type& OneI256Type) +{ + uint32 Hash = GetTypeHash(OneI256Type.N); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FOneI256Type); + + UE_SPACETIMEDB_STRUCT(FOneI256Type, N); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneI32Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneI32Type.g.h new file mode 100644 index 00000000000..cebea651c2f --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneI32Type.g.h @@ -0,0 +1,45 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "OneI32Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FOneI32Type +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + int32 N; + + FORCEINLINE bool operator==(const FOneI32Type& Other) const + { + return N == Other.N; + } + + FORCEINLINE bool operator!=(const FOneI32Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FOneI32Type. + * Combines the hashes of all fields that are compared in operator==. + * @param OneI32Type The FOneI32Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FOneI32Type& OneI32Type) +{ + uint32 Hash = GetTypeHash(OneI32Type.N); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FOneI32Type); + + UE_SPACETIMEDB_STRUCT(FOneI32Type, N); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneI64Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneI64Type.g.h new file mode 100644 index 00000000000..6869fd4556f --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneI64Type.g.h @@ -0,0 +1,45 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "OneI64Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FOneI64Type +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + int64 N; + + FORCEINLINE bool operator==(const FOneI64Type& Other) const + { + return N == Other.N; + } + + FORCEINLINE bool operator!=(const FOneI64Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FOneI64Type. + * Combines the hashes of all fields that are compared in operator==. + * @param OneI64Type The FOneI64Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FOneI64Type& OneI64Type) +{ + uint32 Hash = GetTypeHash(OneI64Type.N); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FOneI64Type); + + UE_SPACETIMEDB_STRUCT(FOneI64Type, N); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneI8Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneI8Type.g.h new file mode 100644 index 00000000000..5caeb4ebde8 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneI8Type.g.h @@ -0,0 +1,45 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "OneI8Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FOneI8Type +{ + GENERATED_BODY() + + // NOTE: int8 field not exposed to Blueprint due to non-blueprintable elements + int8 N; + + FORCEINLINE bool operator==(const FOneI8Type& Other) const + { + return N == Other.N; + } + + FORCEINLINE bool operator!=(const FOneI8Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FOneI8Type. + * Combines the hashes of all fields that are compared in operator==. + * @param OneI8Type The FOneI8Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FOneI8Type& OneI8Type) +{ + uint32 Hash = GetTypeHash(OneI8Type.N); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FOneI8Type); + + UE_SPACETIMEDB_STRUCT(FOneI8Type, N); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneIdentityType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneIdentityType.g.h new file mode 100644 index 00000000000..21061fd7ba0 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneIdentityType.g.h @@ -0,0 +1,46 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "OneIdentityType.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FOneIdentityType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBIdentity I; + + FORCEINLINE bool operator==(const FOneIdentityType& Other) const + { + return I == Other.I; + } + + FORCEINLINE bool operator!=(const FOneIdentityType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FOneIdentityType. + * Combines the hashes of all fields that are compared in operator==. + * @param OneIdentityType The FOneIdentityType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FOneIdentityType& OneIdentityType) +{ + uint32 Hash = GetTypeHash(OneIdentityType.I); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FOneIdentityType); + + UE_SPACETIMEDB_STRUCT(FOneIdentityType, I); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneSimpleEnumType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneSimpleEnumType.g.h new file mode 100644 index 00000000000..420cb2ef7b1 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneSimpleEnumType.g.h @@ -0,0 +1,46 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Types/SimpleEnumType.g.h" +#include "OneSimpleEnumType.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FOneSimpleEnumType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + ESimpleEnumType E; + + FORCEINLINE bool operator==(const FOneSimpleEnumType& Other) const + { + return E == Other.E; + } + + FORCEINLINE bool operator!=(const FOneSimpleEnumType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FOneSimpleEnumType. + * Combines the hashes of all fields that are compared in operator==. + * @param OneSimpleEnumType The FOneSimpleEnumType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FOneSimpleEnumType& OneSimpleEnumType) +{ + uint32 Hash = GetTypeHash(OneSimpleEnumType.E); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FOneSimpleEnumType); + + UE_SPACETIMEDB_STRUCT(FOneSimpleEnumType, E); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneStringType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneStringType.g.h new file mode 100644 index 00000000000..819dc0a61a8 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneStringType.g.h @@ -0,0 +1,45 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "OneStringType.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FOneStringType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FString S; + + FORCEINLINE bool operator==(const FOneStringType& Other) const + { + return S == Other.S; + } + + FORCEINLINE bool operator!=(const FOneStringType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FOneStringType. + * Combines the hashes of all fields that are compared in operator==. + * @param OneStringType The FOneStringType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FOneStringType& OneStringType) +{ + uint32 Hash = GetTypeHash(OneStringType.S); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FOneStringType); + + UE_SPACETIMEDB_STRUCT(FOneStringType, S); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneTimestampType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneTimestampType.g.h new file mode 100644 index 00000000000..01385d872f4 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneTimestampType.g.h @@ -0,0 +1,46 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "OneTimestampType.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FOneTimestampType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBTimestamp T; + + FORCEINLINE bool operator==(const FOneTimestampType& Other) const + { + return T == Other.T; + } + + FORCEINLINE bool operator!=(const FOneTimestampType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FOneTimestampType. + * Combines the hashes of all fields that are compared in operator==. + * @param OneTimestampType The FOneTimestampType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FOneTimestampType& OneTimestampType) +{ + uint32 Hash = GetTypeHash(OneTimestampType.T); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FOneTimestampType); + + UE_SPACETIMEDB_STRUCT(FOneTimestampType, T); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneU128Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneU128Type.g.h new file mode 100644 index 00000000000..d59eceb477b --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneU128Type.g.h @@ -0,0 +1,46 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "OneU128Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FOneU128Type +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBUInt128 N; + + FORCEINLINE bool operator==(const FOneU128Type& Other) const + { + return N == Other.N; + } + + FORCEINLINE bool operator!=(const FOneU128Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FOneU128Type. + * Combines the hashes of all fields that are compared in operator==. + * @param OneU128Type The FOneU128Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FOneU128Type& OneU128Type) +{ + uint32 Hash = GetTypeHash(OneU128Type.N); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FOneU128Type); + + UE_SPACETIMEDB_STRUCT(FOneU128Type, N); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneU16Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneU16Type.g.h new file mode 100644 index 00000000000..8b4a2818ad8 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneU16Type.g.h @@ -0,0 +1,45 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "OneU16Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FOneU16Type +{ + GENERATED_BODY() + + // NOTE: uint16 field not exposed to Blueprint due to non-blueprintable elements + uint16 N; + + FORCEINLINE bool operator==(const FOneU16Type& Other) const + { + return N == Other.N; + } + + FORCEINLINE bool operator!=(const FOneU16Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FOneU16Type. + * Combines the hashes of all fields that are compared in operator==. + * @param OneU16Type The FOneU16Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FOneU16Type& OneU16Type) +{ + uint32 Hash = GetTypeHash(OneU16Type.N); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FOneU16Type); + + UE_SPACETIMEDB_STRUCT(FOneU16Type, N); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneU256Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneU256Type.g.h new file mode 100644 index 00000000000..ed1af06da03 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneU256Type.g.h @@ -0,0 +1,46 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "OneU256Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FOneU256Type +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBUInt256 N; + + FORCEINLINE bool operator==(const FOneU256Type& Other) const + { + return N == Other.N; + } + + FORCEINLINE bool operator!=(const FOneU256Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FOneU256Type. + * Combines the hashes of all fields that are compared in operator==. + * @param OneU256Type The FOneU256Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FOneU256Type& OneU256Type) +{ + uint32 Hash = GetTypeHash(OneU256Type.N); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FOneU256Type); + + UE_SPACETIMEDB_STRUCT(FOneU256Type, N); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneU32Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneU32Type.g.h new file mode 100644 index 00000000000..28a344af18a --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneU32Type.g.h @@ -0,0 +1,45 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "OneU32Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FOneU32Type +{ + GENERATED_BODY() + + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 N; + + FORCEINLINE bool operator==(const FOneU32Type& Other) const + { + return N == Other.N; + } + + FORCEINLINE bool operator!=(const FOneU32Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FOneU32Type. + * Combines the hashes of all fields that are compared in operator==. + * @param OneU32Type The FOneU32Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FOneU32Type& OneU32Type) +{ + uint32 Hash = GetTypeHash(OneU32Type.N); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FOneU32Type); + + UE_SPACETIMEDB_STRUCT(FOneU32Type, N); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneU64Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneU64Type.g.h new file mode 100644 index 00000000000..774ffbf0136 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneU64Type.g.h @@ -0,0 +1,45 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "OneU64Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FOneU64Type +{ + GENERATED_BODY() + + // NOTE: uint64 field not exposed to Blueprint due to non-blueprintable elements + uint64 N; + + FORCEINLINE bool operator==(const FOneU64Type& Other) const + { + return N == Other.N; + } + + FORCEINLINE bool operator!=(const FOneU64Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FOneU64Type. + * Combines the hashes of all fields that are compared in operator==. + * @param OneU64Type The FOneU64Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FOneU64Type& OneU64Type) +{ + uint32 Hash = GetTypeHash(OneU64Type.N); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FOneU64Type); + + UE_SPACETIMEDB_STRUCT(FOneU64Type, N); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneU8Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneU8Type.g.h new file mode 100644 index 00000000000..12654e007f1 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneU8Type.g.h @@ -0,0 +1,45 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "OneU8Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FOneU8Type +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + uint8 N; + + FORCEINLINE bool operator==(const FOneU8Type& Other) const + { + return N == Other.N; + } + + FORCEINLINE bool operator!=(const FOneU8Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FOneU8Type. + * Combines the hashes of all fields that are compared in operator==. + * @param OneU8Type The FOneU8Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FOneU8Type& OneU8Type) +{ + uint32 Hash = GetTypeHash(OneU8Type.N); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FOneU8Type); + + UE_SPACETIMEDB_STRUCT(FOneU8Type, N); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneUnitStructType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneUnitStructType.g.h new file mode 100644 index 00000000000..14d8874a29b --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OneUnitStructType.g.h @@ -0,0 +1,46 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Types/UnitStructType.g.h" +#include "OneUnitStructType.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FOneUnitStructType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FUnitStructType S; + + FORCEINLINE bool operator==(const FOneUnitStructType& Other) const + { + return S == Other.S; + } + + FORCEINLINE bool operator!=(const FOneUnitStructType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FOneUnitStructType. + * Combines the hashes of all fields that are compared in operator==. + * @param OneUnitStructType The FOneUnitStructType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FOneUnitStructType& OneUnitStructType) +{ + uint32 Hash = GetTypeHash(OneUnitStructType.S); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FOneUnitStructType); + + UE_SPACETIMEDB_STRUCT(FOneUnitStructType, S); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OptionEveryPrimitiveStructType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OptionEveryPrimitiveStructType.g.h new file mode 100644 index 00000000000..c8e86173caf --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OptionEveryPrimitiveStructType.g.h @@ -0,0 +1,47 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Optionals/TestClientOptionalEveryPrimitiveStruct.g.h" +#include "ModuleBindings/Types/EveryPrimitiveStructType.g.h" +#include "OptionEveryPrimitiveStructType.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FOptionEveryPrimitiveStructType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FTestClientOptionalEveryPrimitiveStruct S; + + FORCEINLINE bool operator==(const FOptionEveryPrimitiveStructType& Other) const + { + return S == Other.S; + } + + FORCEINLINE bool operator!=(const FOptionEveryPrimitiveStructType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FOptionEveryPrimitiveStructType. + * Combines the hashes of all fields that are compared in operator==. + * @param OptionEveryPrimitiveStructType The FOptionEveryPrimitiveStructType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FOptionEveryPrimitiveStructType& OptionEveryPrimitiveStructType) +{ + uint32 Hash = GetTypeHash(OptionEveryPrimitiveStructType.S); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FOptionEveryPrimitiveStructType); + + UE_SPACETIMEDB_STRUCT(FOptionEveryPrimitiveStructType, S); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OptionI32Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OptionI32Type.g.h new file mode 100644 index 00000000000..816647ac7b2 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OptionI32Type.g.h @@ -0,0 +1,46 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Optionals/TestClientOptionalInt32.g.h" +#include "OptionI32Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FOptionI32Type +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FTestClientOptionalInt32 N; + + FORCEINLINE bool operator==(const FOptionI32Type& Other) const + { + return N == Other.N; + } + + FORCEINLINE bool operator!=(const FOptionI32Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FOptionI32Type. + * Combines the hashes of all fields that are compared in operator==. + * @param OptionI32Type The FOptionI32Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FOptionI32Type& OptionI32Type) +{ + uint32 Hash = GetTypeHash(OptionI32Type.N); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FOptionI32Type); + + UE_SPACETIMEDB_STRUCT(FOptionI32Type, N); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OptionIdentityType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OptionIdentityType.g.h new file mode 100644 index 00000000000..dd13c53c98a --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OptionIdentityType.g.h @@ -0,0 +1,47 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Optionals/TestClientOptionalIdentity.g.h" +#include "Types/Builtins.h" +#include "OptionIdentityType.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FOptionIdentityType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FTestClientOptionalIdentity I; + + FORCEINLINE bool operator==(const FOptionIdentityType& Other) const + { + return I == Other.I; + } + + FORCEINLINE bool operator!=(const FOptionIdentityType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FOptionIdentityType. + * Combines the hashes of all fields that are compared in operator==. + * @param OptionIdentityType The FOptionIdentityType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FOptionIdentityType& OptionIdentityType) +{ + uint32 Hash = GetTypeHash(OptionIdentityType.I); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FOptionIdentityType); + + UE_SPACETIMEDB_STRUCT(FOptionIdentityType, I); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OptionSimpleEnumType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OptionSimpleEnumType.g.h new file mode 100644 index 00000000000..5a4288652c2 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OptionSimpleEnumType.g.h @@ -0,0 +1,47 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Optionals/TestClientOptionalSimpleEnum.g.h" +#include "ModuleBindings/Types/SimpleEnumType.g.h" +#include "OptionSimpleEnumType.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FOptionSimpleEnumType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FTestClientOptionalSimpleEnum E; + + FORCEINLINE bool operator==(const FOptionSimpleEnumType& Other) const + { + return E == Other.E; + } + + FORCEINLINE bool operator!=(const FOptionSimpleEnumType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FOptionSimpleEnumType. + * Combines the hashes of all fields that are compared in operator==. + * @param OptionSimpleEnumType The FOptionSimpleEnumType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FOptionSimpleEnumType& OptionSimpleEnumType) +{ + uint32 Hash = GetTypeHash(OptionSimpleEnumType.E); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FOptionSimpleEnumType); + + UE_SPACETIMEDB_STRUCT(FOptionSimpleEnumType, E); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OptionStringType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OptionStringType.g.h new file mode 100644 index 00000000000..c987c0ff6ef --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OptionStringType.g.h @@ -0,0 +1,46 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Optionals/TestClientOptionalString.g.h" +#include "OptionStringType.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FOptionStringType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FTestClientOptionalString S; + + FORCEINLINE bool operator==(const FOptionStringType& Other) const + { + return S == Other.S; + } + + FORCEINLINE bool operator!=(const FOptionStringType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FOptionStringType. + * Combines the hashes of all fields that are compared in operator==. + * @param OptionStringType The FOptionStringType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FOptionStringType& OptionStringType) +{ + uint32 Hash = GetTypeHash(OptionStringType.S); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FOptionStringType); + + UE_SPACETIMEDB_STRUCT(FOptionStringType, S); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OptionVecOptionI32Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OptionVecOptionI32Type.g.h new file mode 100644 index 00000000000..e9ad2a8fab2 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/OptionVecOptionI32Type.g.h @@ -0,0 +1,47 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Optionals/TestClientOptionalInt32.g.h" +#include "ModuleBindings/Optionals/TestClientOptionalVecInt32.g.h" +#include "OptionVecOptionI32Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FOptionVecOptionI32Type +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FTestClientOptionalVecInt32 V; + + FORCEINLINE bool operator==(const FOptionVecOptionI32Type& Other) const + { + return V == Other.V; + } + + FORCEINLINE bool operator!=(const FOptionVecOptionI32Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FOptionVecOptionI32Type. + * Combines the hashes of all fields that are compared in operator==. + * @param OptionVecOptionI32Type The FOptionVecOptionI32Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FOptionVecOptionI32Type& OptionVecOptionI32Type) +{ + uint32 Hash = GetTypeHash(OptionVecOptionI32Type.V); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FOptionVecOptionI32Type); + + UE_SPACETIMEDB_STRUCT(FOptionVecOptionI32Type, V); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkBoolType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkBoolType.g.h new file mode 100644 index 00000000000..28f9dfd8496 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkBoolType.g.h @@ -0,0 +1,49 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "PkBoolType.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FPkBoolType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + bool B; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + int32 Data; + + FORCEINLINE bool operator==(const FPkBoolType& Other) const + { + return B == Other.B && Data == Other.Data; + } + + FORCEINLINE bool operator!=(const FPkBoolType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FPkBoolType. + * Combines the hashes of all fields that are compared in operator==. + * @param PkBoolType The FPkBoolType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FPkBoolType& PkBoolType) +{ + uint32 Hash = GetTypeHash(PkBoolType.B); + Hash = HashCombine(Hash, GetTypeHash(PkBoolType.Data)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FPkBoolType); + + UE_SPACETIMEDB_STRUCT(FPkBoolType, B, Data); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkConnectionIdType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkConnectionIdType.g.h new file mode 100644 index 00000000000..937b6719706 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkConnectionIdType.g.h @@ -0,0 +1,50 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "PkConnectionIdType.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FPkConnectionIdType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBConnectionId A; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + int32 Data; + + FORCEINLINE bool operator==(const FPkConnectionIdType& Other) const + { + return A == Other.A && Data == Other.Data; + } + + FORCEINLINE bool operator!=(const FPkConnectionIdType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FPkConnectionIdType. + * Combines the hashes of all fields that are compared in operator==. + * @param PkConnectionIdType The FPkConnectionIdType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FPkConnectionIdType& PkConnectionIdType) +{ + uint32 Hash = GetTypeHash(PkConnectionIdType.A); + Hash = HashCombine(Hash, GetTypeHash(PkConnectionIdType.Data)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FPkConnectionIdType); + + UE_SPACETIMEDB_STRUCT(FPkConnectionIdType, A, Data); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkI128Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkI128Type.g.h new file mode 100644 index 00000000000..b864cf43bd5 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkI128Type.g.h @@ -0,0 +1,50 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "PkI128Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FPkI128Type +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBInt128 N; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + int32 Data; + + FORCEINLINE bool operator==(const FPkI128Type& Other) const + { + return N == Other.N && Data == Other.Data; + } + + FORCEINLINE bool operator!=(const FPkI128Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FPkI128Type. + * Combines the hashes of all fields that are compared in operator==. + * @param PkI128Type The FPkI128Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FPkI128Type& PkI128Type) +{ + uint32 Hash = GetTypeHash(PkI128Type.N); + Hash = HashCombine(Hash, GetTypeHash(PkI128Type.Data)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FPkI128Type); + + UE_SPACETIMEDB_STRUCT(FPkI128Type, N, Data); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkI16Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkI16Type.g.h new file mode 100644 index 00000000000..01b1a6bd627 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkI16Type.g.h @@ -0,0 +1,49 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "PkI16Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FPkI16Type +{ + GENERATED_BODY() + + // NOTE: int16 field not exposed to Blueprint due to non-blueprintable elements + int16 N; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + int32 Data; + + FORCEINLINE bool operator==(const FPkI16Type& Other) const + { + return N == Other.N && Data == Other.Data; + } + + FORCEINLINE bool operator!=(const FPkI16Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FPkI16Type. + * Combines the hashes of all fields that are compared in operator==. + * @param PkI16Type The FPkI16Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FPkI16Type& PkI16Type) +{ + uint32 Hash = GetTypeHash(PkI16Type.N); + Hash = HashCombine(Hash, GetTypeHash(PkI16Type.Data)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FPkI16Type); + + UE_SPACETIMEDB_STRUCT(FPkI16Type, N, Data); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkI256Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkI256Type.g.h new file mode 100644 index 00000000000..a5227b23820 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkI256Type.g.h @@ -0,0 +1,50 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "PkI256Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FPkI256Type +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBInt256 N; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + int32 Data; + + FORCEINLINE bool operator==(const FPkI256Type& Other) const + { + return N == Other.N && Data == Other.Data; + } + + FORCEINLINE bool operator!=(const FPkI256Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FPkI256Type. + * Combines the hashes of all fields that are compared in operator==. + * @param PkI256Type The FPkI256Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FPkI256Type& PkI256Type) +{ + uint32 Hash = GetTypeHash(PkI256Type.N); + Hash = HashCombine(Hash, GetTypeHash(PkI256Type.Data)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FPkI256Type); + + UE_SPACETIMEDB_STRUCT(FPkI256Type, N, Data); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkI32Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkI32Type.g.h new file mode 100644 index 00000000000..91686213b6e --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkI32Type.g.h @@ -0,0 +1,49 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "PkI32Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FPkI32Type +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + int32 N; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + int32 Data; + + FORCEINLINE bool operator==(const FPkI32Type& Other) const + { + return N == Other.N && Data == Other.Data; + } + + FORCEINLINE bool operator!=(const FPkI32Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FPkI32Type. + * Combines the hashes of all fields that are compared in operator==. + * @param PkI32Type The FPkI32Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FPkI32Type& PkI32Type) +{ + uint32 Hash = GetTypeHash(PkI32Type.N); + Hash = HashCombine(Hash, GetTypeHash(PkI32Type.Data)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FPkI32Type); + + UE_SPACETIMEDB_STRUCT(FPkI32Type, N, Data); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkI64Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkI64Type.g.h new file mode 100644 index 00000000000..23aed92eaa7 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkI64Type.g.h @@ -0,0 +1,49 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "PkI64Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FPkI64Type +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + int64 N; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + int32 Data; + + FORCEINLINE bool operator==(const FPkI64Type& Other) const + { + return N == Other.N && Data == Other.Data; + } + + FORCEINLINE bool operator!=(const FPkI64Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FPkI64Type. + * Combines the hashes of all fields that are compared in operator==. + * @param PkI64Type The FPkI64Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FPkI64Type& PkI64Type) +{ + uint32 Hash = GetTypeHash(PkI64Type.N); + Hash = HashCombine(Hash, GetTypeHash(PkI64Type.Data)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FPkI64Type); + + UE_SPACETIMEDB_STRUCT(FPkI64Type, N, Data); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkI8Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkI8Type.g.h new file mode 100644 index 00000000000..ea699c62dd4 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkI8Type.g.h @@ -0,0 +1,49 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "PkI8Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FPkI8Type +{ + GENERATED_BODY() + + // NOTE: int8 field not exposed to Blueprint due to non-blueprintable elements + int8 N; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + int32 Data; + + FORCEINLINE bool operator==(const FPkI8Type& Other) const + { + return N == Other.N && Data == Other.Data; + } + + FORCEINLINE bool operator!=(const FPkI8Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FPkI8Type. + * Combines the hashes of all fields that are compared in operator==. + * @param PkI8Type The FPkI8Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FPkI8Type& PkI8Type) +{ + uint32 Hash = GetTypeHash(PkI8Type.N); + Hash = HashCombine(Hash, GetTypeHash(PkI8Type.Data)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FPkI8Type); + + UE_SPACETIMEDB_STRUCT(FPkI8Type, N, Data); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkIdentityType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkIdentityType.g.h new file mode 100644 index 00000000000..1780628d3c3 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkIdentityType.g.h @@ -0,0 +1,50 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "PkIdentityType.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FPkIdentityType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBIdentity I; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + int32 Data; + + FORCEINLINE bool operator==(const FPkIdentityType& Other) const + { + return I == Other.I && Data == Other.Data; + } + + FORCEINLINE bool operator!=(const FPkIdentityType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FPkIdentityType. + * Combines the hashes of all fields that are compared in operator==. + * @param PkIdentityType The FPkIdentityType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FPkIdentityType& PkIdentityType) +{ + uint32 Hash = GetTypeHash(PkIdentityType.I); + Hash = HashCombine(Hash, GetTypeHash(PkIdentityType.Data)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FPkIdentityType); + + UE_SPACETIMEDB_STRUCT(FPkIdentityType, I, Data); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkSimpleEnumType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkSimpleEnumType.g.h new file mode 100644 index 00000000000..6eeb604f9ae --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkSimpleEnumType.g.h @@ -0,0 +1,50 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Types/SimpleEnumType.g.h" +#include "PkSimpleEnumType.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FPkSimpleEnumType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + ESimpleEnumType A; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + int32 Data; + + FORCEINLINE bool operator==(const FPkSimpleEnumType& Other) const + { + return A == Other.A && Data == Other.Data; + } + + FORCEINLINE bool operator!=(const FPkSimpleEnumType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FPkSimpleEnumType. + * Combines the hashes of all fields that are compared in operator==. + * @param PkSimpleEnumType The FPkSimpleEnumType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FPkSimpleEnumType& PkSimpleEnumType) +{ + uint32 Hash = GetTypeHash(PkSimpleEnumType.A); + Hash = HashCombine(Hash, GetTypeHash(PkSimpleEnumType.Data)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FPkSimpleEnumType); + + UE_SPACETIMEDB_STRUCT(FPkSimpleEnumType, A, Data); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkStringType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkStringType.g.h new file mode 100644 index 00000000000..80ac1e09a3d --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkStringType.g.h @@ -0,0 +1,49 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "PkStringType.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FPkStringType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FString S; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + int32 Data; + + FORCEINLINE bool operator==(const FPkStringType& Other) const + { + return S == Other.S && Data == Other.Data; + } + + FORCEINLINE bool operator!=(const FPkStringType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FPkStringType. + * Combines the hashes of all fields that are compared in operator==. + * @param PkStringType The FPkStringType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FPkStringType& PkStringType) +{ + uint32 Hash = GetTypeHash(PkStringType.S); + Hash = HashCombine(Hash, GetTypeHash(PkStringType.Data)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FPkStringType); + + UE_SPACETIMEDB_STRUCT(FPkStringType, S, Data); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkU128Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkU128Type.g.h new file mode 100644 index 00000000000..4b6249df30f --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkU128Type.g.h @@ -0,0 +1,50 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "PkU128Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FPkU128Type +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBUInt128 N; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + int32 Data; + + FORCEINLINE bool operator==(const FPkU128Type& Other) const + { + return N == Other.N && Data == Other.Data; + } + + FORCEINLINE bool operator!=(const FPkU128Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FPkU128Type. + * Combines the hashes of all fields that are compared in operator==. + * @param PkU128Type The FPkU128Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FPkU128Type& PkU128Type) +{ + uint32 Hash = GetTypeHash(PkU128Type.N); + Hash = HashCombine(Hash, GetTypeHash(PkU128Type.Data)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FPkU128Type); + + UE_SPACETIMEDB_STRUCT(FPkU128Type, N, Data); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkU16Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkU16Type.g.h new file mode 100644 index 00000000000..403ba574cc6 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkU16Type.g.h @@ -0,0 +1,49 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "PkU16Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FPkU16Type +{ + GENERATED_BODY() + + // NOTE: uint16 field not exposed to Blueprint due to non-blueprintable elements + uint16 N; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + int32 Data; + + FORCEINLINE bool operator==(const FPkU16Type& Other) const + { + return N == Other.N && Data == Other.Data; + } + + FORCEINLINE bool operator!=(const FPkU16Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FPkU16Type. + * Combines the hashes of all fields that are compared in operator==. + * @param PkU16Type The FPkU16Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FPkU16Type& PkU16Type) +{ + uint32 Hash = GetTypeHash(PkU16Type.N); + Hash = HashCombine(Hash, GetTypeHash(PkU16Type.Data)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FPkU16Type); + + UE_SPACETIMEDB_STRUCT(FPkU16Type, N, Data); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkU256Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkU256Type.g.h new file mode 100644 index 00000000000..4f02f8514ff --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkU256Type.g.h @@ -0,0 +1,50 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "PkU256Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FPkU256Type +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBUInt256 N; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + int32 Data; + + FORCEINLINE bool operator==(const FPkU256Type& Other) const + { + return N == Other.N && Data == Other.Data; + } + + FORCEINLINE bool operator!=(const FPkU256Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FPkU256Type. + * Combines the hashes of all fields that are compared in operator==. + * @param PkU256Type The FPkU256Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FPkU256Type& PkU256Type) +{ + uint32 Hash = GetTypeHash(PkU256Type.N); + Hash = HashCombine(Hash, GetTypeHash(PkU256Type.Data)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FPkU256Type); + + UE_SPACETIMEDB_STRUCT(FPkU256Type, N, Data); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkU32TwoType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkU32TwoType.g.h new file mode 100644 index 00000000000..80f2a43afa7 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkU32TwoType.g.h @@ -0,0 +1,49 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "PkU32TwoType.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FPkU32TwoType +{ + GENERATED_BODY() + + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 N; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + int32 Data; + + FORCEINLINE bool operator==(const FPkU32TwoType& Other) const + { + return N == Other.N && Data == Other.Data; + } + + FORCEINLINE bool operator!=(const FPkU32TwoType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FPkU32TwoType. + * Combines the hashes of all fields that are compared in operator==. + * @param PkU32TwoType The FPkU32TwoType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FPkU32TwoType& PkU32TwoType) +{ + uint32 Hash = GetTypeHash(PkU32TwoType.N); + Hash = HashCombine(Hash, GetTypeHash(PkU32TwoType.Data)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FPkU32TwoType); + + UE_SPACETIMEDB_STRUCT(FPkU32TwoType, N, Data); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkU32Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkU32Type.g.h new file mode 100644 index 00000000000..fd519c7d2f8 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkU32Type.g.h @@ -0,0 +1,49 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "PkU32Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FPkU32Type +{ + GENERATED_BODY() + + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 N; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + int32 Data; + + FORCEINLINE bool operator==(const FPkU32Type& Other) const + { + return N == Other.N && Data == Other.Data; + } + + FORCEINLINE bool operator!=(const FPkU32Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FPkU32Type. + * Combines the hashes of all fields that are compared in operator==. + * @param PkU32Type The FPkU32Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FPkU32Type& PkU32Type) +{ + uint32 Hash = GetTypeHash(PkU32Type.N); + Hash = HashCombine(Hash, GetTypeHash(PkU32Type.Data)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FPkU32Type); + + UE_SPACETIMEDB_STRUCT(FPkU32Type, N, Data); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkU64Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkU64Type.g.h new file mode 100644 index 00000000000..08e0ac70d88 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkU64Type.g.h @@ -0,0 +1,49 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "PkU64Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FPkU64Type +{ + GENERATED_BODY() + + // NOTE: uint64 field not exposed to Blueprint due to non-blueprintable elements + uint64 N; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + int32 Data; + + FORCEINLINE bool operator==(const FPkU64Type& Other) const + { + return N == Other.N && Data == Other.Data; + } + + FORCEINLINE bool operator!=(const FPkU64Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FPkU64Type. + * Combines the hashes of all fields that are compared in operator==. + * @param PkU64Type The FPkU64Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FPkU64Type& PkU64Type) +{ + uint32 Hash = GetTypeHash(PkU64Type.N); + Hash = HashCombine(Hash, GetTypeHash(PkU64Type.Data)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FPkU64Type); + + UE_SPACETIMEDB_STRUCT(FPkU64Type, N, Data); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkU8Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkU8Type.g.h new file mode 100644 index 00000000000..39411f021da --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/PkU8Type.g.h @@ -0,0 +1,49 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "PkU8Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FPkU8Type +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + uint8 N; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + int32 Data; + + FORCEINLINE bool operator==(const FPkU8Type& Other) const + { + return N == Other.N && Data == Other.Data; + } + + FORCEINLINE bool operator!=(const FPkU8Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FPkU8Type. + * Combines the hashes of all fields that are compared in operator==. + * @param PkU8Type The FPkU8Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FPkU8Type& PkU8Type) +{ + uint32 Hash = GetTypeHash(PkU8Type.N); + Hash = HashCombine(Hash, GetTypeHash(PkU8Type.Data)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FPkU8Type); + + UE_SPACETIMEDB_STRUCT(FPkU8Type, N, Data); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/ScheduledTableType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/ScheduledTableType.g.h new file mode 100644 index 00000000000..d9efbe77124 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/ScheduledTableType.g.h @@ -0,0 +1,54 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "ScheduledTableType.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FScheduledTableType +{ + GENERATED_BODY() + + // NOTE: uint64 field not exposed to Blueprint due to non-blueprintable elements + uint64 ScheduledId; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBScheduleAt ScheduledAt; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FString Text; + + FORCEINLINE bool operator==(const FScheduledTableType& Other) const + { + return ScheduledId == Other.ScheduledId && ScheduledAt == Other.ScheduledAt && Text == Other.Text; + } + + FORCEINLINE bool operator!=(const FScheduledTableType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FScheduledTableType. + * Combines the hashes of all fields that are compared in operator==. + * @param ScheduledTableType The FScheduledTableType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FScheduledTableType& ScheduledTableType) +{ + uint32 Hash = GetTypeHash(ScheduledTableType.ScheduledId); + Hash = HashCombine(Hash, GetTypeHash(ScheduledTableType.ScheduledAt)); + Hash = HashCombine(Hash, GetTypeHash(ScheduledTableType.Text)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FScheduledTableType); + + UE_SPACETIMEDB_STRUCT(FScheduledTableType, ScheduledId, ScheduledAt, Text); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/SimpleEnumType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/SimpleEnumType.g.h new file mode 100644 index 00000000000..50e28fbcf4d --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/SimpleEnumType.g.h @@ -0,0 +1,20 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "SimpleEnumType.g.generated.h" + +UENUM(BlueprintType) +enum class ESimpleEnumType : uint8 +{ + Zero, + One, + Two, +}; + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(ESimpleEnumType); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/TableHoldsTableType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/TableHoldsTableType.g.h new file mode 100644 index 00000000000..24c04cd8e8a --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/TableHoldsTableType.g.h @@ -0,0 +1,51 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Types/OneU8Type.g.h" +#include "ModuleBindings/Types/VecU8Type.g.h" +#include "TableHoldsTableType.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FTableHoldsTableType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FOneU8Type A; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FVecU8Type B; + + FORCEINLINE bool operator==(const FTableHoldsTableType& Other) const + { + return A == Other.A && B == Other.B; + } + + FORCEINLINE bool operator!=(const FTableHoldsTableType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FTableHoldsTableType. + * Combines the hashes of all fields that are compared in operator==. + * @param TableHoldsTableType The FTableHoldsTableType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FTableHoldsTableType& TableHoldsTableType) +{ + uint32 Hash = GetTypeHash(TableHoldsTableType.A); + Hash = HashCombine(Hash, GetTypeHash(TableHoldsTableType.B)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FTableHoldsTableType); + + UE_SPACETIMEDB_STRUCT(FTableHoldsTableType, A, B); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UniqueBoolType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UniqueBoolType.g.h new file mode 100644 index 00000000000..9573051c5e7 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UniqueBoolType.g.h @@ -0,0 +1,49 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "UniqueBoolType.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUniqueBoolType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + bool B; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + int32 Data; + + FORCEINLINE bool operator==(const FUniqueBoolType& Other) const + { + return B == Other.B && Data == Other.Data; + } + + FORCEINLINE bool operator!=(const FUniqueBoolType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FUniqueBoolType. + * Combines the hashes of all fields that are compared in operator==. + * @param UniqueBoolType The FUniqueBoolType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FUniqueBoolType& UniqueBoolType) +{ + uint32 Hash = GetTypeHash(UniqueBoolType.B); + Hash = HashCombine(Hash, GetTypeHash(UniqueBoolType.Data)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FUniqueBoolType); + + UE_SPACETIMEDB_STRUCT(FUniqueBoolType, B, Data); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UniqueConnectionIdType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UniqueConnectionIdType.g.h new file mode 100644 index 00000000000..323c4973122 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UniqueConnectionIdType.g.h @@ -0,0 +1,50 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "UniqueConnectionIdType.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUniqueConnectionIdType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBConnectionId A; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + int32 Data; + + FORCEINLINE bool operator==(const FUniqueConnectionIdType& Other) const + { + return A == Other.A && Data == Other.Data; + } + + FORCEINLINE bool operator!=(const FUniqueConnectionIdType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FUniqueConnectionIdType. + * Combines the hashes of all fields that are compared in operator==. + * @param UniqueConnectionIdType The FUniqueConnectionIdType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FUniqueConnectionIdType& UniqueConnectionIdType) +{ + uint32 Hash = GetTypeHash(UniqueConnectionIdType.A); + Hash = HashCombine(Hash, GetTypeHash(UniqueConnectionIdType.Data)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FUniqueConnectionIdType); + + UE_SPACETIMEDB_STRUCT(FUniqueConnectionIdType, A, Data); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UniqueI128Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UniqueI128Type.g.h new file mode 100644 index 00000000000..3df3e1281cd --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UniqueI128Type.g.h @@ -0,0 +1,50 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "UniqueI128Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUniqueI128Type +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBInt128 N; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + int32 Data; + + FORCEINLINE bool operator==(const FUniqueI128Type& Other) const + { + return N == Other.N && Data == Other.Data; + } + + FORCEINLINE bool operator!=(const FUniqueI128Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FUniqueI128Type. + * Combines the hashes of all fields that are compared in operator==. + * @param UniqueI128Type The FUniqueI128Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FUniqueI128Type& UniqueI128Type) +{ + uint32 Hash = GetTypeHash(UniqueI128Type.N); + Hash = HashCombine(Hash, GetTypeHash(UniqueI128Type.Data)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FUniqueI128Type); + + UE_SPACETIMEDB_STRUCT(FUniqueI128Type, N, Data); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UniqueI16Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UniqueI16Type.g.h new file mode 100644 index 00000000000..eaba7b9c89d --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UniqueI16Type.g.h @@ -0,0 +1,49 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "UniqueI16Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUniqueI16Type +{ + GENERATED_BODY() + + // NOTE: int16 field not exposed to Blueprint due to non-blueprintable elements + int16 N; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + int32 Data; + + FORCEINLINE bool operator==(const FUniqueI16Type& Other) const + { + return N == Other.N && Data == Other.Data; + } + + FORCEINLINE bool operator!=(const FUniqueI16Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FUniqueI16Type. + * Combines the hashes of all fields that are compared in operator==. + * @param UniqueI16Type The FUniqueI16Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FUniqueI16Type& UniqueI16Type) +{ + uint32 Hash = GetTypeHash(UniqueI16Type.N); + Hash = HashCombine(Hash, GetTypeHash(UniqueI16Type.Data)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FUniqueI16Type); + + UE_SPACETIMEDB_STRUCT(FUniqueI16Type, N, Data); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UniqueI256Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UniqueI256Type.g.h new file mode 100644 index 00000000000..fda2efc1788 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UniqueI256Type.g.h @@ -0,0 +1,50 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "UniqueI256Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUniqueI256Type +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBInt256 N; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + int32 Data; + + FORCEINLINE bool operator==(const FUniqueI256Type& Other) const + { + return N == Other.N && Data == Other.Data; + } + + FORCEINLINE bool operator!=(const FUniqueI256Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FUniqueI256Type. + * Combines the hashes of all fields that are compared in operator==. + * @param UniqueI256Type The FUniqueI256Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FUniqueI256Type& UniqueI256Type) +{ + uint32 Hash = GetTypeHash(UniqueI256Type.N); + Hash = HashCombine(Hash, GetTypeHash(UniqueI256Type.Data)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FUniqueI256Type); + + UE_SPACETIMEDB_STRUCT(FUniqueI256Type, N, Data); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UniqueI32Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UniqueI32Type.g.h new file mode 100644 index 00000000000..2f9f85fd091 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UniqueI32Type.g.h @@ -0,0 +1,49 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "UniqueI32Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUniqueI32Type +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + int32 N; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + int32 Data; + + FORCEINLINE bool operator==(const FUniqueI32Type& Other) const + { + return N == Other.N && Data == Other.Data; + } + + FORCEINLINE bool operator!=(const FUniqueI32Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FUniqueI32Type. + * Combines the hashes of all fields that are compared in operator==. + * @param UniqueI32Type The FUniqueI32Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FUniqueI32Type& UniqueI32Type) +{ + uint32 Hash = GetTypeHash(UniqueI32Type.N); + Hash = HashCombine(Hash, GetTypeHash(UniqueI32Type.Data)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FUniqueI32Type); + + UE_SPACETIMEDB_STRUCT(FUniqueI32Type, N, Data); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UniqueI64Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UniqueI64Type.g.h new file mode 100644 index 00000000000..6b3a74852fb --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UniqueI64Type.g.h @@ -0,0 +1,49 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "UniqueI64Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUniqueI64Type +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + int64 N; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + int32 Data; + + FORCEINLINE bool operator==(const FUniqueI64Type& Other) const + { + return N == Other.N && Data == Other.Data; + } + + FORCEINLINE bool operator!=(const FUniqueI64Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FUniqueI64Type. + * Combines the hashes of all fields that are compared in operator==. + * @param UniqueI64Type The FUniqueI64Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FUniqueI64Type& UniqueI64Type) +{ + uint32 Hash = GetTypeHash(UniqueI64Type.N); + Hash = HashCombine(Hash, GetTypeHash(UniqueI64Type.Data)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FUniqueI64Type); + + UE_SPACETIMEDB_STRUCT(FUniqueI64Type, N, Data); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UniqueI8Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UniqueI8Type.g.h new file mode 100644 index 00000000000..7dd7945204c --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UniqueI8Type.g.h @@ -0,0 +1,49 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "UniqueI8Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUniqueI8Type +{ + GENERATED_BODY() + + // NOTE: int8 field not exposed to Blueprint due to non-blueprintable elements + int8 N; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + int32 Data; + + FORCEINLINE bool operator==(const FUniqueI8Type& Other) const + { + return N == Other.N && Data == Other.Data; + } + + FORCEINLINE bool operator!=(const FUniqueI8Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FUniqueI8Type. + * Combines the hashes of all fields that are compared in operator==. + * @param UniqueI8Type The FUniqueI8Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FUniqueI8Type& UniqueI8Type) +{ + uint32 Hash = GetTypeHash(UniqueI8Type.N); + Hash = HashCombine(Hash, GetTypeHash(UniqueI8Type.Data)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FUniqueI8Type); + + UE_SPACETIMEDB_STRUCT(FUniqueI8Type, N, Data); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UniqueIdentityType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UniqueIdentityType.g.h new file mode 100644 index 00000000000..2ca11423ee1 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UniqueIdentityType.g.h @@ -0,0 +1,50 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "UniqueIdentityType.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUniqueIdentityType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBIdentity I; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + int32 Data; + + FORCEINLINE bool operator==(const FUniqueIdentityType& Other) const + { + return I == Other.I && Data == Other.Data; + } + + FORCEINLINE bool operator!=(const FUniqueIdentityType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FUniqueIdentityType. + * Combines the hashes of all fields that are compared in operator==. + * @param UniqueIdentityType The FUniqueIdentityType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FUniqueIdentityType& UniqueIdentityType) +{ + uint32 Hash = GetTypeHash(UniqueIdentityType.I); + Hash = HashCombine(Hash, GetTypeHash(UniqueIdentityType.Data)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FUniqueIdentityType); + + UE_SPACETIMEDB_STRUCT(FUniqueIdentityType, I, Data); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UniqueStringType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UniqueStringType.g.h new file mode 100644 index 00000000000..692d8ec71d6 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UniqueStringType.g.h @@ -0,0 +1,49 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "UniqueStringType.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUniqueStringType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FString S; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + int32 Data; + + FORCEINLINE bool operator==(const FUniqueStringType& Other) const + { + return S == Other.S && Data == Other.Data; + } + + FORCEINLINE bool operator!=(const FUniqueStringType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FUniqueStringType. + * Combines the hashes of all fields that are compared in operator==. + * @param UniqueStringType The FUniqueStringType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FUniqueStringType& UniqueStringType) +{ + uint32 Hash = GetTypeHash(UniqueStringType.S); + Hash = HashCombine(Hash, GetTypeHash(UniqueStringType.Data)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FUniqueStringType); + + UE_SPACETIMEDB_STRUCT(FUniqueStringType, S, Data); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UniqueU128Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UniqueU128Type.g.h new file mode 100644 index 00000000000..1ca9a1cd055 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UniqueU128Type.g.h @@ -0,0 +1,50 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "UniqueU128Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUniqueU128Type +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBUInt128 N; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + int32 Data; + + FORCEINLINE bool operator==(const FUniqueU128Type& Other) const + { + return N == Other.N && Data == Other.Data; + } + + FORCEINLINE bool operator!=(const FUniqueU128Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FUniqueU128Type. + * Combines the hashes of all fields that are compared in operator==. + * @param UniqueU128Type The FUniqueU128Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FUniqueU128Type& UniqueU128Type) +{ + uint32 Hash = GetTypeHash(UniqueU128Type.N); + Hash = HashCombine(Hash, GetTypeHash(UniqueU128Type.Data)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FUniqueU128Type); + + UE_SPACETIMEDB_STRUCT(FUniqueU128Type, N, Data); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UniqueU16Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UniqueU16Type.g.h new file mode 100644 index 00000000000..8fa330a27b2 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UniqueU16Type.g.h @@ -0,0 +1,49 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "UniqueU16Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUniqueU16Type +{ + GENERATED_BODY() + + // NOTE: uint16 field not exposed to Blueprint due to non-blueprintable elements + uint16 N; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + int32 Data; + + FORCEINLINE bool operator==(const FUniqueU16Type& Other) const + { + return N == Other.N && Data == Other.Data; + } + + FORCEINLINE bool operator!=(const FUniqueU16Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FUniqueU16Type. + * Combines the hashes of all fields that are compared in operator==. + * @param UniqueU16Type The FUniqueU16Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FUniqueU16Type& UniqueU16Type) +{ + uint32 Hash = GetTypeHash(UniqueU16Type.N); + Hash = HashCombine(Hash, GetTypeHash(UniqueU16Type.Data)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FUniqueU16Type); + + UE_SPACETIMEDB_STRUCT(FUniqueU16Type, N, Data); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UniqueU256Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UniqueU256Type.g.h new file mode 100644 index 00000000000..325b40517c8 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UniqueU256Type.g.h @@ -0,0 +1,50 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "UniqueU256Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUniqueU256Type +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBUInt256 N; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + int32 Data; + + FORCEINLINE bool operator==(const FUniqueU256Type& Other) const + { + return N == Other.N && Data == Other.Data; + } + + FORCEINLINE bool operator!=(const FUniqueU256Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FUniqueU256Type. + * Combines the hashes of all fields that are compared in operator==. + * @param UniqueU256Type The FUniqueU256Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FUniqueU256Type& UniqueU256Type) +{ + uint32 Hash = GetTypeHash(UniqueU256Type.N); + Hash = HashCombine(Hash, GetTypeHash(UniqueU256Type.Data)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FUniqueU256Type); + + UE_SPACETIMEDB_STRUCT(FUniqueU256Type, N, Data); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UniqueU32Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UniqueU32Type.g.h new file mode 100644 index 00000000000..c1590316243 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UniqueU32Type.g.h @@ -0,0 +1,49 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "UniqueU32Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUniqueU32Type +{ + GENERATED_BODY() + + // NOTE: uint32 field not exposed to Blueprint due to non-blueprintable elements + uint32 N; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + int32 Data; + + FORCEINLINE bool operator==(const FUniqueU32Type& Other) const + { + return N == Other.N && Data == Other.Data; + } + + FORCEINLINE bool operator!=(const FUniqueU32Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FUniqueU32Type. + * Combines the hashes of all fields that are compared in operator==. + * @param UniqueU32Type The FUniqueU32Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FUniqueU32Type& UniqueU32Type) +{ + uint32 Hash = GetTypeHash(UniqueU32Type.N); + Hash = HashCombine(Hash, GetTypeHash(UniqueU32Type.Data)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FUniqueU32Type); + + UE_SPACETIMEDB_STRUCT(FUniqueU32Type, N, Data); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UniqueU64Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UniqueU64Type.g.h new file mode 100644 index 00000000000..2bf72db1597 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UniqueU64Type.g.h @@ -0,0 +1,49 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "UniqueU64Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUniqueU64Type +{ + GENERATED_BODY() + + // NOTE: uint64 field not exposed to Blueprint due to non-blueprintable elements + uint64 N; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + int32 Data; + + FORCEINLINE bool operator==(const FUniqueU64Type& Other) const + { + return N == Other.N && Data == Other.Data; + } + + FORCEINLINE bool operator!=(const FUniqueU64Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FUniqueU64Type. + * Combines the hashes of all fields that are compared in operator==. + * @param UniqueU64Type The FUniqueU64Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FUniqueU64Type& UniqueU64Type) +{ + uint32 Hash = GetTypeHash(UniqueU64Type.N); + Hash = HashCombine(Hash, GetTypeHash(UniqueU64Type.Data)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FUniqueU64Type); + + UE_SPACETIMEDB_STRUCT(FUniqueU64Type, N, Data); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UniqueU8Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UniqueU8Type.g.h new file mode 100644 index 00000000000..e75d6047ae7 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UniqueU8Type.g.h @@ -0,0 +1,49 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "UniqueU8Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUniqueU8Type +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + uint8 N; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + int32 Data; + + FORCEINLINE bool operator==(const FUniqueU8Type& Other) const + { + return N == Other.N && Data == Other.Data; + } + + FORCEINLINE bool operator!=(const FUniqueU8Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FUniqueU8Type. + * Combines the hashes of all fields that are compared in operator==. + * @param UniqueU8Type The FUniqueU8Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FUniqueU8Type& UniqueU8Type) +{ + uint32 Hash = GetTypeHash(UniqueU8Type.N); + Hash = HashCombine(Hash, GetTypeHash(UniqueU8Type.Data)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FUniqueU8Type); + + UE_SPACETIMEDB_STRUCT(FUniqueU8Type, N, Data); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UnitStructType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UnitStructType.g.h new file mode 100644 index 00000000000..ddf559322d2 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UnitStructType.g.h @@ -0,0 +1,41 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "UnitStructType.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUnitStructType +{ + GENERATED_BODY() + + FORCEINLINE bool operator==(const FUnitStructType& Other) const + { + return true; + } + + FORCEINLINE bool operator!=(const FUnitStructType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FUnitStructType. + * Combines the hashes of all fields that are compared in operator==. + * @param UnitStructType The FUnitStructType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FUnitStructType& UnitStructType) +{ + return 0; // Empty struct +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FUnitStructType); + + UE_SPACETIMEDB_STRUCT_EMPTY(FUnitStructType); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UsersType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UsersType.g.h new file mode 100644 index 00000000000..0c01824536b --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/UsersType.g.h @@ -0,0 +1,50 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "UsersType.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FUsersType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FSpacetimeDBIdentity Identity; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + FString Name; + + FORCEINLINE bool operator==(const FUsersType& Other) const + { + return Identity == Other.Identity && Name == Other.Name; + } + + FORCEINLINE bool operator!=(const FUsersType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FUsersType. + * Combines the hashes of all fields that are compared in operator==. + * @param UsersType The FUsersType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FUsersType& UsersType) +{ + uint32 Hash = GetTypeHash(UsersType.Identity); + Hash = HashCombine(Hash, GetTypeHash(UsersType.Name)); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FUsersType); + + UE_SPACETIMEDB_STRUCT(FUsersType, Identity, Name); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecBoolType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecBoolType.g.h new file mode 100644 index 00000000000..96a709c725a --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecBoolType.g.h @@ -0,0 +1,45 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "VecBoolType.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FVecBoolType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + TArray B; + + FORCEINLINE bool operator==(const FVecBoolType& Other) const + { + return B == Other.B; + } + + FORCEINLINE bool operator!=(const FVecBoolType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FVecBoolType. + * Combines the hashes of all fields that are compared in operator==. + * @param VecBoolType The FVecBoolType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FVecBoolType& VecBoolType) +{ + uint32 Hash = GetTypeHash(VecBoolType.B); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FVecBoolType); + + UE_SPACETIMEDB_STRUCT(FVecBoolType, B); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecByteStructType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecByteStructType.g.h new file mode 100644 index 00000000000..c4e82aa0125 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecByteStructType.g.h @@ -0,0 +1,46 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Types/ByteStructType.g.h" +#include "VecByteStructType.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FVecByteStructType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + TArray S; + + FORCEINLINE bool operator==(const FVecByteStructType& Other) const + { + return S == Other.S; + } + + FORCEINLINE bool operator!=(const FVecByteStructType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FVecByteStructType. + * Combines the hashes of all fields that are compared in operator==. + * @param VecByteStructType The FVecByteStructType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FVecByteStructType& VecByteStructType) +{ + uint32 Hash = GetTypeHash(VecByteStructType.S); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FVecByteStructType); + + UE_SPACETIMEDB_STRUCT(FVecByteStructType, S); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecConnectionIdType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecConnectionIdType.g.h new file mode 100644 index 00000000000..fdb3e137a40 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecConnectionIdType.g.h @@ -0,0 +1,46 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "VecConnectionIdType.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FVecConnectionIdType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + TArray A; + + FORCEINLINE bool operator==(const FVecConnectionIdType& Other) const + { + return A == Other.A; + } + + FORCEINLINE bool operator!=(const FVecConnectionIdType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FVecConnectionIdType. + * Combines the hashes of all fields that are compared in operator==. + * @param VecConnectionIdType The FVecConnectionIdType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FVecConnectionIdType& VecConnectionIdType) +{ + uint32 Hash = GetTypeHash(VecConnectionIdType.A); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FVecConnectionIdType); + + UE_SPACETIMEDB_STRUCT(FVecConnectionIdType, A); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecEnumWithPayloadType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecEnumWithPayloadType.g.h new file mode 100644 index 00000000000..0e59456f9a3 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecEnumWithPayloadType.g.h @@ -0,0 +1,46 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Types/EnumWithPayloadType.g.h" +#include "VecEnumWithPayloadType.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FVecEnumWithPayloadType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + TArray E; + + FORCEINLINE bool operator==(const FVecEnumWithPayloadType& Other) const + { + return E == Other.E; + } + + FORCEINLINE bool operator!=(const FVecEnumWithPayloadType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FVecEnumWithPayloadType. + * Combines the hashes of all fields that are compared in operator==. + * @param VecEnumWithPayloadType The FVecEnumWithPayloadType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FVecEnumWithPayloadType& VecEnumWithPayloadType) +{ + uint32 Hash = GetTypeHash(VecEnumWithPayloadType.E); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FVecEnumWithPayloadType); + + UE_SPACETIMEDB_STRUCT(FVecEnumWithPayloadType, E); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecEveryPrimitiveStructType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecEveryPrimitiveStructType.g.h new file mode 100644 index 00000000000..ddde6988c24 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecEveryPrimitiveStructType.g.h @@ -0,0 +1,46 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Types/EveryPrimitiveStructType.g.h" +#include "VecEveryPrimitiveStructType.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FVecEveryPrimitiveStructType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + TArray S; + + FORCEINLINE bool operator==(const FVecEveryPrimitiveStructType& Other) const + { + return S == Other.S; + } + + FORCEINLINE bool operator!=(const FVecEveryPrimitiveStructType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FVecEveryPrimitiveStructType. + * Combines the hashes of all fields that are compared in operator==. + * @param VecEveryPrimitiveStructType The FVecEveryPrimitiveStructType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FVecEveryPrimitiveStructType& VecEveryPrimitiveStructType) +{ + uint32 Hash = GetTypeHash(VecEveryPrimitiveStructType.S); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FVecEveryPrimitiveStructType); + + UE_SPACETIMEDB_STRUCT(FVecEveryPrimitiveStructType, S); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecEveryVecStructType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecEveryVecStructType.g.h new file mode 100644 index 00000000000..49a7190e0cc --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecEveryVecStructType.g.h @@ -0,0 +1,46 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Types/EveryVecStructType.g.h" +#include "VecEveryVecStructType.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FVecEveryVecStructType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + TArray S; + + FORCEINLINE bool operator==(const FVecEveryVecStructType& Other) const + { + return S == Other.S; + } + + FORCEINLINE bool operator!=(const FVecEveryVecStructType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FVecEveryVecStructType. + * Combines the hashes of all fields that are compared in operator==. + * @param VecEveryVecStructType The FVecEveryVecStructType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FVecEveryVecStructType& VecEveryVecStructType) +{ + uint32 Hash = GetTypeHash(VecEveryVecStructType.S); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FVecEveryVecStructType); + + UE_SPACETIMEDB_STRUCT(FVecEveryVecStructType, S); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecF32Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecF32Type.g.h new file mode 100644 index 00000000000..6df73fd442b --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecF32Type.g.h @@ -0,0 +1,45 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "VecF32Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FVecF32Type +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + TArray F; + + FORCEINLINE bool operator==(const FVecF32Type& Other) const + { + return F == Other.F; + } + + FORCEINLINE bool operator!=(const FVecF32Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FVecF32Type. + * Combines the hashes of all fields that are compared in operator==. + * @param VecF32Type The FVecF32Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FVecF32Type& VecF32Type) +{ + uint32 Hash = GetTypeHash(VecF32Type.F); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FVecF32Type); + + UE_SPACETIMEDB_STRUCT(FVecF32Type, F); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecF64Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecF64Type.g.h new file mode 100644 index 00000000000..0874cb772d6 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecF64Type.g.h @@ -0,0 +1,45 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "VecF64Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FVecF64Type +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + TArray F; + + FORCEINLINE bool operator==(const FVecF64Type& Other) const + { + return F == Other.F; + } + + FORCEINLINE bool operator!=(const FVecF64Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FVecF64Type. + * Combines the hashes of all fields that are compared in operator==. + * @param VecF64Type The FVecF64Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FVecF64Type& VecF64Type) +{ + uint32 Hash = GetTypeHash(VecF64Type.F); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FVecF64Type); + + UE_SPACETIMEDB_STRUCT(FVecF64Type, F); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecI128Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecI128Type.g.h new file mode 100644 index 00000000000..19e275d8287 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecI128Type.g.h @@ -0,0 +1,46 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "VecI128Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FVecI128Type +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + TArray N; + + FORCEINLINE bool operator==(const FVecI128Type& Other) const + { + return N == Other.N; + } + + FORCEINLINE bool operator!=(const FVecI128Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FVecI128Type. + * Combines the hashes of all fields that are compared in operator==. + * @param VecI128Type The FVecI128Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FVecI128Type& VecI128Type) +{ + uint32 Hash = GetTypeHash(VecI128Type.N); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FVecI128Type); + + UE_SPACETIMEDB_STRUCT(FVecI128Type, N); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecI16Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecI16Type.g.h new file mode 100644 index 00000000000..4fee66d6e15 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecI16Type.g.h @@ -0,0 +1,45 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "VecI16Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FVecI16Type +{ + GENERATED_BODY() + + // NOTE: TArray field not exposed to Blueprint due to non-blueprintable elements + TArray N; + + FORCEINLINE bool operator==(const FVecI16Type& Other) const + { + return N == Other.N; + } + + FORCEINLINE bool operator!=(const FVecI16Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FVecI16Type. + * Combines the hashes of all fields that are compared in operator==. + * @param VecI16Type The FVecI16Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FVecI16Type& VecI16Type) +{ + uint32 Hash = GetTypeHash(VecI16Type.N); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FVecI16Type); + + UE_SPACETIMEDB_STRUCT(FVecI16Type, N); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecI256Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecI256Type.g.h new file mode 100644 index 00000000000..5f27cb11992 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecI256Type.g.h @@ -0,0 +1,46 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "VecI256Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FVecI256Type +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + TArray N; + + FORCEINLINE bool operator==(const FVecI256Type& Other) const + { + return N == Other.N; + } + + FORCEINLINE bool operator!=(const FVecI256Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FVecI256Type. + * Combines the hashes of all fields that are compared in operator==. + * @param VecI256Type The FVecI256Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FVecI256Type& VecI256Type) +{ + uint32 Hash = GetTypeHash(VecI256Type.N); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FVecI256Type); + + UE_SPACETIMEDB_STRUCT(FVecI256Type, N); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecI32Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecI32Type.g.h new file mode 100644 index 00000000000..e4993bb98b8 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecI32Type.g.h @@ -0,0 +1,45 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "VecI32Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FVecI32Type +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + TArray N; + + FORCEINLINE bool operator==(const FVecI32Type& Other) const + { + return N == Other.N; + } + + FORCEINLINE bool operator!=(const FVecI32Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FVecI32Type. + * Combines the hashes of all fields that are compared in operator==. + * @param VecI32Type The FVecI32Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FVecI32Type& VecI32Type) +{ + uint32 Hash = GetTypeHash(VecI32Type.N); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FVecI32Type); + + UE_SPACETIMEDB_STRUCT(FVecI32Type, N); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecI64Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecI64Type.g.h new file mode 100644 index 00000000000..0d9da364d14 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecI64Type.g.h @@ -0,0 +1,45 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "VecI64Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FVecI64Type +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + TArray N; + + FORCEINLINE bool operator==(const FVecI64Type& Other) const + { + return N == Other.N; + } + + FORCEINLINE bool operator!=(const FVecI64Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FVecI64Type. + * Combines the hashes of all fields that are compared in operator==. + * @param VecI64Type The FVecI64Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FVecI64Type& VecI64Type) +{ + uint32 Hash = GetTypeHash(VecI64Type.N); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FVecI64Type); + + UE_SPACETIMEDB_STRUCT(FVecI64Type, N); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecI8Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecI8Type.g.h new file mode 100644 index 00000000000..9762470161f --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecI8Type.g.h @@ -0,0 +1,45 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "VecI8Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FVecI8Type +{ + GENERATED_BODY() + + // NOTE: TArray field not exposed to Blueprint due to non-blueprintable elements + TArray N; + + FORCEINLINE bool operator==(const FVecI8Type& Other) const + { + return N == Other.N; + } + + FORCEINLINE bool operator!=(const FVecI8Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FVecI8Type. + * Combines the hashes of all fields that are compared in operator==. + * @param VecI8Type The FVecI8Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FVecI8Type& VecI8Type) +{ + uint32 Hash = GetTypeHash(VecI8Type.N); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FVecI8Type); + + UE_SPACETIMEDB_STRUCT(FVecI8Type, N); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecIdentityType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecIdentityType.g.h new file mode 100644 index 00000000000..bbaed87ee43 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecIdentityType.g.h @@ -0,0 +1,46 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "VecIdentityType.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FVecIdentityType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + TArray I; + + FORCEINLINE bool operator==(const FVecIdentityType& Other) const + { + return I == Other.I; + } + + FORCEINLINE bool operator!=(const FVecIdentityType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FVecIdentityType. + * Combines the hashes of all fields that are compared in operator==. + * @param VecIdentityType The FVecIdentityType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FVecIdentityType& VecIdentityType) +{ + uint32 Hash = GetTypeHash(VecIdentityType.I); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FVecIdentityType); + + UE_SPACETIMEDB_STRUCT(FVecIdentityType, I); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecSimpleEnumType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecSimpleEnumType.g.h new file mode 100644 index 00000000000..8f654ac887e --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecSimpleEnumType.g.h @@ -0,0 +1,46 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Types/SimpleEnumType.g.h" +#include "VecSimpleEnumType.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FVecSimpleEnumType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + TArray E; + + FORCEINLINE bool operator==(const FVecSimpleEnumType& Other) const + { + return E == Other.E; + } + + FORCEINLINE bool operator!=(const FVecSimpleEnumType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FVecSimpleEnumType. + * Combines the hashes of all fields that are compared in operator==. + * @param VecSimpleEnumType The FVecSimpleEnumType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FVecSimpleEnumType& VecSimpleEnumType) +{ + uint32 Hash = GetTypeHash(VecSimpleEnumType.E); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FVecSimpleEnumType); + + UE_SPACETIMEDB_STRUCT(FVecSimpleEnumType, E); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecStringType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecStringType.g.h new file mode 100644 index 00000000000..c3aeab8388a --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecStringType.g.h @@ -0,0 +1,45 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "VecStringType.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FVecStringType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + TArray S; + + FORCEINLINE bool operator==(const FVecStringType& Other) const + { + return S == Other.S; + } + + FORCEINLINE bool operator!=(const FVecStringType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FVecStringType. + * Combines the hashes of all fields that are compared in operator==. + * @param VecStringType The FVecStringType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FVecStringType& VecStringType) +{ + uint32 Hash = GetTypeHash(VecStringType.S); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FVecStringType); + + UE_SPACETIMEDB_STRUCT(FVecStringType, S); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecTimestampType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecTimestampType.g.h new file mode 100644 index 00000000000..6614ebade5c --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecTimestampType.g.h @@ -0,0 +1,46 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "VecTimestampType.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FVecTimestampType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + TArray T; + + FORCEINLINE bool operator==(const FVecTimestampType& Other) const + { + return T == Other.T; + } + + FORCEINLINE bool operator!=(const FVecTimestampType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FVecTimestampType. + * Combines the hashes of all fields that are compared in operator==. + * @param VecTimestampType The FVecTimestampType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FVecTimestampType& VecTimestampType) +{ + uint32 Hash = GetTypeHash(VecTimestampType.T); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FVecTimestampType); + + UE_SPACETIMEDB_STRUCT(FVecTimestampType, T); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecU128Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecU128Type.g.h new file mode 100644 index 00000000000..b19a0cd2fe2 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecU128Type.g.h @@ -0,0 +1,46 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "VecU128Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FVecU128Type +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + TArray N; + + FORCEINLINE bool operator==(const FVecU128Type& Other) const + { + return N == Other.N; + } + + FORCEINLINE bool operator!=(const FVecU128Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FVecU128Type. + * Combines the hashes of all fields that are compared in operator==. + * @param VecU128Type The FVecU128Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FVecU128Type& VecU128Type) +{ + uint32 Hash = GetTypeHash(VecU128Type.N); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FVecU128Type); + + UE_SPACETIMEDB_STRUCT(FVecU128Type, N); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecU16Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecU16Type.g.h new file mode 100644 index 00000000000..add3b62c0c7 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecU16Type.g.h @@ -0,0 +1,45 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "VecU16Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FVecU16Type +{ + GENERATED_BODY() + + // NOTE: TArray field not exposed to Blueprint due to non-blueprintable elements + TArray N; + + FORCEINLINE bool operator==(const FVecU16Type& Other) const + { + return N == Other.N; + } + + FORCEINLINE bool operator!=(const FVecU16Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FVecU16Type. + * Combines the hashes of all fields that are compared in operator==. + * @param VecU16Type The FVecU16Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FVecU16Type& VecU16Type) +{ + uint32 Hash = GetTypeHash(VecU16Type.N); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FVecU16Type); + + UE_SPACETIMEDB_STRUCT(FVecU16Type, N); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecU256Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecU256Type.g.h new file mode 100644 index 00000000000..d8b979e7c99 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecU256Type.g.h @@ -0,0 +1,46 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "Types/Builtins.h" +#include "VecU256Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FVecU256Type +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + TArray N; + + FORCEINLINE bool operator==(const FVecU256Type& Other) const + { + return N == Other.N; + } + + FORCEINLINE bool operator!=(const FVecU256Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FVecU256Type. + * Combines the hashes of all fields that are compared in operator==. + * @param VecU256Type The FVecU256Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FVecU256Type& VecU256Type) +{ + uint32 Hash = GetTypeHash(VecU256Type.N); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FVecU256Type); + + UE_SPACETIMEDB_STRUCT(FVecU256Type, N); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecU32Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecU32Type.g.h new file mode 100644 index 00000000000..7a697b312d1 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecU32Type.g.h @@ -0,0 +1,45 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "VecU32Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FVecU32Type +{ + GENERATED_BODY() + + // NOTE: TArray field not exposed to Blueprint due to non-blueprintable elements + TArray N; + + FORCEINLINE bool operator==(const FVecU32Type& Other) const + { + return N == Other.N; + } + + FORCEINLINE bool operator!=(const FVecU32Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FVecU32Type. + * Combines the hashes of all fields that are compared in operator==. + * @param VecU32Type The FVecU32Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FVecU32Type& VecU32Type) +{ + uint32 Hash = GetTypeHash(VecU32Type.N); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FVecU32Type); + + UE_SPACETIMEDB_STRUCT(FVecU32Type, N); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecU64Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecU64Type.g.h new file mode 100644 index 00000000000..42f4b422879 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecU64Type.g.h @@ -0,0 +1,45 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "VecU64Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FVecU64Type +{ + GENERATED_BODY() + + // NOTE: TArray field not exposed to Blueprint due to non-blueprintable elements + TArray N; + + FORCEINLINE bool operator==(const FVecU64Type& Other) const + { + return N == Other.N; + } + + FORCEINLINE bool operator!=(const FVecU64Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FVecU64Type. + * Combines the hashes of all fields that are compared in operator==. + * @param VecU64Type The FVecU64Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FVecU64Type& VecU64Type) +{ + uint32 Hash = GetTypeHash(VecU64Type.N); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FVecU64Type); + + UE_SPACETIMEDB_STRUCT(FVecU64Type, N); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecU8Type.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecU8Type.g.h new file mode 100644 index 00000000000..e5e5f7b2c81 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecU8Type.g.h @@ -0,0 +1,45 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "VecU8Type.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FVecU8Type +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + TArray N; + + FORCEINLINE bool operator==(const FVecU8Type& Other) const + { + return N == Other.N; + } + + FORCEINLINE bool operator!=(const FVecU8Type& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FVecU8Type. + * Combines the hashes of all fields that are compared in operator==. + * @param VecU8Type The FVecU8Type instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FVecU8Type& VecU8Type) +{ + uint32 Hash = GetTypeHash(VecU8Type.N); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FVecU8Type); + + UE_SPACETIMEDB_STRUCT(FVecU8Type, N); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecUnitStructType.g.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecUnitStructType.g.h new file mode 100644 index 00000000000..35b0419a3e5 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/ModuleBindings/Types/VecUnitStructType.g.h @@ -0,0 +1,46 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#pragma once +#include "CoreMinimal.h" +#include "BSATN/UESpacetimeDB.h" +#include "ModuleBindings/Types/UnitStructType.g.h" +#include "VecUnitStructType.g.generated.h" + +USTRUCT(BlueprintType) +struct TESTCLIENT_API FVecUnitStructType +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "SpacetimeDB") + TArray S; + + FORCEINLINE bool operator==(const FVecUnitStructType& Other) const + { + return S == Other.S; + } + + FORCEINLINE bool operator!=(const FVecUnitStructType& Other) const + { + return !(*this == Other); + } +}; + +/** + * Custom hash function for FVecUnitStructType. + * Combines the hashes of all fields that are compared in operator==. + * @param VecUnitStructType The FVecUnitStructType instance to hash. + * @return The combined hash value. + */ +FORCEINLINE uint32 GetTypeHash(const FVecUnitStructType& VecUnitStructType) +{ + uint32 Hash = GetTypeHash(VecUnitStructType.S); + return Hash; +} + +namespace UE::SpacetimeDB +{ + UE_SPACETIMEDB_ENABLE_TARRAY(FVecUnitStructType); + + UE_SPACETIMEDB_STRUCT(FVecUnitStructType, S); +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/Tests/CommonTestFunctions.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/Tests/CommonTestFunctions.h new file mode 100644 index 00000000000..29bc21270b2 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/Tests/CommonTestFunctions.h @@ -0,0 +1,157 @@ +#pragma once + +#include "CoreMinimal.h" +#include "ModuleBindings/SpacetimeDBClient.g.h" +#include "Tables/RemoteTable.h" +#include "Tests/TestCounter.h" +#include "Tests/TestHandler.h" +#include "Misc/AutomationTest.h" + +#include "Connection/Callback.h" + +#include "Engine/DeveloperSettings.h" + +#include "CommonTestFunctions.generated.h" + + +/** + * Logs a success message to the output log and the automation test results window. + * @param Format The format string for the message. + * @param ... The arguments for the format string. + */ +#define TESTLOG_SUCCESS(Test, Format, ...) \ + do \ + { \ + const FString UserMessage = FString::Printf(Format, ##__VA_ARGS__); \ + const FString LogMessage = FString::Printf(TEXT(" ✓ %s"), *UserMessage); \ + UE_LOG(LogTemp, Log, TEXT("%s"), *LogMessage); \ + Test.AddInfo(LogMessage); \ + } while (false) + + /** + * Logs a failure message to the output log and the automation test results window, and marks the test as failed. + * @param Format The format string for the message. + * @param ... The arguments for the format string. + */ +#define TESTLOG_FAIL(Test, Format, ...) \ + do \ + { \ + const FString UserMessage = FString::Printf(Format, ##__VA_ARGS__); \ + const FString LogMessage = FString::Printf(TEXT(" ✗ %s"), *UserMessage); \ + UE_LOG(LogTemp, Error, TEXT("%s"), *LogMessage); \ + Test.AddError(LogMessage); \ + } while (false) + + /** + * Logs an informational message to the output log and the automation test results window. + * @param Format The format string for the message. + * @param ... The arguments for the format string. + */ +#define TESTLOG_INFO(Test, Format, ...) \ + do \ + { \ + const FString UserMessage = FString::Printf(Format, ##__VA_ARGS__); \ + const FString LogMessage = FString::Printf(TEXT(" ℹ %s"), *UserMessage); \ + UE_LOG(LogTemp, Log, TEXT("%s"), *LogMessage); \ + Test.AddInfo(LogMessage); \ + } while (false) + +/** + * Custom settings for Spacetime DB tests. + */ +UCLASS(config = EditorPerProjectUserSettings, defaultconfig, meta = (DisplayName = "Spacetime DB")) +class TESTCLIENT_API USpacetimeDBSettings : public UDeveloperSettings +{ + GENERATED_BODY() + +public: + /** Default DB name for Spacetime tests if no CLI arg or env var is set */ + UPROPERTY(EditAnywhere, config, Category = "Spacetime DB") + FString SpacetimeDbTestName; +}; + +// Utility UObject that forwards dynamic delegate calls to C++ lambdas. Dynamic +// delegates require a UObject instance to bind to, so tests install lambdas into +// this wrapper and bind its UFUNCTION thunks to the SDK's delegates. +UCLASS() +class UTestHelperDelegates : public UObject +{ + GENERATED_BODY() + +public: + TFunction OnConnect; + UFUNCTION() + void HandleConnect(UDbConnection* Conn, FSpacetimeDBIdentity Identity, const FString& Token); + + TFunction OnConnectError; + UFUNCTION() + void HandleConnectError(UDbConnection* Conn, const FString& Error); + + TFunction OnDisconnect; + UFUNCTION() + void HandleDisconnect(UDbConnection* Conn, const FString& Error); + + TFunction OnSubscriptionApplied; + UFUNCTION() + void HandleSubscriptionApplied(FSubscriptionEventContext Ctx); + + TFunction OnSubscriptionEnd; + UFUNCTION() + void HandleSubscriptionEnd(FSubscriptionEventContextBase Ctx); + + TFunction OnSubscriptionError; + UFUNCTION() + void HandleSubscriptionError(FErrorContext Ctx); +}; + +// Connect to the test database and invoke a callback once connected. +// Registers an on_connect test with the provided suffix on the counter. +UDbConnection* ConnectWithThen(TSharedPtr Counter, + const FString& TestName, + TFunction WithBuilder, + TFunction Callback); + +// Convenience: connect with default builder. +UDbConnection* ConnectThen(TSharedPtr Counter, + const FString& TestName, + TFunction Callback); + +// Convenience: connect and perform no additional work. +UDbConnection* Connect(TSharedPtr Counter); + +// Subscribe to all tables and invoke callback when applied. +void SubscribeAllThen(UDbConnection* Conn, + TFunction Callback); + +// Subscribe to specific queries and invoke callback when applied. +void SubscribeTheseThen(UDbConnection* Conn, + const TArray& Queries, + TFunction Callback); + +// Assert that a specific table is empty. +bool AssertTableEmpty(FAutomationTestBase* Test, + URemoteTables* Db, + const FString& TableName); + +// Assert that all tables are empty. +bool AssertAllTablesEmpty(FAutomationTestBase* Test, + URemoteTables* Db); + +// Get the Database name from environment variables. +bool GetDbName(FString& DBName, FString& Error); + +//Validate that the test parameters are configured correctly. +bool ValidateParameterConfig(FAutomationTestBase* Test); + +// Report a test result to the automation framework. +bool ReportTestResult(FAutomationTestBase& Test, const FString& TestName, TSharedPtr Counter, bool bTimedOut); + +// Factory method for creating test handlers. +template +T* CreateTestHandler() +{ + T* Handler = NewObject(GetTransientPackage()); + Handler->AddToRoot(); + Handler->Counter = MakeShared(); + return Handler; +} \ No newline at end of file diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/Tests/PrimitiveHandlerList.def b/sdks/unreal/tests/TestClient/Source/TestClient/Public/Tests/PrimitiveHandlerList.def new file mode 100644 index 00000000000..56a099a0a11 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/Tests/PrimitiveHandlerList.def @@ -0,0 +1,61 @@ +/* PrimitiveHandlerList.def + * FOREACH_PRIMITIVE(Suffix, ExpectedLiteral, RowStructType) + */ +#define FOREACH_PRIMITIVE(M) \ + M(U8 , 0, FOneU8Type) \ + M(U16, 0, FOneU16Type) \ + M(U32, 0, FOneU32Type) \ + M(U64, 0, FOneU64Type) \ + M(U128, FSpacetimeDBUInt128(0,0), FOneU128Type) \ + M(U256, FSpacetimeDBUInt256(FSpacetimeDBUInt128(0,0),FSpacetimeDBUInt128(0,0)), FOneU256Type) \ + M(I8 , 0, FOneI8Type) \ + M(I16, 0, FOneI16Type) \ + M(I32, 0, FOneI32Type) \ + M(I64, 0, FOneI64Type) \ + M(I128, FSpacetimeDBInt128(0,0), FOneI128Type) \ + M(I256, FSpacetimeDBInt256(FSpacetimeDBUInt128(0,0),FSpacetimeDBUInt128(0,0)), FOneI256Type) \ + M(Bool, false, FOneBoolType) \ + M(F32 , 0.0f, FOneF32Type) \ + M(F64 , 0.0, FOneF64Type) \ + M(String, TEXT(""), FOneStringType) + + +/* + * Macro list for unique tables used in tests that insert then delete rows. + * Arguments: (Suffix, KeyField, KeyLiteral, ExpectedValue, RowStructType) + */ +#define FOREACH_UNIQUE_PRIMITIVE(M) \ + M(U8 , N, 0, 0xbeef, FUniqueU8Type) \ + M(U16 , N, 0, 0xbeef, FUniqueU16Type) \ + M(U32 , N, 0, 0xbeef, FUniqueU32Type) \ + M(U64 , N, 0, 0xbeef, FUniqueU64Type) \ + M(U128 , N, FSpacetimeDBUInt128(0,0), 0xbeef, FUniqueU128Type) \ + M(U256 , N, FSpacetimeDBUInt256(FSpacetimeDBUInt128(0,0),FSpacetimeDBUInt128(0,0)), 0xbeef, FUniqueU256Type) \ + M(I8 , N, 0, 0xbeef, FUniqueI8Type) \ + M(I16 , N, 0, 0xbeef, FUniqueI16Type) \ + M(I32 , N, 0, 0xbeef, FUniqueI32Type) \ + M(I64 , N, 0, 0xbeef, FUniqueI64Type) \ + M(I128 , N, FSpacetimeDBInt128(0,0), 0xbeef, FUniqueI128Type) \ + M(I256 , N, FSpacetimeDBInt256(FSpacetimeDBUInt128(0,0),FSpacetimeDBUInt128(0,0)), 0xbeef, FUniqueI256Type) \ + M(Bool , B, false, 0xbeef, FUniqueBoolType) \ + M(String, S, TEXT(""), 0xbeef, FUniqueStringType) + +/* + * Macro list for primary-key tables used in update tests. + * Arguments: (Suffix, KeyField, KeyLiteral, ExpectedValue, UpdatedValue, RowStructType) + */ +#define FOREACH_PK_PRIMITIVE(M) \ + M(U8 , N, 0, 0xbeef, 0xbabe, FPkU8Type) \ + M(U16 , N, 0, 0xbeef, 0xbabe, FPkU16Type) \ + M(U32 , N, 0, 0xbeef, 0xbabe, FPkU32Type) \ + M(U64 , N, 0, 0xbeef, 0xbabe, FPkU64Type) \ + M(U128 , N, FSpacetimeDBUInt128(0,0), 0xbeef, 0xbabe, FPkU128Type) \ + M(U256 , N, FSpacetimeDBUInt256(FSpacetimeDBUInt128(0,0),FSpacetimeDBUInt128(0,0)), 0xbeef, 0xbabe, FPkU256Type) \ + M(I8 , N, 0, 0xbeef, 0xbabe, FPkI8Type) \ + M(I16 , N, 0, 0xbeef, 0xbabe, FPkI16Type) \ + M(I32 , N, 0, 0xbeef, 0xbabe, FPkI32Type) \ + M(I64 , N, 0, 0xbeef, 0xbabe, FPkI64Type) \ + M(I128 , N, FSpacetimeDBInt128(0,0), 0xbeef, 0xbabe, FPkI128Type) \ + M(I256 , N, FSpacetimeDBInt256(FSpacetimeDBUInt128(0,0),FSpacetimeDBUInt128(0,0)), 0xbeef, 0xbabe, FPkI256Type) \ + M(Bool , B, false, 0xbeef, 0xbabe, FPkBoolType) \ + M(String, S, TEXT(""), 0xbeef, 0xbabe, FPkStringType) \ No newline at end of file diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/Tests/SpacetimeFullClientTests.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/Tests/SpacetimeFullClientTests.h new file mode 100644 index 00000000000..c0a4440cd6a --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/Tests/SpacetimeFullClientTests.h @@ -0,0 +1,125 @@ +#pragma once + +#include "CoreMinimal.h" +#include "Misc/AutomationTest.h" + +class FTestCounter; + +/** + * Latent command that waits for a test counter to finish or time out. + */ +DEFINE_LATENT_AUTOMATION_COMMAND_FOUR_PARAMETER(FWaitForTestCounter, FAutomationTestBase&, Test, FString, TestName, TSharedPtr, Counter, double, StartTime); + + +/** Tests inserting primitive types by calling reducers and verifying the results. */ +IMPLEMENT_SIMPLE_AUTOMATION_TEST(FInsertPrimitiveTest, "SpacetimeDB.TestClient.InsertPrimitiveTest", EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter) +/** Tests cancelling a subscription before it is applied. */ +IMPLEMENT_SIMPLE_AUTOMATION_TEST(FSubscribeAndCancelTest, "SpacetimeDB.TestClient.SubscribeAndCancelTest", EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter) +/** Tests unsubscribing after a subscription has been applied. */ +IMPLEMENT_SIMPLE_AUTOMATION_TEST(FSubscribeAndUnsubscribeTest, "SpacetimeDB.TestClient.SubscribeAndUnsubscribeTest", EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter) +/** Tests that subscription errors are reported to callbacks. */ +IMPLEMENT_SIMPLE_AUTOMATION_TEST(FSubscriptionErrorSmokeTest, "SpacetimeDB.TestClient.SubscriptionErrorSmokeTest", EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter) +/** Tests deleting primitive rows. */ +IMPLEMENT_SIMPLE_AUTOMATION_TEST(FDeletePrimitiveTest, "SpacetimeDB.TestClient.DeletePrimitiveTest", EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter) +/** Tests updating primitive rows with primary keys. */ +IMPLEMENT_SIMPLE_AUTOMATION_TEST(FUpdatePrimitiveTest, "SpacetimeDB.TestClient.UpdatePrimitiveTest", EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter) + + +/** Tests inserting identity type by calling reducer and verifying the result. */ +IMPLEMENT_SIMPLE_AUTOMATION_TEST(FInsertOneIdentityTest, "SpacetimeDB.TestClient.InsertIdentityTest", EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter) +/** Tests inserting caller ConnectionId type by calling reducer and verifying the result. */ +IMPLEMENT_SIMPLE_AUTOMATION_TEST(FInsertCallerIdentityTest, "SpacetimeDB.TestClient.InsertCallerIdentityTest", EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter) +/** Tests deleting identity rows. */ +IMPLEMENT_SIMPLE_AUTOMATION_TEST(FDeleteUniqueIdentityTest, "SpacetimeDB.TestClient.DeleteIdentityTest", EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter) +/** Tests updating unique identity rows. */ +IMPLEMENT_SIMPLE_AUTOMATION_TEST(FUpdatePkIdentityTest, "SpacetimeDB.TestClient.UpdateIdentityTest", EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter) + + +/** Tests inserting one ConnectionId type by calling reducer and verifying the result. */ +IMPLEMENT_SIMPLE_AUTOMATION_TEST(FInsertOneConnectionIdTest, "SpacetimeDB.TestClient.InsertConnectionIdTest", EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter) +/** Tests inserting caller ConnectionId type by calling reducer and verifying the result. */ +IMPLEMENT_SIMPLE_AUTOMATION_TEST(FInsertCallerConnectionIdTest, "SpacetimeDB.TestClient.InsertCallerConnectionIdTest", EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter) +/** Tests deleting ConnectionId rows. */ +IMPLEMENT_SIMPLE_AUTOMATION_TEST(FDeletePkConnectionIdTest, "SpacetimeDB.TestClient.DeleteConnectionIdTest", EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter) +/** Tests updating unique identity rows. */ +IMPLEMENT_SIMPLE_AUTOMATION_TEST(FUpdatePkConnectionIdTest, "SpacetimeDB.TestClient.UpdateConnectionIdTest", EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter) +/** Tests inserting unique ConnectionId type by calling reducer and verifying the result. */ +IMPLEMENT_SIMPLE_AUTOMATION_TEST(FInsertUniqueConnectionIdTest, "SpacetimeDB.TestClient.InsertUniqueConnectionIdTest", EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter) + + +/** Tests inserting timestamp type by calling reducer and verifying the result. */ +IMPLEMENT_SIMPLE_AUTOMATION_TEST(FInsertOneTimestampTest, "SpacetimeDB.TestClient.InsertTimestampTest", EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter) +/** Tests inserting timestamp type by calling reducer and verifying the result. */ +IMPLEMENT_SIMPLE_AUTOMATION_TEST(FInsertCallTimestampTest, "SpacetimeDB.TestClient.InsertCallTimestampTest", EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter) + + +/** Tests on reducer. */ +IMPLEMENT_SIMPLE_AUTOMATION_TEST(FOnReducerTest, "SpacetimeDB.TestClient.OnReducerTest", EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter) +/** Tests on fail reducer. */ +IMPLEMENT_SIMPLE_AUTOMATION_TEST(FOnFailReducerTest, "SpacetimeDB.TestClient.FailReducerTest", EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter) + + +/** Tests inserting vector types. */ +IMPLEMENT_SIMPLE_AUTOMATION_TEST(FInsertVecTest, "SpacetimeDB.TestClient.InsertVecTest", EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter) +/** Tests inserting some optional types. */ +IMPLEMENT_SIMPLE_AUTOMATION_TEST(FInsertOptionSomeTest, "SpacetimeDB.TestClient.InsertOptionSomeTest", EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter) +/** Tests inserting none optional types. */ +IMPLEMENT_SIMPLE_AUTOMATION_TEST(FInsertOptionNoneTest, "SpacetimeDB.TestClient.InsertOptionNoneTest", EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter) +/** Tests inserting struct types. */ +IMPLEMENT_SIMPLE_AUTOMATION_TEST(FInsertStructTest, "SpacetimeDB.TestClient.InsertStructTest", EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter) +/** Tests inserting simple enum types. */ +IMPLEMENT_SIMPLE_AUTOMATION_TEST(FInsertSimpleEnumTest, "SpacetimeDB.TestClient.InsertSimpleEnumTest", EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter) +/** Tests inserting enum with payload types. */ +IMPLEMENT_SIMPLE_AUTOMATION_TEST(FInsertEnumWithPayloadTest, "SpacetimeDB.TestClient.InsertEnumWithPayloadTest", EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter) + + +/** Tests deleting large table. */ +IMPLEMENT_SIMPLE_AUTOMATION_TEST(FInsertDeleteLargeTableTest, "SpacetimeDB.TestClient.InsertDeleteLargeTableTest", EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter) + + +/** Tests inserting primitives and getting back string to compare to. */ +IMPLEMENT_SIMPLE_AUTOMATION_TEST(FInsertPrimitivesAsStringTest, "SpacetimeDB.TestClient.InsertPrimitivesAsStringsTest", EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter) + + +/** Tests authentication. */ +IMPLEMENT_SIMPLE_AUTOMATION_TEST(FReauth1Test, "SpacetimeDB.TestClient.ReauthPart1Test", EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter) +/** Tests reauthenticate using old credentials. */ +IMPLEMENT_SIMPLE_AUTOMATION_TEST(FReauth2Test, "SpacetimeDB.TestClient.ReauthPart2Test", EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter) + + +/** Tests should file logic. */ +IMPLEMENT_SIMPLE_AUTOMATION_TEST(FShouldFailTest, "SpacetimeDB.TestClient.ShouldFailTest", EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter) + + +/** Tests subscribe caller always notified. */ +IMPLEMENT_SIMPLE_AUTOMATION_TEST(FCallerAlwaysNotifiedTest, "SpacetimeDB.TestClient.CallerAlwaysNotifiedTest", EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter) + + +/** Tests subscribe all select star. */ +IMPLEMENT_SIMPLE_AUTOMATION_TEST(FSubscribeAllSelectStarTest, "SpacetimeDB.TestClient.SubscribeAllSelectStarTest", EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter) +/** Tests row deduplication behavior. */ +IMPLEMENT_SIMPLE_AUTOMATION_TEST(FRowDeduplicationTest, "SpacetimeDB.TestClient.RowDeduplicationTest", EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter) +/** Tests row deduplication with join between pk_u32 and unique_u32. */ +IMPLEMENT_SIMPLE_AUTOMATION_TEST(FRowDeduplicationJoinRAndSTest, "SpacetimeDB.TestClient.RowDeduplicationJoinRAndSTest", EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter) +/** Tests row deduplication with r join s and r join t queries. */ +IMPLEMENT_SIMPLE_AUTOMATION_TEST(FRowDeduplicationRJoinSandRJoinTTest, "SpacetimeDB.TestClient.RowDeduplicationRJoinSAndRJoinTTest", EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter) +/** Tests lhs join update behavior. */ +IMPLEMENT_SIMPLE_AUTOMATION_TEST(FLhsJoinUpdateTest, "SpacetimeDB.TestClient.LhsJoinUpdateTest", EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter) +/** Tests lhs join update with disjoint queries. */ +IMPLEMENT_SIMPLE_AUTOMATION_TEST(FLhsJoinUpdateDisjointQueriesTest, "SpacetimeDB.TestClient.LhsJoinUpdateDisjointQueriesTest", EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter) +/** Tests bag semantics for joins within a single query. */ +IMPLEMENT_SIMPLE_AUTOMATION_TEST(FIntraQueryBagSemanticsForJoinTest, "SpacetimeDB.TestClient.IntraQueryBagSemanticsForJoinTest", EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter) +/** Tests different compression algorithms for multiple clients. @Note: Only one compresstion GZip compresstion is implemented, add this test in the future if more compresstion is added. */ +//IMPLEMENT_SIMPLE_AUTOMATION_TEST(FTwoDifferentCompressionAlgosTest, "SpacetimeDB.TestClient.TwoDifferentCompressionAlgosTest", EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter) +/** Tests parameterized subscriptions. */ +IMPLEMENT_SIMPLE_AUTOMATION_TEST(FParameterizedSubscriptionTest, "SpacetimeDB.TestClient.ParameterizedSubscriptionTest", EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter) +/** Tests RLS controlled subscription visibility. */ +IMPLEMENT_SIMPLE_AUTOMATION_TEST(FRlsSubscriptionTest, "SpacetimeDB.TestClient.RlsSubscriptionTest", EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter) +/** Tests pk simple enum updates. */ +IMPLEMENT_SIMPLE_AUTOMATION_TEST(FPkSimpleEnumTest, "SpacetimeDB.TestClient.PkSimpleEnumTest", EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter) +/** Tests indexed simple enum updates. */ +IMPLEMENT_SIMPLE_AUTOMATION_TEST(FIndexedSimpleEnumTest, "SpacetimeDB.TestClient.IndexedSimpleEnumTest", EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter) + + +/** Tests overlapping subscriptions. */ +IMPLEMENT_SIMPLE_AUTOMATION_TEST(FOverlappingSubscriptionsTest, "SpacetimeDB.TestClient.OverlappingSubscriptionsTest", EAutomationTestFlags::EditorContext | EAutomationTestFlags::EngineFilter) diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/Tests/TestCounter.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/Tests/TestCounter.h new file mode 100644 index 00000000000..35b52debcb5 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/Tests/TestCounter.h @@ -0,0 +1,35 @@ +#pragma once + +#include "CoreMinimal.h" +#include "HAL/CriticalSection.h" + +struct FTestOutcome +{ + bool bSuccess = false; + FString Error; +}; + +class FTestCounter : public TSharedFromThis +{ +public: + FTestCounter() = default; + + void Register(const FString& TestName); + void MarkSuccess(const FString& TestName); + void MarkFailure(const FString& TestName, const FString& Error); + + bool IsComplete() const; + bool AllSucceeded() const; + TArray GetFailures() const; + TArray GetSuccesses() const; + + void Abort(); + bool IsAborted() const { return bAborted; } + + +private: + mutable FCriticalSection Mutex; + TMap Outcomes; + TSet Registered; + bool bAborted = false; +}; \ No newline at end of file diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/Tests/TestHandler.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/Tests/TestHandler.h new file mode 100644 index 00000000000..7e2c0e0d8e5 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/Tests/TestHandler.h @@ -0,0 +1,527 @@ +#pragma once +#include "CoreMinimal.h" +#include "UObject/Object.h" + +#include "Tests/PrimitiveHandlerList.def" + +#include "Types/Builtins.h" +#include "Types/LargeIntegers.h" + +#include "UmbreallaHeaderTypes.h" +#include "UmbreallaHeaderaTables.h" + +#include "ModuleBindings/SpacetimeDBClient.g.h" + +#include "TestHandler.generated.h" + +class FTestCounter; + +/** Receives table updates and validates their payloads. */ +UCLASS() +class UTestHandler : public UObject +{ + GENERATED_BODY() +public: + TSharedPtr Counter; + + UFUNCTION() void OnNoOpSucceeds(const FReducerEventContext& Context); + UFUNCTION() void OnConnectionDone(UDbConnection* Connection); + UFUNCTION() void OnReConnectionDone(UDbConnection* Connection); + + /** Stores the initial connection id so we can ensure a reconnect reuses it. */ + FSpacetimeDBConnectionId InitialConnectionId; +}; + +UCLASS() +class UInsertPrimitiveHandler : public UTestHandler +{ + GENERATED_BODY() +public: + + //@NOTE: Unreal’s UHT cannot see macros when generating reflection data, so the UFUNCTION()s via FOREACH_PRIMITIVE won't be registered or bindable via Macro :( +/* UFUNCTION declarations for every primitive ---------------------- */ +//#define DECLARE_UFUNC(Suffix, Expected, RowStructType) \ +// UFUNCTION() \ +// void OnInsertOne##Suffix(const FEventContext& Context, const RowStructType& Value); +// FOREACH_PRIMITIVE(DECLARE_UFUNC) +//#undef DECLARE_UFUNC + + + UFUNCTION() void OnInsertOneU8(const FEventContext& Context, const FOneU8Type& Value); + UFUNCTION() void OnInsertOneU16(const FEventContext& Context, const FOneU16Type& Value); + UFUNCTION() void OnInsertOneU32(const FEventContext& Context, const FOneU32Type& Value); + UFUNCTION() void OnInsertOneU64(const FEventContext& Context, const FOneU64Type& Value); + UFUNCTION() void OnInsertOneU128(const FEventContext& Context, const FOneU128Type& Value); + UFUNCTION() void OnInsertOneU256(const FEventContext& Context, const FOneU256Type& Value); + UFUNCTION() void OnInsertOneI8(const FEventContext& Context, const FOneI8Type& Value); + UFUNCTION() void OnInsertOneI16(const FEventContext& Context, const FOneI16Type& Value); + UFUNCTION() void OnInsertOneI32(const FEventContext& Context, const FOneI32Type& Value); + UFUNCTION() void OnInsertOneI64(const FEventContext& Context, const FOneI64Type& Value); + UFUNCTION() void OnInsertOneI128(const FEventContext& Context, const FOneI128Type& Value); + UFUNCTION() void OnInsertOneI256(const FEventContext& Context, const FOneI256Type& Value); + UFUNCTION() void OnInsertOneBool(const FEventContext& Context, const FOneBoolType& Value); + UFUNCTION() void OnInsertOneF32(const FEventContext& Context, const FOneF32Type& Value); + UFUNCTION() void OnInsertOneF64(const FEventContext& Context, const FOneF64Type& Value); + UFUNCTION() void OnInsertOneString(const FEventContext& Context, const FOneStringType& Value); + + UFUNCTION() void OnInsertPrimitivesAsString(const FEventContext& Context, const FVecStringType& Value); + + TArray ExpectedStrings; +}; + +/** Handler used for delete-primitive tests. */ +UCLASS() +class UDeletePrimitiveHandler : public UTestHandler +{ + GENERATED_BODY() +public: + UFUNCTION() void OnInsertUniqueU8(const FEventContext& Context, const FUniqueU8Type& Value); + UFUNCTION() void OnDeleteUniqueU8(const FEventContext& Context, const FUniqueU8Type& Value); + UFUNCTION() void OnInsertUniqueU16(const FEventContext& Context, const FUniqueU16Type& Value); + UFUNCTION() void OnDeleteUniqueU16(const FEventContext& Context, const FUniqueU16Type& Value); + UFUNCTION() void OnInsertUniqueU32(const FEventContext& Context, const FUniqueU32Type& Value); + UFUNCTION() void OnDeleteUniqueU32(const FEventContext& Context, const FUniqueU32Type& Value); + UFUNCTION() void OnInsertUniqueU64(const FEventContext& Context, const FUniqueU64Type& Value); + UFUNCTION() void OnDeleteUniqueU64(const FEventContext& Context, const FUniqueU64Type& Value); + UFUNCTION() void OnInsertUniqueU128(const FEventContext& Context, const FUniqueU128Type& Value); + UFUNCTION() void OnDeleteUniqueU128(const FEventContext& Context, const FUniqueU128Type& Value); + UFUNCTION() void OnInsertUniqueU256(const FEventContext& Context, const FUniqueU256Type& Value); + UFUNCTION() void OnDeleteUniqueU256(const FEventContext& Context, const FUniqueU256Type& Value); + UFUNCTION() void OnInsertUniqueI8(const FEventContext& Context, const FUniqueI8Type& Value); + UFUNCTION() void OnDeleteUniqueI8(const FEventContext& Context, const FUniqueI8Type& Value); + UFUNCTION() void OnInsertUniqueI16(const FEventContext& Context, const FUniqueI16Type& Value); + UFUNCTION() void OnDeleteUniqueI16(const FEventContext& Context, const FUniqueI16Type& Value); + UFUNCTION() void OnInsertUniqueI32(const FEventContext& Context, const FUniqueI32Type& Value); + UFUNCTION() void OnDeleteUniqueI32(const FEventContext& Context, const FUniqueI32Type& Value); + UFUNCTION() void OnInsertUniqueI64(const FEventContext& Context, const FUniqueI64Type& Value); + UFUNCTION() void OnDeleteUniqueI64(const FEventContext& Context, const FUniqueI64Type& Value); + UFUNCTION() void OnInsertUniqueI128(const FEventContext& Context, const FUniqueI128Type& Value); + UFUNCTION() void OnDeleteUniqueI128(const FEventContext& Context, const FUniqueI128Type& Value); + UFUNCTION() void OnInsertUniqueI256(const FEventContext& Context, const FUniqueI256Type& Value); + UFUNCTION() void OnDeleteUniqueI256(const FEventContext& Context, const FUniqueI256Type& Value); + UFUNCTION() void OnInsertUniqueBool(const FEventContext& Context, const FUniqueBoolType& Value); + UFUNCTION() void OnDeleteUniqueBool(const FEventContext& Context, const FUniqueBoolType& Value); + UFUNCTION() void OnInsertUniqueString(const FEventContext& Context, const FUniqueStringType& Value); + UFUNCTION() void OnDeleteUniqueString(const FEventContext& Context, const FUniqueStringType& Value); +}; + +/** Handler used for update-primitive tests. */ +UCLASS() +class UUpdatePrimitiveHandler : public UTestHandler +{ + GENERATED_BODY() +public: + UFUNCTION() void OnInsertPkU8(const FEventContext& Context, const FPkU8Type& Value); + UFUNCTION() void OnUpdatePkU8(const FEventContext& Context, const FPkU8Type& OldValue, const FPkU8Type& NewValue); + UFUNCTION() void OnDeletePkU8(const FEventContext& Context, const FPkU8Type& Value); + UFUNCTION() void OnInsertPkU16(const FEventContext& Context, const FPkU16Type& Value); + UFUNCTION() void OnUpdatePkU16(const FEventContext& Context, const FPkU16Type& OldValue, const FPkU16Type& NewValue); + UFUNCTION() void OnDeletePkU16(const FEventContext& Context, const FPkU16Type& Value); + UFUNCTION() void OnInsertPkU32(const FEventContext& Context, const FPkU32Type& Value); + UFUNCTION() void OnUpdatePkU32(const FEventContext& Context, const FPkU32Type& OldValue, const FPkU32Type& NewValue); + UFUNCTION() void OnDeletePkU32(const FEventContext& Context, const FPkU32Type& Value); + UFUNCTION() void OnInsertPkU64(const FEventContext& Context, const FPkU64Type& Value); + UFUNCTION() void OnUpdatePkU64(const FEventContext& Context, const FPkU64Type& OldValue, const FPkU64Type& NewValue); + UFUNCTION() void OnDeletePkU64(const FEventContext& Context, const FPkU64Type& Value); + UFUNCTION() void OnInsertPkU128(const FEventContext& Context, const FPkU128Type& Value); + UFUNCTION() void OnUpdatePkU128(const FEventContext& Context, const FPkU128Type& OldValue, const FPkU128Type& NewValue); + UFUNCTION() void OnDeletePkU128(const FEventContext& Context, const FPkU128Type& Value); + UFUNCTION() void OnInsertPkU256(const FEventContext& Context, const FPkU256Type& Value); + UFUNCTION() void OnUpdatePkU256(const FEventContext& Context, const FPkU256Type& OldValue, const FPkU256Type& NewValue); + UFUNCTION() void OnDeletePkU256(const FEventContext& Context, const FPkU256Type& Value); + UFUNCTION() void OnInsertPkI8(const FEventContext& Context, const FPkI8Type& Value); + UFUNCTION() void OnUpdatePkI8(const FEventContext& Context, const FPkI8Type& OldValue, const FPkI8Type& NewValue); + UFUNCTION() void OnDeletePkI8(const FEventContext& Context, const FPkI8Type& Value); + UFUNCTION() void OnInsertPkI16(const FEventContext& Context, const FPkI16Type& Value); + UFUNCTION() void OnUpdatePkI16(const FEventContext& Context, const FPkI16Type& OldValue, const FPkI16Type& NewValue); + UFUNCTION() void OnDeletePkI16(const FEventContext& Context, const FPkI16Type& Value); + UFUNCTION() void OnInsertPkI32(const FEventContext& Context, const FPkI32Type& Value); + UFUNCTION() void OnUpdatePkI32(const FEventContext& Context, const FPkI32Type& OldValue, const FPkI32Type& NewValue); + UFUNCTION() void OnDeletePkI32(const FEventContext& Context, const FPkI32Type& Value); + UFUNCTION() void OnInsertPkI64(const FEventContext& Context, const FPkI64Type& Value); + UFUNCTION() void OnUpdatePkI64(const FEventContext& Context, const FPkI64Type& OldValue, const FPkI64Type& NewValue); + UFUNCTION() void OnDeletePkI64(const FEventContext& Context, const FPkI64Type& Value); + UFUNCTION() void OnInsertPkI128(const FEventContext& Context, const FPkI128Type& Value); + UFUNCTION() void OnUpdatePkI128(const FEventContext& Context, const FPkI128Type& OldValue, const FPkI128Type& NewValue); + UFUNCTION() void OnDeletePkI128(const FEventContext& Context, const FPkI128Type& Value); + UFUNCTION() void OnInsertPkI256(const FEventContext& Context, const FPkI256Type& Value); + UFUNCTION() void OnUpdatePkI256(const FEventContext& Context, const FPkI256Type& OldValue, const FPkI256Type& NewValue); + UFUNCTION() void OnDeletePkI256(const FEventContext& Context, const FPkI256Type& Value); + UFUNCTION() void OnInsertPkBool(const FEventContext& Context, const FPkBoolType& Value); + UFUNCTION() void OnUpdatePkBool(const FEventContext& Context, const FPkBoolType& OldValue, const FPkBoolType& NewValue); + UFUNCTION() void OnDeletePkBool(const FEventContext& Context, const FPkBoolType& Value); + UFUNCTION() void OnInsertPkString(const FEventContext& Context, const FPkStringType& Value); + UFUNCTION() void OnUpdatePkString(const FEventContext& Context, const FPkStringType& OldValue, const FPkStringType& NewValue); + UFUNCTION() void OnDeletePkString(const FEventContext& Context, const FPkStringType& Value); +}; + +// Define a new test handler class for this specific test +UCLASS() +class UBagSemanticsTestHandler : public UTestHandler +{ + GENERATED_BODY() + +public: + // The handler for the "on delete" event from the database for the PkU32 table + UFUNCTION() + void OnDeletePkU32(const FEventContext& Context, const FPkU32Type& Value); +}; + +/** Handler used for lhs join update tests. */ +UCLASS() +class ULhsJoinUpdateHandler : public UTestHandler +{ + GENERATED_BODY() +public: + bool bInsert1 = false; + bool bInsert2 = false; + bool bUpdateRequested = false; + bool bUpdate1 = false; + bool bUpdate2 = false; + + UFUNCTION() void OnInsertPkU32(const FReducerEventContext& Context, uint32 N, int32 Data); + UFUNCTION() void OnUpdatePkU32(const FReducerEventContext& Context, uint32 N, int32 Data); +}; + +/** Handler used for lhs join update disjoint queries test. */ +UCLASS() +class ULhsJoinUpdateDisjointQueriesHandler : public UTestHandler +{ + GENERATED_BODY() +public: + bool bInserted1 = false; + bool bInserted2 = false; + bool bUpdateRequested = false; + bool bUpdated1 = false; + bool bUpdated2 = false; + + UFUNCTION() void OnInsertPkU32Reducer(const FReducerEventContext& Context, uint32 N, int32 Data); + UFUNCTION() void OnUpdatePkU32Reducer(const FReducerEventContext& Context, uint32 N, int32 Data); +}; + +// Define a new test handler class for this specific test +UCLASS() +class UParameterizedSubscriptionHandler : public UTestHandler +{ + GENERATED_BODY() + +public: + // The values we expect for this client + FSpacetimeDBIdentity ExpectedIdentity; + int32 ExpectedOldData; + int32 ExpectedNewData; + + UTestHandler* Counters; + + // The handler for the "on insert" event from the database + UFUNCTION() + void OnInsertPkIdentity(const FEventContext& Context, const FPkIdentityType& Identity); + + // The handler for the "on update" event from the database + UFUNCTION() + void OnUpdatePkIdentity(const FEventContext& Context, const FPkIdentityType& OldIdentity, const FPkIdentityType& NewIdentity); +}; + +// Define a new test handler class for this specific test +UCLASS() +class URLSSubscriptionHandler : public UTestHandler +{ + GENERATED_BODY() + +public: + + FUsersType ExpectedUserType; + + UTestHandler* MainCounter; + + // The handler for the "on insert" event from the database + UFUNCTION() + void OnInsertUser(const FEventContext& Context, const FUsersType& UserType); +}; + +/** Handler used for insert-identity test. */ +UCLASS() +class UIdentityActionsHandler : public UTestHandler +{ + GENERATED_BODY() +public: + UFUNCTION() void SetExpectedValue(const FSpacetimeDBIdentity& Expected, int32 InsertData = 0, int32 UpdateData = 0); + UFUNCTION() void OnInsertOneIdentity(const FEventContext& Context, const FOneIdentityType& Value); + UFUNCTION() void OnInsertUniqueIdentity(const FEventContext& Context, const FUniqueIdentityType& Value); + UFUNCTION() void OnInsertCallerIdentity(const FEventContext& Context, const FOneIdentityType& Value); + UFUNCTION() void OnInsertPkIdentity(const FEventContext& Context, const FPkIdentityType& Value); + UFUNCTION() void OnDeletePkIdentity(const FEventContext& Context, const FPkIdentityType& Value); + UFUNCTION() void OnDeleteUniqueIdentity(const FEventContext& Context, const FUniqueIdentityType& Value); + UFUNCTION() void OnUpdatePkIdentity(const FEventContext& Context, const FPkIdentityType& OldValue, const FPkIdentityType& NewValue); +private: + FSpacetimeDBIdentity ExpectedValue; + int32 ExpectedInsertData = 0; + int32 ExpectedUpdateData = 0; +}; + +/** Handler used for insert-identity test. */ +UCLASS() +class UConnectionIdActionsHandler : public UTestHandler +{ + GENERATED_BODY() +public: + UFUNCTION() void SetExpectedvalue(const FSpacetimeDBConnectionId& Expected, const int32& Data); + UFUNCTION() void OnInsertOneConnectionId(const FEventContext& Context, const FOneConnectionIdType& Value); + UFUNCTION() void OnInsertPkConnectionId(const FEventContext& Context, const FPkConnectionIdType& Value); + UFUNCTION() void OnInsertUniqueConnectionId(const FEventContext& Context, const FUniqueConnectionIdType& Value); + UFUNCTION() void OnInsertCallerConnectionId(const FEventContext& Context, const FOneConnectionIdType& Value); + UFUNCTION() void OnDeletePkConnectionId(const FEventContext& Context, const FPkConnectionIdType& Value); + UFUNCTION() void OnUpdatePkConnectionId(const FEventContext& Context, const FPkConnectionIdType& OldValue, const FPkConnectionIdType& NewValue); + UFUNCTION() void OnUpdateUniqueConnectionId(const FEventContext& Context, const FUniqueConnectionIdType& OldValue, const FUniqueConnectionIdType& NewValue); +private: + FSpacetimeDBConnectionId ExpectedValue; + int32 ExpectedData; +}; + +/** Handler used for insert-identity test. */ +UCLASS() +class UTimestampActionsHandler : public UTestHandler +{ + GENERATED_BODY() +public: + UFUNCTION() void SetExpectedvalue(const FSpacetimeDBTimestamp& Expected); + UFUNCTION() void OnInsertOneTimestamp(const FEventContext& Context, const FOneTimestampType& Value); + UFUNCTION() void OnInsertCallTimestamp(const FReducerEventContext& Context); +private: + FSpacetimeDBTimestamp ExpectedValue; +}; + +/** Handler used for insert-identity test. */ +UCLASS() +class UOnReducerActionsHandler : public UTestHandler +{ + GENERATED_BODY() +public: + UFUNCTION() void SetExpectedvalue(const uint8& Expected); + UFUNCTION() void SetExpectedKeyAndValue(const uint8& Key, int32 SuccessValue, int32 FailValue); + UFUNCTION() void OnInsertOneU8(const FReducerEventContext& Context, uint8 Value); + UFUNCTION() void OnInsertPkU8(const FReducerEventContext& Context, uint8 Key, int32 Value); +private: + bool bShouldSucceed; + uint8 ExpectedKey; + int32 ExpectedValue; + int32 ExpectedFailValue; +}; + +UCLASS() +class UVectorDataActionsHandler : public UTestHandler +{ + GENERATED_BODY() +public: + + UFUNCTION() void OnInsertVecU8(const FEventContext& Context, const FVecU8Type& Value); + UFUNCTION() void OnInsertVecU16(const FEventContext& Context, const FVecU16Type& Value); + UFUNCTION() void OnInsertVecU32(const FEventContext& Context, const FVecU32Type& Value); + UFUNCTION() void OnInsertVecU64(const FEventContext& Context, const FVecU64Type& Value); + UFUNCTION() void OnInsertVecU128(const FEventContext& Context, const FVecU128Type& Value); + UFUNCTION() void OnInsertVecU256(const FEventContext& Context, const FVecU256Type& Value); + + UFUNCTION() void OnInsertVecI8(const FEventContext& Context, const FVecI8Type& Value); + UFUNCTION() void OnInsertVecI16(const FEventContext& Context, const FVecI16Type& Value); + UFUNCTION() void OnInsertVecI32(const FEventContext& Context, const FVecI32Type& Value); + UFUNCTION() void OnInsertVecI64(const FEventContext& Context, const FVecI64Type& Value); + UFUNCTION() void OnInsertVecI128(const FEventContext& Context, const FVecI128Type& Value); + UFUNCTION() void OnInsertVecI256(const FEventContext& Context, const FVecI256Type& Value); + + UFUNCTION() void OnInsertVecBool(const FEventContext& Context, const FVecBoolType& Value); + + UFUNCTION() void OnInsertVecF32(const FEventContext& Context, const FVecF32Type& Value); + UFUNCTION() void OnInsertVecF64(const FEventContext& Context, const FVecF64Type& Value); + + UFUNCTION() void OnInsertVecString(const FEventContext& Context, const FVecStringType& Value); + + UFUNCTION() void OnInsertVecIdentity(const FEventContext& Context, const FVecIdentityType& Value); + UFUNCTION() void OnInsertVecConnectionId(const FEventContext& Context, const FVecConnectionIdType& Value); + UFUNCTION() void OnInsertVecTimestamp(const FEventContext& Context, const FVecTimestampType& Value); + + FVecU8Type ExpectedVecU8; + FVecU16Type ExpectedVecU16; + FVecU32Type ExpectedVecU32; + FVecU64Type ExpectedVecU64; + FVecU128Type ExpectedVecU128; + FVecU256Type ExpectedVecU256; + + FVecI8Type ExpectedVecI8; + FVecI16Type ExpectedVecI16; + FVecI32Type ExpectedVecI32; + FVecI64Type ExpectedVecI64; + FVecI128Type ExpectedVecI128; + FVecI256Type ExpectedVecI256; + + FVecBoolType ExpectedVecBool; + + FVecF32Type ExpectedVecF32; + FVecF64Type ExpectedVecF64; + + FVecStringType ExpectedVecString; + + FVecIdentityType ExpectedVecIdentity; + FVecConnectionIdType ExpectedVecConnectionId; + FVecTimestampType ExpectedVecTimestamp; +}; + +UCLASS() +class UOptionActionsHandler : public UTestHandler +{ + GENERATED_BODY() +public: + + UFUNCTION() void OnInsertOptionI32(const FEventContext& Context, const FOptionI32Type& Value); + UFUNCTION() void OnInsertOptionString(const FEventContext& Context, const FOptionStringType& Value); + UFUNCTION() void OnInsertOptionIdentity(const FEventContext& Context, const FOptionIdentityType& Value); + UFUNCTION() void OnInsertOptionSimpleEnum(const FEventContext& Context, const FOptionSimpleEnumType& Value); + UFUNCTION() void OnInsertOptionPrimitiveStruct(const FEventContext& Context, const FOptionEveryPrimitiveStructType& Value); + UFUNCTION() void OnInsertOptionVecOptionI32(const FEventContext& Context, const FOptionVecOptionI32Type& Value); + + FTestClientOptionalInt32 ExpectedI32Type; + FTestClientOptionalString ExpectedStringType; + FTestClientOptionalIdentity ExpectedIdentityType; + FTestClientOptionalSimpleEnum ExpectedEnumType; + FTestClientOptionalEveryPrimitiveStruct ExpectedEveryPrimitiveStructType; + FTestClientOptionalVecInt32 ExpectedVecOptionI32Type; +}; + +UCLASS() +class UStructActionsHandler : public UTestHandler +{ + GENERATED_BODY() +public: + + UFUNCTION() void OnInsertOneUnitStruct(const FEventContext& Context, const FOneUnitStructType& Value); + UFUNCTION() void OnInsertOneByteStruct(const FEventContext& Context, const FOneByteStructType& Value); + UFUNCTION() void OnInsertOneEveryPrimitiveStruct(const FEventContext& Context, const FOneEveryPrimitiveStructType& Value); + UFUNCTION() void OnInsertOneEveryVecStruct(const FEventContext& Context, const FOneEveryVecStructType& Value); + + UFUNCTION() void OnInsertVecUnitStruct(const FEventContext& Context, const FVecUnitStructType& Value); + UFUNCTION() void OnInsertVecByteStruct(const FEventContext& Context, const FVecByteStructType& Value); + UFUNCTION() void OnInsertVecEveryPrimitiveStruct(const FEventContext& Context, const FVecEveryPrimitiveStructType& Value); + UFUNCTION() void OnInsertVecEveryVecStruct(const FEventContext& Context, const FVecEveryVecStructType& Value); + + FByteStructType ExpectedByteStruct; + FEveryPrimitiveStructType ExpectedEveryPrimitiveStruct; + FEveryVecStructType ExpectedEveryVecStruct; + TArray ExpectedVecByteStruct; + TArray ExpectedVecPrimitiveStruct; + TArray ExpectedVecEveryVecStruct; +}; + +UCLASS() +class UEnumActionsHandler : public UTestHandler +{ + GENERATED_BODY() +public: + + UFUNCTION() void OnInsertOneSimpleEnum(const FEventContext& Context, const FOneSimpleEnumType& Value); + UFUNCTION() void OnInsertVecSimpleEnum(const FEventContext& Context, const FVecSimpleEnumType& Value); + + UFUNCTION() void OnInsertOneEnumWithPayload(const FEventContext& Context, const FOneEnumWithPayloadType& Value); + UFUNCTION() void OnInsertVecEnumWithPayload(const FEventContext& Context, const FVecEnumWithPayloadType& Value); + + FOneSimpleEnumType ExpectedSimpleEnum; + FVecSimpleEnumType ExpectedVecEnum; + + FVecEnumWithPayloadType ExpectedVecEnumWithPayload; +}; + +UCLASS() +class ULargeTableActionHandler : public UTestHandler +{ + GENERATED_BODY() + +public: + + UFUNCTION() void OnInsertLargeTable(const FEventContext& Context, const FLargeTableType& InsertedRow); + UFUNCTION() void OnDeleteLargeTable(const FEventContext& Context, const FLargeTableType& DeletedRow); + + FLargeTableType ExpectedLargeTable; + }; + +/** Handler used for row deduplication tests. */ +UCLASS() +class URowDeduplicationHandler : public UTestHandler +{ + GENERATED_BODY() +public: + bool bInserted24 = false; + bool bInserted42 = false; + bool bDeleted24 = false; + bool bUpdated42 = false; + + UFUNCTION() void OnInsertPkU32(const FEventContext& Context, const FPkU32Type& Value); + UFUNCTION() void OnDeletePkU32(const FEventContext& Context, const FPkU32Type& Value); + UFUNCTION() void OnUpdatePkU32(const FEventContext& Context, const FPkU32Type& OldValue, const FPkU32Type& NewValue); +}; + +/** Handler used for row deduplication join tests. */ +UCLASS() +class URowDeduplicationJoinHandler : public UTestHandler +{ + GENERATED_BODY() +public: + bool bPkInsert = false; + bool bPkUpdate = false; + bool bUniqueInsert = false; + + UFUNCTION() void OnInsertPkU32(const FEventContext& Context, const FPkU32Type& Value); + UFUNCTION() void OnUpdatePkU32(const FEventContext& Context, const FPkU32Type& OldValue, const FPkU32Type& NewValue); + UFUNCTION() void OnDeletePkU32(const FEventContext& Context, const FPkU32Type& Value); + UFUNCTION() void OnInsertUniqueU32(const FEventContext& Context, const FUniqueU32Type& Value); + UFUNCTION() void OnDeleteUniqueU32(const FEventContext& Context, const FUniqueU32Type& Value); +}; + + + + + + + + + + + +/** Handler used for pk-simple-enum test. */ +UCLASS() +class UPkSimpleEnumHandler : public UTestHandler { + GENERATED_BODY() +public: + int32 Data1; + int32 Data2; + ESimpleEnumType A; + + UFUNCTION() + void OnInsertPkSimpleEnum(const FEventContext& Context, const FPkSimpleEnumType& Value); + UFUNCTION() + void OnUpdatePkSimpleEnum(const FEventContext& Context, const FPkSimpleEnumType& OldValue, const FPkSimpleEnumType& NewValue); + UFUNCTION() + void OnDeletePkSimpleEnum(const FEventContext& Context, const FPkSimpleEnumType& Value); +}; + +/** Handler used for indexed-simple-enum test. */ +UCLASS() +class UIndexedSimpleEnumHandler : public UTestHandler { + GENERATED_BODY() +public: + ESimpleEnumType A1; + ESimpleEnumType A2; + + UFUNCTION() + void OnInsertIndexedSimpleEnum(const FEventContext& Context, const FIndexedSimpleEnumType& Value); +}; + +/** Handler used for overlapping-subscriptions test. */ +UCLASS() +class UOverlappingSubscriptionsHandler : public UTestHandler { + GENERATED_BODY() +public: + UDbConnection* Connection; + + UFUNCTION() + void OnInsertPkU8Reducer(const FReducerEventContext& Context, uint8 N, int32 Data); + UFUNCTION() + void OnUpdatePkU8(const FEventContext& Context, const FPkU8Type& OldValue, const FPkU8Type& NewValue); +}; \ No newline at end of file diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/Tests/UmbreallaHeaderReducers.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/Tests/UmbreallaHeaderReducers.h new file mode 100644 index 00000000000..b9e05055b9c --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/Tests/UmbreallaHeaderReducers.h @@ -0,0 +1,181 @@ +//Reducers +#include "ModuleBindings/Reducers/DeleteFromBtreeU32.g.h" +#include "ModuleBindings/Reducers/DeleteLargeTable.g.h" +#include "ModuleBindings/Reducers/DeletePkBool.g.h" +#include "ModuleBindings/Reducers/DeletePkConnectionId.g.h" +#include "ModuleBindings/Reducers/DeletePkI128.g.h" +#include "ModuleBindings/Reducers/DeletePkI16.g.h" +#include "ModuleBindings/Reducers/DeletePkI256.g.h" +#include "ModuleBindings/Reducers/DeletePkI32.g.h" +#include "ModuleBindings/Reducers/DeletePkI64.g.h" +#include "ModuleBindings/Reducers/DeletePkI8.g.h" +#include "ModuleBindings/Reducers/DeletePkIdentity.g.h" +#include "ModuleBindings/Reducers/DeletePkString.g.h" +#include "ModuleBindings/Reducers/DeletePkU128.g.h" +#include "ModuleBindings/Reducers/DeletePkU16.g.h" +#include "ModuleBindings/Reducers/DeletePkU256.g.h" +#include "ModuleBindings/Reducers/DeletePkU32.g.h" +#include "ModuleBindings/Reducers/DeletePkU32InsertPkU32Two.g.h" +#include "ModuleBindings/Reducers/DeletePkU32Two.g.h" +#include "ModuleBindings/Reducers/DeletePkU64.g.h" +#include "ModuleBindings/Reducers/DeletePkU8.g.h" +#include "ModuleBindings/Reducers/DeleteUniqueBool.g.h" +#include "ModuleBindings/Reducers/DeleteUniqueConnectionId.g.h" +#include "ModuleBindings/Reducers/DeleteUniqueI128.g.h" +#include "ModuleBindings/Reducers/DeleteUniqueI16.g.h" +#include "ModuleBindings/Reducers/DeleteUniqueI256.g.h" +#include "ModuleBindings/Reducers/DeleteUniqueI32.g.h" +#include "ModuleBindings/Reducers/DeleteUniqueI64.g.h" +#include "ModuleBindings/Reducers/DeleteUniqueI8.g.h" +#include "ModuleBindings/Reducers/DeleteUniqueIdentity.g.h" +#include "ModuleBindings/Reducers/DeleteUniqueString.g.h" +#include "ModuleBindings/Reducers/DeleteUniqueU128.g.h" +#include "ModuleBindings/Reducers/DeleteUniqueU16.g.h" +#include "ModuleBindings/Reducers/DeleteUniqueU256.g.h" +#include "ModuleBindings/Reducers/DeleteUniqueU32.g.h" +#include "ModuleBindings/Reducers/DeleteUniqueU64.g.h" +#include "ModuleBindings/Reducers/DeleteUniqueU8.g.h" +#include "ModuleBindings/Reducers/InsertCallerOneConnectionId.g.h" +#include "ModuleBindings/Reducers/InsertCallerOneIdentity.g.h" +#include "ModuleBindings/Reducers/InsertCallerPkConnectionId.g.h" +#include "ModuleBindings/Reducers/InsertCallerPkIdentity.g.h" +#include "ModuleBindings/Reducers/InsertCallerUniqueConnectionId.g.h" +#include "ModuleBindings/Reducers/InsertCallerUniqueIdentity.g.h" +#include "ModuleBindings/Reducers/InsertCallerVecConnectionId.g.h" +#include "ModuleBindings/Reducers/InsertCallerVecIdentity.g.h" +#include "ModuleBindings/Reducers/InsertCallTimestamp.g.h" +#include "ModuleBindings/Reducers/InsertIntoBtreeU32.g.h" +#include "ModuleBindings/Reducers/InsertIntoIndexedSimpleEnum.g.h" +#include "ModuleBindings/Reducers/InsertIntoPkBtreeU32.g.h" +#include "ModuleBindings/Reducers/InsertLargeTable.g.h" +#include "ModuleBindings/Reducers/InsertOneBool.g.h" +#include "ModuleBindings/Reducers/InsertOneByteStruct.g.h" +#include "ModuleBindings/Reducers/InsertOneConnectionId.g.h" +#include "ModuleBindings/Reducers/InsertOneEnumWithPayload.g.h" +#include "ModuleBindings/Reducers/InsertOneEveryPrimitiveStruct.g.h" +#include "ModuleBindings/Reducers/InsertOneEveryVecStruct.g.h" +#include "ModuleBindings/Reducers/InsertOneF32.g.h" +#include "ModuleBindings/Reducers/InsertOneF64.g.h" +#include "ModuleBindings/Reducers/InsertOneI128.g.h" +#include "ModuleBindings/Reducers/InsertOneI16.g.h" +#include "ModuleBindings/Reducers/InsertOneI256.g.h" +#include "ModuleBindings/Reducers/InsertOneI32.g.h" +#include "ModuleBindings/Reducers/InsertOneI64.g.h" +#include "ModuleBindings/Reducers/InsertOneI8.g.h" +#include "ModuleBindings/Reducers/InsertOneIdentity.g.h" +#include "ModuleBindings/Reducers/InsertOneSimpleEnum.g.h" +#include "ModuleBindings/Reducers/InsertOneString.g.h" +#include "ModuleBindings/Reducers/InsertOneTimestamp.g.h" +#include "ModuleBindings/Reducers/InsertOneU128.g.h" +#include "ModuleBindings/Reducers/InsertOneU16.g.h" +#include "ModuleBindings/Reducers/InsertOneU256.g.h" +#include "ModuleBindings/Reducers/InsertOneU32.g.h" +#include "ModuleBindings/Reducers/InsertOneU64.g.h" +#include "ModuleBindings/Reducers/InsertOneU8.g.h" +#include "ModuleBindings/Reducers/InsertOneUnitStruct.g.h" +#include "ModuleBindings/Reducers/InsertOptionEveryPrimitiveStruct.g.h" +#include "ModuleBindings/Reducers/InsertOptionI32.g.h" +#include "ModuleBindings/Reducers/InsertOptionIdentity.g.h" +#include "ModuleBindings/Reducers/InsertOptionSimpleEnum.g.h" +#include "ModuleBindings/Reducers/InsertOptionString.g.h" +#include "ModuleBindings/Reducers/InsertOptionVecOptionI32.g.h" +#include "ModuleBindings/Reducers/InsertPkBool.g.h" +#include "ModuleBindings/Reducers/InsertPkConnectionId.g.h" +#include "ModuleBindings/Reducers/InsertPkI128.g.h" +#include "ModuleBindings/Reducers/InsertPkI16.g.h" +#include "ModuleBindings/Reducers/InsertPkI256.g.h" +#include "ModuleBindings/Reducers/InsertPkI32.g.h" +#include "ModuleBindings/Reducers/InsertPkI64.g.h" +#include "ModuleBindings/Reducers/InsertPkI8.g.h" +#include "ModuleBindings/Reducers/InsertPkIdentity.g.h" +#include "ModuleBindings/Reducers/InsertPkSimpleEnum.g.h" +#include "ModuleBindings/Reducers/InsertPkString.g.h" +#include "ModuleBindings/Reducers/InsertPkU128.g.h" +#include "ModuleBindings/Reducers/InsertPkU16.g.h" +#include "ModuleBindings/Reducers/InsertPkU256.g.h" +#include "ModuleBindings/Reducers/InsertPkU32.g.h" +#include "ModuleBindings/Reducers/InsertPkU32Two.g.h" +#include "ModuleBindings/Reducers/InsertPkU64.g.h" +#include "ModuleBindings/Reducers/InsertPkU8.g.h" +#include "ModuleBindings/Reducers/InsertPrimitivesAsStrings.g.h" +#include "ModuleBindings/Reducers/InsertTableHoldsTable.g.h" +#include "ModuleBindings/Reducers/InsertUniqueBool.g.h" +#include "ModuleBindings/Reducers/InsertUniqueConnectionId.g.h" +#include "ModuleBindings/Reducers/InsertUniqueI128.g.h" +#include "ModuleBindings/Reducers/InsertUniqueI16.g.h" +#include "ModuleBindings/Reducers/InsertUniqueI256.g.h" +#include "ModuleBindings/Reducers/InsertUniqueI32.g.h" +#include "ModuleBindings/Reducers/InsertUniqueI64.g.h" +#include "ModuleBindings/Reducers/InsertUniqueI8.g.h" +#include "ModuleBindings/Reducers/InsertUniqueIdentity.g.h" +#include "ModuleBindings/Reducers/InsertUniqueString.g.h" +#include "ModuleBindings/Reducers/InsertUniqueU128.g.h" +#include "ModuleBindings/Reducers/InsertUniqueU16.g.h" +#include "ModuleBindings/Reducers/InsertUniqueU256.g.h" +#include "ModuleBindings/Reducers/InsertUniqueU32.g.h" +#include "ModuleBindings/Reducers/InsertUniqueU32UpdatePkU32.g.h" +#include "ModuleBindings/Reducers/InsertUniqueU64.g.h" +#include "ModuleBindings/Reducers/InsertUniqueU8.g.h" +#include "ModuleBindings/Reducers/InsertUser.g.h" +#include "ModuleBindings/Reducers/InsertVecBool.g.h" +#include "ModuleBindings/Reducers/InsertVecByteStruct.g.h" +#include "ModuleBindings/Reducers/InsertVecConnectionId.g.h" +#include "ModuleBindings/Reducers/InsertVecEnumWithPayload.g.h" +#include "ModuleBindings/Reducers/InsertVecEveryPrimitiveStruct.g.h" +#include "ModuleBindings/Reducers/InsertVecEveryVecStruct.g.h" +#include "ModuleBindings/Reducers/InsertVecF32.g.h" +#include "ModuleBindings/Reducers/InsertVecF64.g.h" +#include "ModuleBindings/Reducers/InsertVecI128.g.h" +#include "ModuleBindings/Reducers/InsertVecI16.g.h" +#include "ModuleBindings/Reducers/InsertVecI256.g.h" +#include "ModuleBindings/Reducers/InsertVecI32.g.h" +#include "ModuleBindings/Reducers/InsertVecI64.g.h" +#include "ModuleBindings/Reducers/InsertVecI8.g.h" +#include "ModuleBindings/Reducers/InsertVecIdentity.g.h" +#include "ModuleBindings/Reducers/InsertVecSimpleEnum.g.h" +#include "ModuleBindings/Reducers/InsertVecString.g.h" +#include "ModuleBindings/Reducers/InsertVecTimestamp.g.h" +#include "ModuleBindings/Reducers/InsertVecU128.g.h" +#include "ModuleBindings/Reducers/InsertVecU16.g.h" +#include "ModuleBindings/Reducers/InsertVecU256.g.h" +#include "ModuleBindings/Reducers/InsertVecU32.g.h" +#include "ModuleBindings/Reducers/InsertVecU64.g.h" +#include "ModuleBindings/Reducers/InsertVecU8.g.h" +#include "ModuleBindings/Reducers/InsertVecUnitStruct.g.h" +#include "ModuleBindings/Reducers/NoOpSucceeds.g.h" +#include "ModuleBindings/Reducers/SendScheduledMessage.g.h" +#include "ModuleBindings/Reducers/UpdateIndexedSimpleEnum.g.h" +#include "ModuleBindings/Reducers/UpdatePkBool.g.h" +#include "ModuleBindings/Reducers/UpdatePkConnectionId.g.h" +#include "ModuleBindings/Reducers/UpdatePkI128.g.h" +#include "ModuleBindings/Reducers/UpdatePkI16.g.h" +#include "ModuleBindings/Reducers/UpdatePkI256.g.h" +#include "ModuleBindings/Reducers/UpdatePkI32.g.h" +#include "ModuleBindings/Reducers/UpdatePkI64.g.h" +#include "ModuleBindings/Reducers/UpdatePkI8.g.h" +#include "ModuleBindings/Reducers/UpdatePkIdentity.g.h" +#include "ModuleBindings/Reducers/UpdatePkSimpleEnum.g.h" +#include "ModuleBindings/Reducers/UpdatePkString.g.h" +#include "ModuleBindings/Reducers/UpdatePkU128.g.h" +#include "ModuleBindings/Reducers/UpdatePkU16.g.h" +#include "ModuleBindings/Reducers/UpdatePkU256.g.h" +#include "ModuleBindings/Reducers/UpdatePkU32.g.h" +#include "ModuleBindings/Reducers/UpdatePkU32Two.g.h" +#include "ModuleBindings/Reducers/UpdatePkU64.g.h" +#include "ModuleBindings/Reducers/UpdatePkU8.g.h" +#include "ModuleBindings/Reducers/UpdateUniqueBool.g.h" +#include "ModuleBindings/Reducers/UpdateUniqueConnectionId.g.h" +#include "ModuleBindings/Reducers/UpdateUniqueI128.g.h" +#include "ModuleBindings/Reducers/UpdateUniqueI16.g.h" +#include "ModuleBindings/Reducers/UpdateUniqueI256.g.h" +#include "ModuleBindings/Reducers/UpdateUniqueI32.g.h" +#include "ModuleBindings/Reducers/UpdateUniqueI64.g.h" +#include "ModuleBindings/Reducers/UpdateUniqueI8.g.h" +#include "ModuleBindings/Reducers/UpdateUniqueIdentity.g.h" +#include "ModuleBindings/Reducers/UpdateUniqueString.g.h" +#include "ModuleBindings/Reducers/UpdateUniqueU128.g.h" +#include "ModuleBindings/Reducers/UpdateUniqueU16.g.h" +#include "ModuleBindings/Reducers/UpdateUniqueU256.g.h" +#include "ModuleBindings/Reducers/UpdateUniqueU32.g.h" +#include "ModuleBindings/Reducers/UpdateUniqueU64.g.h" +#include "ModuleBindings/Reducers/UpdateUniqueU8.g.h" \ No newline at end of file diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/Tests/UmbreallaHeaderTypes.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/Tests/UmbreallaHeaderTypes.h new file mode 100644 index 00000000000..fc83193de5e --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/Tests/UmbreallaHeaderTypes.h @@ -0,0 +1,105 @@ +//Types +#include "ModuleBindings/Types/BTreeU32Type.g.h" +#include "ModuleBindings/Types/ByteStructType.g.h" +#include "ModuleBindings/Types/EnumWithPayloadType.g.h" +#include "ModuleBindings/Types/EveryPrimitiveStructType.g.h" +#include "ModuleBindings/Types/EveryVecStructType.g.h" +#include "ModuleBindings/Types/IndexedSimpleEnumType.g.h" +#include "ModuleBindings/Types/IndexedTable2Type.g.h" +#include "ModuleBindings/Types/IndexedTableType.g.h" +#include "ModuleBindings/Types/LargeTableType.g.h" +#include "ModuleBindings/Types/OneBoolType.g.h" +#include "ModuleBindings/Types/OneByteStructType.g.h" +#include "ModuleBindings/Types/OneConnectionIdType.g.h" +#include "ModuleBindings/Types/OneEnumWithPayloadType.g.h" +#include "ModuleBindings/Types/OneEveryPrimitiveStructType.g.h" +#include "ModuleBindings/Types/OneEveryVecStructType.g.h" +#include "ModuleBindings/Types/OneF32Type.g.h" +#include "ModuleBindings/Types/OneF64Type.g.h" +#include "ModuleBindings/Types/OneI128Type.g.h" +#include "ModuleBindings/Types/OneI16Type.g.h" +#include "ModuleBindings/Types/OneI256Type.g.h" +#include "ModuleBindings/Types/OneI32Type.g.h" +#include "ModuleBindings/Types/OneI64Type.g.h" +#include "ModuleBindings/Types/OneI8Type.g.h" +#include "ModuleBindings/Types/OneIdentityType.g.h" +#include "ModuleBindings/Types/OneSimpleEnumType.g.h" +#include "ModuleBindings/Types/OneStringType.g.h" +#include "ModuleBindings/Types/OneTimestampType.g.h" +#include "ModuleBindings/Types/OneU128Type.g.h" +#include "ModuleBindings/Types/OneU16Type.g.h" +#include "ModuleBindings/Types/OneU256Type.g.h" +#include "ModuleBindings/Types/OneU32Type.g.h" +#include "ModuleBindings/Types/OneU64Type.g.h" +#include "ModuleBindings/Types/OneU8Type.g.h" +#include "ModuleBindings/Types/OneUnitStructType.g.h" +#include "ModuleBindings/Types/OptionEveryPrimitiveStructType.g.h" +#include "ModuleBindings/Types/OptionI32Type.g.h" +#include "ModuleBindings/Types/OptionIdentityType.g.h" +#include "ModuleBindings/Types/OptionSimpleEnumType.g.h" +#include "ModuleBindings/Types/OptionStringType.g.h" +#include "ModuleBindings/Types/OptionVecOptionI32Type.g.h" +#include "ModuleBindings/Types/PkBoolType.g.h" +#include "ModuleBindings/Types/PkConnectionIdType.g.h" +#include "ModuleBindings/Types/PkI128Type.g.h" +#include "ModuleBindings/Types/PkI16Type.g.h" +#include "ModuleBindings/Types/PkI256Type.g.h" +#include "ModuleBindings/Types/PkI32Type.g.h" +#include "ModuleBindings/Types/PkI64Type.g.h" +#include "ModuleBindings/Types/PkI8Type.g.h" +#include "ModuleBindings/Types/PkIdentityType.g.h" +#include "ModuleBindings/Types/PkSimpleEnumType.g.h" +#include "ModuleBindings/Types/PkStringType.g.h" +#include "ModuleBindings/Types/PkU128Type.g.h" +#include "ModuleBindings/Types/PkU16Type.g.h" +#include "ModuleBindings/Types/PkU256Type.g.h" +#include "ModuleBindings/Types/PkU32TwoType.g.h" +#include "ModuleBindings/Types/PkU32Type.g.h" +#include "ModuleBindings/Types/PkU64Type.g.h" +#include "ModuleBindings/Types/PkU8Type.g.h" +#include "ModuleBindings/Types/ScheduledTableType.g.h" +#include "ModuleBindings/Types/SimpleEnumType.g.h" +#include "ModuleBindings/Types/TableHoldsTableType.g.h" +#include "ModuleBindings/Types/UniqueBoolType.g.h" +#include "ModuleBindings/Types/UniqueConnectionIdType.g.h" +#include "ModuleBindings/Types/UniqueI128Type.g.h" +#include "ModuleBindings/Types/UniqueI16Type.g.h" +#include "ModuleBindings/Types/UniqueI256Type.g.h" +#include "ModuleBindings/Types/UniqueI32Type.g.h" +#include "ModuleBindings/Types/UniqueI64Type.g.h" +#include "ModuleBindings/Types/UniqueI8Type.g.h" +#include "ModuleBindings/Types/UniqueIdentityType.g.h" +#include "ModuleBindings/Types/UniqueStringType.g.h" +#include "ModuleBindings/Types/UniqueU128Type.g.h" +#include "ModuleBindings/Types/UniqueU16Type.g.h" +#include "ModuleBindings/Types/UniqueU256Type.g.h" +#include "ModuleBindings/Types/UniqueU32Type.g.h" +#include "ModuleBindings/Types/UniqueU64Type.g.h" +#include "ModuleBindings/Types/UniqueU8Type.g.h" +#include "ModuleBindings/Types/UnitStructType.g.h" +#include "ModuleBindings/Types/UsersType.g.h" +#include "ModuleBindings/Types/VecBoolType.g.h" +#include "ModuleBindings/Types/VecByteStructType.g.h" +#include "ModuleBindings/Types/VecConnectionIdType.g.h" +#include "ModuleBindings/Types/VecEnumWithPayloadType.g.h" +#include "ModuleBindings/Types/VecEveryPrimitiveStructType.g.h" +#include "ModuleBindings/Types/VecEveryVecStructType.g.h" +#include "ModuleBindings/Types/VecF32Type.g.h" +#include "ModuleBindings/Types/VecF64Type.g.h" +#include "ModuleBindings/Types/VecI128Type.g.h" +#include "ModuleBindings/Types/VecI16Type.g.h" +#include "ModuleBindings/Types/VecI256Type.g.h" +#include "ModuleBindings/Types/VecI32Type.g.h" +#include "ModuleBindings/Types/VecI64Type.g.h" +#include "ModuleBindings/Types/VecI8Type.g.h" +#include "ModuleBindings/Types/VecIdentityType.g.h" +#include "ModuleBindings/Types/VecSimpleEnumType.g.h" +#include "ModuleBindings/Types/VecStringType.g.h" +#include "ModuleBindings/Types/VecTimestampType.g.h" +#include "ModuleBindings/Types/VecU128Type.g.h" +#include "ModuleBindings/Types/VecU16Type.g.h" +#include "ModuleBindings/Types/VecU256Type.g.h" +#include "ModuleBindings/Types/VecU32Type.g.h" +#include "ModuleBindings/Types/VecU64Type.g.h" +#include "ModuleBindings/Types/VecU8Type.g.h" +#include "ModuleBindings/Types/VecUnitStructType.g.h" diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/Public/Tests/UmbreallaHeaderaTables.h b/sdks/unreal/tests/TestClient/Source/TestClient/Public/Tests/UmbreallaHeaderaTables.h new file mode 100644 index 00000000000..ef2ae29fbbe --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/Public/Tests/UmbreallaHeaderaTables.h @@ -0,0 +1,99 @@ +//Include Tables +#include "ModuleBindings/Tables/BTreeU32Table.g.h" +#include "ModuleBindings/Tables/IndexedSimpleEnumTable.g.h" +#include "ModuleBindings/Tables/IndexedTable2Table.g.h" +#include "ModuleBindings/Tables/IndexedTableTable.g.h" +#include "ModuleBindings/Tables/LargeTableTable.g.h" +#include "ModuleBindings/Tables/OneBoolTable.g.h" +#include "ModuleBindings/Tables/OneByteStructTable.g.h" +#include "ModuleBindings/Tables/OneConnectionIdTable.g.h" +#include "ModuleBindings/Tables/OneEnumWithPayloadTable.g.h" +#include "ModuleBindings/Tables/OneEveryPrimitiveStructTable.g.h" +#include "ModuleBindings/Tables/OneEveryVecStructTable.g.h" +#include "ModuleBindings/Tables/OneF32Table.g.h" +#include "ModuleBindings/Tables/OneF64Table.g.h" +#include "ModuleBindings/Tables/OneI128Table.g.h" +#include "ModuleBindings/Tables/OneI16Table.g.h" +#include "ModuleBindings/Tables/OneI256Table.g.h" +#include "ModuleBindings/Tables/OneI32Table.g.h" +#include "ModuleBindings/Tables/OneI64Table.g.h" +#include "ModuleBindings/Tables/OneI8Table.g.h" +#include "ModuleBindings/Tables/OneIdentityTable.g.h" +#include "ModuleBindings/Tables/OneSimpleEnumTable.g.h" +#include "ModuleBindings/Tables/OneStringTable.g.h" +#include "ModuleBindings/Tables/OneTimestampTable.g.h" +#include "ModuleBindings/Tables/OneU128Table.g.h" +#include "ModuleBindings/Tables/OneU16Table.g.h" +#include "ModuleBindings/Tables/OneU256Table.g.h" +#include "ModuleBindings/Tables/OneU32Table.g.h" +#include "ModuleBindings/Tables/OneU64Table.g.h" +#include "ModuleBindings/Tables/OneU8Table.g.h" +#include "ModuleBindings/Tables/OneUnitStructTable.g.h" +#include "ModuleBindings/Tables/OptionEveryPrimitiveStructTable.g.h" +#include "ModuleBindings/Tables/OptionI32Table.g.h" +#include "ModuleBindings/Tables/OptionIdentityTable.g.h" +#include "ModuleBindings/Tables/OptionSimpleEnumTable.g.h" +#include "ModuleBindings/Tables/OptionStringTable.g.h" +#include "ModuleBindings/Tables/OptionVecOptionI32Table.g.h" +#include "ModuleBindings/Tables/PkBoolTable.g.h" +#include "ModuleBindings/Tables/PkConnectionIdTable.g.h" +#include "ModuleBindings/Tables/PkI128Table.g.h" +#include "ModuleBindings/Tables/PkI16Table.g.h" +#include "ModuleBindings/Tables/PkI256Table.g.h" +#include "ModuleBindings/Tables/PkI32Table.g.h" +#include "ModuleBindings/Tables/PkI64Table.g.h" +#include "ModuleBindings/Tables/PkI8Table.g.h" +#include "ModuleBindings/Tables/PkIdentityTable.g.h" +#include "ModuleBindings/Tables/PkSimpleEnumTable.g.h" +#include "ModuleBindings/Tables/PkStringTable.g.h" +#include "ModuleBindings/Tables/PkU128Table.g.h" +#include "ModuleBindings/Tables/PkU16Table.g.h" +#include "ModuleBindings/Tables/PkU256Table.g.h" +#include "ModuleBindings/Tables/PkU32Table.g.h" +#include "ModuleBindings/Tables/PkU32TwoTable.g.h" +#include "ModuleBindings/Tables/PkU64Table.g.h" +#include "ModuleBindings/Tables/PkU8Table.g.h" +#include "ModuleBindings/Tables/ScheduledTableTable.g.h" +#include "ModuleBindings/Tables/TableHoldsTableTable.g.h" +#include "ModuleBindings/Tables/UniqueBoolTable.g.h" +#include "ModuleBindings/Tables/UniqueConnectionIdTable.g.h" +#include "ModuleBindings/Tables/UniqueI128Table.g.h" +#include "ModuleBindings/Tables/UniqueI16Table.g.h" +#include "ModuleBindings/Tables/UniqueI256Table.g.h" +#include "ModuleBindings/Tables/UniqueI32Table.g.h" +#include "ModuleBindings/Tables/UniqueI64Table.g.h" +#include "ModuleBindings/Tables/UniqueI8Table.g.h" +#include "ModuleBindings/Tables/UniqueIdentityTable.g.h" +#include "ModuleBindings/Tables/UniqueStringTable.g.h" +#include "ModuleBindings/Tables/UniqueU128Table.g.h" +#include "ModuleBindings/Tables/UniqueU16Table.g.h" +#include "ModuleBindings/Tables/UniqueU256Table.g.h" +#include "ModuleBindings/Tables/UniqueU32Table.g.h" +#include "ModuleBindings/Tables/UniqueU64Table.g.h" +#include "ModuleBindings/Tables/UniqueU8Table.g.h" +#include "ModuleBindings/Tables/UsersTable.g.h" +#include "ModuleBindings/Tables/VecBoolTable.g.h" +#include "ModuleBindings/Tables/VecByteStructTable.g.h" +#include "ModuleBindings/Tables/VecConnectionIdTable.g.h" +#include "ModuleBindings/Tables/VecEnumWithPayloadTable.g.h" +#include "ModuleBindings/Tables/VecEveryPrimitiveStructTable.g.h" +#include "ModuleBindings/Tables/VecEveryVecStructTable.g.h" +#include "ModuleBindings/Tables/VecF32Table.g.h" +#include "ModuleBindings/Tables/VecF64Table.g.h" +#include "ModuleBindings/Tables/VecI128Table.g.h" +#include "ModuleBindings/Tables/VecI16Table.g.h" +#include "ModuleBindings/Tables/VecI256Table.g.h" +#include "ModuleBindings/Tables/VecI32Table.g.h" +#include "ModuleBindings/Tables/VecI64Table.g.h" +#include "ModuleBindings/Tables/VecI8Table.g.h" +#include "ModuleBindings/Tables/VecIdentityTable.g.h" +#include "ModuleBindings/Tables/VecSimpleEnumTable.g.h" +#include "ModuleBindings/Tables/VecStringTable.g.h" +#include "ModuleBindings/Tables/VecTimestampTable.g.h" +#include "ModuleBindings/Tables/VecU128Table.g.h" +#include "ModuleBindings/Tables/VecU16Table.g.h" +#include "ModuleBindings/Tables/VecU256Table.g.h" +#include "ModuleBindings/Tables/VecU32Table.g.h" +#include "ModuleBindings/Tables/VecU64Table.g.h" +#include "ModuleBindings/Tables/VecU8Table.g.h" +#include "ModuleBindings/Tables/VecUnitStructTable.g.h" \ No newline at end of file diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/TestClient.Build.cs b/sdks/unreal/tests/TestClient/Source/TestClient/TestClient.Build.cs new file mode 100644 index 00000000000..2bfd9d9af19 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/TestClient.Build.cs @@ -0,0 +1,25 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +using UnrealBuildTool; + +public class TestClient : ModuleRules +{ + public TestClient(ReadOnlyTargetRules Target) : base(Target) + { + // Set the module type to be a standard module + PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; + + // Set the module to use C++20 standard + CppStandard = CppStandardVersion.Cpp20; + + + // Enable exceptions for this module + bEnableExceptions = true; + + + PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "SpacetimeDbSdk" }); + + PrivateDependencyModuleNames.AddRange(new string[] { "DeveloperSettings" }); + + } +} diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/TestClient.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/TestClient.cpp new file mode 100644 index 00000000000..99beaceb359 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/TestClient.cpp @@ -0,0 +1,6 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#include "TestClient.h" +#include "Modules/ModuleManager.h" + +IMPLEMENT_PRIMARY_GAME_MODULE( FDefaultGameModuleImpl, TestClient, "TestClient" ); diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/TestClient.h b/sdks/unreal/tests/TestClient/Source/TestClient/TestClient.h new file mode 100644 index 00000000000..90aad9e7e22 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/TestClient.h @@ -0,0 +1,6 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/TestClientGameModeBase.cpp b/sdks/unreal/tests/TestClient/Source/TestClient/TestClientGameModeBase.cpp new file mode 100644 index 00000000000..2d71d20ad86 --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/TestClientGameModeBase.cpp @@ -0,0 +1,5 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "TestClientGameModeBase.h" + diff --git a/sdks/unreal/tests/TestClient/Source/TestClient/TestClientGameModeBase.h b/sdks/unreal/tests/TestClient/Source/TestClient/TestClientGameModeBase.h new file mode 100644 index 00000000000..ad4a259bb0d --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClient/TestClientGameModeBase.h @@ -0,0 +1,17 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "GameFramework/GameModeBase.h" +#include "TestClientGameModeBase.generated.h" + +/** + * + */ +UCLASS() +class TESTCLIENT_API ATestClientGameModeBase : public AGameModeBase +{ + GENERATED_BODY() + +}; diff --git a/sdks/unreal/tests/TestClient/Source/TestClientEditor.Target.cs b/sdks/unreal/tests/TestClient/Source/TestClientEditor.Target.cs new file mode 100644 index 00000000000..d4afeb7a33f --- /dev/null +++ b/sdks/unreal/tests/TestClient/Source/TestClientEditor.Target.cs @@ -0,0 +1,15 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +using UnrealBuildTool; +using System.Collections.Generic; + +public class TestClientEditorTarget : TargetRules +{ + public TestClientEditorTarget(TargetInfo Target) : base(Target) + { + Type = TargetType.Editor; + DefaultBuildSettings = BuildSettingsVersion.V5; + + ExtraModuleNames.AddRange( new string[] { "TestClient" } ); + } +} diff --git a/sdks/unreal/tests/TestClient/TestClient.uproject b/sdks/unreal/tests/TestClient/TestClient.uproject new file mode 100644 index 00000000000..3161fe4b8c8 --- /dev/null +++ b/sdks/unreal/tests/TestClient/TestClient.uproject @@ -0,0 +1,25 @@ +{ + "FileVersion": 3, + "EngineAssociation": "5.6", + "Category": "", + "Description": "", + "Modules": [ + { + "Name": "TestClient", + "Type": "Runtime", + "LoadingPhase": "Default" + } + ], + "Plugins": [ + { + "Name": "ModelingToolsEditorMode", + "Enabled": true, + "TargetAllowList": [ + "Editor" + ] + } + ], + "AdditionalPluginDirectories": [ + "../../src" + ] +} \ No newline at end of file diff --git a/sdks/unreal/tests/test.rs b/sdks/unreal/tests/test.rs new file mode 100644 index 00000000000..7ef7fcd2c28 --- /dev/null +++ b/sdks/unreal/tests/test.rs @@ -0,0 +1,378 @@ +use serial_test::serial; +use spacetimedb_testing::sdk::Test; +use std::env; +use std::path::{Path, PathBuf}; + +const MODULE: &str = "sdk-test"; // Spacetime module name in SpacetimeDB/modules +const UNREAL_MODULE: &str = "TestClient"; // Unreal C++ module target for codegen +const CLIENT_ROOT: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/tests/TestClient"); +const UPROJECT_FILE: &str = "TestClient.uproject"; +const LANGUAGE: &str = "unrealcpp"; // Language for SpacetimeDB codegen + +/// Panics if the file does not exist +fn assert_existing_file>(label: &str, path: P) { + let path = path.as_ref(); + match path.try_exists() { + Ok(true) => { + if !path.is_file() { + panic!("{} exists but is not a file: {}", label, path.display()); + } + } + Ok(false) => panic!("{} does not exist: {}", label, path.display()), + Err(e) => panic!("Failed to check {} ({}): {}", label, path.display(), e), + } +} + +/// Converts a PathBuf to a forward-slash string +fn normalize_path(path: PathBuf) -> String { + path.display().to_string().replace('\\', "/") +} + +/// Returns full path to Unreal Editor executable +fn ue_editor_exe() -> String { + let root = ue_root(); + let path = if cfg!(target_os = "windows") { + root.join("Engine/Binaries/Win64/UnrealEditor.exe") + } else { + root.join("Engine/Binaries/Linux/UnrealEditor") + }; + normalize_path(path) +} + +/// Returns full path to Unreal Build script (Build.bat or Build.sh) +fn ue_build_script() -> String { + let root = ue_root(); + let path = if cfg!(target_os = "windows") { + root.join("Engine/Build/BatchFiles/Build.bat") + } else { + root.join("Engine/Build/BatchFiles/Linux/Build.sh") + }; + normalize_path(path) +} + +/// Reads the UE_ROOT_PATH environment variable to find the Unreal Editor directory. +/// +/// Errors if UE_ROOT_PATH is not set — must point to the full path of Editor direcory path. +/// Example: "C:/Program Files/Epic Games/UE_5.6" +fn ue_root() -> PathBuf { + let root = env::var("UE_ROOT_PATH") + .expect("UE_ROOT_PATH not set — set to Unreal Engine root directory (no trailing slash)"); + PathBuf::from(root.replace('\\', "/")) +} + +fn make_test(test_name: &str) -> Test { + let build_script = ue_build_script(); + let editor_exe = ue_editor_exe(); + + assert_existing_file("Unreal build script", &build_script); + assert_existing_file("Unreal Editor executable", &editor_exe); + + let client_root = normalize_path(PathBuf::from(CLIENT_ROOT)); + let uproject_path = normalize_path(PathBuf::from(format!("{client_root}/{UPROJECT_FILE}"))); + assert_existing_file("uproject", &uproject_path); + + // Headless compile (no cook) + let compile_command = if cfg!(target_os = "windows") { + format!( + "\"{build_script}\" {UNREAL_MODULE}Editor Win64 Development \"{uproject_path}\" -waitmutex -skipbuildengine" + ) + } else { + format!("\"{build_script}\" {UNREAL_MODULE}Editor Linux Development \"{uproject_path}\" -skipbuildengine") + }; + + // Run automation test + + let run_command = format!( + "\"{editor_exe}\" \"{uproject_path}\" -NullRHI -Unattended -NoSound -nop4 -NoSplash -DDC-ForceMemoryCache -ddc=InstalledNoZenLocalFallback -ExecCmds=\"Automation RunTests SpacetimeDB.TestClient.{test_name}; Quit\"" + ); + + Test::builder() + .with_name(test_name) + // Spacetime DB module + .with_module(MODULE) + // For unrealcpp this is the .uproject root folder + .with_client(&client_root) + .with_language(LANGUAGE) + // Unreal-only: required for spacetime generate --module-name + .with_unreal_module(UNREAL_MODULE) + .with_compile_command(compile_command) + .with_run_command(run_command) + .build() +} + +// Below shows examples on how to use the serial and parallel attributes for tests + +//#[test] +//#[serial] +//fn test_serial_one() { +// // Do things +//} + +//#[test] +//#[serial(something)] +//fn test_serial_one() { +// // Do things +//} + +//#[test] +//#[parallel] +//fn test_parallel_another() { +// // Do parallel things +//} + +//48 tests → 6 groups → 8 per group (where possible) +//Gouping added for performace +// ---------------- GROUP 1 ---------------- + +#[test] +#[serial(Group1)] +fn unreal_insert_primitive() { + make_test("InsertPrimitiveTest").run(); +} + +#[test] +#[serial(Group1)] +fn unreal_subscribe_and_cancel() { + make_test("SubscribeAndCancelTest").run(); +} + +#[test] +#[serial(Group1)] +fn unreal_subscribe_and_unsubscribe() { + make_test("SubscribeAndUnsubscribeTest").run(); +} + +#[test] +#[serial(Group1)] +fn unreal_subscription_error_smoke_test() { + make_test("SubscriptionErrorSmokeTest").run(); +} + +#[test] +#[serial(Group1)] +fn unreal_delete_primitive() { + make_test("DeletePrimitiveTest").run(); +} + +#[test] +#[serial(Group1)] +fn unreal_update_primitive() { + make_test("UpdatePrimitiveTest").run(); +} + +#[test] +#[serial(Group1)] +fn unreal_insert_identity() { + make_test("InsertIdentityTest").run(); +} + +#[test] +#[serial(Group1)] +fn unreal_insert_caller_identity() { + make_test("InsertCallerIdentityTest").run(); +} + +// ---------------- GROUP 2 ---------------- +#[test] +#[serial(Group2)] +fn unreal_delete_identity() { + make_test("DeleteIdentityTest").run(); +} + +#[test] +#[serial(Group2)] +fn unreal_update_identity() { + make_test("UpdateIdentityTest").run(); +} + +#[test] +#[serial(Group2)] +fn unreal_insert_connection_id() { + make_test("InsertConnectionIdTest").run(); +} + +#[test] +#[serial(Group2)] +fn unreal_insert_caller_connection_id() { + make_test("InsertCallerConnectionIdTest").run(); +} + +#[test] +#[serial(Group2)] +fn unreal_delete_connection_id() { + make_test("DeleteConnectionIdTest").run(); +} + +#[test] +#[serial(Group2)] +fn unreal_update_connection_id() { + make_test("UpdateConnectionIdTest").run(); +} + +#[test] +#[serial(Group2)] +fn unreal_insert_timestamp() { + make_test("InsertTimestampTest").run(); +} + +#[test] +#[serial(Group2)] +fn unreal_insert_call_timestamp() { + make_test("InsertCallTimestampTest").run(); +} + +// ---------------- GROUP 3 ---------------- +#[test] +#[serial(Group3)] +fn unreal_on_reducer() { + make_test("OnReducerTest").run(); +} + +#[test] +#[serial(Group3)] +fn unreal_fail_reducer() { + make_test("FailReducerTest").run(); +} + +#[test] +#[serial(Group3)] +fn unreal_insert_vec() { + make_test("InsertVecTest").run(); +} + +#[test] +#[serial(Group3)] +fn unreal_insert_option_some() { + make_test("InsertOptionSomeTest").run(); +} + +#[test] +#[serial(Group3)] +fn unreal_insert_option_none() { + make_test("InsertOptionNoneTest").run(); +} + +#[test] +#[serial(Group3)] +fn unreal_insert_struct() { + make_test("InsertStructTest").run(); +} + +#[test] +#[serial(Group3)] +fn unreal_insert_simple_enum() { + make_test("InsertSimpleEnumTest").run(); +} + +#[test] +#[serial(Group3)] +fn unreal_insert_enum_with_payload() { + make_test("InsertEnumWithPayloadTest").run(); +} + +// ---------------- GROUP 4 ---------------- +#[test] +#[serial(Group4)] +fn unreal_insert_delete_large_table() { + make_test("InsertDeleteLargeTableTest").run(); +} + +#[test] +#[serial(Group4)] +fn unreal_insert_primitives_as_strings() { + make_test("InsertPrimitivesAsStringsTest").run(); +} + +#[test] +#[serial(Group4)] +fn unreal_reauth() { + make_test("ReauthPart1Test").run(); + make_test("ReauthPart2Test").run(); +} + +#[test] +#[should_panic] +#[serial(Group4)] +fn unreal_should_fail() { + make_test("ShouldFailTest").run(); +} + +#[test] +#[serial(Group4)] +fn unreal_caller_always_notified() { + make_test("CallerAlwaysNotifiedTest").run(); +} + +#[test] +#[serial(Group4)] +fn unreal_subscribe_all_select_star() { + make_test("SubscribeAllSelectStarTest").run(); +} + +// ---------------- GROUP 5 ---------------- +#[test] +#[serial(Group5)] +fn unreal_row_deduplication() { + make_test("RowDeduplicationTest").run(); +} + +#[test] +#[serial(Group5)] +fn unreal_row_deduplication_join_r_and_s() { + make_test("RowDeduplicationJoinRAndSTest").run(); +} + +#[test] +#[serial(Group5)] +fn unreal_row_deduplication_r_join_s_and_r_joint() { + make_test("RowDeduplicationRJoinSAndRJoinTTest").run(); +} + +#[test] +#[serial(Group5)] +fn unreal_test_lhs_join_update() { + make_test("LhsJoinUpdateTest").run(); +} + +#[test] +#[serial(Group5)] +fn unreal_test_lhs_join_update_disjoint_queries() { + make_test("LhsJoinUpdateDisjointQueriesTest").run(); +} + +#[test] +#[serial(Group5)] +fn unreal_test_intra_query_bag_semantics_for_join() { + make_test("IntraQueryBagSemanticsForJoinTest").run(); +} + +// ---------------- GROUP 6 ---------------- +#[test] +#[serial(Group6)] +fn unreal_test_parameterized_subscription() { + make_test("ParameterizedSubscriptionTest").run(); +} + +#[test] +#[serial(Group6)] +fn unreal_test_rls_subscription() { + make_test("RlsSubscriptionTest").run(); +} + +#[test] +#[serial(Group6)] +fn unreal_pk_simple_enum() { + make_test("PkSimpleEnumTest").run(); +} + +#[test] +#[serial(Group6)] +fn unreal_indexed_simple_enum() { + make_test("IndexedSimpleEnumTest").run(); +} + +#[test] +#[serial(Group6)] +fn unreal_overlapping_subscriptions() { + make_test("OverlappingSubscriptionsTest").run(); +}