Simple data model's contents comparison. More...
Public Member Functions | |
virtual | ~DataComparator () |
GdaDataComparator* | gobj () |
Provides access to the underlying C GObject. | |
const GdaDataComparator* | gobj () const |
Provides access to the underlying C GObject. | |
GdaDataComparator* | gobj_copy () |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. | |
void | set_key_for_columns (const Glib::ArrayHandle< int >& col_numbers, int nb_cols) |
Defines the columns which will be used as a key when searching data. | |
bool | compute_diff () |
Actually computes the differences between the data models for which comp is defined. | |
int | get_n_diffs () const |
Get the number of differences as computed by the last time compute_diff() was called. | |
const Diff* | get_diff (int pos) |
Get a pointer to the Gda::Diff structure representing the difference which number is pos. | |
Glib::PropertyProxy < Glib::RefPtr< DataModel > > | property_old_model () |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | |
Glib::PropertyProxy_ReadOnly < Glib::RefPtr< DataModel > > | property_old_model () const |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | |
Glib::PropertyProxy < Glib::RefPtr< DataModel > > | property_new_model () |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | |
Glib::PropertyProxy_ReadOnly < Glib::RefPtr< DataModel > > | property_new_model () const |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | |
Glib::SignalProxy1< bool, Diff* > | signal_diff_computed () |
Static Public Member Functions | |
static Glib::RefPtr < DataComparator > | create (const Glib::RefPtr< DataModel >& old_model, const Glib::RefPtr< DataModel >& new_model) |
Protected Member Functions | |
DataComparator (const Glib::RefPtr< DataModel >& old_model, const Glib::RefPtr< DataModel >& new_model) | |
Related Functions | |
(Note that these are not member functions.) | |
Glib::RefPtr < Gnome::Gda::DataComparator > | wrap (GdaDataComparator* object, bool take_copy=false) |
A Glib::wrap() method for this object. |
Simple data model's contents comparison.
The DataComparator is a simple object which takes two DataModel objects and compare them. Actual comparison is performed when the compute_diff() is called; for each difference found, the diff-computed signal is emitted (any user installed signal handler which returns FALSE stops the computing process).
After the differences have been computed, they can each be accessed using gda_data_comparator_get_diff(), the number of differences found being returned by gda_data_comparator_get_n_diffs(). There are some limitations to this object:
virtual Gnome::Gda::DataComparator::~DataComparator | ( | ) | [virtual] |
Gnome::Gda::DataComparator::DataComparator | ( | const Glib::RefPtr< DataModel >& | old_model, |
const Glib::RefPtr< DataModel >& | new_model | ||
) | [explicit, protected] |
bool Gnome::Gda::DataComparator::compute_diff | ( | ) |
Actually computes the differences between the data models for which comp 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.
true
if all the differences have been sucessfully computed, and false
if an error occurred. static Glib::RefPtr<DataComparator> Gnome::Gda::DataComparator::create | ( | const Glib::RefPtr< DataModel >& | old_model, |
const Glib::RefPtr< DataModel >& | new_model | ||
) | [static] |
const Diff* Gnome::Gda::DataComparator::get_diff | ( | int | pos ) |
int Gnome::Gda::DataComparator::get_n_diffs | ( | ) | const |
Get the number of differences as computed by the last time compute_diff() was called.
GdaDataComparator* Gnome::Gda::DataComparator::gobj | ( | ) | [inline] |
Provides access to the underlying C GObject.
Reimplemented from Gnome::Gda::DataModel.
const GdaDataComparator* Gnome::Gda::DataComparator::gobj | ( | ) | const [inline] |
Provides access to the underlying C GObject.
Reimplemented from Gnome::Gda::DataModel.
GdaDataComparator* Gnome::Gda::DataComparator::gobj_copy | ( | ) |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<DataModel> > Gnome::Gda::DataComparator::property_new_model | ( | ) | const |
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy< Glib::RefPtr<DataModel> > Gnome::Gda::DataComparator::property_new_model | ( | ) |
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy< Glib::RefPtr<DataModel> > Gnome::Gda::DataComparator::property_old_model | ( | ) |
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<DataModel> > Gnome::Gda::DataComparator::property_old_model | ( | ) | const |
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
void Gnome::Gda::DataComparator::set_key_for_columns | ( | const Glib::ArrayHandle< int > & | col_numbers, |
int | nb_cols | ||
) |
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.
nb_cols | The size of the col_numbers array. |
col_numbers | An array of nb_cols values. |
Glib::SignalProxy1< bool,Diff* > Gnome::Gda::DataComparator::signal_diff_computed | ( | ) |
bool on_my_diff_computed(Diff* diff)
Glib::RefPtr< Gnome::Gda::DataComparator > wrap | ( | GdaDataComparator * | object, |
bool | take_copy = false |
||
) | [related] |
A Glib::wrap() method for this object.
object | The C instance. |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |