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 #include <stdint.h>
21 
22 #ifdef KUDU_HEADERS_NO_STUBS
23 #include "kudu/gutil/macros.h"
24 #else
25 #include "kudu/client/stubs.h"
26 #endif
27 #include "kudu/util/int128.h"
28 #include "kudu/util/kudu_export.h"
29 #include "kudu/util/slice.h"
30 
31 namespace kudu {
32 namespace client {
33 
35 class KUDU_EXPORT KuduValue {
36  public:
38  KuduValue* Clone() const;
39 
49  static KuduValue* FromInt(int64_t val);
50  static KuduValue* FromFloat(float f);
51  static KuduValue* FromDouble(double d);
52  static KuduValue* FromBool(bool b);
54 
55 #if KUDU_INT128_SUPPORTED
56  static KuduValue* FromDecimal(int128_t dv, int8_t scale);
69 #endif
70 
76  static KuduValue* CopyString(Slice s);
77 
78  ~KuduValue();
79  private:
80  friend class ComparisonPredicateData;
81  friend class InBloomFilterPredicateData;
82  friend class InListPredicateData;
83  friend class KuduColumnSpec;
84 
85  class KUDU_NO_EXPORT Data;
86  explicit KuduValue(Data* d);
87 
88  // Owned.
89  Data* data_;
90 
91  private:
92  DISALLOW_COPY_AND_ASSIGN(KuduValue);
93 };
94 
95 } // namespace client
96 } // namespace kudu
97 #endif /* KUDU_CLIENT_VALUE_H */
A constant cell value with a specific type.
Definition: value.h:35
Definition: callbacks.h:28
Builder API for specifying or altering a column within a table schema.
Definition: schema.h:338
A wrapper around externally allocated data.
Definition: slice.h:51