00001 /* Copyright (C) GridGain Systems. All Rights Reserved. */ 00002 00003 /* _________ _____ __________________ _____ 00004 * __ ____/___________(_)______ /__ ____/______ ____(_)_______ 00005 * _ / __ __ ___/__ / _ __ / _ / __ _ __ `/__ / __ __ \ 00006 * / /_/ / _ / _ / / /_/ / / /_/ / / /_/ / _ / _ / / / 00007 * \____/ /_/ /_/ \_,__/ \____/ \__,_/ /_/ /_/ /_/ 00008 */ 00009 00010 #ifndef GRID_CLIENT_STRINGHASHEABLEOBJECT_HPP_INCLUDED 00011 #define GRID_CLIENT_STRINGHASHEABLEOBJECT_HPP_INCLUDED 00012 00013 #include <cstdint> 00014 00015 #include <string> 00016 #include <vector> 00017 00018 #include "gridgain/gridhasheableobject.hpp" 00019 00023 class GridStringHasheableObject : public GridClientHasheableObject { 00024 public: 00030 GridStringHasheableObject(const std::string& s); 00031 00037 virtual int32_t hashCode() const; 00038 00044 virtual void convertToBytes(std::vector<int8_t>& bytes) const; 00045 00051 virtual bool operator<(const GridStringHasheableObject& right) const { 00052 return str < const_cast<GridStringHasheableObject&>(right).str; 00053 } 00054 00055 protected: 00057 std::string str; 00058 }; 00059 00063 class GridWideStringHasheableObject : public GridClientHasheableObject { 00064 public: 00070 GridWideStringHasheableObject(const std::wstring& s); 00071 00077 virtual int32_t hashCode() const; 00078 00084 virtual void convertToBytes(std::vector<int8_t>& bytes) const; 00085 00091 virtual bool operator<(const GridWideStringHasheableObject& right) const { 00092 return str < const_cast<GridWideStringHasheableObject&>(right).str; 00093 } 00094 00095 protected: 00097 std::wstring str; 00098 }; 00099 00100 #endif
1.7.1