libgdamm Reference Documentation
Main Page   Namespaces   Book  

Gnome::Gda::Entity Class Reference
[Lesser used Interfaces]

Base class to represent a generic entity (for tables, views or queries). More...

Inheritance diagram for Gnome::Gda::Entity:

Inheritance graph
[legend]
List of all members.

Public Member Functions

void add_field (const Glib::RefPtr<EntityField>& field)
 Add field to iface's fields (at the end of the list).
void add_field_before (const Glib::RefPtr<EntityField>& field, const Glib::RefPtr<EntityField>& field_before)
 Add field to iface's fields, before field_before if it is not 0, or at the end if field_before is 0.
Glib::RefPtr<const EntityFieldget_field_by_index (int index) const
 
Returns:
The requested GdaEntityField or 0 if the index is out of bounds.

Glib::RefPtr<EntityFieldget_field_by_index (int index)
 
Returns:
The requested GdaEntityField or 0 if the index is out of bounds.

Glib::RefPtr<const EntityFieldget_field_by_name (const Glib::ustring& name) const
 Get a Gda::EntityField using its name.
Glib::RefPtr<EntityFieldget_field_by_name (const Glib::ustring& name)
 Get a Gda::EntityField using its name.
Glib::RefPtr<const EntityFieldget_field_by_xml_id (const Glib::ustring& xml_id) const
 
Returns:
The requested GdaEntityField.

Glib::RefPtr<EntityFieldget_field_by_xml_id (const Glib::ustring& xml_id)
 
Returns:
The requested GdaEntityField.

int get_field_index (const Glib::RefPtr<const EntityField>& field) const
 Get the position of the field in the given entity.
GSList* get_fields ()
 Get a new list containing all the Gda::EntityField objects held within the object implementing the Gda::Entity interface.
int get_n_fields () const
 Get the number of fields in iface.
const GdaEntity* gobj () const
 Provides access to the underlying C GObject.
GdaEntity* gobj ()
 Provides access to the underlying C GObject.
bool has_field (const Glib::RefPtr<const EntityField>& field) const
 Tells if field belongs to the iface entity.
bool is_writable () const
 Tells if the real entity (the corresponding DBMS object) represented by iface can be written to.
void remove_field (const Glib::RefPtr<EntityField>& field)
 
Parameters:
field An object implementing the Gda::EntityField interface to remove.

void swap_fields (const Glib::RefPtr<EntityField>& field1, const Glib::RefPtr<EntityField>& field2)
 
Parameters:
field1 An object implementing the Gda::EntityField interface.

virtual ~Entity ()

Static Public Member Functions

static void add_interface (GType gtype_implementer)

Related Functions

(Note that these are not member functions.)

Glib::RefPtr<Gnome::Gda::Entitywrap (GdaEntity* object, bool take_copy=false)
 A Glib::wrap() method for this object.

Detailed Description

Base class to represent a generic entity (for tables, views or queries).


Constructor & Destructor Documentation

virtual Gnome::Gda::Entity::~Entity (  )  [virtual]


Member Function Documentation

void Gnome::Gda::Entity::add_field ( const Glib::RefPtr<EntityField>&  field  ) 

Add field to iface's fields (at the end of the list).

Parameters:
field An object implementing the Gda::EntityField interface to add.

void Gnome::Gda::Entity::add_field_before ( const Glib::RefPtr<EntityField>&  field,
const Glib::RefPtr<EntityField>&  field_before 
)

Add field to iface's fields, before field_before if it is not 0, or at the end if field_before is 0.

Parameters:
field An object implementing the Gda::EntityField interface to add.
field_before An object implementing the Gda::EntityField interface before which field will be added, or 0.

static void Gnome::Gda::Entity::add_interface ( GType  gtype_implementer  )  [static]

Glib::RefPtr<const EntityField> Gnome::Gda::Entity::get_field_by_index ( int  index  )  const

Returns:
The requested GdaEntityField or 0 if the index is out of bounds.

Glib::RefPtr<EntityField> Gnome::Gda::Entity::get_field_by_index ( int  index  ) 

Returns:
The requested GdaEntityField or 0 if the index is out of bounds.

