00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00031
00032
00033 #pragma once
00034
00035
00036 #include "../api_core.h"
00037 #include "sharedptr.h"
00038 #include "mutex.h"
00039 #include <vector>
00040
00041 class CL_EventProvider;
00042 class CL_Event_Impl;
00043
00047 class CL_API_CORE CL_Event
00048 {
00051
00052 public:
00054 CL_Event(bool manual_reset = true, bool initial_state = false);
00055
00056 CL_Event(CL_EventProvider *event_provider);
00057
00058 ~CL_Event();
00059
00060
00064
00065 public:
00067 CL_EventProvider *get_event_provider() const;
00068
00069
00073
00074 public:
00076 bool wait(int timeout = -1);
00077
00078 static int wait(int count, CL_Event const * const * events, int timeout = -1, bool wait_all = false);
00079
00080 static int wait(const std::vector<CL_Event *> &events, int timeout = -1, bool wait_all = false);
00081
00082 static int wait(const std::vector<CL_Event> &events, int timeout = -1, bool wait_all = false);
00083
00084 static int wait(CL_Event &event1, int timeout = -1);
00085
00086 static int wait(CL_Event &event1, CL_Event &event2, int timeout = -1, bool wait_all = false);
00087
00088 static int wait(CL_Event &event1, CL_Event &event2, CL_Event &event3, int timeout = -1, bool wait_all = false);
00089
00090 static int wait(CL_Event &event1, CL_Event &event2, CL_Event &event3, CL_Event &event4, int timeout = -1, bool wait_all = false);
00091
00092 static int wait(CL_Event &event1, CL_Event &event2, CL_Event &event3, CL_Event &event4, CL_Event &event5, int timeout = -1, bool wait_all = false);
00093
00094 static int wait(CL_Event &event1, CL_Event &event2, CL_Event &event3, CL_Event &event4, CL_Event &event5, CL_Event &event6, int timeout = -1, bool wait_all = false);
00095
00096 static int wait(CL_Event &event1, CL_Event &event2, CL_Event &event3, CL_Event &event4, CL_Event &event5, CL_Event &event6, CL_Event &event7, int timeout = -1, bool wait_all = false);
00097
00098 static int wait(CL_Event &event1, CL_Event &event2, CL_Event &event3, CL_Event &event4, CL_Event &event5, CL_Event &event6, CL_Event &event7, CL_Event &event8, int timeout = -1, bool wait_all = false);
00099
00101 void set();
00102
00104 void reset();
00105
00106
00110
00111 private:
00112 CL_SharedPtr<CL_Event_Impl> impl;
00113
00115 };
00116
00117