12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- #ifndef __AUDITPLUGIN_HPP_
- #define __AUDITPLUGIN_HPP_
- #include <iostream>
- #include "UtilBase.hpp"
- #include "Network/Socket.h"
- #include <mutex>
- #include <condition_variable>
- #include <future>
- #include "Util/logger.h"
- #include "Poller/Timer.h"
- #include <vector>
- #include "PluginSubscriber.hpp"
- #include "PuginFactory.hpp"
- using namespace std;
- using namespace toolkit;
- namespace gsd
- {
- class AuditPlugin: public PluginSubscriber<AuditPlugin>, public PluginBase
- {
- private:
- AuditPlugin(): PluginBase(){
- }
- public:
- using Ptr = std::shared_ptr<AuditPlugin>;
- /**
- * @description: 获取Ptr
- * @return {*}
- */
- static std::shared_ptr<AuditPlugin> getPtr();
- /**
- * @description: Init
- * @return {*}
- */
- virtual bool Init();
- /**
- * @description: StartTask
- * @return {*}
- */
- virtual bool StartTask();
- /**
- * @description: Alive
- * @return {*}
- */
- virtual bool Alive();
- /**
- * @description: 释放资源
- * @return {*}
- */
- virtual void Destroy();
- /**
- * @description: RestPlugin
- * @return {*}
- */
- virtual bool RestPlugin(){
- return true;
- }
- /**
- * @description: PluginTaskCheck
- * @return {*}
- */
- virtual bool PluginTaskCheck();
- /**
- * @description: ~AuditPlugin
- * @return {*}
- */
- ~AuditPlugin(){
- InfoL;
- this->Destroy();
- }
- private:
- Timer::Ptr timer = nullptr;
- unordered_map<std::string, std::function<std::shared_ptr<PluginBase>()>> map_;
- std::shared_ptr<ThreadPool> pool = nullptr;
- };
- } // namespace gsd
- #endif
|