serialthread.hpp

来自「利用Serial ComPort與GPS機器作資料傳輸並可以儲存為google 」· HPP 代码 · 共 62 行

HPP
62
字号
/********************************************************************
	file base:	serialThread
	file ext:	hpp
	
*********************************************************************/

#ifndef SERIALTHREAD_HPP
#define SERIALTHREAD_HPP

// class SerialThread
//-----------------------------------------------------------------------------
// Description: This class is inherited from CWinThread, use to handle in part 
//              of thread process (muliti tasking).
// 


class CSerialAppDlg;              // Forward Declaration.
class SerialCtl;
class SerialDoc;

class SerialThread : public CWinThread
{
public:
  // To enable objects of CObject-derived classes to be created dynamically at 
  // run timeto enable objects of CObject-derived classes to be created 
  // dynamically at run time
  
	//DECLARE_DYNCREATE(SerialThread)
	DECLARE_SERIAL(SerialThread)

  SerialThread ();               // Constructor.
  virtual ~SerialThread();       // Destructor.
public:
  virtual BOOL InitInstance();   // virtual function that derive from base-class.
  virtual int Run();             // virtual function that derive from base-class.  
  void setOwner(CSerialAppDlg* ptrDialog)
  {ptrDlg = ptrDialog;}          // Assign the pointer to pointerDlg is as agent 
                                 // of Class CSerialAppDlg.
private:
  CSerialAppDlg* ptrDlg;	// The pointer that pointer to object CSerialAppDlg.
};


// class SCC
//-----------------------------------------------------------------------------
// Description: This class is as the interface that is used to access the object of Class SerialCtl.
//
class SCC
{
public:
  SCC() {};   // Constructor.
  ~SCC() {};  // Destructor.
public:
  static SerialCtl &serialCtl() // Implement as the singleton funciton.
  {
    static SerialCtl serial;
    return serial;
  }
};

#endif //SERIALTHREAD_HPP

⌨️ 快捷键说明

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