first previous next last contents

Sending a Notification

When a function modifies data it is the responsibility of this function to inform others, via the contig registration scheme, of this change. At the time of notification the data on disk and in memory should be consistent (ie that check_database should not fail). To illustrate this, when joining two contigs we should not start sending notifications until we've recomputed the lengths and left/right neighbours of the joined contig.

To send a request, one of the notification functions should be used. The simplest of these is contig_notify. This function takes a GapIO pointer, a contig number, and a reg_data pointer as arguments. The reg_data is the union of notification types outlined in the above sections. The separate steps for notifying are:

  1. Create a variable of the appropriate structure type (eg reg_length).
  2. Fill the job field of this structure with the correct definition (eg REG_LENGTH).
  3. Fill in any structure dependant fields of the structure (eg length in the case of reg_length).
  4. Call contig_notify with the GapIO, contig number and notification structure. The notification structure should be cast back to a pointer to the reg_data union type.

An example illustrating the above steps would be:

reg_length jl;


jl.job = REG_LENGTH;
jl.length = some_length;
contig_notify(io, contig_number, (reg_data *)&jl);

The available notification functions are contig_notify, result_notify, type_notify and type_contig_notify. See section C Functions Available.

first previous next last contents
This page is maintained by staden-package. Last generated on 1 March 2001.