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