Gda.DataComparator

g GObject.Object GObject.Object Gda.DataComparator Gda.DataComparator GObject.Object->Gda.DataComparator

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

error_quark ()

class

new (old_model, new_model)

compute_diff ()

get_diff (pos)

get_n_diffs ()

set_key_columns (col_numbers)

Virtual Methods

Inherited:

GObject.Object (7)

do_diff_computed (diff)

Properties

Name

Type

Flags

Short Description

new-model

Gda.DataModel

r/w

old-model

Gda.DataModel

r/w

Signals

Inherited:

GObject.Object (1)

Name

Short Description

diff-computed

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

object

GObject.Object

r

Class Details

class Gda.DataComparator(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Gda.DataComparatorClass

classmethod error_quark()
Return type:

int

classmethod new(old_model, new_model)
Parameters:
  • old_model (Gda.DataModel) – Data model to which the modifications should be applied

  • new_model (Gda.DataModel) – Target data model.

Returns:

a new Gda.DataComparator object

Return type:

Gda.DataComparator

Creates a new comparator to compute the differences from old_model to new_model: if one applies all the computed differences (as Gda.Diff structures) to old_model, the resulting data model should have the same contents as new_model.

compute_diff()
Raises:

GLib.Error

Returns:

True if all the differences have been successfully computed, and False if an error occurred

Return type:

bool

Actually computes the differences between the data models for which self is defined.

For each difference computed, stored in a Gda.Diff structure, the “diff-computed” signal is emitted. If one connects to this signal and returns False in the signal handler, then computing differences will be stopped and an error will be returned.

get_diff(pos)
Parameters:

pos (int) – the requested difference number (starting at 0)

Returns:

a pointer to a Gda.Diff, or None if pos is invalid

Return type:

Gda.Diff

Get a pointer to the Gda.Diff structure representing the difference which number is pos

get_n_diffs()
Returns:

the number of computed differences

Return type:

int

Get the number of differences as computed by the last time Gda.DataComparator.compute_diff() was called.

set_key_columns(col_numbers)
Parameters:

col_numbers ([int]) – an array of nb_cols values

Defines the columns which will be used as a key when searching data. This is not mandatory but will speed things up as less data will be processed.

do_diff_computed(diff) virtual
Parameters:

diff (Gda.Diff) –

Return type:

bool

Signal Details

Gda.DataComparator.signals.diff_computed(data_comparator, object)
Signal Name:

diff-computed

Flags:

RUN_LAST

Parameters:
Return type:

bool

Property Details

Gda.DataComparator.props.new_model
Name:

new-model

Type:

Gda.DataModel

Default Value:

None

Flags:

READABLE, WRITABLE

Gda.DataComparator.props.old_model
Name:

old-model

Type:

Gda.DataModel

Default Value:

None

Flags:

READABLE, WRITABLE