C++ TargetRTS
Loading...
Searching...
No Matches
RTIOMonitor.h
1/*
2 * Licensed Materials - Property of HCL and/or IBM
3 * Copyright HCL Technologies Ltd. 2016, 2021. All Rights Reserved.
4 * Copyright IBM Corporation 1999, 2016. All Rights Reserved.
5 *
6 * U.S. Government Users Restricted Rights - Use, duplication or
7 * disclosure restricted by GSA ADP Schedule.
8 */
9
10#ifndef __RTIOMonitor_h__
11#define __RTIOMonitor_h__ included
12
13#ifdef PRAGMA
14#pragma interface
15#endif
16
17#ifndef __RTConfig_h__
18#include <RTConfig.h>
19#endif
20
21struct RTTimespec;
22
24{
25public:
26 RTIOMonitor( void );
27 ~RTIOMonitor( void );
28
29 // One or more of these values are or-ed together to form the status
30 // argument of add() and remove() or the result of status().
31
32 enum
33 {
34 CanRead = 1,
35 CanWrite = 2,
36 Exception = 4
37 };
38
39 void add( int fd, int status );
40 void remove( int fd, int status );
41
42 int status( int fd );
43
44 int anyRegistered( void ) const;
45 int wait( const RTTimespec * timeout );
46
47private:
48 struct Entry
49 {
50 unsigned fd;
51 int bits;
52 };
53
54 Entry * _entries;
55 unsigned _used;
56 unsigned _space;
57
58 enum
59 {
60 RequestMask = CanRead | CanWrite | Exception
61 , ResultShift = 3
62 , ResultCanRead = CanRead << ResultShift
63 , ResultCanWrite = CanWrite << ResultShift
64 , ResultException = Exception << ResultShift
65 };
66
67private:
68 // unavailable methods
69 RTIOMonitor & operator=( const RTIOMonitor & );
70 RTIOMonitor( const RTIOMonitor & );
71};
72
73#endif // __RTIOMonitor_h__
Definition: RTIOMonitor.h:24
Represents the predefined "Exception" protocol.
Definition: RTException.h:31
A time value which can represent either an absolute or relative time.
Definition: RTTimespec.h:29