queue.h
来自「在Linux底下用QtDesigner开发的一个进程同步例子。基本思想是设计一个」· C头文件 代码 · 共 27 行
H
27 行
#include <qglobal.h>struct Circle{ int InitX; int InitY; int InitR;};class HQueue{ //define classes of Cycle Queuepublic: HQueue(int = 4); ~HQueue(){delete []Q;} void EnQueue(Circle& item); Circle DeQueue(); Circle GetFront(); void MakeEmpty(){front = rear = 0;}//tag =0;} //get Queue empty int IsEmpty() const {return front == rear ;}//&& tag == 0; } //if Queue is empty int IsFull() const {return front == (rear+1)%m;}//&&tag ==1; //if Queue is fullprivate: // public: int rear; //the signal of Queue tail int front; //the signal of Queue head //int tag; //the signal of if Queue is full Circle *Q; //a array which store Queue elements int m; //the max size of Queue};
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?