mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-10-22 00:10:52 +00:00
41 lines
824 B
C++
41 lines
824 B
C++
#pragma once
|
|
|
|
#include <map>
|
|
#include <list>
|
|
#include <string>
|
|
|
|
#include <Poco/SharedPtr.h>
|
|
|
|
#include <DB/DataTypes/IDataType.h>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
|
|
using Poco::SharedPtr;
|
|
|
|
struct NameAndTypePair
|
|
{
|
|
String name;
|
|
DataTypePtr type;
|
|
|
|
NameAndTypePair() {}
|
|
NameAndTypePair(const String & name_, const DataTypePtr & type_) : name(name_), type(type_) {}
|
|
|
|
bool operator<(const NameAndTypePair & rhs) const
|
|
{
|
|
return std::make_pair(std::cref(name), type->getName()) < std::make_pair(std::cref(rhs.name), rhs.type->getName());
|
|
}
|
|
|
|
bool operator==(const NameAndTypePair & rhs) const
|
|
{
|
|
return name == rhs.name && type->getName() == rhs.type->getName();
|
|
}
|
|
};
|
|
|
|
typedef std::list<NameAndTypePair> NamesAndTypesList;
|
|
typedef SharedPtr<NamesAndTypesList> NamesAndTypesListPtr;
|
|
typedef std::vector<NameAndTypePair> NamesAndTypes;
|
|
|
|
}
|