RobotHardware-UESTC/Hardware/银星机器人底盘/PiRobot-YH_Firmware v1.0/STM32/Lib/Transport/queue.h

22 lines
331 B
C
Raw Normal View History

2024-01-20 13:19:09 +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