metaforce/Runtime/CArchitectureQueue.hpp

29 lines
504 B
C++
Raw Normal View History

2018-10-07 03:42:33 +00:00
#pragma once
2015-08-20 02:52:07 +00:00
#include <list>
#include "CArchitectureMessage.hpp"
2016-03-04 23:04:53 +00:00
namespace urde
2015-08-20 02:52:07 +00:00
{
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
};
}