2015-08-04 18:30:31 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <SDL_thread.h>
|
|
|
|
|
2015-08-04 18:57:53 +00:00
|
|
|
/**
|
|
|
|
* \class CSDLCondWrapper
|
|
|
|
* \brief Wrapper for safe creation/deletion of SDL_cond
|
|
|
|
*/
|
|
|
|
class CSDLCondWrapper
|
2015-08-04 18:30:31 +00:00
|
|
|
{
|
|
|
|
public:
|
2015-08-04 18:57:53 +00:00
|
|
|
CSDLCondWrapper()
|
2015-08-04 18:30:31 +00:00
|
|
|
: m_cond(SDL_CreateCond())
|
|
|
|
{}
|
|
|
|
|
2015-08-04 18:57:53 +00:00
|
|
|
~CSDLCondWrapper()
|
2015-08-04 18:30:31 +00:00
|
|
|
{
|
|
|
|
SDL_DestroyCond(m_cond);
|
|
|
|
}
|
|
|
|
|
2015-08-04 18:57:53 +00:00
|
|
|
CSDLCondWrapper(const CSDLCondWrapper&) = delete;
|
|
|
|
CSDLCondWrapper& operator=(const CSDLCondWrapper&) = delete;
|
2015-08-04 18:30:31 +00:00
|
|
|
|
|
|
|
SDL_cond* operator*()
|
|
|
|
{
|
|
|
|
return m_cond;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
SDL_cond* m_cond;
|
|
|
|
};
|