Need API support for importing foreign BUFR tables
*Christophe Beauregard wrote:
we need to ensure library users can easily build tables in the
API from non-CMC formats.
We have functions to create Table B and D entries, and new tables, but adding
entries to the tables isn't documented, although it may just use existing array
functions.
Okay... following the code, the process looks roughly like this (both both B and
D):
BUFR_Tables* tbls = bufr_create_
foreach( element in master tableB ) {
EntryTableB *etb = bufr_new_
load table entry data into etb;
arr_add( tbls->master.
}
arr_sort( tbls->master.
tbls-
foreach( element in local tableB ) {
EntryTableB *etb = bufr_new_
load table entry data into etb;
arr_add( tbls->local.tableB, (char *)&etb );
}
arr_sort( tbls->local.tableB, compare_tableb );
tbls-
/* repeat for table D */
This exposes more internals than seems reasonable. I'd recommend for starters
that it be simplified to something like:
BUFR_Tables* tbls = bufr_create_
foreach( element in master tableB ) {
EntryTableB *etb = bufr_new_
load table entry data into etb;
bufr_
}
foreach( element in local tableB ) {
EntryTableB *etb = bufr_new_
load table entry data into etb;
bufr_
}
/* repeat for table D */
bufr_sort_tables( tbls );
One could also implicitly do a sort in bufr_add_*, but that wouldn't be efficient
in a loop. At the very least we'd want to make sure the implicit sort uses a
linear insertion sort versus quicksort.
The second thing we should be thinking about is making sure each BUFR_Table has
some useful meta-data.
Master version, local version, local center would be minimum. Nobody can sanely
manage BUFR tables without that stuff.
A BUFR Edition flag might be useful (i.e. some newer descriptors might
desire/require IEEE FP for full range representation).
Some kind of "table status" flag might also be necessary (validation,
operational, etc).
Blueprint information
- Status:
- Not started
- Approver:
- None
- Priority:
- Medium
- Drafter:
- None
- Direction:
- Needs approval
- Assignee:
- None
- Definition:
- Discussion
- Series goal:
- None
- Implementation:
- Unknown
- Milestone target:
- None
- Started by
- Completed by