#include <ncCompoundType.h>
Class represents a netCDF compound type
| NcCompoundType::NcCompoundType |
( |
| ) |
|
| netCDF::NcCompoundType::NcCompoundType |
( |
const NcGroup & |
grp, |
|
|
const std::string & |
name |
|
) |
| |
Constructor. The compound Type must already exist in the netCDF file. New netCDF compound types can be added using NcGroup::addNcCompoundType();
- Parameters
-
| grp | The parent group where this type is defined. |
| name | Name of new type. |
| NcCompoundType::NcCompoundType |
( |
const NcType & |
ncType | ) |
|
Constructor. Constructs from the base type NcType object. Will throw an exception if the NcType is not the base of a Compound type.
- Parameters
-
| netCDF::NcCompoundType::~NcCompoundType |
( |
| ) |
|
|
inline |
| void netCDF::NcCompoundType::addMember |
( |
const std::string & |
memName, |
|
|
const NcType & |
newMemberType, |
|
|
size_t |
offset |
|
) |
| |
Adds a named field.
- Parameters
-
| memName | Name of new field. |
| newMemberType | The type of the new member. |
| offset | Offset of this member in bytes, obtained by a call to offsetof. For example the offset of a member "mem4" in structure struct1 is: offsetof(struct1,mem4). |
| void netCDF::NcCompoundType::addMember |
( |
const std::string & |
memName, |
|
|
const NcType & |
newMemberType, |
|
|
size_t |
offset, |
|
|
const std::vector< int > & |
shape |
|
) |
| |
Adds a named array field.
- Parameters
-
| memName | Name of new field. |
| newMemberType | The type of the new member. |
| offset | Offset of this member in bytes, obtained by a call to offsetof. For example the offset of a member "mem4" in structure struct1 is: offsetof(struct1,mem4). |
| shape | The shape of the array field. |
| NcType NcCompoundType::getMember |
( |
int |
memberIndex | ) |
const |
Returns a NcType object for a single member.
| size_t NcCompoundType::getMemberCount |
( |
| ) |
const |
| int NcCompoundType::getMemberDimCount |
( |
int |
memberIndex | ) |
const |
Returns the number of dimensions of a member with the given index.
- Parameters
-
| Index | of member (numbering starts at zero). |
- Returns
- The number of dimensions of the field. Non-array fields have 0 dimensions.
| int NcCompoundType::getMemberIndex |
( |
const std::string & |
memberName | ) |
const |
Returns index of named member field.
| std::string NcCompoundType::getMemberName |
( |
int |
memberIndex | ) |
const |
Returns name of member field.
| size_t NcCompoundType::getMemberOffset |
( |
const int |
index | ) |
const |
Returns the offset of the member with given index.
| vector< int > NcCompoundType::getMemberShape |
( |
int |
memberIndex | ) |
const |
Returns the shape of a given member.
- Parameters
-
| Index | of member (numbering starts at zero). |
- Returns
- The size of the dimensions of the field. Non-array fields have 0 dimensions.
Assignment operator. This assigns from the base type NcType object. Will throw an exception if the NcType is not the base of a Compound type.
The documentation for this class was generated from the following files:
- ncCompoundType.h
- ncCompoundType.cpp