From 47af12dab85d3aabf20b8330cb434c7cb188b072 Mon Sep 17 00:00:00 2001 From: Kenta Murata Date: Sun, 17 Mar 2019 12:12:54 +0900 Subject: [PATCH] [GLib] Rewrite with G_DECLARE_DERIVABLE_TYPE --- c_glib/arrow-glib/array-builder.h | 43 +++++-------------------------- 1 file changed, 6 insertions(+), 37 deletions(-) diff --git a/c_glib/arrow-glib/array-builder.h b/c_glib/arrow-glib/array-builder.h index 448c4da4434f7..4c2e16f9cce6b 100644 --- a/c_glib/arrow-glib/array-builder.h +++ b/c_glib/arrow-glib/array-builder.h @@ -45,48 +45,17 @@ GArrowArray *garrow_array_builder_finish (GArrowArrayBuilder *builder, GError **error); -#define GARROW_TYPE_NULL_ARRAY_BUILDER \ - (garrow_null_array_builder_get_type()) -#define GARROW_NULL_ARRAY_BUILDER(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST((obj), \ - GARROW_TYPE_NULL_ARRAY_BUILDER, \ - GArrowNullArrayBuilder)) -#define GARROW_NULL_ARRAY_BUILDER_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST((klass), \ - GARROW_TYPE_NULL_ARRAY_BUILDER, \ - GArrowNullArrayBuilderClass)) -#define GARROW_IS_NULL_ARRAY_BUILDER(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE((obj), \ - GARROW_TYPE_NULL_ARRAY_BUILDER)) -#define GARROW_IS_NULL_ARRAY_BUILDER_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE((klass), \ - GARROW_TYPE_NULL_ARRAY_BUILDER)) -#define GARROW_NULL_ARRAY_BUILDER_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS((obj), \ - GARROW_TYPE_NULL_ARRAY_BUILDER, \ - GArrowNullArrayBuilderClass)) - -typedef struct _GArrowNullArrayBuilder GArrowNullArrayBuilder; -typedef struct _GArrowNullArrayBuilderClass GArrowNullArrayBuilderClass; - -/** - * GArrowNullArrayBuilder: - * - * It wraps `arrow::NullBuilder`. - */ -struct _GArrowNullArrayBuilder -{ - /*< private >*/ - GArrowArrayBuilder parent_instance; -}; - +#define GARROW_TYPE_NULL_ARRAY_BUILDER (garrow_null_array_builder_get_type()) +G_DECLARE_DERIVABLE_TYPE(GArrowNullArrayBuilder, + garrow_null_array_builder, + GARROW, + NULL_ARRAY_BUILDER, + GArrowArrayBuilder) struct _GArrowNullArrayBuilderClass { GArrowArrayBuilderClass parent_class; }; -GType garrow_null_array_builder_get_type(void) G_GNUC_CONST; - GArrowNullArrayBuilder *garrow_null_array_builder_new(void); gboolean garrow_null_array_builder_append_null(GArrowNullArrayBuilder *builder,