Apache Ignite C++ Client
Loading...
Searching...
No Matches
column_metadata.h
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#pragma once
19
20#include "ignite/client/sql/column_origin.h"
21#include "ignite/common/ignite_type.h"
22
23#include <cstdint>
24#include <string>
25
26namespace ignite {
27
31class column_metadata {
32public:
33 // Default
34 column_metadata() = default;
35
46 column_metadata(std::string name, ignite_type type, std::int32_t precision, std::int32_t scale, bool nullable,
48 : m_name(std::move(name))
49 , m_type(type)
50 , m_precision(precision)
51 , m_scale(scale)
52 , m_nullable(nullable)
53 , m_origin(std::move(origin)) {}
54
60 [[nodiscard]] const std::string &name() const { return m_name; }
61
67 [[nodiscard]] ignite_type type() const { return m_type; }
68
80 [[nodiscard]] std::int32_t precision() const { return m_precision; }
81
87 [[nodiscard]] std::int32_t scale() const { return m_scale; }
88
94 [[nodiscard]] bool nullable() const { return m_nullable; }
95
103 [[nodiscard]] const column_origin &origin() const { return m_origin; }
104
105private:
107 std::string m_name;
108
110 ignite_type m_type{ignite_type::UNDEFINED};
111
113 std::int32_t m_precision{0};
114
116 std::int32_t m_scale{0};
117
119 bool m_nullable{false};
120
122 column_origin m_origin;
123};
124
125} // namespace ignite
std::int32_t precision() const
Definition column_metadata.h:80
column_metadata(std::string name, ignite_type type, std::int32_t precision, std::int32_t scale, bool nullable, column_origin origin)
Definition column_metadata.h:46
const std::string & name() const
Definition column_metadata.h:60
std::int32_t scale() const
Definition column_metadata.h:87
ignite_type type() const
Definition column_metadata.h:67
const column_origin & origin() const
Definition column_metadata.h:103
bool nullable() const
Definition column_metadata.h:94
Definition column_origin.h:27