00001 /* Copyright (C) GridGain Systems. All Rights Reserved. */ 00002 00003 /* _________ _____ __________________ _____ 00004 * __ ____/___________(_)______ /__ ____/______ ____(_)_______ 00005 * _ / __ __ ___/__ / _ __ / _ / __ _ __ `/__ / __ __ \ 00006 * / /_/ / _ / _ / / /_/ / / /_/ / / /_/ / _ / _ / / / 00007 * \____/ /_/ /_/ \_,__/ \____/ \__,_/ /_/ /_/ /_/ 00008 */ 00009 00010 #ifndef GRID_CLIENT_DOUBLE_HASHEABLEOBJECT_HPP_INCLUDED 00011 #define GRID_CLIENT_DOUBLE_HASHEABLEOBJECT_HPP_INCLUDED 00012 00013 #include <cstdint> 00014 00015 #include <string> 00016 #include <vector> 00017 00018 #include "gridgain/gridhasheableobject.hpp" 00019 00023 class GridDoubleHasheableObject : public GridClientHasheableObject { 00024 public: 00029 GridDoubleHasheableObject(double pDoubleVal); 00030 00036 virtual int32_t hashCode() const; 00037 00043 virtual void convertToBytes(std::vector<int8_t>& bytes) const; 00044 00053 static int64_t doubleToLongBits(double doubleVal); 00054 00063 static double longBitsToDouble(const int64_t& bits); 00064 00070 virtual bool operator<(const GridDoubleHasheableObject& right) const; 00071 protected: 00080 static int64_t doubleToRawLongBits(double val); 00081 00083 double doubleVal; 00084 }; 00085 00086 #endif
1.7.1