Glib::RefPtr<const EntityField> Gnome::Gda::Entity::get_field_by_name ( const Glib::ustring name  )  const

Get a Gda::EntityField using its name.

The notion of "field name" is the string returned by Gda::EntityField::get_name() on each of the fields composing iface. However, if that definition does not return any field, then each particular implementation of iface may try to give an extra definition to the notion of "field name".

For instance, in the case of the Gda::Query object, the Gda::EntityField::get_name() is used as a first try to find a field, and if that fails, then the object tries to find fields from their SQL naming.

In the case where there can be more than one field with the same name (depending on iface's implementation), then the returned value is 0.

Returns:
The requested Gda::EntityField or 0 if the field cannot be found, or if more than one field has been found.

Glib::RefPtr<EntityField> Gnome::Gda::Entity::get_field_by_name ( const Glib::ustring name  ) 

Get a Gda::EntityField using its name.

The notion of "field name" is the string returned by Gda::EntityField::get_name() on each of the fields composing iface. However, if that definition does not return any field, then each particular implementation of iface may try to give an extra definition to the notion of "field name".

For instance, in the case of the Gda::Query object, the Gda::EntityField::get_name() is used as a first try to find a field, and if that fails, then the object tries to find fields from their SQL naming.

In the case where there can be more than one field with the same name (depending on iface's implementation), then the returned value is 0.

Returns:
The requested Gda::EntityField or 0 if the field cannot be found, or if more than one field has been found.

Glib::RefPtr<const EntityField> Gnome::Gda::Entity::get_field_by_xml_id ( const Glib::ustring xml_id  )  const

Returns:
The requested GdaEntityField.

Glib::RefPtr<EntityField> Gnome::Gda::Entity::get_field_by_xml_id ( const Glib::ustring xml_id  ) 

Returns:
The requested GdaEntityField.

int Gnome::Gda::Entity::get_field_index ( const Glib::RefPtr<const EntityField>&  field  )  const

Get the position of the field in the given entity.

Positions start at 0. field MUST be a visible field.

Parameters:
field An object implementing the Gda::EntityField interface.
Returns:
The position or -1 if the field is not in the entity or is not visible.

GSList* Gnome::Gda::Entity::get_fields (  ) 

Get a new list containing all the Gda::EntityField objects held within the object implementing the Gda::Entity interface.

The returned list nodes are in the order in which the fields are within the entity.

Returns:
The new list.

int Gnome::Gda::Entity::get_n_fields (  )  const

Get the number of fields in iface.

Returns:
The number of fields, or -1 if an error occurred.

const GdaEntity* Gnome::Gda::Entity::gobj (  )  const [inline]

Provides access to the underlying C GObject.

Reimplemented from Glib::Interface.

Reimplemented in Gnome::Gda::DictTable, and Gnome::Gda::Query.

GdaEntity* Gnome::Gda::Entity::gobj (  )  [inline]

Provides access to the underlying C GObject.

Reimplemented from Glib::Interface.

Reimplemented in Gnome::Gda::DictTable, and Gnome::Gda::Query.

bool Gnome::Gda::Entity::has_field ( const Glib::RefPtr<const EntityField>&  field  )  const

Tells if field belongs to the iface entity.

Parameters:
field An object implementing the Gda::EntityField interface.
Returns:
true if field belongs to the iface entity.

bool Gnome::Gda::Entity::is_writable (  )  const

Tells if the real entity (the corresponding DBMS object) represented by iface can be written to.

Returns:
true if it is possible to write to iface.

void Gnome::Gda::Entity::remove_field ( const Glib::RefPtr<EntityField>&  field  ) 

Parameters:
field An object implementing the Gda::EntityField interface to remove.

void Gnome::Gda::Entity::swap_fields ( const Glib::RefPtr<EntityField>&  field1,
const Glib::RefPtr<EntityField>&  field2 
)

Parameters:
field1 An object implementing the Gda::EntityField interface.

Parameters:
field2 An object implementing the Gda::EntityField interface.


Friends And Related Function Documentation

Glib::RefPtr<Gnome::Gda::Entity> wrap ( GdaEntity *  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:
Generated for libgdamm by Doxygen 1.5.1 © 1997-2001