Kudu C++ client API
value.h
1 // Licensed to the Apache Software Foundation (ASF) under one
2 // or more contributor license agreements. See the NOTICE file
3 // distributed with this work for additional information
4 // regarding copyright ownership. The ASF licenses this file
5 // to you under the Apache License, Version 2.0 (the
6 // "License"); you may not use this file except in compliance
7 // with 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,
12 // software distributed under the License is distributed on an
13 // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 // KIND, either express or implied. See the License for the
15 // specific language governing permissions and limitations
16 // under the License.
17 #ifndef KUDU_CLIENT_VALUE_H
18 #define KUDU_CLIENT_VALUE_H
19 
20 // NOTE: using stdint.h instead of cstdint because this file is supposed
21 // to be processed by a compiler lacking C++11 support.
22 #include <stdint.h>
23 
24 #ifdef KUDU_HEADERS_NO_STUBS
25 #include "kudu/gutil/macros.h"
26 #else
27 #include "kudu/client/stubs.h"
28 #endif
29 #include "kudu/util/int128.h"
30 #include "kudu/util/kudu_export.h"
31 #include "kudu/util/slice.h"
32 
33 namespace kudu {
34 namespace client {
35 
37 class KUDU_EXPORT KuduValue {
38  public:
40  KuduValue* Clone() const;
41 
44 
50  static KuduValue* FromInt(int64_t val);
51  static KuduValue* FromFloat(float val);
52  static KuduValue* FromDouble(double val);
53  static KuduValue* FromBool(bool val);
55 
56 #if KUDU_INT128_SUPPORTED
68  static KuduValue* FromDecimal(int128_t dv, int8_t scale);
70 #endif
71 
78 
79  ~KuduValue();
80  private:
81  friend class ComparisonPredicateData;
82  friend class InBloomFilterPredicateData;
83  friend class InListPredicateData;
84  friend class KuduColumnSpec;
85 
86  class KUDU_NO_EXPORT Data;
87  explicit KuduValue(Data* d);
88 
89  // Owned.
90  Data* data_;
91 
92  private:
93  DISALLOW_COPY_AND_ASSIGN(KuduValue);
94 };
95 
96 } // namespace client
97 } // namespace kudu
98 #endif /* KUDU_CLIENT_VALUE_H */
A wrapper around externally allocated data.
Definition: slice.h:51
Builder API for specifying or altering a column within a table schema.
Definition: schema.h:370
A constant cell value with a specific type.
Definition: value.h:37
static KuduValue * FromDouble(double val)
static KuduValue * FromFloat(float val)
static KuduValue * CopyString(Slice s)
KuduValue * Clone() const
static KuduValue * FromInt(int64_t val)
static KuduValue * FromBool(bool val)