All pastes #746866 Raw Edit

Something

public text v1 · immutable
·published 2007-10-23 15:29 UTC
rendered paste body
#ifndef IRC__H
#define IRC__H

#include <string>
#include <queue>
// #include <vector>
#include "NetworkLayer.h"
#include "Protocol.h"
#include "QueueEvent.h"

// -- Define Event Values -- //
#define IRC_ON_JOIN		400
#define IRC_ON_QUIT		401
#define IRC_ON_NICK		402
#define IRC_ON_MODE		403
#define IRC_ON_TOPIC	404
#define IRC_ON_INVITE	405
#define IRC_ON_KICK		406
#define IRC_ON_PRIVMSG	407
#define IRC_ON_PING		408


class IRC : public Protocol
{
public:
	// -- Constructors
	IRC(std::string const& tHost, int tPort, std::queue<QueueEvent>* tpMessageQueue);

	// -- Destructors
	~IRC();

	// -- Accessors
	std::string GetHost();
	int GetPort();

	// -- Mutators
	void SetHost(std::string const& tHost);
	void SetPort(int tPort);

	// -- Actors
	virtual bool Start();
	virtual void Stop();
	virtual void Restart();
	virtual void Send(std::string const& Message);
	virtual bool Receive();	
	
	// -- IRC Commands
	void Pong(std::string const& Reply);



private:
	NetworkLayer IRCNL;
	Logger IRCLog;
	std::queue<QueueEvent>* pMessageQueue;
};
#endif