Gnome::Db::DataStore Class Reference

#include <datastore.h>

Inheritance diagram for Gnome::Db::DataStore:

Inheritance graph
[legend]
List of all members.

Public Member Functions

virtual ~DataStore ()
GnomeDbDataStore* gobj ()
 Provides access to the underlying C GObject.
const GnomeDbDataStore* gobj () const
 Provides access to the underlying C GObject.
GnomeDbDataStore* gobj_copy ()
 Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
bool set_value (const Gtk::TreeModel::iterator& iter, int col, const Gda::Value& value)
 Stores a value in the store data model.
void erase (const Gtk::TreeModel::iterator& iter)
 Marks the row pointed by iter to be deleted.
void unerase (const Gtk::TreeModel::iterator& iter)
 Remove the "to be deleted" mark the row pointed by iter , if it existed.
bool append (Gtk::TreeModel::iterator& iter)
 Appends a new row.
Glib::RefPtr<Gda::DataProxy> get_proxy ()
Glib::RefPtr<const Gda::DataProxy> get_proxy () const
int get_row_from_iter (const Gtk::TreeModel::iterator& iter) const
 Get the number of the row represented by iter.
bool get_iter_from_values (Gtk::TreeModel::iterator& iter, const Glib::SListHandle<Gda::Value>& values, const Glib::ArrayHandle<int>& cols_index) const
 Sets iter to the first row where all the values in values at the columns identified at cols_index match.

Static Public Member Functions

static Glib::RefPtr<DataStorecreate (const Glib::RefPtr<Gda::DataModel>& model)

Protected Member Functions

 DataStore (const Glib::RefPtr<Gda::DataModel>& model)

Related Functions

(Note that these are not member functions.)

Glib::RefPtr<Gnome::Db::DataStorewrap (GnomeDbDataStore* object, bool take_copy=false)

Constructor & Destructor Documentation

virtual Gnome::Db::DataStore::~DataStore (  )  [virtual]

Gnome::Db::DataStore::DataStore ( const Glib::RefPtr< Gda::DataModel > &  model  )  [explicit, protected]


Member Function Documentation

bool Gnome::Db::DataStore::append ( Gtk::TreeModel::iterator iter  ) 

Appends a new row.

Parameters:
iter An unset Gtk::TreeIter to set to the appended row.
Returns:
true if no error occurred.

static Glib::RefPtr<DataStore> Gnome::Db::DataStore::create ( const Glib::RefPtr< Gda::DataModel > &  model  )  [static]

void Gnome::Db::DataStore::erase ( const Gtk::TreeModel::iterator iter  ) 

Marks the row pointed by iter to be deleted.

Parameters:
iter The considered row.

bool Gnome::Db::DataStore::get_iter_from_values ( Gtk::TreeModel::iterator iter,
const Glib::SListHandle< Gda::Value > &  values,
const Glib::ArrayHandle< int > &  cols_index 
) const

Sets iter to the first row where all the values in values at the columns identified at cols_index match.

If the row can't be identified, then the contents of iter is not modified.

NOTE: the cols_index array MUST contain a column index for each value in values

Parameters:
iter An unset Gtk::TreeIter to set to the requested row.
values A list of G::Value values.
cols_index An array of int containing the column number to match each value of values .
Returns:
true if the row has been identified iter was set.

Glib::RefPtr<const Gda::DataProxy> Gnome::Db::DataStore::get_proxy (  )  const

Returns:
The internal Gda::DataProxy being used by store .

Glib::RefPtr<Gda::DataProxy> Gnome::Db::DataStore::get_proxy (  ) 

Returns:
The internal Gda::DataProxy being used by store .

int Gnome::Db::DataStore::get_row_from_iter ( const Gtk::TreeModel::iterator iter  )  const

Get the number of the row represented by iter.

Parameters:
iter A valid Gtk::TreeIter.
Returns:
The row number, or -1 if an error occurred.

const GnomeDbDataStore* Gnome::Db::DataStore::gobj (  )  const [inline]

Provides access to the underlying C GObject.

Reimplemented from Gtk::TreeModel.

GnomeDbDataStore* Gnome::Db::DataStore::gobj (  )  [inline]

Provides access to the underlying C GObject.

Reimplemented from Gtk::TreeModel.

GnomeDbDataStore* Gnome::Db::DataStore::gobj_copy (  ) 

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

bool Gnome::Db::DataStore::set_value ( const Gtk::TreeModel::iterator iter,
int  col,
const Gda::Value &  value 
)

Stores a value in the store data model.

Parameters:
iter The considered row.
col The considered column.
value The value to store (gets copied).
Returns:
true on succes.

void Gnome::Db::DataStore::unerase ( const Gtk::TreeModel::iterator iter  ) 

Remove the "to be deleted" mark the row pointed by iter , if it existed.

Parameters:
iter The considered row.


Friends And Related Function Documentation

Glib::RefPtr<Gnome::Db::DataStore> wrap ( GnomeDbDataStore *  object,
bool  take_copy = false 
) [related]

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:
Generated on Mon Feb 12 16:49:03 2007 for libgnomedbmm by  doxygen 1.4.7