VR-Link API Documentation for DIS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
vlSelectParamW.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 1992-2010 VT MAK
3 ** All rights reserved.
4 *********************************************************************/
8 #pragma once
9 
10 #ifdef DtUSE_UTILITIES_NAMESPACE
11 namespace DtUSE_UTILITIES_NAMESPACE
12 {
13 #endif
14 
15 
17 {
18  public:
20 
21  int select(DtTime timeout);
22  void addRead(int fd);
23  void delRead(int fd);
24  int canRead(int fd);
25  void addWrite(int fd);
26  void clearWrite();
27 
28  protected:
29  int myMaxFD;
30  fd_set myRead0, myRead;
31  fd_set myWrite0, myWrite;
32 };
33 
34 inline
36 {
37  FD_ZERO(&myRead0);
38  FD_ZERO(&myWrite0);
39  myRead = myRead0;
40  myWrite = myWrite0;
41  myMaxFD = -1;
42 }
43 
44 inline int
46 {
47  myRead = myRead0;
48  myWrite = myWrite0;
49  return DtSelect(myMaxFD+1, &myRead, &myWrite, NULL, timeout);
50 }
51 
52 inline void
54 {
55  FD_SET((unsigned int) fd, &myRead0);
56  myMaxFD = DtMax(myMaxFD, fd);
57 }
58 
59 inline void
61 {
62  FD_CLR((unsigned int) fd, &myRead0);
64 }
65 
66 inline int
68 {
69  return ((int)(FD_ISSET((unsigned int) fd, &myRead)));
70 }
71 
72 inline void
74 {
75  FD_SET((unsigned int) fd, &myWrite0);
76  myMaxFD = DtMax(myMaxFD, fd);
77 }
78 
79 inline void
81  FD_ZERO(&myWrite0);
82 }
83 
84 #ifdef DtUSE_UTILITIES_NAMESPACE
85 }
86 #endif
87 

Document ID: Generated on Mon Feb 6 18:36:34 EST 2017 from SVN revision 173107
Copyright © 2005-2016 VT MÄK. All Rights Reserved (www.mak.com)