- Move pipeline related code in gdbus-util to proper src.
- Adjust function names to the model-impl.
Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
}
/**
- * @brief Cleanup the instance of the DBus interface.
- */
-static void
-put_instance (gpointer * instance)
-{
- g_object_unref (*instance);
- *instance = NULL;
-}
-
-/**
- * @brief Get the skeleton object of the DBus interface.
- */
-MachinelearningServicePipeline *
-gdbus_get_instance_pipeline (void)
-{
- return machinelearning_service_pipeline_skeleton_new ();
-}
-
-/**
- * @brief Put the obtained skeleton object and release the resource.
- */
-void
-gdbus_put_instance_pipeline (MachinelearningServicePipeline ** instance)
-{
- put_instance ((gpointer *) instance);
-}
-
-/**
* @brief Connect to the DBus message bus, which type is SYSTEM.
*/
int
#include <gio/gio.h>
#include <stdbool.h>
-#include "pipeline-dbus.h"
-
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/**
* @brief Export the DBus interface at the Object path on the bus connection.
- *
* @param instance The instance of the DBus interface to export.
* @param obj_path The path to export the interface at.
* @return @c 0 on success. Otherwise a negative error value.
struct gdbus_signal_info *signal_infos);
/**
- * @brief Get the skeleton object of the DBus interface.
- * @remarks If the function succeeds, @a MachinelearningServicePipeline*
- * should be released using gdbus_put_instance_pipeline().
- * @return MachinelearningServiceProcess* The skeleton object.
- */
-MachinelearningServicePipeline *gdbus_get_instance_pipeline (void);
-
-/**
- * @brief Put the obtained skeleton object and release the resource.
- * @param instance The obtained skeleton object of the DBus interface.
- */
-void gdbus_put_instance_pipeline (MachinelearningServicePipeline ** instance);
-
-/**
* @brief Connect to the DBus message bus
- * @param is_session Ture is DBus Bus type is session.
+ * @param is_session True is DBus Bus type is session.
* @return @c 0 on success. Otherwise a negative error value.
*/
int gdbus_get_system_connection (gboolean is_session);
#include <gdbus-util.h>
#include <log.h>
+#include "pipeline-dbus.h"
#include "service-db.hh"
#include "dbus-interface.h"
}
/**
+ * @brief Get the skeleton object of the DBus interface.
+ */
+static MachinelearningServicePipeline *
+gdbus_get_pipeline_instance (void)
+{
+ return machinelearning_service_pipeline_skeleton_new ();
+}
+
+/**
+ * @brief Put the obtained skeleton object and release the resource.
+ */
+static void
+gdbus_put_pipeline_instance (MachinelearningServicePipeline ** instance)
+{
+ g_clear_object (instance);
+}
+
+/**
* @brief Set the service with given description. Return the call result.
*/
static gboolean dbus_cb_core_set_pipeline (MachinelearningServicePipeline *obj,
{
int ret = 0;
- g_gdbus_instance = gdbus_get_instance_pipeline ();
+ g_gdbus_instance = gdbus_get_pipeline_instance ();
if (g_gdbus_instance == NULL) {
_E ("cannot get a dbus instance for the %s interface\n",
DBUS_PIPELINE_INTERFACE);
gdbus_disconnect_signal (g_gdbus_instance,
ARRAY_SIZE (handler_infos), handler_infos);
out:
- gdbus_put_instance_pipeline (&g_gdbus_instance);
+ gdbus_put_pipeline_instance (&g_gdbus_instance);
return ret;
}
gdbus_disconnect_signal (g_gdbus_instance,
ARRAY_SIZE (handler_infos), handler_infos);
- gdbus_put_instance_pipeline (&g_gdbus_instance);
+ gdbus_put_pipeline_instance (&g_gdbus_instance);
}
static const struct module_ops pipeline_ops = {