RobotHardware-UESTC/Hardware/Pibot驱动底盘/PiRobot_Firmware v1.0/STM32/Lib/Transport/queue.h

22 lines
331 B
C
Raw Permalink Normal View History

2023-12-12 10:36:56 +08:00
#ifndef PIBOT_QUEUE_H_
#define PIBOT_QUEUE_H_
// 一个ringbuffer的接口
class Queue
{
public:
// 生产数据
virtual bool put(unsigned char ch)=0;
// 消费数据
virtual bool get(unsigned char& ch)=0;
// 可用数据
virtual unsigned short size()=0;
// 占用大小
virtual unsigned short max_size()=0;
};
#endif