ClickHouse/libs/libcommon/include/common/Common.h

56 lines
1.2 KiB
C++
Raw Normal View History

#pragma once
#include <string>
#include <functional>
#include <Poco/Types.h>
#include <common/strong_typedef.h>
2016-06-08 13:08:20 +00:00
using Int8 = Poco::Int8;
using Int16 = Poco::Int16;
using Int32 = Poco::Int32;
using Int64 = Poco::Int64;
2016-06-08 13:08:20 +00:00
using UInt8 = Poco::UInt8;
using UInt16 = Poco::UInt16;
using UInt32 = Poco::UInt32;
using UInt64 = Poco::UInt64;
/// Обход проблемы с тем, что KDevelop не видит time_t и size_t (для подсветки синтаксиса).
#ifdef IN_KDEVELOP_PARSER
2016-06-08 13:08:20 +00:00
using time_t = Int64;
using size_t = UInt64;
#endif
/** Тип данных для хранения идентификатора пользователя. */
2016-06-08 13:08:20 +00:00
using UserID_t = UInt64;
/** Тип данных для хранения идентификатора счетчика. */
2016-06-08 13:08:20 +00:00
using CounterID_t = UInt32;
/** Идентификатор хита */
2016-06-08 13:08:20 +00:00
using WatchID_t = UInt64;
/** Идентификатор визита */
STRONG_TYPEDEF(UInt64, VisitID_t);
/** Идентификатор клика */
2016-06-08 13:08:20 +00:00
using ClickID_t = UInt64;
/** Идентификатор цели */
2016-06-08 13:08:20 +00:00
using GoalID_t = UInt32;
namespace std
{
template<>
struct hash<VisitID_t> : public unary_function<VisitID_t, size_t>
{
size_t operator()(VisitID_t x) const { return x; }
};
}