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
+53
View File
@@ -0,0 +1,53 @@
#ifndef INC_SEXT_CALLBACK_H
#define INC_SEXT_CALLBACK_H
#include <string>
#include <boost/asio.hpp>
#include "Define.h"
struct SocketWrapper;
class Callback {
public:
/**
* construct a connect, disconnect or sendqueueempty callback
*/
Callback(CallbackEvent callbackEvent, const void* socket);
/**
* construct a receive callback
*/
Callback(CallbackEvent callbackEvent, const void* socket, const char* data, size_t dataLength);
/**
* construct an incoming callback
*/
Callback(CallbackEvent callbackEvent, const void* socket, const void* newSocket, const boost::asio::ip::tcp::endpoint& remoteEndPoint);
/**
* construct an error callback
*/
Callback(CallbackEvent callbackEvent, const void* socket, SM_ErrorType errorType, int errorNumber);
~Callback();
bool IsExecutable();
bool IsValid();
void Execute();
friend class CallbackHandler;
private:
template<class SocketType> void ExecuteHelper();
const CallbackEvent callbackEvent;
SocketWrapper* socketWrapper;
const void* additionalData[2];
// volatile bool isExecuting;
};
#endif