netCDF  4.2.1.1
Dispatch Programming Notes

As with the existing code, and when MPI is not being used, the comm and info parameters should be passed in as 0.

This is taken care of in the nc_open() and nc_create() API procedures in libdispatch/netcdf.c.

In fact, the object returned in the ncp parameter does not actually have to be an instance of struct NC. It only needs to "look like it for the first few fields. This is, in effect, a fake version of subclassing. Let us suppose that the NCM_create function uses a struct NCM object. The initial part of the definition of NCM must match the fields at the beginning of struct NC between the comments BEGIN_COMMON and END_COMMON. So, we would have the following.

              typedef struct NCM {
              /*BEGIN COMMON*/
                      int ext_ncid; /* uid «« 16 */
                      int int_ncid; /* unspecified other id */
                      struct NC_Dispatch* dispatch;
              #ifdef USE_DAP
                      struct NCDRNO* drno;
              #endif
              /*END COMMON*/
              ...
              } NCM;

This allows the pointer to the NCM object to be cast as an instance of NC* and its pointer returned in the ncp file. Eventually, this will be replaced with a separate structure containing the common fields.

 All Data Structures Files Functions Variables Typedefs Defines

Generated on Fri Sep 14 2012 07:36:40 for netCDF. NetCDF is a Unidata library.