Irc thread can now be properly terminated. Separate initialization from connecting. Add callback class for irc stuff.
This commit is contained in:
+7
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user