Initial community commit

This commit is contained in:
Jef 2024-09-24 14:54:57 +02:00
parent 537bcbc862
commit fc06254474
16440 changed files with 4239995 additions and 2 deletions

View file

@ -0,0 +1,48 @@
#ifndef CACHEDDATAH
#define CACHEDDATAH
template <class DataType>
class CachedData
{
public:
CachedData() : cached(false)
{
}
CachedData(DataType _data) : cached(true), data(_data)
{
}
operator DataType()
{
return data;
}
bool IsCached()
{
return cached;
}
void ClearCache()
{
cached=false;
}
DataType *operator &()
{
if (cached)
return &data;
else
return 0;
}
template <class FromType>
bool operator =(FromType from)
{
data = from;
cached=true;
return cached;
}
private:
bool cached;
DataType data;
};
#endif