# Gnome::Gda::Set Class Reference
[Data Handlers]

Container for several values. More...

Inheritance diagram for Gnome::Gda::Set:
[legend]
Collaboration diagram for Gnome::Gda::Set:
[legend]

List of all members.

## Public Member Functions

virtual | ~Set ()
GdaSet* | gobj ()
| Provides access to the underlying C GObject.
const GdaSet* | gobj () const
| Provides access to the underlying C GObject.
GdaSet* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
Glib::RefPtr< Set > | copy ()
| Creates a new Gda::Set object, copy of set.
Value | get_holder_value (const Glib::ustring& holder_id) const
| Get the value of the Gda::Holder which ID is holder_id.
template<class T >
bool | set_holder_value (const Glib::ustring& holder_id, T value)
| Set the value of the Gda::Holder which ID is holder_id to a specified value.
Glib::RefPtr< Holder > | get_holder (const Glib::ustring& holder_id)
| Finds a Gda::Holder using its ID.
Glib::RefPtr< const Holder > | get_holder (const Glib::ustring& holder_id) const
| Finds a Gda::Holder using its ID.
void | add_holder (const Glib::RefPtr< Holder >& holder)
| Adds holder to the list of holders managed within set.
void | add_holder_as_value (const Glib::ustring& id, const Gda::Value&value)
| Add a holder.
template<class ValueType >
void | add_holder (const Glib::ustring& id, const ValueType&value)
| Add a holder.
void | remove_holder (const Glib::RefPtr< Holder >& holder)
| Removes a Gda::Holder from the list of holders managed by set.
void | merge_with_set (const Glib::RefPtr< Set >& set_to_merge)
| Add to set all the holders of set_to_merge.
bool | is_valid () const
| This method tells if all set's Gda::Holder objects are valid, and if they represent a valid combination of values, as defined by rules external to Libgda: the "validate-set" signal is emitted and if none of the signal handlers return an error, then the returned value is `true`, otherwise the return value is `false` as soon as a signal handler returns an error.
Glib::SignalProxy1< void, const Glib::RefPtr< Holder >& > | signal_holder_changed ()
Glib::SignalProxy0< void > | signal_public_data_changed ()
Glib::SignalProxy0< Glib::Error > | signal_validate_set ()
Glib::SignalProxy2 < Glib::Error, const Glib::RefPtr< Holder > &, const Value& > | signal_validate_holder_change ()
Glib::SignalProxy3< void, const Glib::RefPtr< Holder > &, const Glib::ustring &, Value > | signal_holder_attr_changed ()
Glib::PropertyProxy < Glib::ustring > | property_description ()
| Description.
Glib::PropertyProxy_ReadOnly < Glib::ustring > | property_description () const
| Description.
Glib::PropertyProxy < Glib::ustring > | property_id ()
| Id.
Glib::PropertyProxy_ReadOnly < Glib::ustring > | property_id () const
| Id.
Glib::PropertyProxy < Glib::ustring > | property_name ()
| Name.
Glib::PropertyProxy_ReadOnly < Glib::ustring > | property_name () const
| Name.

## Static Public Member Functions

static Glib::RefPtr< Set > | create (const HolderVector& holders=HolderVector())

## Protected Types

typedef std::vector < Glib::RefPtr< Holder > > | HolderVector

## Protected Member Functions

| Set (const HolderVector& holders)
virtual void | on_holder_changed (const Glib::RefPtr< Holder >& holder)
virtual void | on_public_data_changed ()

## Related Functions

(Note that these are not member functions.)
Glib::RefPtr< Gnome::Gda::Set > | wrap (GdaSet* object, bool take_copy=false)
| A Glib::wrap() method for this object.

## Detailed Description

Container for several values.

The Gda::Set object is a container for several values (as Gda::Holder objects), which also offers different classifications of the group of GdaHolder values (see get_node(), get_source() or get_group()).

It is possible to control the values a Gda::Holder can have in the Gda::Set by connecting to the signal_before_holder_change() signal.

## Member Typedef Documentation

typedef std::vector< Glib::RefPtr<Holder> > Gnome::Gda::Set::HolderVector `[protected]`

## Constructor & Destructor Documentation

virtual Gnome::Gda::Set::~Set | ( | ) | `[virtual]`

Gnome::Gda::Set::Set | ( | const HolderVector & | holders ) | `[explicit, protected]`

## Member Function Documentation

void Gnome::Gda::Set::add_holder | ( | const Glib::RefPtr< Holder >& | holder ) |

Adds holder to the list of holders managed within set.

NOTE: if set already has a Gda::Holder with the same ID as holder, then holder will not be added to the set (even if holder's type or value is not the same as the one already in set).

Parameters:

  holder | A Gda::Holder object.

Returns:
  `true` if holder has been added to set (and `false` if it has not been added because there is another Gda::Holder with the same ID).

template <class ValueType >

void Gnome::Gda::Set::add_holder | ( | const Glib::ustring & | id,
|  | const ValueType & | value
| ) |  |

Add a holder.

Convenience method to add a holder with value

Parameters:

  id | Name of the holder
  value | Value of the holder

void Gnome::Gda::Set::add_holder_as_value | ( | const Glib::ustring & | id,
|  | const Gda::Value& | value
| ) |  |

Add a holder.

Convenience method to add a holder with value

Parameters:

  id | Name of the holder
  value | Value of the holder

Glib::RefPtr<Set> Gnome::Gda::Set::copy | ( | ) |

Creates a new Gda::Set object, copy of set.

Returns:
  A new Gda::Set object.

static Glib::RefPtr<Set> Gnome::Gda::Set::create | ( | const HolderVector & | holders = `HolderVector()` ) | `[static]`

Glib::RefPtr<Holder> Gnome::Gda::Set::get_holder | ( | const Glib::ustring & | holder_id ) |

Finds a Gda::Holder using its ID.

Parameters:

  holder_id | The ID of the requested value holder.

Returns:
  The requested Gda::Holder or `0`.

Glib::RefPtr<const Holder> Gnome::Gda::Set::get_holder | ( | const Glib::ustring & | holder_id ) | const

Finds a Gda::Holder using its ID.

Parameters:

  holder_id | The ID of the requested value holder.

Returns:
  The requested Gda::Holder or `0`.

Value Gnome::Gda::Set::get_holder_value | ( | const Glib::ustring & | holder_id ) | const

Get the value of the Gda::Holder which ID is holder_id.

Parameters:

  holder_id | The ID of the holder to set the value.

Returns:
  The requested GValue, or `0` (see Gda::Holder::get_value()).

const GdaSet* Gnome::Gda::Set::gobj | ( | ) | const`[inline]`

Provides access to the underlying C GObject.

Reimplemented from Glib::ObjectBase.

Reimplemented in Gnome::Gda::DataModelIter.

GdaSet* Gnome::Gda::Set::gobj | ( | ) | `[inline]`

Provides access to the underlying C GObject.

Reimplemented from Glib::ObjectBase.

Reimplemented in Gnome::Gda::DataModelIter.

GdaSet* Gnome::Gda::Set::gobj_copy | ( | ) |

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

Reimplemented in Gnome::Gda::DataModelIter.

bool Gnome::Gda::Set::is_valid | ( | ) | const

This method tells if all set's Gda::Holder objects are valid, and if they represent a valid combination of values, as defined by rules external to Libgda: the "validate-set" signal is emitted and if none of the signal handlers return an error, then the returned value is `true`, otherwise the return value is `false` as soon as a signal handler returns an error.

Returns:
  `true` if the set is valid.

Reimplemented in Gnome::Gda::DataModelIter.

void Gnome::Gda::Set::merge_with_set | ( | const Glib::RefPtr< Set >& | set_to_merge ) |

Add to set all the holders of set_to_merge.

Note:
  only the Gda::Holder of set_to_merge for which no holder in set has the same ID are merged
  all the Gda::Holder merged in set are still used by set_to_merge.

Parameters:

  set_to_merge | A Gda::Set object.

virtual void Gnome::Gda::Set::on_holder_changed | ( | const Glib::RefPtr< Holder >& | holder ) | `[protected, virtual]`

virtual void Gnome::Gda::Set::on_public_data_changed | ( | ) | `[protected, virtual]`

Glib::PropertyProxy<Glib::ustring> Gnome::Gda::Set::property_description | ( | ) |

Description.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<Glib::ustring> Gnome::Gda::Set::property_description | ( | ) | const

Description.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<Glib::ustring> Gnome::Gda::Set::property_id | ( | ) |

Id.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<Glib::ustring> Gnome::Gda::Set::property_id | ( | ) | const

Id.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<Glib::ustring> Gnome::Gda::Set::property_name | ( | ) |

Name.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<Glib::ustring> Gnome::Gda::Set::property_name | ( | ) | const

Name.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

void Gnome::Gda::Set::remove_holder | ( | const Glib::RefPtr< Holder >& | holder ) |

Removes a Gda::Holder from the list of holders managed by set.

Parameters:

  holder | The Gda::Holder to remove from set.

template <class T >

bool Gnome::Gda::Set::set_holder_value | ( | const Glib::ustring & | holder_id,
|  | T | value
| ) |  |

Set the value of the Gda::Holder which ID is holder_id to a specified value.

Parameters:

  holder_id | The ID of the holder to set the value.
  Varargs | Value, of the correct type, depending on the requested holder's type (not `0`).

Returns:
  `true` if no error occurred and the value was set correctly.

Glib::SignalProxy3< void,const Glib::RefPtr<Holder>&,const Glib::ustring&,Value > Gnome::Gda::Set::signal_holder_attr_changed | ( | ) |

Prototype:
  `void on_my_holder_attr_changed(const Glib::RefPtr<Holder>& holder, const Glib::ustring& attr_name, Value value)`

Glib::SignalProxy1< void,const Glib::RefPtr<Holder>& > Gnome::Gda::Set::signal_holder_changed | ( | ) |

Prototype:
  `void on_my_holder_changed(const Glib::RefPtr<Holder>& holder)`

Glib::SignalProxy0< void > Gnome::Gda::Set::signal_public_data_changed | ( | ) |

Prototype:
  `void on_my_public_data_changed()`

Glib::SignalProxy2< Glib::Error,const Glib::RefPtr<Holder>&,const Value& > Gnome::Gda::Set::signal_validate_holder_change | ( | ) |

Prototype:
  `Glib::Error on_my_validate_holder_change(const Glib::RefPtr<Holder>& holder, const Value& value)`

Glib::SignalProxy0< Glib::Error > Gnome::Gda::Set::signal_validate_set | ( | ) |

Prototype:
  `Glib::Error on_my_validate_set()`

## Friends And Related Function Documentation

Glib::RefPtr< Gnome::Gda::Set > wrap | ( | GdaSet * | object,
|  | bool | take_copy = `false`
| ) |  | `[related]`

A Glib::wrap() method for this object.

Parameters:

  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.

Returns:
  A C++ instance that wraps this C instance.

The documentation for this class was generated from the following file:

- libgdamm/set.h