NetCDF4 C++ API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
netcdf::NcGroup Class Reference

Represents a netCDF group. More...

#include <NetCDF/cpp4/src/NcGroup.h>

+ Inheritance diagram for netcdf::NcGroup:

Detailed Description

Copyright:
Original C++ API developed by Lynton Appel.
Portions of this software were developed by the Unidata Program at the
University Corporation for Atmospheric Research.
Modifications: Copyright 2013 Colorado State University. All rights reserved.
Organization:
Natural Resource Ecology Laboratory
Colorado State University, Fort Collins, CO 80523 USA
www.nrel.colostate.edu
Project:
IRC <www.nrel.colostate.edu/projects/irc/>
Author
Tom Hilinski tom.h.nosp@m.ilin.nosp@m.ski@c.nosp@m.olos.nosp@m.tate..nosp@m.edu
Date
2013Jan

Public Types

enum  GroupLocation {
  ChildrenGrps, ParentsGrps, ChildrenOfChildrenGrps, AllChildrenGrps,
  ParentsAndCurrentGrps, AllGrps
}
 options for selecting groups (used for returned set of NcGroup objects) More...
 
enum  Location {
  Current, Parents, Children, ParentsAndCurrent,
  ChildrenAndCurrent, All
}
 options for selecting groups. More...
 
typedef std::map< std::string,
NcGroup
NcGroupMapUnique
 
typedef std::multimap
< std::string, NcGroup
NcGroupMap
 
typedef std::pair< std::string,
NcGroup
NcGroupPair
 
typedef std::set< NcGroupNcGroupSet
 
typedef std::multimap
< std::string, NcType
NcTypeMap
 
typedef std::pair< std::string,
NcType
NcTypePair
 
typedef std::set< NcTypeNcTypeSet
 
typedef std::multimap
< std::string, NcTypeUserDef
NcUserTypeMap
 
typedef std::multimap
< std::string, NcVar
NcVarMap
 
typedef std::pair< std::string,
NcVar
NcVarPair
 
typedef std::set< NcVarNcVarSet
 
typedef std::multimap
< std::string, NcDim
NcDimMap
 
typedef std::pair< std::string,
NcDim
NcDimPair
 
typedef std::set< NcDimNcDimSet
 
typedef std::multimap
< std::string, NcGroupAtt
NcGroupAttMap
 
typedef std::pair< std::string,
NcGroupAtt
NcGroupAttPair
 
typedef std::set< NcGroupAttNcGroupAttSet
 
- Public Types inherited from netcdf::NcItem
enum  { idGlobal = NC_GLOBAL }
 

Public Member Functions

 NcGroup ()
 null group More...
 
 NcGroup (int const useFileID, int const groupId, std::string const groupName)
 name of new group More...
 
 NcGroup (NcGroup const &rhs)
 
virtual ~NcGroup ()
 
bool operator< (NcGroup const &rhs) const
 
std::string GetName (bool fullName=false) const
 
NcGroup GetParentGroup () const
 
int GetGroupCount (NcGroup::GroupLocation location=ChildrenGrps) const
 
NcGroupMap GetGroups (NcGroup::GroupLocation location=ChildrenGrps) const
 
NcGroupSet GetGroups (std::string const name, NcGroup::GroupLocation location=ChildrenGrps) const
 
NcGroup GetGroup (std::string const name, NcGroup::GroupLocation location=ChildrenGrps) const
 
NcGroup AddGroup (std::string const name) const
 
bool IsRootGroup () const
 
int GetVarCount (NcGroup::Location location=Current) const
 
bool HaveVariable (std::string const name, NcGroup::Location const location=Current) const
 
NcVarMap GetVars (NcGroup::Location location=Current) const
 
NcVarSet GetVars (std::string const name, NcGroup::Location location=Current) const
 
NcVar GetVar (std::string const name, NcGroup::Location location=Current) const
 
NcVar AddVar (std::string const name, std::string const typeName) const
 Add a scalar variable of a specified type name. More...
 
NcVar AddVar (std::string const name, NcType const &ncType) const
 Add a scalar variable of a specifed type. More...
 
NcVar AddVar (std::string const name, std::string const typeName, std::string const dimName) const
 
