Shumate.DataSourceRequest
Description: Reference for Shumate.DataSourceRequest

### Class

# ShumateDataSourceRequest

since: 1.1

#### Description [src]

    class Shumate.DataSourceRequest : GObject.Object
    {
      /* No available fields */
    }

Represents a request to a `ShumateDataSource` for a tile.

Data sources can return a tile multiple times. For example, a `ShumateTileDownloader` may return cached data first, then later return data from a network service when it arrives. This allows the map to be rendered as quickly as possible without waiting for the network unnecessarily.

Conventional async/finish method pairs don’t support multiple returns. Instead, `shumate_data_source_start_request()` is available, which returns a `ShumateDataSourceRequest` whose properties, `ShumateDataSourceRequest:data` and `ShumateDataSourceRequest:error`, update as data becomes available. The `GObject::notify` signal can be used to watch for these changes. When the request is done and no more data will be returned, `ShumateDataSourceRequest:completed` is set to `TRUE`.

`ShumateDataSource` implementations can use a subclass of `ShumateDataSourceRequest`, but the base class should be sufficient in most cases.

Available since: 1.1

#### Ancestors

- GObject

#### Constructors

###### shumate_data_source_request_new

Creates a new `ShumateDataSourceRequest`.

since: 1.1

#### Instance methods

###### shumate_data_source_request_complete

Marks the request as complete. No more data or errors may be emitted.

since: 1.1

###### shumate_data_source_request_emit_data

Emits tile data as a response to the request. This sets the `ShumateDataSourceRequest:data` property.

since: 1.1

###### shumate_data_source_request_emit_error

Emits a fatal error in response to the request. This completes the request, so no more data or errors can be emitted after this. Non-fatal errors should not be reported.

since: 1.1

###### shumate_data_source_request_get_data

Gets the latest data from the request.

since: 1.1

###### shumate_data_source_request_get_error

Gets the latest error from the request.

since: 1.1

###### shumate_data_source_request_get_x

Gets the X coordinate of the requested tile.

since: 1.1

###### shumate_data_source_request_get_y

Gets the Y coordinate of the requested tile.

since: 1.1

###### shumate_data_source_request_get_zoom_level

Gets the zoom level of the requested tile.

since: 1.1

###### shumate_data_source_request_is_completed

Gets whether the request has been completed. Completed requests will not receive new data or errors.

since: 1.1

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

#### Properties

###### Shumate.DataSourceRequest:completed

`TRUE` if the request has been completed, otherwise `FALSE`. A completed request will not receive further updates to either `ShumateDataSourceRequest:data` or `ShumateDataSourceRequest:error`.

since: 1.1

###### Shumate.DataSourceRequest:data

The most recent data for the tile, if available. If an error is emitted, this will be set to `NULL`.

since: 1.1

###### Shumate.DataSourceRequest:error

The error that occurred during the request, if any.

since: 1.1

###### Shumate.DataSourceRequest:x

The X coordinate of the requested tile.

since: 1.1

###### Shumate.DataSourceRequest:y

The Y coordinate of the requested tile.

since: 1.1

###### Shumate.DataSourceRequest:zoom-level

The zoom level of the requested tile.

since: 1.1

#### Signals

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

#### Class structure

    struct ShumateDataSourceRequestClass {
      GObjectClass parent_class;

    }

No description available.

###### Class members

`parent_class: GObjectClass`

  No description available.