Changeset 28:9b3c2d3ea9f3 in vscpl for src/hu/varadiistvan/scpl/io/_win32/EventFailable.h
Legend:
- Unmodified
- Added
- Removed
-
src/hu/varadiistvan/scpl/io/_win32/EventFailable.h
r6 r28 33 33 #include "../Failable.h" 34 34 35 #include "EventFactory.h" 36 37 #include <memory> 38 35 39 //------------------------------------------------------------------------------ 36 40 … … 51 55 class EventFailable : public Failable 52 56 { 57 protected: 58 /** 59 * The event factory for this object. 60 */ 61 std::unique_ptr<EventFactory> eventFactory; 62 63 protected: 64 /** 65 * Construct the object with the given event factory. 66 */ 67 EventFailable(std::unique_ptr<EventFactory> eventFactory); 68 69 /** 70 * Create an event for this object using the event factory. 71 */ 72 HANDLE createEvent(); 73 74 /** 75 * Set the event represented by the given handle using the event factory. 76 */ 77 bool setEvent(HANDLE handle); 78 79 /** 80 * Set the event represented by the given handle using the event factory. 81 */ 82 bool resetEvent(HANDLE handle); 83 84 /** 85 * Destroy the event represented by the given handle using the event factory. 86 */ 87 void destroyEvent(HANDLE handle); 88 53 89 friend class Event; 54 90 }; 91 92 //------------------------------------------------------------------------------ 93 // Inline definitions 94 //------------------------------------------------------------------------------ 95 96 inline EventFailable::EventFailable(std::unique_ptr<EventFactory> eventFactory) : 97 eventFactory(std::move(eventFactory)) 98 { 99 } 100 101 //------------------------------------------------------------------------------ 102 103 inline HANDLE EventFailable::createEvent() 104 { 105 return eventFactory->createEvent(); 106 } 107 108 //------------------------------------------------------------------------------ 109 110 inline bool EventFailable::setEvent(HANDLE handle) 111 { 112 return eventFactory->setEvent(handle); 113 } 114 115 //------------------------------------------------------------------------------ 116 117 inline bool EventFailable::resetEvent(HANDLE handle) 118 { 119 return eventFactory->resetEvent(handle); 120 } 121 122 //------------------------------------------------------------------------------ 123 124 inline void EventFailable::destroyEvent(HANDLE handle) 125 { 126 eventFactory->destroyEvent(handle); 127 } 55 128 56 129 //------------------------------------------------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.