Modules: use public API

Avoid accessing protected member variables directly, so
there's a chance of cleaning up the module API later.
This commit is contained in:
J-P Nurmi
2014-10-06 19:18:31 +02:00
parent d9ae3fa7c8
commit 1bacec1dd3
40 changed files with 291 additions and 270 deletions

View File

@@ -26,14 +26,14 @@ public:
~CSampleJob() {
if (wasCancelled()) {
m_pModule->PutModule("Sample job cancelled");
GetModule()->PutModule("Sample job cancelled");
} else {
m_pModule->PutModule("Sample job destroyed");
GetModule()->PutModule("Sample job destroyed");
}
}
virtual void runThread() {
// Cannot safely use m_pModule in here, because this runs in its
// Cannot safely use GetModule() in here, because this runs in its
// own thread and such an access would require synchronisation
// between this thread and the main thread!
@@ -46,7 +46,7 @@ public:
}
virtual void runMain() {
m_pModule->PutModule("Sample job done");
GetModule()->PutModule("Sample job done");
}
};
@@ -59,7 +59,7 @@ public:
private:
protected:
virtual void RunJob() {
m_pModule->PutModule("TEST!!!!");
GetModule()->PutModule("TEST!!!!");
}
};
@@ -234,7 +234,7 @@ public:
}
virtual EModRet OnUserTopic(CString& sTarget, CString& sTopic) {
PutModule("* " + m_pClient->GetNick() + " changed topic on " + sTarget + " to '" + sTopic + "'");
PutModule("* " + GetClient()->GetNick() + " changed topic on " + sTarget + " to '" + sTopic + "'");
return CONTINUE;
}