00001 /* Copyright (C) GridGain Systems. All Rights Reserved. */ 00002 00003 /* _________ _____ __________________ _____ 00004 * __ ____/___________(_)______ /__ ____/______ ____(_)_______ 00005 * _ / __ __ ___/__ / _ __ / _ / __ _ __ `/__ / __ __ \ 00006 * / /_/ / _ / _ / / /_/ / / /_/ / / /_/ / _ / _ / / / 00007 * \____/ /_/ /_/ \_,__/ \____/ \__,_/ /_/ /_/ /_/ 00008 */ 00009 00010 #ifndef GRID_CLIENT_FLOAT_HASHEABLEOBJECT_HPP_INCLUDED 00011 #define GRID_CLIENT_FLOAT_HASHEABLEOBJECT_HPP_INCLUDED 00012 00013 #include <cstdint> 00014 00015 #include <string> 00016 #include <vector> 00017 00018 #include "gridgain/gridhasheableobject.hpp" 00019 00023 class GridFloatHasheableObject : public GridClientHasheableObject { 00024 public: 00030 GridFloatHasheableObject(float pFloat); 00031 00037 virtual int32_t hashCode() const; 00038 00044 virtual void convertToBytes(std::vector<int8_t>& bytes) const; 00045 00052 static int32_t floatToIntBits(float val); 00053 00060 static float intBitsToFloat(int bits); 00061 00067 virtual bool operator<(const GridFloatHasheableObject& right) const; 00068 protected: 00075 static int floatToRawIntBits(float val); 00076 00078 float floatVal; 00079 }; 00080 00081 #endif
1.7.1