CelticCraft/Plugins/VoxelFree/Source/Voxel/Public/VoxelCancelCounter.h

25 lines
443 B
C
Raw Permalink Normal View History

2023-07-03 16:17:13 +00:00
// Copyright 2020 Phyronnaz
#pragma once
#include "CoreMinimal.h"
#include "VoxelSharedPtr.h"
class FVoxelCancelCounter
{
public:
explicit FVoxelCancelCounter(const TVoxelSharedRef<FThreadSafeCounter64>& Counter)
: Counter(Counter)
, Threshold(Counter->GetValue())
{
}
bool IsCanceled() const
{
return Counter->GetValue() > Threshold;
}
private:
const TVoxelSharedRef<FThreadSafeCounter64> Counter;
const int64 Threshold;
};