Irc thread can now be properly terminated. Separate initialization from connecting. Add callback class for irc stuff.

This commit is contained in:
lotodore
2007-09-25 21:26:22 +00:00
parent bcc5966a68
commit 0dcd313c9d
5 changed files with 105 additions and 16 deletions
+7 -1
View File
@@ -21,6 +21,7 @@
#ifndef _IRCTHREAD_H_
#define _IRCTHREAD_H_
#include <net/irccallback.h>
#include <core/thread.h>
#include <string>
@@ -29,12 +30,14 @@ struct IrcContext;
class IrcThread : public Thread
{
public:
IrcThread();
IrcThread(IrcCallback &callback);
virtual ~IrcThread();
// Set the parameters.
void Init(const std::string &serverAddress, unsigned serverPort, bool ipv6, const std::string &nick, const std::string &channel);
virtual void SignalTermination();
protected:
// Main function of the thread.
@@ -43,8 +46,11 @@ protected:
const IrcContext &GetContext() const;
IrcContext &GetContext();
IrcCallback &GetCallback();
private:
std::auto_ptr<IrcContext> m_context;
IrcCallback &m_callback;
};
#endif