The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

Finance::GeniusTrader::Graphics::DataSource

A datasource if a source of data for a graphical object. The datas are always indexed by an integer.

FUNCTION TO IMPLEMENT

Each real datasource has to implement a few functions :

Constructor : $ds->new(...)

A constructor for the datasource has the right to have parameters. When constructed it should update the available range and set the selected range to the available range.

$ds->get($index)

Return the data associated to the corresponding index.

$ds->is_available($index)

Tell if the data is available for the corresponding index.

$ds->update_value_range()

Update the minimum value and the maximum value.

GENERIC FUNCTIONS AVAILABLE

($start, $end) = $ds->get_selected_range()

Return the range of selected data.

$ds->set_selected_range($start, $end)

Set the range of selected data.

($start, $end) = $ds->get_available_range()

Return the range of available data.

$ds->set_available_range($start, $end)

Set the range of available data.

($min, $max) = $ds->get_value_range()

Return the minimum and the maximum of the values available within the selected range.

$ds->set_min_value($min)

Set the minimum value.

$ds->set_max_value($max)

Set the maximum value.