📄 iocontroller.h
字号:
// IoController.h
//
// This software can be offered for free and used as necessary to aid
// in your program developments.
//
// RENESAS TECHNOLOGY CORPORATION, RENESAS SOLUTIONS CORPORATION,
// and related original software developers assume no responsibility
// for any damage or infringement of any third-party's rights, originating
// in the use of the following software.
// Please use this software under the agreement and acceptance of these conditions.
//
// Copyright(C)1998(2003) RENESAS TECHNOLOGY CORPORATION AND RENESAS SOLUTIONS CORPORATION
// ALL RIGHTS RESERVED
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_IOCONTROLLER_H__DD9EB930_01DE_11D2_AF83_444553540000__INCLUDED_)
#define AFX_IOCONTROLLER_H__DD9EB930_01DE_11D2_AF83_444553540000__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#include <TYPEINFO.H>
class CIoState;
//////////////////////////////////////////////////////////////////////
// A CIoController class
//
// It is the abstraction class that defines the interface that was common to I/O.
// I have real regarding a part of function such as frank, closing of the device.
//
class CIoController
{
//Construction/disappearance
public: CIoController();
public: virtual ~CIoController();
// The device handle
protected: HANDLE m_hDevice;
public: HANDLE GetDeviceHandle() const { return m_hDevice; }
// The device name
protected: CString m_strDevice;
public: CString GetDeviceName() const { return m_strDevice; }
// Openinig/closing of the device
public: virtual BOOL Open(const CString& strDevice);
public: virtual BOOL Close();
public: virtual BOOL IsOpen() const { return m_hDevice != INVALID_HANDLE_VALUE; }
// Lead/Write
public: virtual DWORD Write(const void* pBuffer, DWORD dwBytesToWrite) =0;
public: virtual DWORD Read(void* pBuffer, DWORD dwRequestBytes) =0;
//The setting of the time out.
public: virtual BOOL SetTimeout(DWORD dwTimeout) =0;
//The setting, operation of device reliance.
public: virtual BOOL SetState(const CIoState* pState) = 0;
public: virtual BOOL GetState(CIoState* pState) =0;
//The processing such as the clear, the after error occurrence of the buffer.
public: virtual int CleanUp(void* pParam) =0;
// The model declaration of reception event handle.
protected: typedef void (*IO_EVENT_PROC)(void* pParam, DWORD dwParam);
// The reception surveillance thread handle.
protected: HANDLE m_hRcvThread;
public: HANDLE GetThreadHandle() const { return m_hRcvThread; }
// The reception surveillance thread start, end.
public: virtual BOOL CreateRcvThread(IO_EVENT_PROC pEventProc = NULL,
void* pParam = NULL, DWORD dwBytesWaitFor = 1) =0;
public: virtual BOOL DeleteRcvThread() =0;
};
//////////////////////////////////////////////////////////////////////
// A CIoState class.
//
// It is the class that becomes an argument of SetState or GetState () of CIoController ().
//
class CIoState
{
//Construction/disappearance
public: CIoState() { Clear(); }
public: virtual ~CIoState() {}
// Clear
public: void Clear()
{
}
};
#endif // !defined(AFX_IOCONTROLLER_H__DD9EB930_01DE_11D2_AF83_444553540000__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -