// Copyright (c) Microsoft Corporation. 
// Licensed under the MIT license.

#pragma once

#include "Containers/Ticker.h"
#include "SimplygonJobData.h"

class SIMPLYGONPLUGINUTILITIES_API FSimplygonProcessor : FTickerObjectBase
{
public:
	FSimplygonProcessor() {};
	~FSimplygonProcessor() {};

	virtual bool Tick(float DeltaTime) override;

	void Add(const FSimplygonProcessGameThreadDelegate& ExecuteOnGameThread);

protected:
	TArray<FSimplygonProcessGameThreadDelegate> JobsToComplete;

	/** Critical section to keep ProxyMeshJobs/ToProcessJobDataMap access thread-safe */
	FCriticalSection StateLock;
};

