diff options
author | Adam <Adam@anope.org> | 2013-02-15 14:22:23 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2013-02-15 19:01:46 -0500 |
commit | d9c18a6072521bb44418830d2ba1cda14389af20 (patch) | |
tree | 2163f6ba24b315a54a15f6419c194fc2236a1455 /include/serialize.h | |
parent | 73099b82e8619a87f894a0f787a582ee973bd177 (diff) |
Store hashes of the last commit instead of the last commit
Diffstat (limited to 'include/serialize.h')
-rw-r--r-- | include/serialize.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/include/serialize.h b/include/serialize.h index f495cdd73..23c865688 100644 --- a/include/serialize.h +++ b/include/serialize.h @@ -33,8 +33,7 @@ namespace Serialize virtual std::iostream& operator[](const Anope::string &key) = 0; virtual std::set<Anope::string> KeySet() const { throw CoreException("Not supported"); } - - virtual bool IsEqual(Data *other) { throw CoreException("Not supported"); } + virtual size_t Hash() const { throw CoreException("Not supported"); } virtual void SetType(const Anope::string &key, Type t) { } virtual Type GetType(const Anope::string &key) const { return DT_TEXT; } @@ -65,12 +64,11 @@ class CoreExport Serializable : public virtual Base private: /* Iterator into serializable_items */ std::list<Serializable *>::iterator s_iter; - /* The last serialized form of this object commited to the database */ - Serialize::Data *last_commit; + /* The hash of the last serialized form of this object commited to the database */ + size_t last_commit; /* The last time this object was commited to the database */ time_t last_commit_time; - Serializable(); protected: Serializable(const Anope::string &serialize_type); Serializable(const Serializable &); @@ -87,8 +85,8 @@ class CoreExport Serializable : public virtual Base */ void QueueUpdate(); - bool IsCached(Serialize::Data *); - void UpdateCache(Serialize::Data *); + bool IsCached(Serialize::Data &); + void UpdateCache(Serialize::Data &); bool IsTSCached(); void UpdateTS(); |