/* * Copyright (C) 2004-2008 See the AUTHORS file for details. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published * by the Free Software Foundation. */ #include "Chan.h" #include "Modules.h" class CSampleTimer : public CTimer { public: CSampleTimer(CModule* pModule, unsigned int uInterval, unsigned int uCycles, const CString& sLabel, const CString& sDescription) : CTimer(pModule, uInterval, uCycles, sLabel, sDescription) {} virtual ~CSampleTimer() {} private: protected: virtual void RunJob() { m_pModule->PutModule("TEST!!!!"); } }; class CServiceMod : public CService { public: MODCONSTRUCTOR(CServiceMod) {} virtual bool OnLoad(const CString& sArgs, CString& sMessage) { PutModule("LOADED"); //AddTimer(new CSampleTimer(this, 300, 0, "Sample", "Sample timer for sample things.")); //AddTimer(new CSampleTimer(this, 5, 20, "Another", "Another sample timer.")); //AddTimer(new CSampleTimer(this, 25000, 5, "Third", "A third sample timer.")); return true; } virtual ~CServiceMod() { PutModule("I'm being unloaded! HALP!!"); } virtual bool OnBoot() { // This is called when the app starts up (only modules that are loaded in the config will get this event) return true; } virtual void OnIRCConnected() { PutModule("You got connected BoyOh."); } virtual void OnIRCDisconnected() { PutModule("You got disconnected BoyOh."); } virtual void OnModCommand(const CString& sCommand) { if (strcasecmp(sCommand.c_str(), "HELP") == 0) { PutModule("No Help Yet"); } } virtual EModRet OnStatusCommand(const CString& sCommand) { if (strcasecmp(sCommand.c_str(), "SAMPLE") == 0) { PutModule("Hi, I'm test."); return HALT; } return CONTINUE; } }; MODULEDEFS(CServiceMod, "Test Module") ====================================== Errors modules/test.cpp:61: error: âEModRetâ does not name a type modules/test.cpp: In constructor âCServiceMod::CServiceMod(void*, CUser*, const CString&, const CString&)â: modules/test.cpp:27: error: type âCModuleâ is not a direct base of âCServiceModâ modules/test.cpp: In member function âvirtual bool CServiceMod::OnLoad(const CString&, CString&)â: modules/test.cpp:30: error: âPutModuleâ was not declared in this scope modules/test.cpp: In destructor âvirtual CServiceMod::~CServiceMod()â: modules/test.cpp:38: error: âPutModuleâ was not declared in this scope modules/test.cpp: In member function âvirtual void CServiceMod::OnIRCConnected()â: modules/test.cpp:47: error: âPutModuleâ was not declared in this scope modules/test.cpp: In member function âvirtual void CServiceMod::OnIRCDisconnected()â: modules/test.cpp:51: error: âPutModuleâ was not declared in this scope modules/test.cpp: In member function âvirtual void CServiceMod::OnModCommand(const CString&)â: modules/test.cpp:57: error: âPutModuleâ was not declared in this scope modules/test.cpp: In function âCModule* Load(void*, CUser*, const CString&, const CString&)â: modules/test.cpp:71: error: cannot convert âCServiceMod*â to âCModule*â in return