mirror of
https://github.com/nostar/urfd.git
synced 2026-11-08 04:19:39 +00:00
condensed front() and pop() into pop()
This commit is contained in:
1 parent
048bb6d9ba
commit
197fb2c166
12 files changed
+14
-26
No files matched your search
@@ -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
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
~CDcsStreamCacheItem() {}
|
||||
|
||||
CDvHeaderPacket m_dvHeader;
|
||||
uint32_t m_iSeqCounter;
|
||||
uint32_t m_iSeqCounter;
|
||||
};
|
||||
|
||||
class CDcsProtocol : public CProtocol
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -283,8 +283,7 @@ void CReflector::RouterThread(CPacketStream *streamIn)
|
||||
if ( !streamIn->empty() )
|
||||
{
|
||||
// get the packet
|
||||
packet = streamIn->front();
|
||||
streamIn->pop();
|
||||
packet = streamIn->pop();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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());
|
||||
|
||||
Reference in new issue
Block a user