metaforce/Runtime/CArchitectureQueue.hpp

31 lines
617 B
C++
Raw Permalink Normal View History

2015-08-20 02:52:07 +00:00
#ifndef __RETRO_CARCHITECTUREQUEUE_HPP__
#define __RETRO_CARCHITECTUREQUEUE_HPP__
#include <list>
#include "CArchitectureMessage.hpp"
namespace Retro
{
class CArchitectureQueue
{
std::list<CArchitectureMessage> m_list;
public:
2015-08-26 01:34:56 +00:00
void Push(CArchitectureMessage&& msg)
2015-08-20 02:52:07 +00:00
{
m_list.push_back(std::move(msg));
}
2015-08-26 01:34:56 +00:00
CArchitectureMessage Pop()
2015-08-20 02:52:07 +00:00
{
2015-08-26 01:34:56 +00:00
CArchitectureMessage msg = std::move(m_list.front());
2015-08-20 02:52:07 +00:00
m_list.pop_front();
2015-08-26 01:34:56 +00:00
return msg;
2015-08-20 02:52:07 +00:00
}
2015-08-26 01:34:56 +00:00
void Clear() {m_list.clear();}
operator bool() {return m_list.size() != 0;}
2015-08-20 02:52:07 +00:00
};
}
#endif // __RETRO_CARCHITECTUREQUEUE_HPP__