@@ -269,6 +269,8 @@ G_BEGIN_DECLS
269269 * #GArrowExtractRegexOptions is a class to customize the `extract_regex`
270270 * function.
271271 *
272+ * #GArrowRoundBinaryOptions is a class to customize the `round_binary` function.
273+ *
272274 * There are many functions to compute data on an array.
273275 */
274276
@@ -7091,6 +7093,99 @@ garrow_extract_regex_options_new(void)
70917093 return GARROW_EXTRACT_REGEX_OPTIONS (options);
70927094}
70937095
7096+ enum {
7097+ PROP_ROUND_BINARY_OPTIONS_MODE = 1 ,
7098+ };
7099+
7100+ G_DEFINE_TYPE (GArrowRoundBinaryOptions,
7101+ garrow_round_binary_options,
7102+ GARROW_TYPE_FUNCTION_OPTIONS)
7103+
7104+ static void
7105+ garrow_round_binary_options_set_property(GObject *object,
7106+ guint prop_id,
7107+ const GValue *value,
7108+ GParamSpec *pspec)
7109+ {
7110+ auto options = garrow_round_binary_options_get_raw (GARROW_ROUND_BINARY_OPTIONS (object));
7111+
7112+ switch (prop_id) {
7113+ case PROP_ROUND_BINARY_OPTIONS_MODE:
7114+ options->round_mode = static_cast <arrow::compute::RoundMode>(g_value_get_enum (value));
7115+ break ;
7116+ default :
7117+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
7118+ break ;
7119+ }
7120+ }
7121+
7122+ static void
7123+ garrow_round_binary_options_get_property (GObject *object,
7124+ guint prop_id,
7125+ GValue *value,
7126+ GParamSpec *pspec)
7127+ {
7128+ auto options = garrow_round_binary_options_get_raw (GARROW_ROUND_BINARY_OPTIONS (object));
7129+
7130+ switch (prop_id) {
7131+ case PROP_ROUND_BINARY_OPTIONS_MODE:
7132+ g_value_set_enum (value, static_cast <GArrowRoundMode>(options->round_mode ));
7133+ break ;
7134+ default :
7135+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
7136+ break ;
7137+ }
7138+ }
7139+
7140+ static void
7141+ garrow_round_binary_options_init (GArrowRoundBinaryOptions *object)
7142+ {
7143+ auto arrow_priv = GARROW_FUNCTION_OPTIONS_GET_PRIVATE (object);
7144+ arrow_priv->options = static_cast <arrow::compute::FunctionOptions *>(
7145+ new arrow::compute::RoundBinaryOptions ());
7146+ }
7147+
7148+ static void
7149+ garrow_round_binary_options_class_init (GArrowRoundBinaryOptionsClass *klass)
7150+ {
7151+ auto gobject_class = G_OBJECT_CLASS (klass);
7152+
7153+ gobject_class->set_property = garrow_round_binary_options_set_property;
7154+ gobject_class->get_property = garrow_round_binary_options_get_property;
7155+
7156+ arrow::compute::RoundBinaryOptions options;
7157+
7158+ GParamSpec *spec;
7159+ /* *
7160+ * GArrowRoundBinaryOptions:mode:
7161+ *
7162+ * The rounding and tie-breaking mode.
7163+ *
7164+ * Since: 23.0.0
7165+ */
7166+ spec = g_param_spec_enum (" mode" ,
7167+ " Mode" ,
7168+ " The rounding and tie-breaking mode" ,
7169+ GARROW_TYPE_ROUND_MODE,
7170+ static_cast <GArrowRoundMode>(options.round_mode ),
7171+ static_cast <GParamFlags>(G_PARAM_READWRITE));
7172+ g_object_class_install_property (gobject_class, PROP_ROUND_BINARY_OPTIONS_MODE, spec);
7173+ }
7174+
7175+ /* *
7176+ * garrow_round_binary_options_new:
7177+ *
7178+ * Returns: A newly created #GArrowRoundBinaryOptions.
7179+ *
7180+ * Since: 23.0.0
7181+ */
7182+ GArrowRoundBinaryOptions *
7183+ garrow_round_binary_options_new (void )
7184+ {
7185+ return GARROW_ROUND_BINARY_OPTIONS (
7186+ g_object_new (GARROW_TYPE_ROUND_BINARY_OPTIONS, NULL ));
7187+ }
7188+
70947189G_END_DECLS
70957190
70967191arrow::Result<arrow::FieldRef>
@@ -7254,6 +7349,11 @@ garrow_function_options_new_raw(const arrow::compute::FunctionOptions *arrow_opt
72547349 static_cast <const arrow::compute::ExtractRegexOptions *>(arrow_options);
72557350 auto options = garrow_extract_regex_options_new_raw (arrow_extract_regex_options);
72567351 return GARROW_FUNCTION_OPTIONS (options);
7352+ } else if (arrow_type_name == " RoundBinaryOptions" ) {
7353+ const auto arrow_round_binary_options =
7354+ static_cast <const arrow::compute::RoundBinaryOptions *>(arrow_options);
7355+ auto options = garrow_round_binary_options_new_raw (arrow_round_binary_options);
7356+ return GARROW_FUNCTION_OPTIONS (options);
72577357 } else {
72587358 auto options = g_object_new (GARROW_TYPE_FUNCTION_OPTIONS, NULL );
72597359 return GARROW_FUNCTION_OPTIONS (options);
@@ -7893,3 +7993,21 @@ garrow_extract_regex_options_get_raw(GArrowExtractRegexOptions *options)
78937993 return static_cast <arrow::compute::ExtractRegexOptions *>(
78947994 garrow_function_options_get_raw (GARROW_FUNCTION_OPTIONS (options)));
78957995}
7996+
7997+ GArrowRoundBinaryOptions *
7998+ garrow_round_binary_options_new_raw (
7999+ const arrow::compute::RoundBinaryOptions *arrow_options)
8000+ {
8001+ return GARROW_ROUND_BINARY_OPTIONS (
8002+ g_object_new (GARROW_TYPE_ROUND_BINARY_OPTIONS,
8003+ " mode" ,
8004+ static_cast <GArrowRoundMode>(arrow_options->round_mode ),
8005+ NULL ));
8006+ }
8007+
8008+ arrow::compute::RoundBinaryOptions *
8009+ garrow_round_binary_options_get_raw (GArrowRoundBinaryOptions *options)
8010+ {
8011+ return static_cast <arrow::compute::RoundBinaryOptions *>(
8012+ garrow_function_options_get_raw (GARROW_FUNCTION_OPTIONS (options)));
8013+ }
0 commit comments