## GdaDataAccessWrapper GdaDataAccessWrapper — Offers a random access on top of a cursor-only access data model |

## Stability Level

Stable, unless otherwise indicated

## Functions

GdaDataModel * | gda_data_access_wrapper_new ()
gboolean | gda_data_access_wrapper_set_mapping ()

## Properties

GdaDataModel * | model | Read / Write / Construct Only

## Types and Values

struct | GdaDataAccessWrapper
struct | GdaDataAccessWrapperClass
| GdaDataAccessWrapperPrivate

## Object Hierarchy

        GObject
        ╰── GdaDataAccessWrapper

## Implemented Interfaces

GdaDataAccessWrapper implements GdaDataModel.

## Includes

    #include <virtual/gda-ldap-connection.h>

## Description

The GdaDataAccessWrapper object simply wraps another GdaDataModel data model object and allows data to be accessed in a random way while remaining memory efficient as much as possible.

## Functions

### gda_data_access_wrapper_new ()

    GdaDataModel *
    gda_data_access_wrapper_new (GdaDataModel *model);

Creates a new GdaDataModel object which buffers the rows of `model` . This object is useful only if `model` can only be accessed using cursor based method.

#### Parameters

model | a GdaDataModel |

#### Returns

a pointer to the newly created GdaDataModel.

[transfer full]

### gda_data_access_wrapper_set_mapping ()

    gboolean
    gda_data_access_wrapper_set_mapping (GdaDataAccessWrapper *wrapper,
                                         const gint *mapping,
                                         gint mapping_size);

`wrapper` will report as many columns as `mapping_size` , and for each value at position 'i' in `mapping` , `wrapper` will report the 'i'th column, mapped to the wrapped data model column at position mapping[i]. For example if mapping is {3, 4, 0}, then `wrapper` will report 3 columns, respectively mapped to the 4th, 5th and 1st columns of the wrapped data model (as column numbers start at 0).

If `mapping` is `NULL`, then no mapping is done and `wrapper` 's columns will be the same as the wrapped data model.

If a column in `mapping` does not exist in the wrapped data model, then it is simply ignored (no error reported).

Please note that if `wrapper` has already been used and if the wrapped data model offers a cursor forward access mode, then this method will return `FALSE` and no action will be done.

If the mapping is applied, then any existing iterator will be invalid, and `wrapper` is reset as if it had just been created.

#### Parameters

wrapper | a GdaDataAccessWrapper object |
mapping | an array of gint which represents the mapping between `wrapper` 's columns and the columns of the wrapped data model. | [allow-none][array length=mapping_size]
mapping_size | the size of `mapping` . |

#### Returns

`TRUE` if the mapping actually changed

Since: 5.2

## Types and Values

### struct GdaDataAccessWrapper

    struct GdaDataAccessWrapper;

### struct GdaDataAccessWrapperClass

    struct GdaDataAccessWrapperClass {
    	GObjectClass                   parent_class;
    };

### GdaDataAccessWrapperPrivate

    typedef struct _GdaDataAccessWrapperPrivate GdaDataAccessWrapperPrivate;

## Property Details

### The `“model”` property

      “model”                    GdaDataModel *

Data model being wrapped.

Owner: GdaDataAccessWrapper

Flags: Read / Write / Construct Only

## See Also

GdaDataModel