2019-07-27 22:44:32 +08:00
|
|
|
|
#pragma once
|
2014-11-19 00:25:21 +08:00
|
|
|
|
|
|
|
|
|
class host_status;
|
|
|
|
|
class ping_callback;
|
|
|
|
|
class ping_store : public acl::rpc_request
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
ping_store(std::vector<host_status*>* host_list,
|
|
|
|
|
ping_callback* callback);
|
|
|
|
|
~ping_store();
|
|
|
|
|
protected:
|
2019-07-27 22:44:32 +08:00
|
|
|
|
// 基类虚函数:子线程处理函数
|
2014-11-19 00:25:21 +08:00
|
|
|
|
virtual void rpc_run();
|
|
|
|
|
|
2019-07-27 22:44:32 +08:00
|
|
|
|
// 基类虚函数:主线程处理过程,收到子线程任务完成的消息
|
2014-11-19 00:25:21 +08:00
|
|
|
|
virtual void rpc_onover();
|
|
|
|
|
private:
|
|
|
|
|
std::vector<host_status*>* host_list_;
|
|
|
|
|
|
|
|
|
|
acl::string dbpath_;
|
|
|
|
|
ping_callback* callback_;
|
|
|
|
|
bool create_tbl(acl::db_handle& db);
|
|
|
|
|
void insert_tbl(acl::db_handle& db);
|
|
|
|
|
void insert_one(acl::db_handle& db, const host_status* status);
|
2013-08-18 17:42:25 +08:00
|
|
|
|
};
|