| 16 | CommandQueue::~CommandQueue() = default; |
| 17 | |
| 18 | void CommandQueue::enqueue(std::unique_ptr<MICommand> command) |
| 19 | { |
| 20 | ++m_tokenCounter; |
| 21 | if (m_tokenCounter == 0) |
| 22 | m_tokenCounter = 1; |
| 23 | command->setToken(m_tokenCounter); |
| 24 | |
| 25 | // take the time when this command was added to the command queue |
| 26 | command->markAsEnqueued(); |
| 27 | |
| 28 | if (command->flags() & (CmdImmediately | CmdInterrupt)) |
| 29 | ++m_immediatelyCounter; |
| 30 | |
| 31 | m_commandList.push_back(std::move(command)); |
| 32 | |
| 33 | rationalizeQueue(m_commandList.back().get()); |
| 34 | dumpQueue(); |
| 35 | } |
| 36 | |
| 37 | void CommandQueue::dumpQueue() const |
| 38 | { |