qactive.h

来自「本程序将ucosii移入了QF框架」· C头文件 代码 · 共 34 行

H
34
字号
/////////////////////////////////////////////////////////////////////
// Quantum Active Object declaration (C++ version)
// Copyright (c) 2002 Miro Samek, Palo Alto, CA. 
// All Rights Reserved.
/////////////////////////////////////////////////////////////////////
#ifndef qactive_h
#define qactive_h

#ifndef qhsm_h
   #include "qhsm.h"
#endif

class QActive : public QHsm {     // Quantum Active Object base class
public:
   int start(unsigned prio, QEvent *qSto[], unsigned qLen,
             int stkSto[], unsigned stkLen);
   void postFIFO(QEvent *e);  // post event directly (FIFO enqueuing)
   void postLIFO(QEvent *e);  // post event directly (LIFO enqueuing)
   void run();   // run() is active throughout lifetime of the object
protected:
   QActive(QPseudoState initial);                   // protected ctor
   virtual ~QActive();                                // virtual xtor
   void stop();     // stopps the thread; nothing happens thereafter!
private:
   int enqueue(QEvent *e); // intended to use only by friend class QF
private:                                           // data members...
   QF_EQUEUE(myEqueue)          // OS-dependent event-queue primitive
   QF_THREAD(myThread)               // OS-dependent thread primitive
   unsigned char myPrio;             // priority of the active object
   friend class QF;
};

#endif                                                   // qactive_h

⌨️ 快捷键说明

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