#pragma once #include "common.h" class LComparator { public: LComparator(); virtual ~LComparator(); virtual int Compare(const void* inItemOne, const void* inItemTwo, unsigned int inSizeOne, unsigned int inSizeTwo) const; virtual BOOL IsEqualTo(const void* inItemOne, const void* inItemTwo, unsigned int inSizeOne, unsigned int inSizeTwo) const; virtual int CompareToKey(const void* inItem, unsigned int inSize, const void* inKey) const; virtual BOOL IsEqualToKey(const void* inItem, unsigned int inSize, const void* inKey) const; static LComparator* GetComparator(); virtual LComparator* Clone(); protected: static LComparator* sComparator; }; class LLongComparator : public LComparator { public: LLongComparator(); virtual ~LLongComparator(); virtual int Compare(const void* inItemOne, const void* inItemTwo, unsigned int inSizeOne, unsigned int inSizeTwo) const; virtual BOOL IsEqualTo(const void* inItemOne, const void* inItemTwo, unsigned int inSizeOne, unsigned int inSizeTwo) const; static LLongComparator* GetComparator(); virtual LComparator* Clone(); protected: static LLongComparator* sLongComparator; };