Introduction
The main requirements for the design of the C++ interface are:
- to provide the functionality of the C interface;
- to provide type safety by eliminating all use of
void*
pointers; and
- to provide an interface that is simpler to use than the C interface.
Some of the features of the C++ interface are:
- No IDs needed for netCDF's variables, dimensions, or attributes.
- No explicit open or close calls needed for netCDF files; a constructor
opens and a destructor closes a file.
- No need to specify types for creating attributes; they will have the
type of the value provided.
- No use of
void*
: values are type-checked.
- Less indirection is needed for dimensions & dimension sizes than with
the C interface. A variable's dimensions can be provided as arguments
when defining a variable.
- Code for data types is isolated to make the addition of new
types easier.
- No explicit
ncredef
or ncendef
calls are needed for
switching between define and data modes. Whenever a mode switch is
required, it happens implicitly.
The header file netcdfcpp.h must be included in source code files
using this interface.
This release provides the functionality of netCDF version
3.6.2.
This manual assumes familiarity with Chapters 1 through 4 of the netCDF
User's Guide, where the concepts of netCDF dimensions, variables, and
attributes are discussed.