kou commented on code in PR #36470:
URL: https://github.com/apache/arrow/pull/36470#discussion_r1253854089


##########
c_glib/arrow-glib/composite-array.cpp:
##########
@@ -1760,4 +1768,330 @@ 
garrow_dictionary_array_get_dictionary_data_type(GArrowDictionaryArray *array)
   return GARROW_DICTIONARY_DATA_TYPE(data_type);
 }
 
+
+struct GArrowRunEndEncodedArrayPrivate {
+  GArrowArray *run_ends;
+  GArrowArray *values;
+};
+
+enum {
+  PROP_RUN_ENDS = 1,
+  PROP_VALUES,
+};
+
+G_DEFINE_TYPE_WITH_PRIVATE(GArrowRunEndEncodedArray,
+                           garrow_run_end_encoded_array,
+                           GARROW_TYPE_ARRAY)
+
+#define GARROW_RUN_END_ENCODED_ARRAY_GET_PRIVATE(obj)        \
+  static_cast<GArrowRunEndEncodedArrayPrivate *>(            \
+    garrow_run_end_encoded_array_get_instance_private(       \
+      GARROW_RUN_END_ENCODED_ARRAY(obj)))
+
+static void
+garrow_run_end_encoded_array_dispose(GObject *object)
+{
+  auto priv = GARROW_RUN_END_ENCODED_ARRAY_GET_PRIVATE(object);
+
+  if (priv->run_ends) {
+    g_object_unref(priv->run_ends);
+    priv->run_ends = nullptr;
+  }
+
+  if (priv->values) {
+    g_object_unref(priv->values);
+    priv->values = nullptr;
+  }
+
+  G_OBJECT_CLASS(garrow_run_end_encoded_array_parent_class)->dispose(object);
+}
+
+static void
+garrow_run_end_encoded_array_set_property(GObject *object,
+                                          guint prop_id,
+                                          const GValue *value,
+                                          GParamSpec *pspec)
+{
+  auto priv = GARROW_RUN_END_ENCODED_ARRAY_GET_PRIVATE(object);
+
+  switch (prop_id) {
+  case PROP_RUN_ENDS:
+    priv->run_ends = GARROW_ARRAY(g_value_dup_object(value));
+    break;
+  case PROP_VALUES:
+    priv->values = GARROW_ARRAY(g_value_dup_object(value));
+    break;
+  default:
+    G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+    break;
+  }
+}
+
+static void
+garrow_run_end_encoded_array_get_property(GObject *object,
+                                          guint prop_id,
+                                          GValue *value,
+                                          GParamSpec *pspec)
+{
+  auto priv = GARROW_RUN_END_ENCODED_ARRAY_GET_PRIVATE(object);
+
+  switch (prop_id) {
+  case PROP_RUN_ENDS:
+    g_value_set_object(value, priv->run_ends);
+    break;
+  case PROP_VALUES:
+    g_value_set_object(value, priv->values);
+    break;
+  default:
+    G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+    break;
+  }
+}
+
+static void
+garrow_run_end_encoded_array_init(GArrowRunEndEncodedArray *object)
+{
+}

Review Comment:
   Yes.
   This is a constructor in the GObject world. And all classes must have a 
constructor.
   We don't have anything to do for `GArrowRunEndEncodedArray` in a 
constructor. So this is a no-op function.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to