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 InListPredicateData;
82  friend class KuduColumnSpec;
83 
84  class KUDU_NO_EXPORT Data;
85  explicit KuduValue(Data* d);
86 
87  // Owned.
88  Data* data_;
89 
90  private:
91  DISALLOW_COPY_AND_ASSIGN(KuduValue);
92 };
93 
94 } // namespace client
95 } // namespace kudu
96 #endif /* KUDU_CLIENT_VALUE_H */
Definition: callbacks.h:28
A constant cell value with a specific type.
Definition: value.h:35
Builder API for specifying or altering a column within a table schema.
Definition: schema.h:274
A wrapper around externally allocated data.
Definition: slice.h:50