NcVar AddVar (std::string const name, NcType const &ncType, const NcDim &ncDim) const
 
NcVar AddVar (std::string const name, std::string const typeName, const std::vector< std::string > &dimNames) const
 
NcVar AddVar (std::string const name, NcType const &ncType, const std::vector< NcDim > &ncDimVector) const
 
NcVar AddVar (NcVar const &var)
 
int GetAttCount (NcGroup::Location const location=Current) const
 
bool HaveAttribute (std::string const name, NcGroup::Location const location=Current) const
 
NcGroupAttMap GetAttributes (NcGroup::Location location=Current) const
 
NcGroupAttSet GetAttributes (std::string const name, NcGroup::Location location=Current) const
 
NcGroupAtt GetAtt (std::string const name, NcGroup::Location location=Current) const
 
NcGroupAtt PutAtt (std::string const name, NcType const &type, size_t len, const unsigned char *dataValues) const
 
NcGroupAtt PutAtt (std::string const name, NcType const &type, size_t len, const signed char *dataValues) const
 
NcGroupAtt PutAtt (std::string const name, char const aChar) const
 
NcGroupAtt PutAtt (std::string const name, NcType const &type, short datumValue) const
 
NcGroupAtt PutAtt (std::string const name, NcType const &type, size_t len, const short *dataValues) const
 
NcGroupAtt PutAtt (std::string const name, NcType const &type, unsigned short datumValue) const
 
NcGroupAtt PutAtt (std::string const name, NcType const &type, size_t len, const unsigned short *dataValues) const
 
NcGroupAtt PutAtt (std::string const name, NcType const &type, int datumValue) const
 
NcGroupAtt PutAtt (std::string const name, NcType const &type, size_t len, const int *dataValues) const
 
NcGroupAtt PutAtt (std::string const name, NcType const &type, long datumValue) const
 
NcGroupAtt PutAtt (std::string const name, NcType const &type, size_t len, const long *dataValues) const
 
NcGroupAtt PutAtt (std::string const name, NcType const &type, unsigned int datumValue) const
 
NcGroupAtt PutAtt (std::string const name, NcType const &type, size_t len, const unsigned int *dataValues) const
 
NcGroupAtt PutAtt (std::string const name, NcType const &type, float datumValue) const
 
NcGroupAtt PutAtt (std::string const name, NcType const &type, size_t len, const float *dataValues) const
 
NcGroupAtt PutAtt (std::string const name, NcType const &type, double datumValue) const
 
NcGroupAtt PutAtt (std::string const name, NcType const &type, size_t len, const double *dataValues) const
 
NcGroupAtt PutAtt (std::string const name, NcType const &type, long long datumValue) const
 
NcGroupAtt PutAtt (std::string const name, NcType const &type, size_t len, const long long *dataValues) const
 
NcGroupAtt PutAtt (std::string const name, NcType const &type, unsigned long long datumValue) const
 
NcGroupAtt PutAtt (std::string const name, NcType const &type, size_t len, const unsigned long long *dataValues) const
 
NcGroupAtt PutAtt (std::string const name, size_t len, const char **dataValues) const
 
NcGroupAtt PutAtt (std::string const name, std::string const &dataValues) const
 
NcGroupAtt PutAtt (std::string const name, std::vector< std::string > const &strVec)
 
NcGroupAtt PutAtt (std::string const name, NcType const &type, size_t len, const void *dataValues) const
 
NcGroupAtt PutAtt (NcGroupAtt const &att)
 
int GetDimCount (NcGroup::Location const location=Current) const
 
NcDimMap GetDims (NcGroup::Location const location=Current) const
 
NcDimSet GetDims (std::string const name, NcGroup::Location const location=Current) const
 
NcDim GetDim (std::string const name, NcGroup::Location const location=Current) const
 
NcDim AddDim (std::string const name, size_t const dimSize) const
 
NcDim AddDim (std::string const name) const
 
NcDim AddDim (NcDim const &dim) const
 
int GetTypeCount (NcGroup::Location location=Current) const
 
int GetTypeCount (NcType::ncType enumType, NcGroup::Location location=Current) const
 
NcTypeMap GetTypes (NcGroup::Location location=Current) const
 
NcTypeSet GetTypes (std::string const &name, NcGroup::Location location=Current) const
 
