condensed front() and pop() into pop()

This commit is contained in:
Tom Early committed 2021-10-28 18:02:57 -07:00
1 parent 048bb6d9ba
commit 197fb2c166
12 files changed
+14 -26

No files matched your search

+2 -4
View File
@@ -181,9 +181,8 @@ void CCodecStream::Task(void)
// pop the original packet
if ( !m_LocalQueue.empty() )
{
auto Packet = m_LocalQueue.front();
auto Packet = m_LocalQueue.pop();
auto Frame = (CDvFramePacket *)Packet.get();
m_LocalQueue.pop();
// todo: check the PID
// update content with transcoded ambe
Frame->SetAmbe(m_uiCodecOut, Ambe);
@@ -208,9 +207,8 @@ void CCodecStream::Task(void)
while ( !empty() )
{
// yes, pop it from queue
auto Packet = front();
auto Packet = pop();
auto Frame = (CDvFramePacket *)Packet.get();
pop();
// yes, send to ambed
// this assume that thread pushing the Packet
+1 -2
View File
@@ -232,8 +232,7 @@ void CDcsProtocol::HandleQueue(void)
while ( !m_Queue.empty() )
{
// get the packet
auto packet = m_Queue.front();
m_Queue.pop();
auto packet = m_Queue.pop();
// get our sender's id
int iModId = g_Reflector.GetModuleIndex(packet->GetModuleId());
+1 -1
View File
@@ -37,7 +37,7 @@ public:
~CDcsStreamCacheItem() {}
CDvHeaderPacket m_dvHeader;
uint32_t m_iSeqCounter;
uint32_t m_iSeqCounter;
};
class CDcsProtocol : public CProtocol
+1 -2
View File
@@ -223,8 +223,7 @@ void CDextraProtocol::HandleQueue(void)
while ( !m_Queue.empty() )
{
// get the packet
auto packet = m_Queue.front();
m_Queue.pop();
auto packet = m_Queue.pop();
// encode it
CBuffer buffer;
+1 -2
View File
@@ -351,8 +351,7 @@ void CDmrmmdvmProtocol::HandleQueue(void)
while ( !m_Queue.empty() )
{
// get the packet
auto packet = m_Queue.front();
m_Queue.pop();
auto packet = m_Queue.pop();
// get our sender's id
int iModId = g_Reflector.GetModuleIndex(packet->GetModuleId());
+1 -2
View File
@@ -224,8 +224,7 @@ void CDmrplusProtocol::HandleQueue(void)
while ( !m_Queue.empty() )
{
// get the packet
auto packet = m_Queue.front();
m_Queue.pop();
auto packet = m_Queue.pop();
// get our sender's id
int iModId = g_Reflector.GetModuleIndex(packet->GetModuleId());
+1 -2
View File
@@ -238,8 +238,7 @@ void CDplusProtocol::HandleQueue(void)
while ( !m_Queue.empty() )
{
// get the packet
auto packet = m_Queue.front();
m_Queue.pop();
auto packet = m_Queue.pop();
// get our sender's id
int iModId = g_Reflector.GetModuleIndex(packet->GetModuleId());
+1 -2
View File
@@ -452,8 +452,7 @@ void CG3Protocol::HandleQueue(void)
m_LastKeepaliveTime.start();
// get the packet
auto packet = m_Queue.front();
m_Queue.pop();
auto packet = m_Queue.pop();
// encode it
CBuffer buffer;
+2 -3
View File
@@ -39,15 +39,14 @@ public:
void Unlock() { m_Mutex.unlock(); }
// pass thru
void pop() { queue.pop(); }
std::unique_ptr<CPacket> pop() { auto pack = std::move(queue.front()); queue.pop(); return std::move(pack); }
bool empty() const { return queue.empty(); }
std::unique_ptr<CPacket> front() { return std::move(queue.front()); }
void push(std::unique_ptr<CPacket> &packet) { queue.push(std::move(packet)); }
protected:
// status
bool m_bOpen;
uint16_t m_uiStreamId;
uint16_t m_uiStreamId;
std::mutex m_Mutex;
// owner
+1 -2
View File
@@ -283,8 +283,7 @@ void CReflector::RouterThread(CPacketStream *streamIn)
if ( !streamIn->empty() )
{
// get the packet
packet = streamIn->front();
streamIn->pop();
packet = streamIn->pop();
}
else
{
+1 -2
View File
@@ -224,8 +224,7 @@ void CUlxProtocol::HandleQueue(void)
while ( !m_Queue.empty() )
{
// get the packet
auto packet = m_Queue.front();
m_Queue.pop();
auto packet = m_Queue.pop();
// check if origin of packet is local
// if not, do not stream it out as it will cause
+1 -2
View File
@@ -279,8 +279,7 @@ void CYsfProtocol::HandleQueue(void)
while ( !m_Queue.empty() )
{
// get the packet
auto packet = m_Queue.front();
m_Queue.pop();
auto packet = m_Queue.pop();
// get our sender's id
int iModId = g_Reflector.GetModuleIndex(packet->GetModuleId());