2019-07-28 10:31:56 +08:00
|
|
|
|
#pragma once
|
2018-12-12 11:16:12 +08:00
|
|
|
|
|
|
|
|
|
class mail_object : public acl::diff_object
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* 构造函数
|
2018-12-12 11:16:12 +08:00
|
|
|
|
* @param manager {diff_manager&}
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @param key {const char*} 以字符串方式表示的键,非空字符串
|
|
|
|
|
* @param val {const char*} 以字符串方式表示的值,非空字符串
|
2018-12-12 11:16:12 +08:00
|
|
|
|
*/
|
|
|
|
|
mail_object(acl::diff_manager& manager, const char* key, const char* val);
|
|
|
|
|
|
|
|
|
|
void set_ctime(long long n);
|
|
|
|
|
|
|
|
|
|
public:
|
2019-07-28 10:31:56 +08:00
|
|
|
|
// override: 基类纯虚函数的实现
|
2018-12-12 11:16:12 +08:00
|
|
|
|
const char* get_key() const;
|
|
|
|
|
|
2019-07-28 10:31:56 +08:00
|
|
|
|
// override: 基类纯虚函数的实现
|
2018-12-12 11:16:12 +08:00
|
|
|
|
const char* get_val() const;
|
|
|
|
|
|
2019-07-28 10:31:56 +08:00
|
|
|
|
// override: 基类纯函数的实现
|
2018-12-12 11:16:12 +08:00
|
|
|
|
bool operator== (const acl::diff_object& obj) const;
|
|
|
|
|
|
|
|
|
|
// @override
|
|
|
|
|
bool check_range(long long from, long long to) const;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
const char* key_;
|
|
|
|
|
const char* val_;
|
|
|
|
|
long long ctime_;
|
|
|
|
|
|
2019-07-28 10:31:56 +08:00
|
|
|
|
// 析构函数声明为私有的,从而要求动态创建本类对象
|
2018-12-12 11:16:12 +08:00
|
|
|
|
~mail_object();
|
|
|
|
|
};
|