stk-code_catmod/dev/SocketsBase/protocol.hpp
hilnius 1cac3c7815 improving socket management
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/hilnius@12870 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2013-06-17 18:06:02 +00:00

36 lines
730 B
C++

#ifndef PROTOCOL_HPP
#define PROTOCOL_HPP
#include "protocol_manager.hpp"
#include "callback_object.hpp"
#include <stdint.h>
enum PROTOCOL_TYPE
{
GET_PUBLIC_ADDRESS = 0
};
class Protocol
{
public:
Protocol(CallbackObject* callbackObject);
virtual ~Protocol();
virtual void messageReceived(uint8_t* data) = 0;
void setListener(ProtocolManager* listener);
virtual void setup() = 0;
virtual void start() = 0;
virtual void update() = 0;
PROTOCOL_TYPE getProtocolType();
protected:
ProtocolManager* m_listener;
PROTOCOL_TYPE m_type;
CallbackObject* m_callbackObject;
};
#endif // PROTOCOL_HPP