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/slice.h"
28 #include "kudu/util/kudu_export.h"
29 
30 namespace kudu {
31 namespace client {
32 
34 class KUDU_EXPORT KuduValue {
35  public:
37  KuduValue* Clone() const;
38 
48  static KuduValue* FromInt(int64_t val);
49  static KuduValue* FromFloat(float f);
50  static KuduValue* FromDouble(double d);
51  static KuduValue* FromBool(bool b);
53 
59  static KuduValue* CopyString(Slice s);
60 
61  ~KuduValue();
62  private:
63  friend class ComparisonPredicateData;
64  friend class InListPredicateData;
65  friend class KuduColumnSpec;
66 
67  class KUDU_NO_EXPORT Data;
68  explicit KuduValue(Data* d);
69 
70  // Owned.
71  Data* data_;
72 
73  private:
74  DISALLOW_COPY_AND_ASSIGN(KuduValue);
75 };
76 
77 } // namespace client
78 } // namespace kudu
79 #endif /* KUDU_CLIENT_VALUE_H */
A constant cell value with a specific type.
Definition: value.h:34
Definition: callbacks.h:28
Builder API for specifying or altering a column within a table schema.
Definition: schema.h:240
A wrapper around externally allocated data.
Definition: slice.h:47