Changeset 6:81a0ade149e1 in xplcommon for src/xplcommon/posix/Waitable.h
- Timestamp:
- 12/29/12 06:40:32 (12 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/xplcommon/posix/Waitable.h
r4 r6 82 82 83 83 /** 84 * Indicate if this waitable is valid, i.e. the file descriptor is 85 * non-negative. 86 */ 87 bool isValid() const; 88 89 /** 90 * Determine if the waitable is ready or not, i.e. if there is no 91 * need to wait for it. 92 * 93 * It first checks the events. If they are 0, the waitable is 94 * ready. Then it calls isReady() and returns the result of that 95 * function. 96 */ 97 bool ready(); 98 99 protected: 100 /** 84 101 * Indicate if the waitable is ready, i.e. there is no need to 85 102 * wait for it. 86 103 * 87 * Calling this function should not deleted the ready 88 * indication. It should be deleted by actually processing the data. 104 * Calling this function should not delete the ready 105 * indication. It should be deleted by actually processing the 106 * data. 89 107 */ 90 virtual bool ready() = 0;108 virtual bool isReady() = 0; 91 109 92 protected:93 110 /** 94 111 * Handle the given events. … … 98 115 friend class Waiter; 99 116 }; 117 118 //------------------------------------------------------------------------------ 119 // Inline defintions 120 //------------------------------------------------------------------------------ 121 122 inline bool Waitable::isValid() const 123 { 124 return fd>=0; 125 } 126 127 //------------------------------------------------------------------------------ 128 129 inline bool Waitable::ready() 130 { 131 return (events==0) || isReady(); 132 } 100 133 101 134 //------------------------------------------------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.