Skip to content
2.0Product documentation

C++ integration ​

Add AuralisRegisterSystemRuntime to the dependencies of the module that uses the plugin. Use a public dependency when your public headers expose plugin types; otherwise a private dependency may be enough.

csharp
PublicDependencyModuleNames.AddRange(new[]
{
    "Core", "CoreUObject", "Engine",
    "GameplayTags", "AuralisRegisterSystemRuntime"
});

Minimal actor example ​

This example defines a project actor named ARegistryBeacon. It registers itself as the active checkpoint on BeginPlay and unregisters its saved handle on EndPlay. Add these files to your own project module, then rebuild that project.

RegistryBeacon.h

cpp
#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "AuralisRegisterSystemTypes.h"
#include "RegistryBeacon.generated.h"

UCLASS()
class ARegistryBeacon : public AActor
{
    GENERATED_BODY()

protected:
    virtual void BeginPlay() override;
    virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;

private:
    UPROPERTY(Transient)
    FAuralisRegisterHandle RegistrationHandle;
};

RegistryBeacon.cpp

cpp
#include "RegistryBeacon.h"
#include "AuralisRegisterSystem.h"
#include "AuralisRegisterBlueprintLibrary.h"

void ARegistryBeacon::BeginPlay()
{
    Super::BeginPlay();

    FAuralisRegisterDescriptor Descriptor;
    Descriptor.Key = TEXT("Checkpoint.Active");
    Descriptor.DuplicatePolicy = EAuralisRegisterDuplicatePolicy::Replace;
    RegistrationHandle = FAuralisRegisterSystem::Register(this, this, Descriptor);
}

void ARegistryBeacon::EndPlay(const EEndPlayReason::Type EndPlayReason)
{
    UAuralisRegisterBlueprintLibrary::Unregister(RegistrationHandle);
    RegistrationHandle.Reset();
    Super::EndPlay(EndPlayReason);
}

Use this lookup fragment inside another game-thread method with a valid UObject world context (this):

cpp
ARegistryBeacon* Checkpoint =
    FAuralisRegisterSystem::FindByKey<ARegistryBeacon>(
        this, TEXT("Checkpoint.Active"));

if (IsValid(Checkpoint))
{
    const FVector CheckpointLocation = Checkpoint->GetActorLocation();
    // Use CheckpointLocation in your own gameplay logic.
}

The lookup file also needs RegistryBeacon.h and AuralisRegisterSystem.h. This is a source-reviewed integration example; it has not been compiled as a new sample project for this website.

Query more than a key ​

cpp
FAuralisRegisterQuery Query;
Query.Key = TEXT("Interact");
Query.SortMode = EAuralisRegisterSortMode::PriorityThenOldest;

TArray<AActor*> Actors;
FAuralisRegisterSystem::FindAll<AActor>(this, Actors, Query);

FindFirst<T> sets the object class to T, clears the struct filter, and forces one result. FindAll<T> resets the output array, sets the class to T, and retains the query limit. An interface supplied through ObjectClass is retained as RequiredInterface by these typed wrappers. Set RequiredInterface explicitly when combining a concrete class with an interface requirement.

These typed methods return registration-derived objects, so an object with several matching entries can appear more than once. Use UAuralisRegisterBlueprintLibrary::FindObjects for unique object results.

Other facade methods ​

MethodPurpose
FindByKey<T> / FindByTag<T>Typed first-object shortcuts.
Count / IsRegisteredCount matching registrations or check one object.
UpdateChange metadata through a saved handle.
ResolveObtain the scope's registry.
FindFirstStruct<T>Read an owned result copy for a reflected struct type.

The underlying Blueprint library is also callable from C++. Keep its argument order in mind: RegisterObject takes scope before descriptor; the FAuralisRegisterSystem::Register facade takes descriptor before scope.

Ownership and scope ​

Object references in the registry are weak. Keep independently created services in reflected owner properties. Struct registration copies the value; modifying a returned copy does not update the stored data. All calls require the game thread.

Pass EAuralisRegisterScope::GameInstance, LocalPlayer, or Engine when needed; the facade defaults to World. LocalPlayer calls can take an explicit ULocalPlayer* to remove ambiguity. See Scopes and lifetimes.

Multiple products. One knowledge base.