Files
UnrealEngineUWP/Engine/Source/Developer/Windows/LiveCodingServer/Private/External/LC_CoffCache.h
Rolando Caloca 532adaa65c DR - Merging //UE4/Dev-Main@5531558 to Dev-Rendering (//UE4/Dev-Rendering)
#rb none
#rnx

[CL 5591014 by Rolando Caloca in Dev-Rendering branch]
2019-03-27 11:33:31 -04:00

33 lines
742 B
C++

// Copyright 2011-2019 Molecular Matters GmbH, all rights reserved.
#pragma once
#include "CoreTypes.h"
#include "LC_Coff.h"
#include "LC_CriticalSection.h"
template <typename T>
class CoffCache
{
public:
CoffCache(void);
~CoffCache(void);
// updates an entry in the cache. if it already exists, the existing one will be deleted.
// takes ownership over the database.
// thread-safe.
void Update(const ImmutableString& coffIdentifier, T* database);
// returns a database associated with a certain COFF id.
const T* Lookup(const ImmutableString& coffIdentifier) const;
bool Contains(const ImmutableString& coffIdentifier) const;
private:
mutable CriticalSection m_cs;
typedef types::StringMap<T*> Cache;
Cache m_cache;
};