Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #pragma once
00015
00019 #include <vector>
00020
00021 #include "Event.h"
00022
00023 namespace kNet
00024 {
00025
00028 class EventArray
00029 {
00030 public:
00032 EventArray();
00033
00035 void Clear();
00036
00039 void AddEvent(const Event &e);
00040
00042 static const int WaitTimedOut = -1;
00043
00045 static const int WaitFailed = -2;
00046
00050 int Wait(int msecs);
00051
00053 int Size() const;
00054
00055 private:
00056 static const int maxEvents = 64;
00057 int numAdded;
00058
00059 #ifdef WIN32
00060 WSAEVENT events[maxEvents];
00061
00062 #elif LINUX
00063 fd_set readfds;
00064 fd_set writefds;
00065 int nfds;
00066 timeval tv;
00069 std::vector<Event> cachedEvents;
00070 #endif
00071 };
00072
00073 }