JD2022-TU1/main/extern/Camcam/LIBS/Net/NET_FIFO.cpp

26 lines
389 B
C++

#include <windows.h>
#include <stdio.h>
#include "NET.h"
void IO_FIFO_Stack::Add(OneBuf *pBuf)
{
FIFO[Base++] = pBuf;
if (Base == MAXBUFFERS_IN) Base = 0;
Number++;
};
OneBuf *IO_FIFO_Stack::Get()
{
OneBuf *Ret;
if (!Number) return NULL;
Number--;
Ret = FIFO[End++];
if (End == MAXBUFFERS_IN) End = 0;
return Ret;
};
void IO_FIFO_Stack::Reset()
{
Base = End = Number = 0;
};