NcTypeSet GetTypes (NcType::ncType enumType, NcGroup::Location location=Current) const
 
NcTypeSet GetTypes (std::string const &name, NcType::ncType enumType, NcGroup::Location location=Current) const
 
NcType GetType (std::string const &name, NcGroup::Location location=Current) const
 
NcEnumType AddEnumType (std::string const name, NcEnumType::ncEnumType basetype) const
 
NcVlenType AddVlenType (std::string const name, NcType &basetype) const
 
NcOpaqueType AddOpaqueType (std::string const name, size_t size) const
 
NcCompoundType AddCompoundType (std::string const name, size_t size) const
 
NcGroupMapUnique GetCoordVars (Location location=Current) const
 
void GetCoordVar (std::string &coordVarName, NcDim &ncDim, NcVar &ncVar, NcGroup::Location location=Current) const
 
- Public Member Functions inherited from netcdf::NcItem
virtual ~NcItem ()=0
 
bool IsNull () const
 
std::string const & GetName () const
 
int GetID () const
 
int GetGroupID () const
 
int GetFileID () const
 
NcItemoperator= (NcItem const &rhs)
 
bool operator== (NcItem const &rhs) const
 
bool operator!= (NcItem const &rhs) const
 
bool operator< (NcItem const &rhs) const
 

Protected Member Functions

virtual void Rename (std::string const &)
 
- Protected Member Functions inherited from netcdf::NcItem
 NcItem (bool const isNullObject=true)
 
 NcItem (int const useFileID, int const useID, int const useGroupID=NcItem::idGlobal, std::string const useName=std::string())
 
 NcItem (NcItem const &rhs)
 
void Copy (NcItem const &rhs)
 

Additional Inherited Members

- Static Public Attributes inherited from netcdf::NcItem
static int const nullID = -999
 
- Protected Attributes inherited from netcdf::NcItem
bool nullObject
 
int myID
 object ID number More...
 
int groupID
 group ID number (can be unused) More...
 
int fileID
 netCDF file ID number More...
 
std::string myName
 optional name of object More...
 

Member Typedef Documentation

typedef std::multimap<std::string, NcDim> netcdf::NcGroup::NcDimMap
typedef std::pair<std::string, NcDim> netcdf::NcGroup::NcDimPair
typedef std::set<NcDim> netcdf::NcGroup::NcDimSet
typedef std::multimap<std::string, NcGroupAtt> netcdf::NcGroup::NcGroupAttMap
typedef std::pair<std::string, NcGroupAtt> netcdf::NcGroup::NcGroupAttPair
typedef std::multimap<std::string, NcGroup> netcdf::NcGroup::NcGroupMap
typedef std::map<std::string, NcGroup> netcdf::NcGroup::NcGroupMapUnique
typedef std::pair<std::string, NcGroup> netcdf::NcGroup::NcGroupPair
typedef std::multimap<std::string, NcType> netcdf::NcGroup::NcTypeMap
typedef std::pair<std::string, NcType> netcdf::NcGroup::NcTypePair
typedef std::multimap<std::string, NcTypeUserDef> netcdf::NcGroup::NcUserTypeMap
typedef std::multimap<std::string, NcVar> netcdf::NcGroup::NcVarMap
typedef std::pair<std::string, NcVar> netcdf::NcGroup::NcVarPair
typedef std::set<NcVar> netcdf::NcGroup::NcVarSet

Member Enumeration Documentation

Enumerator
ChildrenGrps 
ParentsGrps 

Select from the set of children in the current group.

ChildrenOfChildrenGrps 

Select from set of parent groups (excludes the current group).

AllChildrenGrps 

Select from set of all children of children in the current group.

ParentsAndCurrentGrps 

Select from set of all children of the current group and beneath.

AllGrps 

Select from set of parent groups(includes the current group).

Select from set of parent groups, current groups and all the children beneath.

Enumerator
Current 
Parents 

Select from contents of current group.

Children 

Select from contents of parents groups.

ParentsAndCurrent 

Select from contents of children groups.

ChildrenAndCurrent 

Select from contents of current and parents groups.

All 

Select from contents of current and child groups.

Select from contents of current, parents and child groups.

