⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 charqueu.hpp

📁 Borland C++ 下实现的串口通信
💻 HPP
字号:
/***************************************************************************
These C++ classes are copyright 1990, by William Herrera.
All those who put this code or its derivatives in a commercial product MUST
mention this copyright in their documentation for users of the products in
which this code or its derivative classes are used.  Otherwise, this code
may be freely distributed and freely used for any purpose.

Enhancements: 1991 by David Orme
	*  General cleanup.
			- I/O now takes advantage of C++ overloading.
			- Serial port I/O functionality now only in Serial class.
			- Modem functionality now only in Modem class.
	*  Possible to easily implement file Xfr prots now.
	*  CCITT CRC-16 class added							-- 2-20-1991
	*  BIOS Timer class added								-- 2-22-1991
	*  Optional timeout on all input routines added	-- 2-25-1991

***************************************************************************/

// file charqueu.hpp class declaration for the CharQueue class.

#ifndef CHARQUEU_HPP
#define CHARQUEU_HPP 1

#include <bool.h>	// enum boolean { false, true }; if you don't have

class CharQueue 
{
protected:
	char * queue_buffer;
	unsigned int size;
	unsigned int count;
	unsigned int add_position;
	unsigned int get_position;
public:
	CharQueue(unsigned int bufsize = 1000);
	~CharQueue();
	int Add(char ch);
	int Get();
	int Peek();
	void Purge();
	unsigned int GetCount();
	boolean IsFull();
	boolean IsEmpty();
};

#endif

// end of file CharQueu.hpp

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -