libgdamm Reference Documentation

Main Page Namespaces Book

# Gnome::Gda::ParameterList Class Reference
[Data Models]

Manages a list of GdaParameter objects which contain individual values. More...

Inheritance diagram for Gnome::Gda::ParameterList:

[legend]
List of all members.

## Public Member Functions

Glib::RefPtr<Parameter> | add_parameter (const Glib::ustring& name, const Value& value)
| Creates and adds a new Gda::Parameter to paramlist.
Glib::RefPtr<Parameter> | add_parameter (const Glib::ustring& name, GType type, const Glib::ustring& str)
| Creates and adds a new Gda::Parameter to paramlist.
void | add_parameter (const Glib::RefPtr<Parameter>& param)
| Adds param to the list of parameters managed within paramlist.
Glib::RefPtr<Parameter> | find_param (const Glib::ustring& param_name)
| Finds a Gda::Parameter using its name.
Glib::RefPtr<Parameter> | find_param_for_user (const Glib::RefPtr<Gda::Object>& user)
| Finds a Gda::Parameter which is to be used by user.
guint | get_length () const
| Get the number of Gda::Parameter objects in paramlist.
guint | get_length ()
| Get the number of Gda::Parameter objects in paramlist.
Value | get_param_default_value (const Glib::RefPtr<const Parameter>& param) const
Glib::ustring | get_spec () const
| Get the specification as an XML string.
const GdaParameterList* | gobj () const
| Provides access to the underlying C GObject.
GdaParameterList* | gobj ()
| Provides access to the underlying C GObject.
GdaParameterList* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
bool | is_coherent () const
| Checks that paramlist has a coherent public data structure.
bool | is_valid () const
| Tells if all the paramlist's parameters have valid data.
void | merge (const Glib::RefPtr<ParameterList>& paramlist_to_merge)
| Add to paramlist all the parameters of paramlist_to_merge.
| operator bool () const
bool | restrict_param_by_name (const Glib::ustring& param_name, const Glib::RefPtr<DataModel>& model, int col)
| Restricts the values of a parameter in the list.
void | set_param_default_alias (const Glib::RefPtr<const Parameter>& param, const Glib::RefPtr<const Parameter>& alias)
void | set_param_default_value (const Glib::RefPtr<const Parameter>& param, const Value& value)
| Stores value in paramlist to make it possible for paramlist's users to find a default value for param when one is required, instead of `0`.
Glib::SignalProxy1< void, Glib::RefPtr<Parameter >> | signal_param_attr_changed ()

Prototype:
  `void on_my_param_attr_changed(Glib::RefPtr<Parameter> parameter)`

Glib::SignalProxy1< void, Glib::RefPtr<Parameter >> | signal_param_changed ()

Prototype:
  `void on_my_param_changed(Glib::RefPtr<Parameter> parameter)`

Glib::SignalProxy1< void, Glib::RefPtr<Parameter >> | signal_param_plugin_changed ()

Prototype:
  `void on_my_param_plugin_changed(Glib::RefPtr<Parameter> parameter)`

Glib::SignalProxy0<void> | signal_public_data_changed ()

Prototype:
  `void on_my_public_data_changed()`

virtual | ~ParameterList ()

## Static Public Member Functions

static Glib::RefPtr<ParameterList> | create ()
static Glib::RefPtr<ParameterList> | create (const Glib::SListHandle<Parameter>& param)

## Protected Member Functions

virtual void | on_param_attr_changed (Glib::RefPtr<Parameter> parameter)
virtual void | on_param_changed (Glib::RefPtr<Parameter> parameter)
virtual void | on_param_plugin_changed (Glib::RefPtr<Parameter> parameter)
virtual void | on_public_data_changed ()
| ParameterList (const Glib::RefPtr<Dict>& dict, const Glib::SListHandle<Parameter>& params)

## Related Functions

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

## Detailed Description

Manages a list of GdaParameter objects which contain individual values.

A ParameterList is a list of Parameter objects, but also creates other lists such as:

- a list of ParameterListNode structures (the nodes_list attribute): for each parameter a structure is created to show in a single place all the information about each parameter: the DataModel which may restrict the list of values along with the column number in it, and any hint for the parameter (a value made of ParameterListParamHint flags)
- a list of ParameterListSource structures (the sources_list attribute): each ParameterListSource structure is complementary to the ParameterListNode structures listed in its "nodes" attribute: there is one such structure for each DataModel which may restrict values of one or more parameters.
- a list of ParameterListGroup structures (the groups_list attribute): there is one such structure for each _independant_ parameter (parameters which are constrained by the same data model all appear in the same ParameterListGroup structure).

Some queries require arguments before they can be executed. For such queries, the arguments are passed using Parameter objects (the list of parameters can be obtained using Query::get_parameters() or Query::get_parameter_list()).

## Constructor & Destructor Documentation

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

Gnome::Gda::ParameterList::ParameterList | ( | const Glib::RefPtr<Dict>& | dict,
|  | const Glib::SListHandle<Parameter>& | params |
| ) |  |  | `[protected]`

## Member Function Documentation

Glib::RefPtr<Parameter> Gnome::Gda::ParameterList::add_parameter | ( | const Glib::ustring & | name,
|  | const Value& | value |
| ) |  |  |

Creates and adds a new Gda::Parameter to paramlist.

The ID and name of the new parameter are set as name. The parameter's value is a copy of value.

Parameters:

  | name | The name to give to the new parameter.
  | value | The value to give to the new parameter, must not be `0` or of type null.

Returns:
  The new Gda::Parameter for information, or `0` if an error occurred.

Glib::RefPtr<Parameter> Gnome::Gda::ParameterList::add_parameter | ( | const Glib::ustring & | name,
|  | GType | type,
|  | const Glib::ustring & | str |
| ) |  |  |

Creates and adds a new Gda::Parameter to paramlist.

The ID and name of the new parameter are set as name. The parameter's value is set from str.

Parameters:

  | name | The name to give to the new parameter.
  | type | The type of parameter to add.
  | str | The string representation of the parameter.

Returns:
  The new Gda::Parameter for information, or `0` if an error occurred.

void Gnome::Gda::ParameterList::add_parameter | ( | const Glib::RefPtr<Parameter>& | param | ) |

Adds param to the list of parameters managed within paramlist.

WARNING: the paramlist may decide not to use the param parameter, but to modify another parameter already present within the paramlist. The publicly available lists from the paramlist object may also be changed in the process.

Parameters:

  | param | A Gda::Parameter object.

static Glib::RefPtr<ParameterList> Gnome::Gda::ParameterList::create | ( |  | ) | `[static]`

static Glib::RefPtr<ParameterList> Gnome::Gda::ParameterList::create | ( | const Glib::SListHandle<Parameter>& | param | ) | `[static]`

Glib::RefPtr<Parameter> Gnome::Gda::ParameterList::find_param | ( | const Glib::ustring & | param_name | ) |

Finds a Gda::Parameter using its name.

Parameters:

  | param_name | The name of the requested parameter.

Returns:
  A Gda::Parameter or `0`.

Glib::RefPtr<Parameter> Gnome::Gda::ParameterList::find_param_for_user | ( | const Glib::RefPtr<Gda::Object>& | user | ) |

Finds a Gda::Parameter which is to be used by user.

Parameters:

  | user | A Gda::Object object.

Returns:
  A Gda::Parameter or `0`.

guint Gnome::Gda::ParameterList::get_length | ( |  | ) | const

Get the number of Gda::Parameter objects in paramlist.

guint Gnome::Gda::ParameterList::get_length | ( |  | ) |

Get the number of Gda::Parameter objects in paramlist.

Value Gnome::Gda::ParameterList::get_param_default_value | ( | const Glib::RefPtr<const Parameter>& | param | ) | const

Glib::ustring Gnome::Gda::ParameterList::get_spec | ( |  | ) | const

Get the specification as an XML string.

See the new_from_spec_string() form more information about the XML specification string format.

Returns:
  A new string.

const GdaParameterList* Gnome::Gda::ParameterList::gobj | ( |  | ) | const`[inline]`

Provides access to the underlying C GObject.

Reimplemented from Glib::ObjectBase.

Reimplemented in Gnome::Gda::DataModelIter.

GdaParameterList* Gnome::Gda::ParameterList::gobj | ( |  | ) | `[inline]`

Provides access to the underlying C GObject.

Reimplemented from Glib::ObjectBase.

Reimplemented in Gnome::Gda::DataModelIter.

GdaParameterList* Gnome::Gda::ParameterList::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::ParameterList::is_coherent | ( |  | ) | const

Checks that paramlist has a coherent public data structure.

Returns:
  `true` if paramlist is coherent.

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

Tells if all the paramlist's parameters have valid data.

Returns:
  `true` if the paramlist is valid.

Reimplemented in Gnome::Gda::DataModelIter.

void Gnome::Gda::ParameterList::merge | ( | const Glib::RefPtr<ParameterList>& | paramlist_to_merge | ) |

Add to paramlist all the parameters of paramlist_to_merge.

Parameters:

  | paramlist_to_merge | A Gda::ParameterList object.

virtual void Gnome::Gda::ParameterList::on_param_attr_changed | ( | Glib::RefPtr<Parameter> | parameter | ) | `[protected, virtual]`

virtual void Gnome::Gda::ParameterList::on_param_changed | ( | Glib::RefPtr<Parameter> | parameter | ) | `[protected, virtual]`

virtual void Gnome::Gda::ParameterList::on_param_plugin_changed | ( | Glib::RefPtr<Parameter> | parameter | ) | `[protected, virtual]`

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

Gnome::Gda::ParameterList::operator bool | ( |  | ) | const

bool Gnome::Gda::ParameterList::restrict_param_by_name | ( | const Glib::ustring & | param_name,
|  | const Glib::RefPtr<DataModel>& | model,
|  | int | col |
| ) |  |  |

Restricts the values of a parameter in the list.

Parameters:

  | param_name | The name of the parameter
  | model | A Gda::DataModel
  | col | The reference column in model

Returns:
  Whether the parameter was found and the restriction was set.

Sets a limit on the possible values of the paramater with name param_name. This function is actually a shortcut for:

`Glib::RefPtr<Parameter> param = list->find_param(param_name); param->restrict_values(model, col);`

void Gnome::Gda::ParameterList::set_param_default_alias | ( | const Glib::RefPtr<const Parameter>& | param,
|  | const Glib::RefPtr<const Parameter>& | alias |
| ) |  |  |

void Gnome::Gda::ParameterList::set_param_default_value | ( | const Glib::RefPtr<const Parameter>& | param,
|  | const Value& | value |
| ) |  |  |

Stores value in paramlist to make it possible for paramlist's users to find a default value for param when one is required, instead of `0`.

paramlist only provides a storage functionnality, the way the value obtained with get_param_default_value() is used is up to paramlist's user.

Parameters:

  | param | A Gda::Parameter object, managed by paramlist.
  | value | A Value, of the same type as param, or `0`.

Glib::SignalProxy1<void,Glib::RefPtr<Parameter>> Gnome::Gda::ParameterList::signal_param_attr_changed | ( |  | ) |

Prototype:
  `void on_my_param_attr_changed(Glib::RefPtr<Parameter> parameter)`

Glib::SignalProxy1<void,Glib::RefPtr<Parameter>> Gnome::Gda::ParameterList::signal_param_changed | ( |  | ) |

Prototype:
  `void on_my_param_changed(Glib::RefPtr<Parameter> parameter)`

Glib::SignalProxy1<void,Glib::RefPtr<Parameter>> Gnome::Gda::ParameterList::signal_param_plugin_changed | ( |  | ) |

Prototype:
  `void on_my_param_plugin_changed(Glib::RefPtr<Parameter> parameter)`

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

Prototype:
  `void on_my_public_data_changed()`

## Friends And Related Function Documentation

Glib::RefPtr<Gnome::Gda::ParameterList> wrap | ( | GdaParameterList * | 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:

- parameterlist.h