Constructor & Destructor Documentation

netcdf::NcGroup::NcGroup ( )
netcdf::NcGroup::NcGroup ( int const  useFileID,
int const  groupId,
std::string const  groupName 
)
Parameters
useFileIDcreate a group netCDF file ID number
groupIdgroup ID number
netcdf::NcGroup::NcGroup ( NcGroup const &  rhs)
netcdf::NcGroup::~NcGroup ( )
inlinevirtual

Member Function Documentation

NcCompoundType netcdf::NcGroup::AddCompoundType ( std::string const  name,
size_t  size 
) const

Adds a netCDF UserDefined type.

Parameters
nameName of type.
sizeThe size of the new type in bytes.
Returns
The new NcCompoundType object for this new netCDF userDefined type.
NcDim netcdf::NcGroup::AddDim ( std::string const  name,
size_t const  dimSize 
) const

Adds a netCDF dimension.

Parameters
Thename of new dimension.
Lengthof dimension; that is, number of values for this dimension as an index to variables that use it.
Returns
The NcDim object for this new netCDF dimension.
Examples:
Test_NcChar.cpp.
NcDim netcdf::NcGroup::AddDim ( std::string const  name) const

Adds an unlimited netCDF dimension.

Parameters
Thename of new dimension.
Returns
The NcDim object for this new netCDF dimension.
NcDim netcdf::NcGroup::AddDim ( NcDim const &  dim) const

Adds a netCDF dimension from an existing dimension object.

Parameters
Adimension object.
Returns
The NcDim object for this new netCDF dimension.
NcEnumType netcdf::NcGroup::AddEnumType ( std::string const  name,
NcEnumType::ncEnumType  basetype 
) const

Adds a netCDF enum type.

Parameters
nameName of type. For atomic types, the CDL name is expected. This is consistent with the string returned from NcType::GetName().
enumTypeThe enumeration value of the object type.
Returns
The NcEnumType object for this new netCDF enum type.
NcGroup netcdf::NcGroup::AddGroup ( std::string const  name) const

Adds a child netCDF group object. Method will throw an netcdf::NcNullgrp exception if the group is null (ie NcGroup::IsNull()=true).

Parameters
nameVariable name.
Returns
NcGroup The NcGroup object for this new netCDF group.
NcOpaqueType netcdf::NcGroup::AddOpaqueType ( std::string const  name,
size_t  size 
) const

Adds a netCDF Opaque type.

Parameters
nameName of type.
sizeThe size of the new type in bytes.
Returns
The NcOpaqueType object for this new netCDF opaque type..
NcVar netcdf::NcGroup::AddVar ( std::string const  name,
std::string const  typeName 
) const
Examples:
Test_NcChar.cpp.
NcVar netcdf::NcGroup::AddVar ( std::string const  name,
NcType const &  ncType 
) const
NcVar netcdf::NcGroup::AddVar ( std::string const  name,
std::string const  typeName,
std::string const  dimName 
) const

Adds a netCDF variable. The NcType and NcDim objects must be non-null, and be defined in either the current group or a parent group. An NcNullType exception is thrown if the NcType object is invalid. An NcNullDim exception is thrown if the NcDim object is invalid.

Parameters
nameVariable name.
typeNameType name.
dimNameDimension name.
Returns
The NcVar object for this new netCDF variable.
NcVar netcdf::NcGroup::AddVar ( std::string const  name,
NcType const &  ncType,
const NcDim ncDim 
) const

Adds a netCDF variable. The NcType and NcDim objects must be non-null, and be defined in either the current group or a parent group. An NcNullType exception is thrown if the NcType object is invalid. An NcNullDim exception is thrown if the NcDim object is invalid.

Parameters
nameVariable name.
ncTypeNcType object.
ncDimNcDim object.
Returns
The NcVar object for this new netCDF variable.
NcVar netcdf::NcGroup::AddVar ( std::string const  name,
std::string const  typeName,
const std::vector< std::string > &  dimNames 
) const

Adds a netCDF multi-dimensional variable. The NcType and NcDim objects must be non-null, and be defined in either the current group or a parent group. An NcNullType exception is thrown if the NcType object is invalid. An NcNullDim exception is thrown if the NcDim object is invalid.

Parameters
nameVariable name.
typeNameType name.
dimNamesVector of dimension names.
Returns
The NcVar object for this new netCDF variable.
NcVar netcdf::NcGroup::AddVar ( std::string const  name,
NcType const &  ncType,
const std::vector< NcDim > &  ncDimVector 
) const

Adds a multi-dimensional netCDF variable. The NcType and NcDim objects must be non-null, and be defined in either the current group or a parent group. An NcNullType exception is thrown if the NcType object is invalid. An NcNullDim exception is thrown if any of the the NcDim objects are invalid.

Parameters
nameVariable name.
ncTypeNcType object.
ncDimvectorVector of NcDim objects.
Returns
The NcVar object for this new netCDF variable.
NcVar netcdf::NcGroup::AddVar ( NcVar const &  var)

Adds a netCDF variable from an existing variable object.

Parameters
nameA variable object.
Returns
The NcVar object for this new netCDF variable.
NcVlenType netcdf::NcGroup::AddVlenType ( std::string const  name,
NcType basetype 
) const

Adds a netCDF Vlen type.

Parameters
nameName of type.
basetypeA NcType object to be used for the basetype.
Returns
The NcVlenType object for this new netCDF vlen type.
NcGroupAtt netcdf::NcGroup::GetAtt ( std::string const  name,
NcGroup::Location  location = Current 
) const

Gets the named NcGroupAtt object.

Parameters
nameName of attribute
locationEnumeration type controlling the groups to search.
Returns
A NcGroupAtt object. If there are multiple objects indentied with the same name, the object closest to the current group is returned. If no valid object is found , a null node is returned.
int netcdf::NcGroup::GetAttCount ( NcGroup::Location const  location = Current) const

Gets the number of group attributes.

Parameters
locationEnumeration type controlling the groups to search.
Returns
Number of attributes.
NcGroup::NcGroupAttMap netcdf::NcGroup::GetAttributes ( NcGroup::Location  location = Current) const

Gets the collection of NcGroupAtt objects.

Parameters
locationEnumeration type controlling the groups to search.
Returns
A STL multimap object, containing pairs of <attribute name, NcGroupAtt object> entities.
NcGroup::NcGroupAttSet netcdf::NcGroup::GetAttributes ( std::string const  name,
NcGroup::Location  location = Current 
) const

Gets all NcGroupAtt objects with a given name.

Parameters
nameName of attribute
locationEnumeration type controlling the groups to search.
Returns
Set of NcGroupAtt objects.
void netcdf::NcGroup::GetCoordVar ( std::string &  coordVarName,
NcDim ncDim,
NcVar ncVar,
NcGroup::Location  location = Current 
) const

Gets the NcDim and NcVar object pair for a named coordinate variable. Coordinate variable have an NcDim and NcVar object with the same name defined in the same group.

The method returns two objects for the named coordinate variable. The method searches first in the current group and optionally in the parent and child group and returns the first instance found.
Parameters
locationEnumeration type controlling the groups to search.
Returns
The set of names of dimension variables.
Todo:
the following is constant; should use iterator
NcGroup::NcGroupMapUnique netcdf::NcGroup::GetCoordVars ( NcGroup::Location  location = Current) const

Gets a collection of coordinate variables. Coordinate variable have an NcDim and NcVar object with the same name defined in the same group.

The method returns STL map object containing a coordinate variables in the current group and optionally in the parent and child groups. It is expected that within each group, the names of dimensions are unique and the the names of variables are unique. However, if this is not the case, this method will still work correctly.
Parameters
locationEnumeration type controlling the groups to search.
Returns
The NcVar dimension variable. If no valid object is found , a null node is returned.
NcDim netcdf::NcGroup::GetDim ( std::string const  name,
NcGroup::Location const  location = Current 
) const

Gets the named NcDim object.

Parameters
nameName of dimension.
locationEnumeration type controlling the groups to search.
Returns
An NcDim object. If there are multiple objects indentied with the same name, the object closest to the current group is returned. If no valid object is found , a null node is returned.
int netcdf::NcGroup::GetDimCount ( NcGroup::Location const  location = Current) const

Gets the number of NcDim objects.

Parameters
locationEnumeration type controlling the groups to search.
Returns
Number of dimensions.
NcGroup::NcDimMap netcdf::NcGroup::GetDims ( NcGroup::Location const  location = Current) const

Gets the collection of NcDim objects.

Parameters
locationEnumeration type controlling the groups to search.
Returns
A STL multimap object, containing pairs of <attribute name, NcDim object> entities.
NcGroup::NcDimSet netcdf::NcGroup::GetDims ( std::string const  name,
NcGroup::Location const  location = Current 
) const

Gets NcDim objects with a given name.

Parameters
nameName of dimension.
locationEnumeration type controlling the groups to search.
Returns
Set of NcDim objects with given name.
NcGroup netcdf::NcGroup::GetGroup ( std::string const  name,
NcGroup::GroupLocation  location = ChildrenGrps 
) const

Gets the named child NcGroup object. Method will throw an netcdf::NcNullgrp exception if the group is null (ie NcGroup::IsNull()=true).

Parameters
nameGroup name.
locationEnumeration type controlling the groups to search.
Returns
An NcGroup object. If there are multiple objects indentied with the same name, the object closest to the current group is returned. If no valid object is found , a null node is returned.
int netcdf::NcGroup::GetGroupCount ( NcGroup::GroupLocation  location = ChildrenGrps) const

Gets the number of NcGroup objects. Method will throw an netcdf::NcNullgrp exception if the group is null (ie NcGroup::IsNull()=true).

Parameters
locationEnumeration type controlling the groups to search.
Returns
Number of groups.
NcGroup::NcGroupMap netcdf::NcGroup::GetGroups ( NcGroup::GroupLocation  location = ChildrenGrps) const

Gets the collection of NcGroup objects. Method will throw an netcdf::NcNullgrp exception if the group is null (ie NcGroup::IsNull()=true).

Parameters
locationEnumeration type controlling the groups to search.
Returns
A STL multimap object, containing pairs of <attribute name, NcGroup object> entities.
NcGroup::NcGroupSet netcdf::NcGroup::GetGroups ( std::string const  name,
NcGroup::GroupLocation  location = ChildrenGrps 
) const

Gets NcGroup objects with a given name. Method will throw an netcdf::NcNullgrp exception if the group is null (ie NcGroup::IsNull()=true).

Parameters
nameName of group.
locationEnumeration type controlling the groups to search.
Returns
Set of NcGroup objects with given name.
std::string netcdf::NcGroup::GetName ( bool  fullName = false) const

Gets the group name.

Method will throw an netcdf::NcNullgrp exception if the group is null (ie NcGroup::IsNull()=true).

Parameters
fullNameIf true then the full name is returned with subgroups separated by a forward slash "/" (default is false)
Returns
The group name.
NcGroup netcdf::NcGroup::GetParentGroup ( ) const

Gets the parent group. Method will throw an netcdf::NcNullgrp exception if the group is null (ie NcGroup::IsNull()=true). If the current root is the parent group, then return a null group.

NcType netcdf::NcGroup::GetType ( std::string const &  name,
NcGroup::Location  location = Current 
) const

Gets the NcType object with a given name.

Parameters
nameName of type. For atomic types, the CDL name is expected. This is consistent with the string returned from NcType::GetName().
locationEnumeration type controlling the groups to search.
Returns
NcType object. If there are multiple objects indentied with the same name, the object closest to the current group is returned. If no valid object is found , a null node is returned.
int netcdf::NcGroup::GetTypeCount ( NcGroup::Location  location = Current) const

Gets the number of type objects.

Parameters
locationEnumeration type controlling the groups to search.
Returns
Number of types.
int netcdf::NcGroup::GetTypeCount ( NcType::ncType  enumType,
NcGroup::Location  location = Current 
) const

Gets the number of type objects with a given enumeration type.

Parameters
enumTypeThe enumeration value of the object type.
locationEnumeration type controlling the groups to search.
Returns
Number of types of the given enumeration type.
NcGroup::NcTypeMap netcdf::NcGroup::GetTypes ( NcGroup::Location  location = Current) const

Gets the collection of NcType objects.

Parameters
locationEnumeration type controlling the groups to search.
Returns
A STL multimap object, on return contains pairs of <Type name, NcType object> entities. For atomic types, the type returned is the CDL name.
NcGroup::NcTypeSet netcdf::NcGroup::GetTypes ( std::string const &  name,
NcGroup::Location  location = Current 
) const

Gets the collection of NcType objects with a given name.

Parameters
nameName of type. For atomic types, the CDL name is expected. This is consistent with the string returned from NcType::GetName().
locationEnumeration type controlling the groups to search.
Returns
Set of NcType objects.
NcGroup::NcTypeSet netcdf::NcGroup::GetTypes ( NcType::ncType  enumType,
NcGroup::Location  location = Current 
) const

Gets the collection of NcType objects with a given data type.

Parameters
enumTypeEnumeration type specifying the data type.
locationEnumeration type controlling the groups to search.
Returns
Set of Nctype objects.
NcGroup::NcTypeSet netcdf::NcGroup::GetTypes ( std::string const &  name,
NcType::ncType  enumType,
NcGroup::Location  location = Current 
) const

Gets the collection of NcType objects with a given name and data type.

Parameters
nameName of type. For atomic types, the CDL name is expected. This is consistent with the string returned from NcType::GetName().
enumTypeEnumeration type specifying the data type.
locationEnumeration type controlling the groups to search.
Returns
Set of Nctype objects.
NcVar netcdf::NcGroup::GetVar ( std::string const  name,
NcGroup::Location  location = Current 
) const

Gets the named NcVar object..

Parameters
nameVariable name.
locationEnumeration type controlling the groups to search.
Returns
A NcVar object. If there are multiple objects indentied with the same name, the object closest to the current group is returned. If no valid object is found , a null node is returned.
Examples:
Test_CreateFileNc3.cpp, Test_NcChar.cpp, and Test_NcString.cpp.
int netcdf::NcGroup::GetVarCount ( NcGroup::Location  location = Current) const

Gets the number of NcVar objects in this group.

Parameters
locationEnumeration type controlling the groups to search.
Returns
Number of variables.
NcGroup::NcVarMap netcdf::NcGroup::GetVars ( NcGroup::Location  location = Current) const

Get the collection of NcVar objects.

Parameters
locationEnumeration type controlling the groups to search.
Returns
A STL multimap object, containing pairs of <attribute name, NcVar object> entities.
NcGroup::NcVarSet netcdf::NcGroup::GetVars ( std::string const  name,
NcGroup::Location  location = Current 
) const

Gets all NcVar objects with a given name.

Parameters
nameName of attribute
locationEnumeration type controlling the groups to search.
Returns
Set of NcVar objects.
bool netcdf::NcGroup::HaveAttribute ( std::string const  name,
NcGroup::Location const  location = Current 
) const

Checks if the attribute of the given name exists.

Parameters
nameName of attribute
locationEnumeration type controlling the groups to search.
Returns
True if the attribute exists, else false.
bool netcdf::NcGroup::HaveVariable ( std::string const  name,
NcGroup::Location const  location = Current 
) const

Checks if the variable of the given name exists.

Parameters
nameName of variable
locationEnumeration type controlling the groups to search.
Returns
True if the variable exists, else false.
bool netcdf::NcGroup::IsRootGroup ( ) const

Returns true if this is the root group, otherwise returns false.

