00001 #ifndef MMPH_IPID_H_
00002 #define MMPH_IPID_H_
00003
00004
00005 #include "un_ord_map_selector.hpp"
00006
00007 #ifdef __cplusplus
00008 extern "C"{
00009 #endif
00010
00011
00012 struct mmpt_ipid{
00013
00014 static const int size_in_ints=2;
00015
00016 int owner,
00017 id_at_owner;
00018
00019 mmpt_ipid(const int Owner = -1, const int Id_at_owner =- 1)
00020 : owner(Owner),id_at_owner(Id_at_owner)
00021 {
00022 }
00023
00024 operator const int*() const { return & owner; }
00025
00026 } ;
00027
00028 #ifdef __cplusplus
00029 }
00030 #endif
00031
00032 bool operator==(const mmpt_ipid& one, const mmpt_ipid& two) ;
00033 bool operator!=(const mmpt_ipid& one, const mmpt_ipid& two) ;
00034
00035 #ifdef BOOST_NO_CXX11_HDR_UNORDERED_MAP
00036
00037 namespace boost {
00038
00039 template<>
00040 struct hash<mmpt_ipid>
00041 {
00042 typedef mmpt_ipid argument_type;
00043 typedef size_t result_type;
00044
00045 result_type operator () (const argument_type& x) const {
00046 return boost::hash<int64_t>()( *reinterpret_cast<const int64_t*>(& x) );
00047 }
00048 };
00049
00050 }
00051
00052 #else
00053
00055 namespace std {
00056
00057 template<>
00058 struct hash<mmpt_ipid>
00059 {
00060 typedef mmpt_ipid argument_type;
00061 typedef size_t result_type;
00062
00063 result_type operator () (const argument_type& x) const {
00064 return std::hash<int64_t>()( *reinterpret_cast<const int64_t*>(& x) );
00065 }
00066 };
00067
00068 template<>
00069 struct __is_fast_hash<hash<mmpt_ipid>> : public std::false_type
00070 { };
00071
00072 }
00073
00074 #endif
00075
00076 #endif //MMPH_IPID_H_