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

22 lines
331 B
C++

#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