Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
cOverlappedIO.h
Go to the documentation of this file.
1 //
4 //
5 
6 #ifndef _INC_cOverlappedIO_H
7 #define _INC_cOverlappedIO_H
8 #ifndef NO_PRAGMA_ONCE
9 #pragma once
10 #endif
11 
12 #include "../GrayLibBase.h"
13 
14 #if defined(_WIN32) && !defined(UNDER_CE)
16 
17 namespace GrayLib
18 {
19  class GRAYLIB_LINK cOverlappedIO
20  {
23 
24  private:
25  HANDLE m_hIO;
26  HANDLE m_hStopEvent;
27  OVERLAPPED m_op;
28 
29  public:
30  cOverlappedIO(HANDLE hIO = INVALID_HANDLE_VALUE);
31  virtual ~cOverlappedIO(void);
32 
33  bool isOpenIO() const
34  {
35  return m_hIO != INVALID_HANDLE_VALUE;
36  }
37  void AttachIO(HANDLE hIO);
38 
39  bool hasStopEvent() const
40  {
42  return m_hStopEvent != INVALID_HANDLE_VALUE;
43  }
44  void AttachStopEvent(HANDLE hStopEvent);
45 
46  OVERLAPPED* operator&()
47  {
48  return &m_op;
49  }
50 
51  virtual bool Read(void* pbData, DWORD dwBufferSize, LPDWORD pdwBytesRead, TIMESYSD_t nTimeWait = INFINITE);
52  virtual bool Write(const void* pbData, DWORD dwBufferSize, LPDWORD pdwBytesWritten, TIMESYSD_t nTimeWait = INFINITE);
53 
54  virtual bool Wait(LPDWORD pdwBytesTransferred, TIMESYSD_t nTimeWait = INFINITE);
55  };
56 
57 
58 };
59 #endif
60 #endif
#define GRAYLIB_LINK
Definition: GrayLibBase.h:35
Definition: cMesh.h:22
INT32 TIMESYSD_t
Time delta. signed milli-Seconds Span. cTimeSys::k_DMAX, cTimeSys::k_INF = MAILSLOT_WAIT_FOREVER.
Definition: cTimeSys.h:28
cUInt64 operator&(const cUInt64 &roUI64_1, const cUInt64 &roUI64_2)
Definition: cUInt64.h:384