mirror of
https://github.com/libretro/Play-.git
synced 2025-02-01 14:15:27 +00:00
31 lines
495 B
C++
31 lines
495 B
C++
#pragma once
|
|
|
|
template <typename Type>
|
|
struct OsVariableWrapper
|
|
{
|
|
public:
|
|
explicit OsVariableWrapper(Type* storage) : m_storage(storage) { }
|
|
OsVariableWrapper(const OsVariableWrapper&) = delete;
|
|
|
|
OsVariableWrapper& operator =(const OsVariableWrapper&) = delete;
|
|
|
|
OsVariableWrapper& operator =(const Type& value)
|
|
{
|
|
(*m_storage) = value;
|
|
return (*this);
|
|
}
|
|
|
|
operator Type() const
|
|
{
|
|
return *m_storage;
|
|
}
|
|
|
|
uint32 Get() const
|
|
{
|
|
return *m_storage;
|
|
}
|
|
|
|
private:
|
|
Type* m_storage;
|
|
};
|