cql3: Introduce to_identifier(column_definition&)

This commit is contained in:
Tomasz Grabiec
2015-03-04 17:50:11 +01:00
parent 70059ac1d4
commit 4c7480ce3b
2 changed files with 8 additions and 1 deletions

View File

@@ -180,12 +180,17 @@ column_definition* get_column_definition(schema_ptr schema, column_identifier& i
return schema->get_column_definition(id.bytes_);
}
static inline
::shared_ptr<column_identifier> to_identifier(const column_definition& def) {
return def.column_specification->name;
}
static inline
std::vector<::shared_ptr<column_identifier>> to_identifiers(const std::vector<const column_definition*>& defs) {
std::vector<::shared_ptr<column_identifier>> r;
r.reserve(defs.size());
for (auto&& def : defs) {
r.push_back(def->column_specification->name);
r.push_back(to_identifier(*def));
}
return r;
}

View File

@@ -34,6 +34,8 @@ public:
}))
{ }
tuple_type(tuple_type&&) = default;
prefix_type as_prefix() {
return prefix_type(_types);
}