Files
FlaxEngine/Source/Engine/Level/ActorsCache.h
2022-01-14 13:31:12 +01:00

37 lines
1.1 KiB
C++

// Copyright (c) 2012-2022 Wojciech Figat. All rights reserved.
#pragma once
#include "Actor.h"
#include "Engine/Serialization/ISerializeModifier.h"
#include "Engine/Core/Collections/CollectionPoolCache.h"
/// <summary>
/// Acceleration structure used to improve operations performed on a set of actors. Cache the data and allows to reuse memory container for less allocations. It's a thread-safe.
/// </summary>
class ActorsCache
{
public:
typedef ActorsLookup ActorsLookupType;
typedef Array<Actor*> ActorsListType;
typedef Array<SceneObject*> SceneObjectsListType;
public:
/// <summary>
/// Gets the actors lookup cached. Safe allocation, per thread, uses caching.
/// </summary>
static CollectionPoolCache<ActorsLookupType> ActorsLookupCache;
/// <summary>
/// Gets the actors lookup cached. Safe allocation, per thread, uses caching.
/// </summary>
static CollectionPoolCache<ActorsListType> ActorsListCache;
/// <summary>
/// Gets the scene objects lookup cached. Safe allocation, per thread, uses caching.
/// </summary>
static CollectionPoolCache<SceneObjectsListType> SceneObjectsListCache;
};