summaryrefslogtreecommitdiffstats
path: root/src/arrow/c_glib/arrow-glib/datum.h
blob: bc7dda369117c2ea31193b441ca496b20703e3d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

#pragma once

#include <arrow-glib/array.h>
#include <arrow-glib/chunked-array.h>
#include <arrow-glib/record-batch.h>
#include <arrow-glib/scalar.h>
#include <arrow-glib/table.h>

G_BEGIN_DECLS

#define GARROW_TYPE_DATUM (garrow_datum_get_type())
G_DECLARE_DERIVABLE_TYPE(GArrowDatum,
                         garrow_datum,
                         GARROW,
                         DATUM,
                         GObject)
struct _GArrowDatumClass
{
  GObjectClass parent_class;
};

GARROW_AVAILABLE_IN_1_0
gboolean garrow_datum_is_array(GArrowDatum *datum);
GARROW_AVAILABLE_IN_1_0
gboolean garrow_datum_is_array_like(GArrowDatum *datum);
GARROW_AVAILABLE_IN_5_0
gboolean garrow_datum_is_scalar(GArrowDatum *datum);
GARROW_AVAILABLE_IN_5_0
gboolean garrow_datum_is_value(GArrowDatum *datum);
/*
GARROW_AVAILABLE_IN_5_0
gboolean garrow_datum_is_collection(GArrowDatum *datum);
*/
GARROW_AVAILABLE_IN_1_0
gboolean garrow_datum_equal(GArrowDatum *datum,
                            GArrowDatum *other_datum);
GARROW_AVAILABLE_IN_1_0
gchar *garrow_datum_to_string(GArrowDatum *datum);

/* GARROW_TYPE_NONE_DATUM */

#define GARROW_TYPE_SCALAR_DATUM (garrow_scalar_datum_get_type())
G_DECLARE_DERIVABLE_TYPE(GArrowScalarDatum,
                         garrow_scalar_datum,
                         GARROW,
                         SCALAR_DATUM,
                         GArrowDatum)
struct _GArrowScalarDatumClass
{
  GArrowDatumClass parent_class;
};

GARROW_AVAILABLE_IN_5_0
GArrowScalarDatum *garrow_scalar_datum_new(GArrowScalar *value);

#define GARROW_TYPE_ARRAY_DATUM (garrow_array_datum_get_type())
G_DECLARE_DERIVABLE_TYPE(GArrowArrayDatum,
                         garrow_array_datum,
                         GARROW,
                         ARRAY_DATUM,
                         GArrowDatum)
struct _GArrowArrayDatumClass
{
  GArrowDatumClass parent_class;
};

GARROW_AVAILABLE_IN_1_0
GArrowArrayDatum *garrow_array_datum_new(GArrowArray *value);

#define GARROW_TYPE_CHUNKED_ARRAY_DATUM (garrow_chunked_array_datum_get_type())
G_DECLARE_DERIVABLE_TYPE(GArrowChunkedArrayDatum,
                         garrow_chunked_array_datum,
                         GARROW,
                         CHUNKED_ARRAY_DATUM,
                         GArrowDatum)
struct _GArrowChunkedArrayDatumClass
{
  GArrowDatumClass parent_class;
};

GARROW_AVAILABLE_IN_1_0
GArrowChunkedArrayDatum *
garrow_chunked_array_datum_new(GArrowChunkedArray *value);

#define GARROW_TYPE_RECORD_BATCH_DATUM (garrow_record_batch_datum_get_type())
G_DECLARE_DERIVABLE_TYPE(GArrowRecordBatchDatum,
                         garrow_record_batch_datum,
                         GARROW,
                         RECORD_BATCH_DATUM,
                         GArrowDatum)
struct _GArrowRecordBatchDatumClass
{
  GArrowDatumClass parent_class;
};

GARROW_AVAILABLE_IN_1_0
GArrowRecordBatchDatum *
garrow_record_batch_datum_new(GArrowRecordBatch *value);

#define GARROW_TYPE_TABLE_DATUM (garrow_table_datum_get_type())
G_DECLARE_DERIVABLE_TYPE(GArrowTableDatum,
                         garrow_table_datum,
                         GARROW,
                         TABLE_DATUM,
                         GArrowDatum)
struct _GArrowTableDatumClass
{
  GArrowDatumClass parent_class;
};

GARROW_AVAILABLE_IN_1_0
GArrowTableDatum *garrow_table_datum_new(GArrowTable *value);

/* GARROW_TYPE_COLLECTION_DATUM */

G_END_DECLS