Initial commit

This commit is contained in:
Nefarius
2014-06-22 12:45:36 +02:00
commit e4ac88dfc5
28 changed files with 5150 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
#ifndef INC_SEXT_CALLBACKHANDLER_H
#define INC_SEXT_CALLBACKHANDLER_H
#include <deque>
#include <boost/thread.hpp>
class Callback;
struct SocketWrapper;
/**
* manages the callbacks for asynchronous operations.
*
* @note No destructor, objects will be freed by ~SocketHandler -> ~SocketWrapper -> CallbackHandler::RemoveCallbacks
*/
class CallbackHandler {
public:
void AddCallback(Callback* callback);
void RemoveCallbacks(SocketWrapper* sw);
void ExecuteQueuedCallbacks();
private:
Callback* FetchFirstCallback();
std::deque<Callback*> callbackQueue;
boost::mutex callbackQueueMutex;
};
extern CallbackHandler callbackHandler;
#endif