conv_manager_t changed to template

This commit is contained in:
wangyu-
2018-07-19 01:23:25 -05:00
parent fef76af3a5
commit 946b615acf
4 changed files with 230 additions and 181 deletions

View File

@@ -185,6 +185,36 @@ struct address_t //TODO scope id
char* get_ip();
};
namespace std {
template <>
struct hash<address_t>
{
std::size_t operator()(const address_t& key) const
{
//return address_t::hash_function(k);
return sdbm((unsigned char*)&key.inner,sizeof(key.inner));
}
};
}
struct not_copy_able_t
{
not_copy_able_t()
{
}
not_copy_able_t(const not_copy_able_t &other)
{
assert(0==1);
}
const not_copy_able_t & operator=(const not_copy_able_t &other)
{
assert(0==1);
return other;
}
};
const int max_data_len=1800;
const int buf_len=max_data_len+400;