ClickHouse/dbms/include/DB/Core/NamesAndTypes.h

41 lines
802 B
C
Raw Normal View History

2011-10-31 17:55:06 +00:00
#pragma once
2010-03-18 19:32:14 +00:00
#include <map>
#include <list>
2010-03-18 19:32:14 +00:00
#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(name, type->getName()) < std::make_pair(rhs.name, rhs.type->getName());
}
bool operator==(const NameAndTypePair & rhs) const
{
return name == rhs.name && type->getName() == rhs.type->getName();
}
};
2011-11-01 17:12:11 +00:00
typedef std::list<NameAndTypePair> NamesAndTypesList;
typedef SharedPtr<NamesAndTypesList> NamesAndTypesListPtr;
typedef std::vector<NameAndTypePair> NamesAndTypes;
2011-11-01 17:12:11 +00:00
2010-03-18 19:32:14 +00:00
}