netcdf-C++
|
#include <ncGroup.h>
Public Types | |
enum | GroupLocation { ChildrenGrps, ParentsGrps, ChildrenOfChildrenGrps, AllChildrenGrps, ParentsAndCurrentGrps, AllGrps } |
enum | Location { Current, Parents, Children, ParentsAndCurrent, ChildrenAndCurrent, All } |
Public Member Functions | |
NcCompoundType | addCompoundType (const std::string &name, size_t size) const |
NcDim | addDim (const std::string &name) const |
NcDim | addDim (const std::string &name, size_t dimSize) const |
NcEnumType | addEnumType (const std::string &name, NcEnumType::ncEnumType basetype) const |
NcGroup | addGroup (const std::string &name) const |
NcOpaqueType | addOpaqueType (const std::string &name, size_t size) const |
NcVar | addVar (const std::string &name, const NcType &ncType) const |
NcVar | addVar (const std::string &name, const NcType &ncType, const NcDim &ncDim) const |
NcVar | addVar (const std::string &name, const NcType &ncType, const std::vector< NcDim > &ncDimVector) const |
NcVar | addVar (const std::string &name, const std::string &typeName, const std::string &dimName) const |
NcVar | addVar (const std::string &name, const std::string &typeName, const std::vector< std::string > &dimNames) const |
NcVlenType | addVlenType (const std::string &name, NcType &basetype) const |
NcGroupAtt | getAtt (const std::string &name, NcGroup::Location location=Current) const |
int | getAttCount (NcGroup::Location location=Current) const |
std::set< NcGroupAtt > | getAtts (const std::string &name, NcGroup::Location location=Current) const |
std::multimap< std::string, NcGroupAtt > | getAtts (NcGroup::Location location=Current) const |
void | getCoordVar (std::string &coordVarName, NcDim &ncDim, NcVar &ncVar, NcGroup::Location location=Current) const |
std::map< std::string, NcGroup > | getCoordVars (NcGroup::Location location=Current) const |
NcDim | getDim (const std::string &name, NcGroup::Location location=Current) const |
int | getDimCount (NcGroup::Location location=Current) const |
std::set< NcDim > | getDims (const std::string &name, NcGroup::Location location=Current) const |
std::multimap< std::string, NcDim > | getDims (NcGroup::Location location=Current) const |
NcGroup | getGroup (const std::string &name, NcGroup::GroupLocation location=ChildrenGrps) const |
int | getGroupCount (NcGroup::GroupLocation location=ChildrenGrps) const |
std::set< NcGroup > | getGroups (const std::string &name, NcGroup::GroupLocation location=ChildrenGrps) const |
std::multimap< std::string, NcGroup > | getGroups (NcGroup::GroupLocation location=ChildrenGrps) const |
int | getId () const |
std::string | getName (bool fullName=false) const |
NcGroup | getParentGroup () const |
NcType | getType (const std::string &name, NcGroup::Location location=Current) const |
int | getTypeCount (NcGroup::Location location=Current) const |
int | getTypeCount (NcType::ncType enumType, NcGroup::Location location=Current) const |
std::set< NcType > | getTypes (const std::string &name, NcGroup::Location location=Current) const |
std::set< NcType > | getTypes (const std::string &name, NcType::ncType enumType, NcGroup::Location location=Current) const |
std::multimap< std::string, NcType > | getTypes (NcGroup::Location location=Current) const |
std::set< NcType > | getTypes (NcType::ncType enumType, NcGroup::Location location=Current) const |
NcVar | getVar (const std::string &name, NcGroup::Location location=Current) const |
int | getVarCount (NcGroup::Location location=Current) const |
std::set< NcVar > | getVars (const std::string &name, NcGroup::Location location=Current) const |
std::multimap< std::string, NcVar > | getVars (NcGroup::Location location=Current) const |
bool | isNull () const |
bool | isRootGroup () const |
NcGroup () | |
NcGroup (const NcGroup &rhs) | |
bool | operator!= (const NcGroup &rhs) const |
NcGroup & | operator= (const NcGroup &rhs) |
bool | operator== (const NcGroup &rhs) const |
NcGroupAtt | putAtt (const std::string &name, const NcType &type, double datumValue) const |
NcGroupAtt | putAtt (const std::string &name, const NcType &type, float datumValue) const |
NcGroupAtt | putAtt (const std::string &name, const NcType &type, int datumValue) const |
NcGroupAtt | putAtt (const std::string &name, const NcType &type, long datumValue) const |
NcGroupAtt | putAtt (const std::string &name, const NcType &type, long long datumValue) const |
NcGroupAtt | putAtt (const std::string &name, const NcType &type, short datumValue) const |
NcGroupAtt | putAtt (const std::string &name, const NcType &type, size_t len, const double *dataValues) const |
NcGroupAtt | putAtt (const std::string &name, const NcType &type, size_t len, const float *dataValues) const |
NcGroupAtt | putAtt (const std::string &name, const NcType &type, size_t len, const int *dataValues) const |
NcGroupAtt | putAtt (const std::string &name, const NcType &type, size_t len, const long *dataValues) const |
NcGroupAtt | putAtt (const std::string &name, const NcType &type, size_t len, const long long *dataValues) const |
NcGroupAtt | putAtt (const std::string &name, const NcType &type, size_t len, const short *dataValues) const |
NcGroupAtt | putAtt (const std::string &name, const NcType &type, size_t len, const signed char *dataValues) const |
NcGroupAtt | putAtt (const std::string &name, const NcType &type, size_t len, const unsigned char *dataValues) const |
NcGroupAtt | putAtt (const std::string &name, const NcType &type, size_t len, const unsigned int *dataValues) const |
NcGroupAtt | putAtt (const std::string &name, const NcType &type, size_t len, const unsigned long long *dataValues) const |
NcGroupAtt | putAtt (const std::string &name, const NcType &type, size_t len, const unsigned short *dataValues) const |
NcGroupAtt | putAtt (const std::string &name, const NcType &type, size_t len, const void *dataValues) const |
NcGroupAtt | putAtt (const std::string &name, const NcType &type, unsigned int datumValue) const |
NcGroupAtt | putAtt (const std::string &name, const NcType &type, unsigned long long datumValue) const |
NcGroupAtt | putAtt (const std::string &name, const NcType &type, unsigned short datumValue) const |
NcGroupAtt | putAtt (const std::string &name, const std::string &dataValues) const |
NcGroupAtt | putAtt (const std::string &name, size_t len, const char **dataValues) const |
virtual | ~NcGroup () |
Protected Attributes | |
bool | nullObject |
Friends | |
bool | operator< (const NcGroup &lhs, const NcGroup &rhs) |
bool | operator> (const NcGroup &lhs, const NcGroup &rhs) |
Class represents a netCDF group.
The enumeration list contains the options for selecting groups (used for returned set of NcGroup objects).
The enumeration list contains the options for selecting groups.
NcGroup::NcGroup | ( | ) |
Constructor generates a null object.
NcGroup::NcGroup | ( | const NcGroup & | rhs | ) |
The copy constructor.
|
virtual |
destructor
NcCompoundType NcGroup::addCompoundType | ( | const std::string & | name, |
size_t | size | ||
) | const |
Adds a new netCDF UserDefined type.
name | Name of type. |
size | The size of the new type in bytes. |
NcDim netCDF::NcGroup::addDim | ( | const std::string & | name | ) | const |
NcDim netCDF::NcGroup::addDim | ( | const std::string & | name, |
size_t | dimSize | ||
) | const |
NcEnumType NcGroup::addEnumType | ( | const std::string & | name, |
NcEnumType::ncEnumType | basetype | ||
) | const |
Adds a new netCDF enum type.
name | Name of type. For atomic types, the CDL name is expected. This is consistent with the string returned from NcType::getName(). |
enumType | The enumeration value of the object type. |
NcGroup NcGroup::addGroup | ( | const std::string & | name | ) | const |
Adds a new child netCDF group object. Method will throw an netCDF::exceptions::NcNullgrp exception if the group is null (ie NcGroup::isNull()=true).
name | Variable name. |
NcOpaqueType NcGroup::addOpaqueType | ( | const std::string & | name, |
size_t | size | ||
) | const |
Adds a new netCDF Opaque type.
name | Name of type. |
size | The size of the new type in bytes. |
NcVar netCDF::NcGroup::addVar | ( | const std::string & | name, |
const NcType & | ncType, | ||
const NcDim & | ncDim | ||
) | const |
NcVar netCDF::NcGroup::addVar | ( | const std::string & | name, |
const NcType & | ncType, | ||
const std::vector< NcDim > & | ncDimVector | ||
) | const |
NcVar netCDF::NcGroup::addVar | ( | const std::string & | name, |
const std::string & | typeName, | ||
const std::string & | dimName | ||
) | const |
Adds a new 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.
name | Variable name. |
typeName | Type name. |
dimName | Dimension name. |
NcVar netCDF::NcGroup::addVar | ( | const std::string & | name, |
const std::string & | typeName, | ||
const std::vector< std::string > & | dimNames | ||
) | const |
Adds a new 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.
name | Variable name. |
typeName | Type name. |
dimNames | Vector of dimension names. |
NcVlenType NcGroup::addVlenType | ( | const std::string & | name, |
NcType & | basetype | ||
) | const |
Adds a new netCDF Vlen type.
name | Name of type. |
basetype | A NcType object to be used for the basetype. |
NcGroupAtt NcGroup::getAtt | ( | const std::string & | name, |
NcGroup::Location | location = Current |
||
) | const |
Gets the named NcGroupAtt object.
name | Name of attribute |
location | Enumeration type controlling the groups to search. |
int NcGroup::getAttCount | ( | NcGroup::Location | location = Current | ) | const |
Gets the number of group attributes.
location | Enumeration type controlling the groups to search. |
std::set<NcGroupAtt> netCDF::NcGroup::getAtts | ( | const std::string & | name, |
NcGroup::Location | location = Current |
||
) | const |
Gets all NcGroupAtt objects with a given name.
name | Name of attribute |
location | Enumeration type controlling the groups to search. |
multimap< std::string, NcGroupAtt > NcGroup::getAtts | ( | NcGroup::Location | location = Current | ) | const |
Gets the collection of NcGroupAtt objects.
location | Enumeration type controlling the groups to search. |
void 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.
location | Enumeration type controlling the groups to search. |
map< string, NcGroup > 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.
location | Enumeration type controlling the groups to search. |
NcDim NcGroup::getDim | ( | const std::string & | name, |
NcGroup::Location | location = Current |
||
) | const |
Gets the named NcDim object.
name | Name of dimension. |
location | Enumeration type controlling the groups to search. |
int NcGroup::getDimCount | ( | NcGroup::Location | location = Current | ) | const |
Gets the number of NcDim objects.
location | Enumeration type controlling the groups to search. |
std::set<NcDim> netCDF::NcGroup::getDims | ( | const std::string & | name, |
NcGroup::Location | location = Current |
||
) | const |
multimap< string, NcDim > NcGroup::getDims | ( | NcGroup::Location | location = Current | ) | const |
NcGroup NcGroup::getGroup | ( | const std::string & | name, |
NcGroup::GroupLocation | location = ChildrenGrps |
||
) | const |
Gets the named child NcGroup object. Method will throw an netCDF::exceptions::NcNullgrp exception if the group is null (ie NcGroup::isNull()=true).
name | Group name. |
location | Enumeration type controlling the groups to search. |
int NcGroup::getGroupCount | ( | NcGroup::GroupLocation | location = ChildrenGrps | ) | const |
Gets the number of NcGroup objects. Method will throw an netCDF::exceptions::NcNullgrp exception if the group is null (ie NcGroup::isNull()=true).
location | Enumeration type controlling the groups to search. |
set< NcGroup > NcGroup::getGroups | ( | const std::string & | name, |
NcGroup::GroupLocation | location = ChildrenGrps |
||
) | const |
Gets NcGroup objects with a given name. Method will throw an netCDF::exceptions::NcNullgrp exception if the group is null (ie NcGroup::isNull()=true).
name | Name of group. |
location | Enumeration type controlling the groups to search. |
multimap< std::string, NcGroup > NcGroup::getGroups | ( | NcGroup::GroupLocation | location = ChildrenGrps | ) | const |
Gets the collection of NcGroup objects. Method will throw an netCDF::exceptions::NcNullgrp exception if the group is null (ie NcGroup::isNull()=true).
location | Enumeration type controlling the groups to search. |
int NcGroup::getId | ( | ) | const |
Gets the group id. Method will throw an netCDF::exceptions::NcNullgrp exception if the group is null (ie NcGroup::isNull()=true).
string NcGroup::getName | ( | bool | fullName = false | ) | const |
Gets the group name.
Method will throw an netCDF::exceptions::NcNullgrp exception if the group is null (ie NcGroup::isNull()=true).
fullName | If true then the full name is returned with subgroups separated by a forward slash "/" (default is false) |
NcGroup NcGroup::getParentGroup | ( | ) | const |
Gets the parent group. Method will throw an netCDF::exceptions::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 NcGroup::getType | ( | const std::string & | name, |
NcGroup::Location | location = Current |
||
) | const |
Gets the NcType object with a given name.
name | Name of type. For atomic types, the CDL name is expected. This is consistent with the string returned from NcType::getName(). |
location | Enumeration type controlling the groups to search. |
int NcGroup::getTypeCount | ( | NcGroup::Location | location = Current | ) | const |
Gets the number of type objects.
location | Enumeration type controlling the groups to search. |
int NcGroup::getTypeCount | ( | NcType::ncType | enumType, |
NcGroup::Location | location = Current |
||
) | const |
Gets the number of type objects with a given enumeration type.
enumType | The enumeration value of the object type. |
location | Enumeration type controlling the groups to search. |
std::set<NcType> netCDF::NcGroup::getTypes | ( | const std::string & | name, |
NcGroup::Location | location = Current |
||
) | const |
Gets the collection of NcType objects with a given name.
name | Name of type. For atomic types, the CDL name is expected. This is consistent with the string returned from NcType::getName(). |
location | Enumeration type controlling the groups to search. |
std::set<NcType> netCDF::NcGroup::getTypes | ( | const std::string & | name, |
NcType::ncType | enumType, | ||
NcGroup::Location | location = Current |
||
) | const |
Gets the collection of NcType objects with a given name and data type.
name | Name of type. For atomic types, the CDL name is expected. This is consistent with the string returned from NcType::getName(). |
enumType | Enumeration type specifying the data type. |
location | Enumeration type controlling the groups to search. |
multimap< string, NcType > NcGroup::getTypes | ( | NcGroup::Location | location = Current | ) | const |
set< NcType > NcGroup::getTypes | ( | NcType::ncType | enumType, |
NcGroup::Location | location = Current |
||
) | const |
Gets the collection of NcType objects with a given data type.
enumType | Enumeration type specifying the data type. |
location | Enumeration type controlling the groups to search. |
NcVar NcGroup::getVar | ( | const std::string & | name, |
NcGroup::Location | location = Current |
||
) | const |
Gets the named NcVar object..
name | Variable name. |
location | Enumeration type controlling the groups to search. |
int NcGroup::getVarCount | ( | NcGroup::Location | location = Current | ) | const |
Gets the number of NcVar objects in this group.
location | Enumeration type controlling the groups to search. |
std::set<NcVar> netCDF::NcGroup::getVars | ( | const std::string & | name, |
NcGroup::Location | location = Current |
||
) | const |
multimap< std::string, NcVar > NcGroup::getVars | ( | NcGroup::Location | location = Current | ) | const |
|
inline |
Returns true if this object is null (i.e. it has no contents); otherwise returns false.
bool NcGroup::isRootGroup | ( | ) | const |
Returns true if this is the root group, otherwise returns false.
bool NcGroup::operator!= | ( | const NcGroup & | rhs | ) | const |
!= operator
bool NcGroup::operator== | ( | const NcGroup & | rhs | ) | const |
equivalence operator
NcGroupAtt netCDF::NcGroup::putAtt | ( | const std::string & | name, |
const NcType & | type, | ||
double | datumValue | ||
) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
NcGroupAtt netCDF::NcGroup::putAtt | ( | const std::string & | name, |
const NcType & | type, | ||
float | datumValue | ||
) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
NcGroupAtt netCDF::NcGroup::putAtt | ( | const std::string & | name, |
const NcType & | type, | ||
int | datumValue | ||
) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
NcGroupAtt netCDF::NcGroup::putAtt | ( | const std::string & | name, |
const NcType & | type, | ||
long | datumValue | ||
) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
NcGroupAtt netCDF::NcGroup::putAtt | ( | const std::string & | name, |
const NcType & | type, | ||
long long | datumValue | ||
) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
NcGroupAtt netCDF::NcGroup::putAtt | ( | const std::string & | name, |
const NcType & | type, | ||
short | datumValue | ||
) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
NcGroupAtt netCDF::NcGroup::putAtt | ( | const std::string & | name, |
const NcType & | type, | ||
size_t | len, | ||
const double * | dataValues | ||
) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
NcGroupAtt netCDF::NcGroup::putAtt | ( | const std::string & | name, |
const NcType & | type, | ||
size_t | len, | ||
const float * | dataValues | ||
) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
NcGroupAtt netCDF::NcGroup::putAtt | ( | const std::string & | name, |
const NcType & | type, | ||
size_t | len, | ||
const int * | dataValues | ||
) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
NcGroupAtt netCDF::NcGroup::putAtt | ( | const std::string & | name, |
const NcType & | type, | ||
size_t | len, | ||
const long * | dataValues | ||
) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
NcGroupAtt netCDF::NcGroup::putAtt | ( | const std::string & | name, |
const NcType & | type, | ||
size_t | len, | ||
const long long * | dataValues | ||
) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
NcGroupAtt netCDF::NcGroup::putAtt | ( | const std::string & | name, |
const NcType & | type, | ||
size_t | len, | ||
const short * | dataValues | ||
) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
NcGroupAtt netCDF::NcGroup::putAtt | ( | const std::string & | name, |
const NcType & | type, | ||
size_t | len, | ||
const signed char * | dataValues | ||
) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
NcGroupAtt netCDF::NcGroup::putAtt | ( | const std::string & | name, |
const NcType & | type, | ||
size_t | len, | ||
const unsigned char * | dataValues | ||
) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
NcGroupAtt netCDF::NcGroup::putAtt | ( | const std::string & | name, |
const NcType & | type, | ||
size_t | len, | ||
const unsigned int * | dataValues | ||
) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
NcGroupAtt netCDF::NcGroup::putAtt | ( | const std::string & | name, |
const NcType & | type, | ||
size_t | len, | ||
const unsigned long long * | dataValues | ||
) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
NcGroupAtt netCDF::NcGroup::putAtt | ( | const std::string & | name, |
const NcType & | type, | ||
size_t | len, | ||
const unsigned short * | dataValues | ||
) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
NcGroupAtt netCDF::NcGroup::putAtt | ( | const std::string & | name, |
const NcType & | type, | ||
size_t | len, | ||
const void * | dataValues | ||
) | const |
Creates a new 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.
name | Name of attribute. |
type | The attribute type. |
len | The length of the attribute (number of Nctype repeats). |
dataValues | Data 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.) |
NcGroupAtt netCDF::NcGroup::putAtt | ( | const std::string & | name, |
const NcType & | type, | ||
unsigned int | datumValue | ||
) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
NcGroupAtt netCDF::NcGroup::putAtt | ( | const std::string & | name, |
const NcType & | type, | ||
unsigned long long | datumValue | ||
) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
NcGroupAtt netCDF::NcGroup::putAtt | ( | const std::string & | name, |
const NcType & | type, | ||
unsigned short | datumValue | ||
) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
NcGroupAtt netCDF::NcGroup::putAtt | ( | const std::string & | name, |
const std::string & | dataValues | ||
) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
NcGroupAtt netCDF::NcGroup::putAtt | ( | const std::string & | name, |
size_t | len, | ||
const char ** | dataValues | ||
) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
protected |
assignment operator