bool netcdf::NcGroup::operator< ( NcGroup const &  rhs) const
NcGroupAtt netcdf::NcGroup::PutAtt ( std::string const  name,
NcType const &  type,
size_t  len,
const unsigned char *  dataValues 
) const
Examples:
Test_AttVectors.cpp.
NcGroupAtt netcdf::NcGroup::PutAtt ( std::string const  name,
NcType const &  type,
size_t  len,
const signed char *  dataValues 
) const
NcGroupAtt netcdf::NcGroup::PutAtt ( std::string const  name,
char const  aChar 
) const
NcGroupAtt netcdf::NcGroup::PutAtt ( std::string const  name,
NcType const &  type,
short  datumValue 
) const
NcGroupAtt netcdf::NcGroup::PutAtt ( std::string const  name,
NcType const &  type,
size_t  len,
const short *  dataValues 
) const
NcGroupAtt netcdf::NcGroup::PutAtt ( std::string const  name,
NcType const &  type,
unsigned short  datumValue 
) const
NcGroupAtt netcdf::NcGroup::PutAtt ( std::string const  name,
NcType const &  type,
size_t  len,
const unsigned short *  dataValues 
) const
NcGroupAtt netcdf::NcGroup::PutAtt ( std::string const  name,
NcType const &  type,
int  datumValue 
) const
NcGroupAtt netcdf::NcGroup::PutAtt ( std::string const  name,
NcType const &  type,
size_t  len,
const int *  dataValues 
) const
NcGroupAtt netcdf::NcGroup::PutAtt ( std::string const  name,
NcType const &  type,
long  datumValue 
) const
NcGroupAtt netcdf::NcGroup::PutAtt ( std::string const  name,
NcType const &  type,
size_t  len,
const long *  dataValues 
) const
NcGroupAtt netcdf::NcGroup::PutAtt ( std::string const  name,
NcType const &  type,
unsigned int  datumValue 
) const
NcGroupAtt netcdf::NcGroup::PutAtt ( std::string const  name,
NcType const &  type,
size_t  len,
const unsigned int *  dataValues 
) const
NcGroupAtt netcdf::NcGroup::PutAtt ( std::string const  name,
NcType const &  type,
float  datumValue 
) const
NcGroupAtt netcdf::NcGroup::PutAtt ( std::string const  name,
NcType const &  type,
size_t  len,
const float *  dataValues 
) const
NcGroupAtt netcdf::NcGroup::PutAtt ( std::string const  name,
NcType const &  type,
double  datumValue 
) const
NcGroupAtt netcdf::NcGroup::PutAtt ( std::string const  name,
NcType const &  type,
size_t  len,
const double *  dataValues 
) const
NcGroupAtt netcdf::NcGroup::PutAtt ( std::string const  name,
NcType const &  type,
long long  datumValue 
) const
NcGroupAtt netcdf::NcGroup::PutAtt ( std::string const  name,
NcType const &  type,
size_t  len,
const long long *  dataValues 
) const
NcGroupAtt netcdf::NcGroup::PutAtt ( std::string const  name,
NcType const &  type,
unsigned long long  datumValue 
) const
NcGroupAtt netcdf::NcGroup::PutAtt ( std::string const  name,
NcType const &  type,
size_t  len,
const unsigned long long *  dataValues 
) const
NcGroupAtt netcdf::NcGroup::PutAtt ( std::string const  name,
size_t  len,
const char **  dataValues 
) const
NcGroupAtt netcdf::NcGroup::PutAtt ( std::string const  name,
std::string const &  dataValues 
) const
NcGroupAtt netcdf::NcGroup::PutAtt ( std::string const  name,
std::vector< std::string > const &  strVec 
)
NcGroupAtt netcdf::NcGroup::PutAtt ( std::string const  name,
NcType const &  type,
size_t  len,
const void *  dataValues 
) const

Creates a NetCDF group attribute or if already exisiting replaces it. If you are writing a Fill_Value attribute, and will tell the HDF5 layer to use the specified fill value for that variable.

Although it's possible to create attributes of all types, text and double attributes are adequate for most purposes.
Parameters
nameName of attribute.
typeThe attribute type.
lenThe length of the attribute (number of Nctype repeats).
dataValuesData Values to put into the new attribute. If the type of data values differs from the netCDF variable type, type conversion will occur. (However, no type conversion is carried out for variables using the user-defined data types: nc_Vlen, nc_Opaque, nc_Compound and nc_Enum.)
Returns
The NcGroupAtt object for this new netCDF attribute.
NcGroupAtt netcdf::NcGroup::PutAtt ( NcGroupAtt const &  att)
Todo:
PutAtt = Adds an attribute containing a vector of data.

Adds an attribute containing a vector of data.

Parameters
nameName of attribute.
dataA vector of data for this attribute.
Returns
The NcGroupAtt object for this new netCDF attribute.

Adds a NetCDF group attribute by copying an existing attribute object.

Parameters
attAn attribute object from a different group or netCDF file.
Returns
The NcGroupAtt object for this new netCDF attribute.
virtual void netcdf::NcGroup::Rename ( std::string const &  )
inlineprotectedvirtual

Implements netcdf::NcItem.


The documentation for this class was generated from the following files: