metaforce/Runtime/CArchitectureQueue.hpp

31 lines
617 B
C++
Raw Normal View History

2016-02-13 09:02:47 +00:00
#ifndef __PSHAG_CARCHITECTUREQUEUE_HPP__
#define __PSHAG_CARCHITECTUREQUEUE_HPP__
2015-08-20 02:52:07 +00:00
#include <list>
#include "CArchitectureMessage.hpp"
2016-02-13 09:02:47 +00:00
namespace pshag
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
};
}
2016-02-13 09:02:47 +00:00
#endif // __PSHAG_CARCHITECTUREQUEUE_HPP__