diff options
author | max42 <max42@yandex-team.com> | 2023-07-29 00:02:16 +0300 |
---|---|---|
committer | max42 <max42@yandex-team.com> | 2023-07-29 00:02:16 +0300 |
commit | 73b89de71748a21e102d27b9f3ed1bf658766cb5 (patch) | |
tree | 188bbd2d622fa91cdcbb1b6d6d77fbc84a0646f5 /library/cpp/skiff/skiff_schema-inl.h | |
parent | 528e321bcc2a2b67b53aeba58c3bd88305a141ee (diff) | |
download | ydb-73b89de71748a21e102d27b9f3ed1bf658766cb5.tar.gz |
YT-19210: expose YQL shared library for YT.
After this, a new target libyqlplugin.so appears. in open-source cmake build.
Diff in open-source YDB repo looks like the following: https://paste.yandex-team.ru/f302bdb4-7ef2-4362-91c7-6ca45f329264
Diffstat (limited to 'library/cpp/skiff/skiff_schema-inl.h')
-rw-r--r-- | library/cpp/skiff/skiff_schema-inl.h | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/library/cpp/skiff/skiff_schema-inl.h b/library/cpp/skiff/skiff_schema-inl.h new file mode 100644 index 0000000000..d66325b222 --- /dev/null +++ b/library/cpp/skiff/skiff_schema-inl.h @@ -0,0 +1,61 @@ +#pragma once + +#ifndef SKIFF_SCHEMA_H +#error "Direct inclusion of this file is not allowed, include skiff_schema.h" +// For the sake of sane code completion. +#include "skiff_schema.h" +#endif +#undef SKIFF_SCHEMA_H + +namespace NSkiff { + +//////////////////////////////////////////////////////////////////////////////// + +inline bool IsSimpleType(EWireType type) +{ + switch (type) { + case EWireType::Int8: + case EWireType::Int16: + case EWireType::Int32: + case EWireType::Int64: + case EWireType::Int128: + + case EWireType::Uint8: + case EWireType::Uint16: + case EWireType::Uint32: + case EWireType::Uint64: + case EWireType::Uint128: + + case EWireType::Double: + case EWireType::Boolean: + case EWireType::String32: + case EWireType::Yson32: + case EWireType::Nothing: + return true; + case EWireType::Tuple: + case EWireType::Variant8: + case EWireType::Variant16: + case EWireType::RepeatedVariant8: + case EWireType::RepeatedVariant16: + return false; + } + Y_FAIL(); +} + +//////////////////////////////////////////////////////////////////////////////// + +template <EWireType WireType> +TComplexSchema<WireType>::TComplexSchema(TSkiffSchemaList elements) + : TSkiffSchema(WireType) + , Elements_(std::move(elements)) +{ } + +template <EWireType WireType> +const TSkiffSchemaList& TComplexSchema<WireType>::GetChildren() const +{ + return Elements_; +} + +//////////////////////////////////////////////////////////////////////////////// + +} // namespace NSkiff |