This module provides a simplified fortran API to Dballe. More...
Files | |
file | binding.cc |
Simplified interface for Dballe. |
This module provides a simplified fortran API to Dballe.
The interface is simplified by providing functions with fewer parameters than their counterparts in the full interface, and the omitted parameters are replaced by useful defaults.
The resulting interface is optimized for the common usage, making it faster and less error prone. However, when creating complicated code with more parallel reads and writes, it may be useful to use the functions in fortranfull instead, because all parameters are explicit and their precise semantics is always evident.
This is a sample code for a query session with the simplified interface:
call idba_presentati(dba, "myDSN", "mariorossi", "CippoLippo") call idba_preparati(dba, handle, "read", "read", "read") call idba_setr(handle, "latmin", 30.) call idba_setr(handle, "latmax", 50.) call idba_setr(handle, "lonmin", 10.) call idba_setr(handle, "lonmax", 20.) call idba_voglioquesto(handle, count) do i=1,count call idba_dammelo(handle, param) call idba_enqd(handle, param, ...) call idba_enqi(handle, ...) call idba_enqr(handle, ...) call idba_enqd(handle, ...) call idba_enqc(handle, ...) call idba_voglioancora(handle, countancora) do ii=1,count call idba_ancora(handle, param) call idba_enqi(handle, param) enddo enddo call idba_fatto(handle) call idba_arrivederci(dba)
This is a sample code for a data insert session with the simplified interface:
call idba_presentati(dba, "myDSN", "mariorossi", "CippoLippo") call idba_preparati(dba, handle, "reuse", "add", "add") call idba_scopa(handle, "") call idba_setr(handle, "lat", 30.) call idba_setr(handle, "lon", 10.) call idba_seti(handle, .....) call idba_seti(handle, "B12011", 5) call idba_seti(handle, "B12012", 10) call idba_prendilo(handle) call idba_setc(handle, "*var", "B12012") call idba_seti(handle, "*B33101", 50) call idba_seti(handle, "*B33102", 75) call idba_critica(handle) call idba_setc(handle, "*var", "B12011") call idba_seti(handle, "*B33101", 50) call idba_seti(handle, "*B33102", 75) call idba_critica(handle) call idba_fatto(handle) call idba_arrivederci(dba)