Download

Exposing C++ class thats inside a preprocessor

How should I go on about exposing this class to blueprints?

class FOnlineSubsystemEOS;

#if WITH_EOS_SDK
#include "eos_stats_types.h"

/**
 * Interface for interacting with EOS stats
 */

UCLASS(Blueprintable, BlueprintType)
class FOnlineStatsEOS : public UObject
{
public:
    FOnlineStatsEOS() = delete;
    virtual ~FOnlineStatsEOS() = default;

// IOnlineStats Interface
    UFUNCTION(BlueprintCallable, Category = "OnlineStats")
    virtual void QueryStats(const TSharedRef<const FUniqueNetId> LocalUserId, const TSharedRef<const FUniqueNetId> StatsUser, const FOnlineStatsQueryUserStatsComplete& Delegate) override;
    UFUNCTION(BlueprintCallable, Category = "OnlineStats")
    virtual void QueryStats(const TSharedRef<const FUniqueNetId> LocalUserId, const TArray<TSharedRef<const FUniqueNetId>>& StatUsers, const TArray<FString>& StatNames, const FOnlineStatsQueryUsersStatsComplete& Delegate) override;
    virtual TSharedPtr<const FOnlineStatsUserStats> GetStats(const TSharedRef<const FUniqueNetId> StatsUserId) const override;
    virtual void UpdateStats(const TSharedRef<const FUniqueNetId> LocalUserId, const TArray<FOnlineStatsUserUpdatedStats>& UpdatedUserStats, const FOnlineStatsUpdateStatsComplete& Delegate) override;
#if !UE_BUILD_SHIPPING
    virtual void ResetStats(const TSharedRef<const FUniqueNetId> StatsUserId) override;
#endif
// ~IOnlineStats Interface

PACKAGE_SCOPE:
    FOnlineStatsEOS(FOnlineSubsystemEOS* InSubsystem)
        : EOSSubsystem(InSubsystem)
    {
    }

private:
    void WriteStats(EOS_ProductUserId LocalUserId, EOS_ProductUserId UserId, const FOnlineStatsUserUpdatedStats& PlayerStats);

    /** Reference to the main EOS subsystem */
    FOnlineSubsystemEOS* EOSSubsystem;
    /** Cached list of stats for users as they arrive */
    TUniqueNetIdMap<TSharedRef<FOnlineStatsUserStats>> StatsCache;
};

typedef TSharedPtr<FOnlineStatsEOS, ESPMode::ThreadSafe> FOnlineStatsEOSPtr;

#endif

I’ve read I have to “wrap it” or “create a wrapper” but how do I do that? (I need some code examples of how such an wrapper would look like)