// Copyright (c) 2024 Sentry. All Rights Reserved. #include "SentrySamplingContext.h" #include "SentryTransactionContext.h" #include "Interface/SentrySamplingContextInterface.h" #if PLATFORM_ANDROID #include "Android/SentrySamplingContextAndroid.h" #elif PLATFORM_IOS || PLATFORM_MAC #include "Apple/SentrySamplingContextApple.h" #endif USentrySamplingContext::USentrySamplingContext() { } USentryTransactionContext* USentrySamplingContext::GetTransactionContext() const { if (!SentrySamplingContextNativeImpl) return nullptr; TSharedPtr transactionContextNativeImpl = SentrySamplingContextNativeImpl->GetTransactionContext(); USentryTransactionContext* unrealTransactionContext = NewObject(); unrealTransactionContext->InitWithNativeImpl(transactionContextNativeImpl); return unrealTransactionContext; } TMap USentrySamplingContext::GetCustomSamplingContext() const { if (!SentrySamplingContextNativeImpl) return TMap(); return SentrySamplingContextNativeImpl->GetCustomSamplingContext(); } void USentrySamplingContext::InitWithNativeImpl(TSharedPtr samplingContextImpl) { SentrySamplingContextNativeImpl = samplingContextImpl; } TSharedPtr USentrySamplingContext::GetNativeImpl() { return SentrySamplingContextNativeImpl; }